From 3efbdb00cbae44ad591f63ec788527eb3b0da2eb Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Thu, 11 Jan 2018 11:16:27 -0600 Subject: [PATCH 01/15] upgrade to v1.32.0 --- NEWS.md | 2 +- R/plotly.R | 2 +- R/sysdata.rda | Bin 69526 -> 70911 bytes .../lib/plotlyjs/plotly-latest.min.js | 79 +----------------- 4 files changed, 5 insertions(+), 78 deletions(-) diff --git a/NEWS.md b/NEWS.md index cf4028e1f5..a1d725cb46 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,7 +5,7 @@ ## CHANGES * The `elementId` field is no longer populated, which fixes the "Ignoring explicitly provided widget ID" warning in shiny applications (see #985). -* Upgraded to plotly.js v1.31.2 -- https://github.com/plotly/plotly.js/releases/tag/v1.31.2 +* Upgraded to plotly.js v1.32.0 -- https://github.com/plotly/plotly.js/releases/tag/v1.32.0 ## BUG FIXES diff --git a/R/plotly.R b/R/plotly.R index 1ba6afdda6..33fedc5d0f 100644 --- a/R/plotly.R +++ b/R/plotly.R @@ -373,7 +373,7 @@ typedArrayPolyfill <- function() { # and bundle size at print time. plotlyMainBundle <- function() { htmltools::htmlDependency( - "plotlyjs", "1.31.2.9000", + "plotlyjs", "1.32.0", src = depPath("plotlyjs"), script = "plotly-latest.min.js", stylesheet = "plotly-htmlwidgets.css" diff --git a/R/sysdata.rda b/R/sysdata.rda index 6b7f050389c29174c6b09aecdb86bced6b98ffa6..c362e7d583cbb9c396505d4309694c40996686bb 100644 GIT binary patch literal 70911 zcmZU4S5yBMU4ZVflAv7BzEs+v>Q9}<&B=oL8Ksq4= zq)R7M=^d~C`*hE_-@~4>-_Gvr?wN;~+1aP&E(*XWW`bZdDTBW&S1M`${(so2fcOA&)B=5?~1LM0g)tBGC9(3w>O~d?S=$Uf7JdG-D&>c0En=R~?# zQKM@#q)++zG%p{Dz7aO0DG)F;B3zEMV@~?~O8uHil{)j~()%LJuO85FUAY9iOT$4U z%nB2|o?`r}_>Ojx@ynaSEKlFQ{%VYV_3CQU+s7<7|Meae2pEapV|ntl_+irP&q?ne zGc(^6x$#m&RLkw!AvyuS6dkUoQSk zNAuZG_%)sAn^(-A>8fIBN{tM!(J)_r9HTC56m|KHk@3sB!k=Fb4whUh9jxZEH@f`b z-W|GYmtMHjP%JnuKYsZt<$A_K-$=LaY;bxP4#ce)14+;<29YFxf-oBtbJ7Jp2TG zkNntWaL~bplYxdthJ=3drSLT;4SlA|^*dia(_H!tq`Cf@hLZ+#>GM6(C)dw1E-oM$ zhW}A6q|bxo#|$*r^<=Kx7#yUb8DxKbp@Ns%|8wQ@J|Dc$cvBv-Ftl1<*Lh1-J73uWs0caz2tE)sd)eP%Rw3j z-oiJlGK0LIIsZvNdrUJZGe~m<7FjbFRxB^-ghC_CYtqfw9UgXwr1;2WI?}V3N!iAB z+m*-K0;ST^GaNZYO8$KQ8;?Iq_YX||Rr2S3dO0eCp6Fy}FY0Jl9up6I$KD}k8{6Lf z4a9CICM7M^BmAw*#OdX?3IUW9&^X>URjkZ5o?z1<5^vAJZqwdsYY*ZO1kjhfp1A3D zw_TS0>#EUu{!pq>c}gkitr-8c3|m{%jwD#>7a52{0UP_1^cYqX~FX7LY3 z773JpGAldK8bOv7Ev4SfYrI)?6EMe)g ze412~H5}D=`PWyCl)_T*hjuNWRvcZm=oc7kEbN}g(~H$eG|=Gi%inu{ZF@X9-N(bS zPZWMrCeJ^_2 z75Lx1=Y5h=&qhQai=`-pDI$74A8OfBZDxf01_E|O;3F7tQmxBMRdphorEz7Xq|7Jw zuYFin_D-g34cA1hm$M@Gy6ihMKIFyiKl{GA8M^3{;UQ9{3`L1kk@U?+9C=_a#HBAK z4L{nn1UAG8KJxG!Dc-G;>6M`Od6c21Kamh$N*WW7in5b4&}y|^i-JIw$y;a^HF~#) zz{U>yy5=piu|MEWKxFY*EU1WgCxlHP%C})N@2`>15m+^ntH`fg_b3Fs-^87>d9lnI z9NkyAZN-9)(cb=~2L+~tiu!Uw9&TwAS(*Q>9ysL-=N8_HHqS(-{V>*dY(4%~!2m>a z^f-*UlB1`wd9P(61YcGFwn=AKgzYjDK&xA+0l|EVD(wz+6+eYJQ_p0S_Rd- zrC~3p(rFPpXaCOJ?3}Z)uQ{O;Os}fg@}wp-s_jmJYT_`w(6HBZVf;iqTe=VPikO#? z?DnYK^jiq0o_<_WomFwT_F?I2?q2)8u7R&h?!tjkCU-7w-DC6QSN3V`g!lCOQOPgn z*4eN^x7MXB~>-CiGz1b+uED(D@H<764&lKxUJfUeTidh-?L^; ziLTw0ac0iBTHIP_HhFMt9;5#hX_CvkW=66e+yP8|JZ4%pa5#>FF0{AL${3GH8Kh^w z4clvxJIUiamJG38CaMnD9EQc>IDoNXmCjv-gz{^JamF&=GSt8>;{)4~1?L87KIc|@ zjr-e6$EfZ+Zj-odRo$~KA~pwEmS-5f;ydnn?%(Y)g-DRvGvKUJ=xzaD#>aj`y?a*-{QCH9fHj-%4CbCLl-A9cyDwe%{LoiHc~g zG!T-Za0e({}VqYwF7%e=EpJ8Yv1Whz7iTsIra zMp9=An#+P6dCe}82+^9XAA&|~T@~6#R=QoKwcE5ZG19<}l8#*2`GT$(@|V~P{l@Gf zy_-{sVJwJ3iT>CvVuudMA=}M(wAam=f$f%%Q5zFL_glZIhqSJ%UNu$`NFpAd0ex{YoNrF_FwN=3GKprWK0iN-YZ-5D#4oX3>n)iO zwU~~cW~(Tf+D|X#QTQbokQp+SZ42`^+ud{ZkDbiI-;-J z5Ir-jnu$IdWI}*@nPg`Gp+~Gi{M~zt?WtYH)h-;&T%$^lKz>N>c6H4t0T#riiUSjq zZ@wp#eC#f$+xOLAqF$*se@h7owd*S+cN`Z>md|lN2G2 zy<-ffb4%=pJu@**P`AU@3@cE?pjGH(*E_)=lCA-`-(95#ekX2+x$Bq_UxSr4`;rka zfJ*cN5(SgTB3N!?%9s#mIm-8PORKABZyOKRLU=F4WdS$c=r?pmf@<>2t} zUjtG99~NzAApo>!iw?jn1AM6Fi8_>*ex|`!->x#;9kW`f-J6jtXr{xF;bi#1k-hBh z2{mP>4I`jzS3okYw#)Gr4;uXYNUdj}*3)~{^s3->RCi*jK-(EX9@)1f& zg$E#t_J6N&Z^|a=%KNCR-O)-CPg%a+f9k`|9h5Ave*8S@>BncE)QhhM7=xQ1cBB79 zF%ODh?t$mRP0iodBpI`JGhTW4+?%Rx#QydMU1IyKQf_(6pF)N>u_W^rnV-Ks?3~0p zV}7*S#w5E5j*UUCuW|*{~ zt#55Q!3TVZ;Q)(zB>~@1*)b>Sjrr~RiNU)1r4v;gf~eTvYIiBtE%84>a-o61#78_p zkncLZ?f;a15M<9|Xst=U-gU7X+KOGw&@s**taJt0{ci{+v_n9QXv6>b zX6d}DU=YmGDctB}u&n73b)5#YzG`~1`#Sc-c<)0#>Sci7^OO(t#%wF?>a5$(OHZ-2 zPX@c6-@MUO4^dZrTyaajc6df%VQ!lixu?h)FjhkdQ|=j?T~c9poIi5K?98a2l+V=p zg%?15a^(7cDf}635>0KjYsJ5~Xtn%{T%2o=uq;a1%^nz2Hh8#_H_NyguA2MM3%guh!Rs0t52U5KGf>94>=%M)!!@q9fwvYy`PBM4Z``@1{CrNLjvzmK ziHh4!#LNiK?lNO@5DLEfX9|=Opd*AKSqt8ZQcBkRfdyvSRQIjOdg9!Rhx#%>=^5$v zB5~~L6d5vWyv&fR3`KrYwye?%Y+fEOMYOZ?(gOs#={za)GRtZUw09Ejdj=bDuCA^f zsiS1bHjzWj^5|J>+Wd?hvbqbuWp>NPuW5X>0y2=9;%no};!S#^iizf8peoLljljB4 z5ue!$!vN}K6|OFrlBRx>Uymz(#-F861TfmnmuJ6$I4l;lapzK#9YZX0eqQ4WEE66M8 zim46RopqNJ*4j}_^wVQ48>#9?#g|8U!878RSa-#^`n@xf9(8h3KF}ykuahe#vT_E3N$gyhSg-}(>tv&;CaYnESbcnHbsetP4&XePWf(4B ztFf`-%ic0*v7o)*pO4XJ+P!d|k9@a3Q-Qx6`qYT2@;?lhf(YULQJ6|LiTw|TVZ;rg zuaSMmveyzI-1@m> z0xhre89P%5Jce(KvRT&P3S^i3d_P?~deryj^FWEt`nu|Su+X>aLvwWx7Ugp&62{%JE5s*TaO%Bzbyq02!ginnS47=JO)s*wn0gnHH%Bcx zYH6=UkD=n-s@C;|-#DG6hQlr259+F{8WLV>W~i!8ZY_I{i}|pw6KX1KQ!8|xu;v{j zS?&~eU9@Uop7Ri%s7bgsYC39Wm}ia}RjRB|uh0fum%(bt>`jO}aNKmN3alxzy3)4C z)EM4Vvx+zFj9tc}=5@$7&ZT3+U+jj)9|;YHKo3I;%^}YAV{KTDZdnB*QnZ5TO%vnX zasi*H&Yy2ndLGOA&ka$QL+z%oFO|XyW4jVW3*XQCnrqK7-W{*eSeYy+1q;ZdO;Bxm zH(z{pWMHum+)ZN$WoUh_TMo_J12V=ClG{&&S)y0edOXy zatt~kggY*h?2>0>wM%dBKB2a)9_v>S6m>DeL=z^Et$?q|QA1uM$oVyh5mp@PZg+l zJz83O&?}JP_>uU=uJv1b8G}P=EWuYI~nx&T&K9l|GW-&t1D^JzH zO6vf1fQ@L2!CvDG9a+J;8IDc{$1=h4QrWUzG`}{H*0Rhl-u~{8x%dvOwG1uti6GW< zT`OaW`zPy)SU=oGhn>kzyX%97F$RMSq_o}4&t#2lHc-i_D&ov)E;)6YEGl%}KLHHl zSPH`F&aanjgxyvcK`8zW?ZlG@-;A;Z=$7aekRxGdJ5EkgD?e0jya?3Eo{(N>*h7alYYHUJ^6;mRKT24W?9~sNKDf|P z^awt0IKs*EarHL)Hjp+B4BlynHqe%CDLagIh8vE&iga$+1=vO7(*`1L%x@f5@<<=K ztZC**Myq#LAah3xdhz`PS>9hWna9R!T@haWjUI2&*W%ha=T@UgHWs$oX&5^lS+IG@ zI7UQ3P>jw=hrYebHYVnyiP(1{tb#+gLg#_4t%j%r@FS6(2)Yg`ENvAxyL%wbk?KU> zi!~P`RJ~8D5RudUkshyZBH#o7rh`B_-5?ocPhx56jScqhZ%wObf)`Ak2yC!M$%b^u zTAG^3;zmi?E#5R`MhjEf?B z5iAF&sxTqdh(^}Dn^fhqllm|);|J0%G>)(cmq`2LT!ETvdDsYP^7C%s)mp2|^^?z7 zmR>(DY+MTIcW(7j72U~EF2ali=lbPYoAu5}D;I$bEWn}YvOl>(A$3$WzmZV=(0yR~^J%hnmq^D;fh90SYBe*ZtFAi*VagOTbH5&`IQdH_-mpEisM{ zW*QtET8UAqj)42I?d9q0ZNj!1V3zmYQhZfrY}-;fpp;rrv5DA2r|S+Fz|9PfBqss0 z_dQbGwr?w#%`!3^q#u~Dd_=`P&?Sfgb=%W_n!OY0z&eVFp<<$*ezP@8Y6GxW073SG zc5Yz9WL6V;DQON+kAN;H-h|$a-Z9F}stYT$j$@+*diVWn%Ze zL9wY)DXB^G!tv>aHXNq0#P_`=*0UOs23u$M`2tHTZ}+7{y2Yr)ai1MkIhZ+^s^tOF z&npOdEwRCWwvHob?5&}+_fM`onX_)Dh{xId*@7{ z+W@Aq&*JgEnc(V4!!vb4trw=&B|BAcNz}Fsxj-DDdiglEjhCqfc~&|PFPdJAOaWU9 zl}m;Oz=z49nQe6?7zh@>IPJ5`2gCUuFkHxvPlxkI*0`x9aQ1m6feANYm7uxcI{XjR7TX|l)i?9^EZ#ma18lv1o_X`VC{WZA87w^9lj!1&0l6rmCc_&$%-zwqNqKQ9sqbXx!ZyxzTQ5|d6$@Scpqt;YI-Rt1M_#%$QEA$Vd zCIydwn?;Gd$!l$L=b{qv-UV^TmffH$q9dtCATg;$Z~@i|(pFjRk}4}khD&$zy=rFY zb@XuNG)*do zWVV_6@66!-a&r!myvsFd%a%~*} zV0g^mJXKST-9>&V@wNJ}R=U|3yBvP9(ccG#u)^0o#mIL?6gA`hxH?U#++8rm4pOBD zCz7l4Bj&v&YF0B!4yzHY8{S0A|vh6R_|OH|_r6X%M1!1-l(^=y6*^c@jt45T(d8ES?+>3&!X}P$zF}x*I3w$$ENGS*@Oi>cq zA`B7qOX1QD7;6?aV@_J_W=Xz}xkfH3hsgz_Jx#n=R6T??HPCgdNm=m(Q_zMPrHrlA zPZ4t-9 zhtY-LrU%OQ(~giyU$ncxmMyF-|GT4EO6#}OBk@=B%YZ5PzAW!^|0>1k3H@g)4AIuI zGK@{dV|?oYLJ`>^4RIkx-rEMQoz2U0g-x}yyVGuc&{ARu+!YT4ZAJGWRbAFDUqKA65~ zF95}V(L=tAl12(vPLYWnX=;W)%K;r@4x|%FPbKr4LHjd{_smb<17+mqy&XJ1TGy-bPpjfwv zKb(Q*rub5Ybi+_{`-eOcxUu+Nm8FtZ=g9KH#%96+nuj-ePXG+HHL_V#*!ZWi zyhkW&Rb>RVp?TH6DA7~-YxrOJl>^(UP1lNHGNC89h}AK5D8VdI4bgBKSoH^59aHCE8|BY(0;zu7QDU zIPYR8W7R+R=g!p9)Mf`TR3T)FS2Zo7hJ_NPn8(=Ihkul5qe%KR54VSP63w+vwddb@ z9jYbnq~ZH<4Tsy9xFK95ya&i-Z5PJoNmW^Lld{f7tKFVH5GB9SYmazQ|)%$M7-67 zc~G5gS2eIflG%~V4%72`H}nD*xH}jKF>^s~eOySmPDxtP6lH2nLwealFX}7sz~bRU zuSFht$#6uIM^|Z!NHRUvkldmwDIR!q3sJhhIINpq4bV^zr=#*{Z?i2(0(crAT~oP_ z@RLG6tncm0U+9<A(OFFxdCk?2YIo8hrR0t)8OE5SSrsxBN#)QxDRy%qA#)kA;p))$0f0Z9y0vgC?PHdi z3`^9SM_jd8$XH2+zy}uFcjeG?%Z@#mEKhBDMB1bME_M@^HUH^4_qE+h#+wZ-9xb&0 zB9(%$A2V1FQzC?s=;qR`-0Ku74H*DsgK;?7LdP=MgzY_hXF2C*CoFNBMT+a3zWWX2 zB&TOS?dxrqI_s9W3c&=$5EmT58zPx)w?Q1)#Ha2BA?`MaSt~sHJq6I6|1yX0RDHZ7 zy1cxDUa8N4SqYCMwo$zB9@!0R-0mM_b?gYoatM2+!y#&qA=UDvai2;NOl3iE`j1zA zCWf3|SZuE;Ky<$FCXY;HkU~$lxpr)=Jvh_g{n(w2+y>YgEqAbn4^};B2=A++vZm8i#%msXJ@GePK@u1#kISKl`NX~PgEiGUEMZUVg249v`$OQ@6#8I zJTo4=B6EmnWB>5jeG^)AIi*8Zd!E^@vD~Ww@ZxYIfH=dO2)!0mRjHy)GH+H<`@Zu# zO2Ld`;Ubyd*L%(A(Xgnbb*nhxlJgt4yVy3ofLna*KH4#`BO#dyK+dh-Xwem!F%LOK zX8)e^Dav_-p4Bj1Ge$}9)9uDf3h!7XM1`<4fwkdPXm*5fpP0iR6Sl0l=%i-6vtKSQ zj;)96e9alByx)U<$6-z-Sr&0ZlE0D}2swuN)ARb79%dE}fw_8yR5i%Uy|rb{E%>9{ zXb+ZL#hz_()z46GN!`0a$x^J!X)(}#)%$C~-Uh+p%GO2b6e~Sr~ z7_zVpgE?0YHm2YH`DbLBu4_9)p(n}d_M;c%U-A?Vr{#KN;L0+DLa0Mg-;H*pkK}Fe zLSZZV@2NwIjl;))phoZSqXd5_grjL(C2>foMtt+wTI`uh;zX$Vv?QOK$13#a{?9oD z!!qq+~1Twopw<-j&}}`)Fnu{UMM<Z-BP zK3+=+QBF-=S;4|aoM6&Q8jqIYPSuGX@4(b|`GKn@!Qavp}ET-0RH3oYP;#4!Tabgx4(C0hjYvCQJK^)PqK9itdQ9Q++ z$xt2O_Ix@J!et+)>}-_@fURKj{#8bVyhC{xsSj@GE$h7f{jEk!BGho%nCL~;FN?{v zSjY}2az^AxjEdV6(k6a|vT2-JSg?9> z;_~OI=7X{x*C1qGwMxiFm#Icw{4Suas+f?VApsXHiJkY9chjr2=g_Rjd`w_K&vS5Q zI6n+RH=$B7Yg^$KwTN^67FFKIZstoxw6;nWdLypbS>62E{4l~59%xF z8@jXBUEd^PWom%5_FN@jp_tia9$C7}lLrWm&uH@$!=Xk#Ej%hU0p5G-zx^SQpF3-i z^5oCQNp=RN1DD=x-wqC_KI`4<-?OVczKDF=5}j8wTigKd&w_g&dH&1P`uzOuB(*T- zQncPM<@LtAUU;ODrKg&u{n~r4C`atGnxT2GK91qOyhmFZ?JJ$}{TD+`Kk*NyT?-{>Pi*U(2FPjW@Qxu0VXN!9VfExWq|h-r}P60wTD- zdNJ#6Pa!>R)}>9Y6xj9$LbSC9cz4_FTOcGVDU~9roUdS31~A&At*e*QjQyRP9hhrX zd!hhw{<7vB-!H%$HGe?X;^k8H z`iC5j#8sxpl~J3y27Wn}Ym>MpYu-)>%hS>Ky|oH?iEE`2~l*INBO_$1@-R*wlZ1P~Fqx0clx|d-J2=W~|8+sx1`Lj9Mg1 z3j#6b!!jWunBIxfEs6&M-_iGSqNssP8H%sh+TK|GbExRQmg6!VH5QD{C~NvCNl`dz&?7d0k!#iz!p^~8hbePx zN|3wiX7F7dKlhg`?@z210>VUrNuo5Q9t3!B8Ggek8DIGWJD6>ki=U;bK z0*-xmYpnuz88AMQ@P;z|cTk7UyE-Ri!5cq-OYrDun&Np>4>a>zG3if0xB3M7KUy30 zIS1qmrY<1<+%5qv< zfsaD)2CQwrzD;|%0?S#Hh<;7s#!6T!HK^p!Mg@dyEf4TCoYn^I1S%?vuP#~;PzFJ7 zYqll5Zq9RP_Lj@~;yiJ@IZYeNDY*Y;V;ssY0W4#t^6^RA@d<`ioCx;udQhOCVLgc3 z+&T&%Q%Eh%y;LJ!f++AEufjmZD8DELg}yV;Mz5L18D<=tvUGGeLU`h4Xux3a1aYM? z#H`P^kkJCd+7>O?ZS5rf~2AD}yz*M?fn4AE(uz%JW!W;1CF;Z11wht+Cw*lTQdMo-#f! zBo%M)-B>p&C-b)xrVV8HQ}M{(GQD$IYJWqi^1;JCiN@>-w{oJ@PIMSS^LI4 zleA>*-{VaeQ?%USITrP&h=h$Lh|GZrOXqDgkHm6RXt~8R&ji1YERz>RC$ZbU*-U2L zz2@|CrJ=NPY@+ZAT#gorgN&ZivF)*HYR<(>+g%H{;sIcJH&m}^!5$p{ZSCbjw41n-9p2ZEPMM?$t{@|28ft->1^ z>XlP9Ru02@GhUkbkk`lI%AnK6(2&PlC7o5vkPaY zsr8{}XGY^QzD*H$wa(x6H>tU%EAWFN?_+O#5xTU$+fL=sswS-eM^-6k$*W@9w%eu#*P<)pGxz3Gqo)3ivoGpTYQRy`sB;jS6fRXE6YReT6y%&g z5#?$?BP3!~{@BS4!n!e+ENR{ZS^3scUs zJuD;s_Ctcch2qPz4qtXk^dHBE7*b4^3!FBNqm6wQaK_`~A zbEl4XNL3QlI9g?QL_4Iiwbr@Mf119F%nq%Gu3|>!kS~bP06tN9FF!pso@`&7(JFb} zclyNiupE)r*E7$vB~0bQWKGS7j0L-G`h#ae);>0EPlNuI9!&8*4`&HX4m7SpNmGz< z^oM|$=E$yG_kc!9*9lAP0xs;XoAvO_Qg9%f^J34R4-3>JSWob^y}%@@g>m53p4h& zuyVGAvy^~UT=zL_xYsG5fAt*J+7f45U~7qK{lHS?QxFvWG2{z*Gn#yRHTs2r^oxkv z(Aio)hG!?6FAqyjr%&=a&~3dc-M_~1eZ@<>{iSdj><8LtLBq2^HFkyHIC&BB_K`=a zA`GD@ztX9#Y#fNS(zGo53*o8bt6{yk6A@gw3b8m03N~qLQTKNJVO`?h5@NQtTqrU6 zcw6(wSHyvpuU!=>k~19}jXIxJXuvt|*q!GFttD=LOK=F*OdI9%54Kcv%HhUJCXX&y z++C8+g*C}~I3~7`x5)zJPQ_YRuo(}3bKWhW)w7pNAbryfax~J@btpr(D9qnwT#xbB z&cDdS8|P{jyTeYjaZMIG=&*)ZSj^m5H-t!vcZ}!VJS#ZTT*L zgSf`pMf`U%kiR2uJgZi;7Zqq?xNufF-iYcvudCuKZ;OfqN0dYTL(W{kMkjr% zrm{(@vJUlObF%g@q(+5_!oq4-oKjfh32rA(pk#*Rh7y(a|2Lz*grrnR?swQ$aW<JCKs(H4u)x{U@Sma+$+&+@vg#hANc$3VuF9$Z+gM=1dX>1YSjNTL zh<;BN%dVP%?zuIDHf3oWgRR=GJIdxYfzUqFKuXX;r4@LyWNh)$lMC}=J@ocj&ex}= zJ)^(Whn?=C0x&RSSIyx@@^peL;!mM3htL9_anoGDGqDhIe6sP~j|RmXUn)C@N`nu)!p z(Nlh*EHo~U-k<;#p*(T8`X|S}b#4xNn18sA8)>ZHKaL%l1W539)rL(4E%$LY^%N*> zrQud)R0PFbOO+=9#8U6zdi2~1x1+xaqEJwf+D|F9O_nrnLXj3K5nGJ7;AK|4WmS3| zBU_q6hGVKlki5LSRGUXNcj&47uKCWWi+5mq|0;EfEL+4$wu&sUln167?wv`TQ@wF6 zGe%yNHr-(P{dGS}X>)Xf8@{H-nTaD4&A1i?KYcXQ5?VbKaR<{9?o8oa%br+f#B+6Q zC3I8gARd%AOGTX1tSh5E5tbEdet~WEv$IxX#`FDWP?eL8?OsdIy@dIxMwlYJey8kr z&V*eJWqcKTvKPD&`1e7}Keutxj9X-C#<^Z`(m2$9-UAMe_~*F+KJGPWx}`6HFbzpN z2@=@M)~R`X^Yp3(D=Ta8pHX#ZfzUgB$$`GUJpNN#N1>GNX3RP9tW`rlON#Vmr zbPMy|C}K*Kik_x$!^I8Bx!tRH1L-fDyClf#f#|}@Tz{7p?-1~Kwtkg?ftv2W&3#{+ zFLn){TWnE!RKx$Hsmtp0&QKkoj!RSb7q+JGcu4Gwf2T7$AYtnl@~gXmsu{(q4T@bmKn|34r!8Si~R@P)LW zys}^DkwkNuEEOJ@q~nA%$tp!(;rdR?`Ex$d@`Le521Y80HS zB@?){92}JGv0rxEBi$R*l6EaR56Tl~`6jTUrg8j>e6Q9UBzg!`k@_jm8Y}q^Xv0!V z3AS5NBl0P;-nEwE!~bXt9RF_Ti;E#eiMX#Tjq?HjM5`^tQ+x3G{{&knRZTQRtoGN> zb&MhwPSS?!@d8tJW5MDhYXO8IVjSD=^ zVDr%4M()OQ_7`9|$2&yU->AP#s?UN*z)mZzxy4w9auqjoG zFcul0b-Z$dp5V5H#4ZNo1quj6!j`z0mDjJhe&zX((+UW&gn8j%^MWH(rKJ3l@|}7L z&*&|kS3|>s;H+MX4J;qoAJtC2LHQ^P)elQmR9oDLg+jlWgq z53YNIzj6%}m{Vky{LgBbQpBHbJh2&I{Z*@;Z*h ztowE#gE%49cdr8qs;>CnD$8h{{ZC?pIKdJdFnH%zoQ)~l>ooVvFJqn*RW|BBoQuCb zyxqjGfqX{#qx#n|XlQR`F5B?(3a<+TztnfyoM0`QaC_yRaNf=|QoeQKr>|>~plB$( zn=_U<)?F6-@(L{GSbGPugIUci2-GYv{1|3?{u74It=GJGWaVnr6npWG!?oOc^&?A) zXsFgbz9Y%GM^I;ejCI0R7-(zwwhWm~OMmj1-`4BWVY7L3PTHM2WnRhSs-uBwDc{y_ zZ-AqF*tT!iM*jkD2^(EHy0%Xwv7PjDM!&277Mx@C^>XgBHr+w}S~FpNiQkq!S3EDf z$X}8Z{`fumz^^Lgw@NhayBD9iTE`@7Usy8i9<0UD2EKWtUi>)cGCTMz#X5zoC@9x| z27kXCi9L*zthC2-L=q!Gr*?-u2cyH*gAzm${mh_ivsXSzd=ty1ZU)RQ|SC#mL3O2m|jIOvdN+I6d8%n%wPO>bJmO5q5*ijd0(tI)s6SSFZ1HsF)@Ku(73&@K)Bo<#K0Lqe zIKh_HVPypB~EVE@I#77(DEk9O*jFBOkQfToI0( zUULs}4iJlUw)Nk6_qYO$F8=cE9&BD_|Z296?s zD}V7s-ZUt}#wxy@zo?5MWDo!K?f`eN!6kzwO(kLC<$lD$$LE4>EgavKuc>NhCr0|E zEx2-UHf;MFEy3qrNd|Kccr@+kCHa3JkE13h=l|9hTR?8A);9hKFNZfpS}tY3xCm>B zT?}Z!Y%;DxlUEN5P;AMx;_4fr*VsOPJrn(%6!yO04*b{d`Cq{Ldic1SLDNIk8^&QR zx5ER2HjC|^oxfohIXeTKi=UguM!qdDPD&QdcLd%0;qb*SMXdJWf&sLrFr(uTz z&q!BSIdh1%v(-kB$0b;)8!zrb8MP+ZPPk1{{l3TmtwDK*eIi-4?f&YjS>LID@#XX& zC+A51CohM;?B)*Oi|4d``q;LR!6N?X?N~#zx3(^C+~KW!>CU9Hw?lrup)a2d)4XQA zakjV5()*vt{H{ZxUE&RP*-$m`am(H2PRJlEJS##-bP;NCvg%d!?pWft(6Bwj5*Lv_#T|+ z=AQmQ0s>Kl6sjqTXku1YQQI`m%8fnTa@h?GB(oGH7=GuoO$_NgGu^#Y|BdfQsnW8w zBJ8%BQVY)cQfFq}_dP~Usi2wgsrvmoh`JwwFM03u^l)VjPn_s$_)xs%XU`kqGmX?K z%ERLLKaP5aAEq|0OHj~EObaJfEAZg`+kx*wv-M9HXGcBco2;IpJ)SJ9&F;~*ALY1V zlJ}UVvqDyzQgxK)4L(#kTQ;U83|H4Jgg~c%RO=@fHd<~X${@k@F4h9>vbl?{)?RrL zb#1HQ*JnJG6PMAIvZV9hKc(0Kr?W9K99m!wQC2gSR1;HHF{ZJwt|+Rixwc|0iBC;i zCLTc50ML;N{`zKE{PqCfdP_)F_bFiDuu9M5?2@pMjPd@MO2TmX8B2N@0Rv1| z6VL47q=?%}GdsqZ4!L0Or+!PtiWIvEWH8+_w#*-$_GTSp3WneLi$Mw6@<5EDQ`YFA z{sGS$7(cB*jEiNonuQNKnR;r2N+a9+!V1ha>h)hPh3~RDbj2k9Ym)DVRYwQokQb|8 zh7d)qCAIB9k!$a|>^Rcs zwktj!YoN!wh1Q-GKnm~lpF$#*YJUdQ#+>|BDuqS`nmf+4Ty8`u*q3ve80@>iN~~Lq zZTKIwW+d@O%6EMbLyOqO=Uv=phH+?~f;TAa_+=Aw!&rF=Cp|s-CZsBQ$YSP!$CB`L z%#!gwq5zaa4NjC7N zvsL!wcLbYRmF*k-4C_n_bVwYL9b*v8FJ($zYyk33pAb&CLx=7B$x$b!Ln?+RicFa+)yE#eXKrFrW{^vZ45s$$Zc`$0NH^G&%dnN zhtGbOC=;m@d&Xj>4gZZPRm=+W#w!#QL=25>2@6AF|Fn8m=x}5568fA6qeOM{Om4)i$QGh za9h(yO>9MT)xTP_%h?ce5zVe_Y+2AD}T#)$BFT!V+YtM+sCz zJN-1Q1b`b92QH<)C5B*eLVLTbFI1bX?*G_5B4We|0^F3AD6Q9Rb95k7Km5;6M3Vg6 zvsc6{PKa#@6-~1%2;p~r)L{2RJuQ|;9|Od3^y^C*1!?laNU(;CFq+ zjMJX%51oe=HZ2D)dgj7Nu;vigCAy#y0JcQb-0$jeLx>(-^25&dtY;dRhc!(RvYZg; zW%wWXgjc5XH)X;~OUvV5Lx=T^%|+Ge_aU1x-VBxR^i8qSe-7`9?q#8}Gvjp-64r@x z$=V6KXfA@W@QsNUQ(L`ux9}WQ-f}_F8l$6=Xa7m2e?RA?9^1|LfHj}@=>@TCBi(9i z;x(i;fqxISC%K%_PeLqMRU#^ir_99)NsoUrRlb`qsAM)iG}xnQOyfg*Pk9EEn+f28 zfR|Yg7xS+=XHzhi5_3@1_g~7>GrS-Ssg8$NyTQmb>-DZR{ZYwxf9e6RUm_~|0VzP4 zNIu6hae^Q>$sy5N8)1ymd0}ZiZX0RfZB{lO`)HUk7dTL-7#CES@2&C2prgSWIHa`E`f$nb4;&b^TPIiPdly#WtGCld?N`p&u ziXmHr}lJ2$gH()}E5gCjE~y4Inbk!&{Jx$eA)Oloa_{c6K-f0u}Q@yw@av z)z~5hz%df(V^}LQe=K=K3Rm1_C}P9I09b(mZ$B~YwTWniIJeJ$mPW)0rjN2Oo7zDde>atWam;{iwsmwQ^hTS03(wEb|5|%EJGK9ZK=c^6&b4M@;o zFY{Gpc|)gGZQr=J2@Qruih`dugM@DmA-af;wsucY|6#=Q%U!?TIyX^5Fwzxu3e`WN z$T`RuqZ?C!LRdQ>-lopQyD-gQie6#E)yU^=P;Q;yrVoN$+Z&p*;``k=Mss%gNqr<9 z_50R$D`OqEvB!uM=2vw`@)NfgUqU@fulnekr6Cg^bjn*Ub>OiOKtj5f_0VsLvjS|m z(wpQf;Xc0{W{R#DHmwXPe zUL-HY{uEu-rPbkUZ3{ zv(@?jV!Efm`1#Hx`-hq!6JN`%QsEL^Cf-17Z4578MYgV# zJP9LC>3H2&T%SL%*j(ea3*oaW38@Nt{IiA)Z5ufSr711^K|aJP{%NR{iHTC!;Ez~_ zIU^@lhyQQQJ*{^4YyXVm2?=3-st- zDOboxck|ME@A{YgRJrz7-yGSe^lm%pKL4VHzB66B<~f#;SY+}o+NIal0};_&Tx7X0 z4j2>JAT}XZB)y~XZph4r;qFDrs@J9TtIqb0_qaj;q6%|77Cd@511 zA@7qsrCnY*sj;v2h*uJQb0&^9#x=<%#5yqwRQglCRTyKomHVovihrNN2iXsS&LM?4whjcgcFY*ueI2xUb1(b$6 z$>Q5n*KO^iy6$j|ZjMDJZ@i>du1D1_Ni*hu%U3v&s&rU<{pvwTErDzb(DCaWR#yGjL8_c7G+@ zoAhqI9B~5tT7z%ab^6 znwj5>k(J{2ZDL+NsWwlbUS1Ir=}RTW@vcC)zI+_;e3dW`ps35_7CHBpQ|;!%d!u7V z1J*;);I5Vo-LL#CW`&^|YyhqCNJzfhAE)ff{X3?wG!IRX=^k@i^eTtFu`%7H+KJfw zLGzOnsaIax&T})JN|!f=i%q*9I&9$=T&se1uP5=NoSj7e@VWjdjLH;;`B{zb_EOr7 zD=?9RYjXJ+tM?R3^d6~w$!~bX;;JR$BTg+4D`$eb!;o{?0nfej6Khi>CHTV6E(i z*ZOVxtAQ-RTo3g3(oGA(k8gBmD72qA@!(3S732ZP%J?h%pZ&ghs@fDDOO1}GXE4m3 zZ$CL^O?^t<&QDbwGg2=3(f?eDW1T$`FQ0w7zP{}5uwFLII!)lF&kw>jBs2w{ z&|z%zPg{9~qJh$|&HTnW@1p*=qGF=u@5WOJnur)4h`;Guto59sO(1Ia?fb9ZYt5J! z#gTD=7UxT~-;#sG0z{3ga2?B4=>kLg;~JZVn| zF%eXcz*`qng@NLw(X;Ln&fFo$+Q*B6w5fo?R{R!}oBqc;=;z_#^kWcAUY`^Zggn=< zzvv^WpYJ(?l}ROvDRgXBCpfw8nO%+^@HOwE+X-Az01YvTN@>(HEWD_>6!+9qsO z{ko?)s_cuvfUTM1Yt9`QC?IjdK$*+woyvU6j1NdDp(8w!gH_x{q}2~olR)mNK&ueB zQeQ=x`^sZbc5M49l#DxzX1Dfkwwi@0jd^tj&J!3GF-_f_y^%MLz;!UBX+KqwB9i$D zQO+pyZ5fEFPi2&zI&3!Ldih!BYk#MFvl^>nTcC*zhRH;EBHtily%6TGF0U}0Z3QQY zAk-eyZylc$Zk`B5Ay7ywXs5>TJY~h=a*e+M3_D*tQ8G&|>J##d^n2|9;`X3r-KI_P z4H;gZ7$385P+O7ANYnzd&f_x0_kj|ZnACx(Y$qcRhrX!6F_a-)JYHMGRyl!oUERxT z*YKmjinmO2OlTd^B1RO+{AEO(OS5X7NU=$oi3&9-Gj{8%f0$c+;4P#gr!0izO&c5I z8q}S%kUd;?_AHb1^!HGpM0?BjrL~EEY(YcgrP)VTeU;=_IxG0?an;y)eEqAI!u@J? zN%N7Upn7~iv3|YOP0zw?tL7Ih+R?OPO!qete_cMP&*S8FiORhb>4&L%ze`9mnMPRsOco|h}@VAY^nrhx$4a{-o z?erXoX&1pb&vai&)Kqnr45Op3i&0uGK4%&g(kyug1)gSDTxr(3r`*UfO!YjpZm-GS z8va>KI0h@4a|MpwtX~%jK|ai^K13Cr8BKMOxfFM4`q+>Bv%TyGjq6CPHBqbv*zd&5J!iBzIcQhU<&u=d8H3srf z6P$R^{|zMb4kTKm=;(Jicj)tSQdAj&*AX$=TS0+5ZM#JmhrCT5((DU8XLAun=Prd- zOe8wj^M!Q=SK;oh_`KLgIz_KCuyp_YQI#}&A^o6Z}rT2B%$C~TplyQkc}5f z#a9*=Nm+$QfKUkFlcUdH|LGB>HXLlaFoq&~9<COqzC7kPYMvd( zB4^Wb*13UEhQ_Ud&izktV5U{j3BT=4@?`_IY)#2Ookc=8>w9b${>$S1goK(cG}ljf zL<@36E#WfXZjx*+-l?tSL(Z$+a{dvBqU80`9&(B7=}%o#Opi-()+n(ENJfskDL+oe zu^EdKR0y{nfrN+;835dd&MV8 zya-L{D~f```ULHyPgNrFY+QEda129EhCV@Bq@9kk0)%i#-Nk%je(Jm@E+ise3854UFiFq!&-+7~Lvq`L1Sei#n?YE^JK0Flh%X7z zzcn%gu+c7}qpgkx^Ac11_D^2-3|h2hHaC=Mjj4vbJXOY%BH&vO>92EAU(^fb2CK3D zIktFwI7VN$s%=W>wJA5>|CS4Y*-nRuxWNrVw8YM^B2#(wfRyl?_hzts9h4=TvKUg9j%dsFZf{V$BY{{?JeX?yCYkq7zIq^B|03$PQbz@qQ51njW3j1 zcTO&eF{sS8E7HT`R*6dLCLPJ0fz<^G=k(mk$m)!i$+HRVY5FOpSB3RM+!5El8ms!hi?8Ju z+X9|jM=l5J4{S?-_K$D zYB9VuCQkB1m%H`3eNN&7eOb{$7fdau!XFD8L9m9$!W~1&3$?d(j4wS)VLWU+iun*X z#Z<`5iYw}g?BP6?I7+?ij#vJHt?ivNlmd2G3A{Sp!~XDHX>X`VqSK+BfKZY)AeUbI z(0=qsXbIn@xeA{Wrg*cx)Zr2o*F@MZXB->9YQs9yA96VxQ$lyJP6s7<*K2g6&5^L7 z6}4Z6O#v9(u0t(Hi7ugX47>U#kG&2Z6{d-e4%3!#TU}g+g(+Qv$v0yI$L3G~q;hw} z%#E3_kY6zF(3=ocGg5`ePK0pB8S$!a>N`azrzc7Q|`o>{E*W} zsmPZXnd7f%@)f=LaD0H=bZuax?rE*^a_aLAbFtTAi~OQ0pt$%(=y%TqvWjFvkIHdcyDU$bfbwQrf`FA zhVZe&K7VE8+cBD1h0>}Vr{?lvLDi0`rC|5Y%z>gWo9+a4MdRho!Rz&TYc1=y{1*cX zf^N*K{+BKm^PfsQ|2ocE(Wy5u*dQ=m)^L|`n6mTNGr)UIrA?Xdui!Pdx2OL_3VJ00 zSVl9_V!2Rt?e+7Mj=+q@El~?!%ul`6m}ie-{elHz(nEMk4FYD)N|xBd1>cndf3XbE zZ<15yU9x!z2afsnoI~wh8-+e!bUlPLTM=xUBq}L?k+_PunnNRIX!(lFM|TGaVX3wD zHhz<~6Mf|{hsn>>@!OEj!d~0xO>#+d?Y2SPlgSdr^z#XnPxJlGrZCi?*H7vqpatj$ z@7A14dNZPRl@+aBbqx`vPZ~S_QZ4s9j%D!e&xl3N{T>D6x6ds%sHM2z>aeFPYa}c^ zG=qEy-^~TqI9;E;&7^hI1_tAK)!pL)MNY7Cu=r6tX7}ripsk-=c+y4htM^JYtSl<{ z82d+!7T^lk#D?|3Eucul?$<>{C_kCLKni>4GpH^>Xle(=kP^Gay^8O(k@j4+G+!4<$PLM6iiO|j_2Gs&|?nppFL2J0Knq~?%lDQN!h6c!>mcQ0n<2(DkyW0kQkpAV&kN9|Utz~Z z0K`hTR9422&J~gMlR@M~?N%2xBPwb9rpK-gWrd|<`{goHv@LAoqd zps>NusO&1S(Xj*dBbm{aF8A?k;fg@R2&DUAPTx+(I_uXOgkLG%Vrt+{iQNu(5hjHiv-9##Ex~ap$(h=^zkvegTLf+U;*!DDN zx+KzcPo4-DEKFjuS}3k7e_b00Y{v?PYw_f_8L8Z`(d?@bI!qt_)xkZz7Q#EPB9@uc ze#f*g@|vhwN&{vs};icTvG1evI+VGO{_IfmaI_aqlI6Pn$*?CXUfNp*y z)=@k~!AX1^d>jLWz*BbPpSc-Z6e1TWzgBWH z^;kDt3Hx0ALGZ_R6JL!|mYS{y>k>8+iijA zT#Hrqo~u-vsMP0t_X?+5nUz>-s&?wXV~#-S`(K0)a%gJcW`~qihg3@f0ZNT`c&Sr4 zDX|ISVZ(DsffL0Eax6CTB$`zS4xua0F1#@?<~eipeF{-CUHWr|9jIT2&v{8a|DG3- zGILeiRoK~>dxTHQD(+=6R>Ghh@ZV?!?8p2OQoSE_R(?4&`%@?14=Xr+p^{jM2`d?3RvB&H4H9&Jl# zX6U5JUkxW=$TEE?xr}LcAXjsFA-j$6fT_FVnc)p#EY78kfTQ>p*hw+PPT5>-+CX7< z5-Fq(xchvxpmju>%`h?t`+(GpE6?7c2VLIBlZ%XH%M|1uN5_o!sSHo;Db^(=yv}dr ztgNpm@jNdR2{I09d+J+I;pJ#uo{dj_FBMA=0VPO3u)@86z;dnhc$)(*|3U8Sj z%S$4uYAfSwH-11sIm0E|x> z;Ls1s>BFZ_Rn{z2juH~}Q|T0OOzc{|LnuDlCfA_-C&>MdL5bKgZ;JICF%?b56guKv z0ST>b&)Rq+wF04i-`jCkJiRZ6ET@t~?~gM0q?p{q2;&NEN|b0m#KvLzRhR6v8Y@6j zyo#h|gzkhU(0xpa7Cc)-gSm8mQ3g?>!Umm%ZU}J}#o401;~*Sj4mja5Zi7?WKNk*! z(*E3BqBFS6&v~spdrIA+F8dDMjI)QAa_I$%3IJb{{+9(t#I(jUgO{fF zfCuYp)3+IZ&6!hWg3OpdXpvNneFZI3EV4LNJ&fad_*w^C_~y5W;e?n5Xrrnz2>$%r ztI?M$8jY=l7oIHd5&yA@xy^@pg% zd?XKUu4s57kF$0ST|p&#^&8JO38NHX1svv}{F}|PFP@kZ*{-ltApd&>_8aN@bdbl* zE#^1L@pco3TT3CYW+PxzlX&^WfHVcoLG~28=DpnUqOu^KDRe z6<(fU;|b9Ul5NA4=dRc}J&9l>N6pGb*nqUl?#3F1e|FGz{cp72mNtJgQJeY26PK=a z!$kD0T2f4`l64)BE%fps$UIIfA*d)W$>w*bmIRQ#{a5Y>a4RG1o9DIrdry50CVi*d zldJy>3!e#&W7V~m4)Y`AB@Zu|mJ%0s6H65@4VEAZ-i)va zy|((N@4hZD_wB#;m%fS@qRjblaTqJizKrJJ?}3NtfkD?;%RRqlX)gRg~jbx=m5G+@Rcvzk@3i-N3t?}<_BixHFo_hCmuVkA3Q%s zWIAMZUSgvb#vvrf{8YzKjAL%3=dTo%cYIHd0WVIx0`O~a{sPbI{qf!?PtfOFmqr1T z*hS5W_aQ|vU(O`x(}YfOD@-V=Rbw#Y2I!FIMM=G#DH!mEOz#P`Q+(MzVxDYr&~k+TF4`slv*pFjN-?*j43-O*RxKp`-rP7 zsq)Hdv546SmPs7cx;!7}2`u`#*Spa$jRY;Dp%_?!F+-5#3dvv1vECWT%Q%0?=qoQO zc(HD)-GTgo$}Wijhz6Xj)349>#-RZMA6^=lCR!AqOiff`0#`VeI<~EgV$m9NN;Xqu ze{2ljeo-JVg{zM(;cnP3AU5!(g^y3>vJO(4+=tR8(h% ztM+fD@*oU=_lvb7I<8)fJnzrh*IZPkcDo^E28F!7E6G(6>FFe1(PE-gOasc$j48Zd zatXQR%q~cBN(=YRcu+E$y|T;DZlO=YQfi2oZ77R7F{160om!ok#9bW8x)PBB&;DXe z3b$momok~<@iLv7gQC(pT*>VyCbI>4tFNC;oa~6Bi_<^$KPgNZP(t$QZlH^Vv=Qye zhi<^-fo@2?{GgK#2Lfaj@s+hp&GElBpge;7(j^g^Y|VpTX`tHfXv(Lh$I&dXNKF^$NvK?)FvA?xSt@HyP4Um?cF$$OJ=$mW-F90Y$VMgoc^w$)nHS5o5swqA%2Rxpfu&P*N_Q!Q<>_k3g@hoQTP2D~JK1;n@G&rI4-2fq^93`H6$J&I*DNDms zaPaKvtn5OTP^=*r-Xu4oszmxCua%BvX`fCd(WDgeY$L~eXyN4fgr9a$ZPf(%70A;Y zv1R4!(kDmPO5QA6THo}~A{KjS%nAJ?E@p+5q9tmFCoPR=HmqJA{0S2kVx$_%GNsK? zw^w0ewAX0S&-jA_-Fq|J9kVeJ=4xN#tM>6y7Bj(O<$2eV%gBzT;5ht<*21mohu_#Q z`~sIEb`q4Fu%xAZvAtKivu+Ep6)on;{l0QY%uKGu(<Cs)h~km{>3yFZvDLtK1U$Mk4rd^}k;*Xkb;m(3tj=A(a67L<_*~ z6!7NDX?9*_GnsI-aZGVea7n3v5+G5$ePw(jkOuBc{l(+j2x&h%+<=40h!*NJP2gxoL;MFfx?g?l_&ofhr&Ib$P@koC5K+E%zP_%;r_jg-M+&)g#T}UO z!QF~CD_d5wer#;?OCev}D+i}A8ZZ0fP>xz()jHbh915WzGr`qh|7?7qOTUpdkJBz< zsr%MUg}@1;AE$&}%`*lse^va2QW*m!HM^Qpk}%E{n0iA|)ao5zz}CUyH@EJilp**l zlfKlxvg|rng?@^Q^QGq#&@Gp!dS{bwt+g81@vq!OYh{~2gY|aG%V{q}NY0RA)p9OL z5*OAGUwKr}S2v^H#IL!{dmF&zQ_3*4H4aOu-y`~XcZ^2Ee{l`zc7OMeVHc3=_k5ja zi0?H{(=E5f;+rcpyCCh>%&YNYqH$dv$={IHxC{Hc8c^(JAwHJ zdgQokH_4D%868yr<9gPCG1fM8_{8H*=gm{|+V5WxkHNa|=8SR%M(%O9XFnkdJC*uk z_yczO)DybcJ^rYoA8|77JLRc};gR&Gz@5aLweGkM4@^7Zv8=vsG>KyIRod&-LU>)B z;`~FJaK~7Nmls1iYXKoD-yvU`_gG6Cq4rN3i#Q;n3aC!b5Shqv<&ee+>$g00#=lKS z6en^e0eJhh>5x#h=9&?{-10(cs|d1xVV5a9R-2&!)z4?h*_uij(r!1s#@I~dM>mjh<({@l4l;|e z(j4OVy3hYxxhCLqVSMUNTdH;$6*3fkEIVJk%SWUtTlhednG;?WPOtl=J9GC*o+QUA zJ9&~zt+YMs#Bz+t>(Hr{Yj+p>D*$7jSjjv3{Q*m!T@#Pl(JKM_0ipGU==(4rG>W>!R{2ehmAJmfd1K78Ac;HTbtVqg+fgO9Hvaz z|8$uc-o{F8%EK_d+HMQ|0XENu`Dkuko->n`o0X>U*9eZhyF+O;2-!TPop0_izF}R5 z`KS~IVqF24^rV~iW7l@Ee8{BD9#r5_0ich9E3N5D)kEfA%(zCru3 z;w8wKf+o4hy(fwsaL1And!C*)EW6!?&gjiGUDL6vZZ7yLQ#&i7b7-zN+tl#cvSafXoJypU!{bn>t-yk8?D3pGWXGWXKL+BX z@>-L?oFdcEqKU~QKMK3X`&KU{f>B>^0N>-;0}D9~|KF7CbY9V* z_q7nU&8r6+L5g9`d^FyVZK^wRAs*js=wXD+g2+J;h10IY9Xy;Lug<`YK)J4F$F>?{^8 ze(eWrNr<(O^II~Tj|=z{7w2?EnQNe(p7vJ;o&(RHLvCp}%g!X)vjhn}GPd@ee}I1K zojOQPp2GFbIHO#K(0MHo>hO=QUxH9^2Do|$_+8BS^1TkBcWeY%TYZ^ZMpfsz!V%rc zLrw3Ue|`V+1%sd7*_b%+><^MWAJo3ADre>;iFw6Ei+&BVT;?(sdJ=zOy}}hs559#% zR#zhu8g~O?RDGt>t=y#a`he@lC8iLW%hT5;m$Td&%r@vb(Fr3WM(fd>^&b+LCntxGnShz{l}4mF$`J0q(d$p%M@dXkhcC7 zfU7{a=KhMJHbLg?Skv0Ih1$o_lDb!O`^>nyg>z~(9~xOb7tcycUK~obH&W=x_4V>xqC0@3K+Dk3x<_X#T*-?gBPPq2JPE_$5N8vwh}vrG zmX{ZD!*ewaW^R)*NktZ(aQAHvdd|lDQ~!JcaY|&+981O5IlICjGc$^NJJGMg6MH|n zc8Azp3JXeYtA`lZp^c#m<9gGEQI8cf%oKs$_{Np_dPD7EVb{rJ7^nQCfP#|qXukJj zlDEvvfWqGGhp8lwX_qS>F z+N@;Pj0;%lHByO^+EMvnI4EM;9j&nMkvlJX`VD36sP!{^h?Tn*ArPYgfu&ES6bd{{ z=!h2M4OixoA@Q9HNP=)02!I-Xqe71NL(BWx(m zR&3{uB`^Ant`BFm#6Ms4tl$N!aW2%p$H&@szMOD&fgWD;AepLB6niHaiBCZqZTT(V zyEKdEy-wwaklr>|AKnVf@kq@MNMf~`5w>CUWzD%D!Ho$$|J5L~AeMT#ulayutnsF; za{IPzn-ve3+=j7&f|8kBuL~kR2j5|~32gz{ExSF3d=ZI~TnRB!BX~+1Vx7Qq++(WU zDc*Nv&#|6%h!&Szp4Ec{6a@wfc4Rb-k4~I7!Wg$o1M(qvBNzu(i?y;~+z7noLSV9S zuExY5?3!b85xzV8BVFz|q6^4^TAF?ct$-dbSH$Q7*eSZ@nBjTSY{Ko|JW!F=0-q5fQirHdy!|SNZC~kl68U;q z*$=7FdTyKG+{GCN;S5uG)MH&(qZMs|3{h+)76{elSU)CDLrCE!(s-nPG0wI0M z8?V(9{kB&~kfF<{V4&Osa4LG8cNdL>oO;y?K zv}qFx=Yn>SkBo;`8r-5YvhWX$9aHF4q86_shU!p5Y3)l@(x2596o9@^h#@&L)G~3~ zwYV}01YX7NFV)GzJSB73@N^K8ODw%QL#)H(Pn)>)yHN0QG zpQkt~DkZ$KGV*d07i>cwVTVp;hT)Nr{31JyI;Ij^ugTD^)8*iy9kxu{AMYpn97 zFuw~Rr2h%DN_buRp|6S#^s}XUhXbKkL0b_%W>QR+ZcG3syk>uMR z8FGK(7k_sTQjB|Ez8o6dW^8qWb8Vq|H$Yjo*m%(hW+@%Ko8OYB4-d|~3$>D%dePTT z*%Ni0_D>p|QYylN{L03k^bG%9A?bwCKKZ{CYzIq5NXc^@s9nsI{V<`^-j=}_43IS# z(W6`*7u^v4*K8+$I~OJ&eP1Cy&VOmt;vQigf!`@JfqnS}-?Qlf*xA{}3|q&N5{h`2 zER2E;qzD95=Y@UC&UPZ>aCUKr<{ZIP1Gtl&O{@=3!F!eKA3Aib<;zL42C5K*j>tja zrczNq`u17mDCPH2_Kky^>%p40H~R)OkFcJ38(;W7R0f%8487iQq(P$WqAYC*54Hv& z1}?Hr7wBLx+V0i_MGA#cYsKYHm18drn3go2LkI_*@}fVvc5DWlGb=t zAs*J~ANB(fDjWO2%JLR%Xz`Ke@g(aQNuyr;(6jtd2>xPr^SWo-q1l9X)I>yUY!?j5 z(~(R~Mu3yqFaRMjD-_SVMAJFTkp^6IDMduje#@)uPhNxZnDBs~xPTBgK2$vbkQa(S z;`gICJClaz5o1V2jkROx0Z50;V2Is)+ZB9Du_cCb^_?V0t8F*8cgo#3npW=88mzz^75{KJGsIu@allzyQWYUAOb*n{b?)D@4rrnK&o8sUH@jH0 z*`aE;X`Dw~8@Uq;5T7b{nu=<2ZQSp5xC#qUxJnm|wuw#~;8EUxQ8!bY&dK+T?wLhE8U~dqSi5c2^T4L(LA% z9A;B^`1(>UC!h1^iYyg2WKmMV{UqMEb#-wsrRAzjQu$`k&xf?fIGsdIDUfUOQ$%~S z%^n$hQRkxVxk}`GfMC>^Xs`eH6j9U^hq(*z zKrC1P4MF=tt{t4s5^#l(G&2QNXma=~dC>jgn5`Awl!?Zz8H zz5|(8;ZK^IZen3S{M|~EtFF9jlpXYui1^)dbh-cQ)^U(3ld>*bUUgf5XO8nK^AskL z{OGF9>Y)^qhND_zesL4PwOtZmQyT_}D6x-77uviEbeNuk7a76&rK_CeT+ecG^1 zVYZ{4C!E&Psx4h&^Pubs^Rd6KmyWzp>T++aK{)u^NG?mGD9u0oblvm!3M8`nthL)q z`KB%YGG8Dx5{C3Ef4qH@1XKNg;q!n0Hl6GQ?*844T>HC~vTpiXDR|;c(s%BOQQ0~l z9U)PBXXR6kv&+24d`HpYtoqr(2ri>D=fAP;I)ldUZIvO-xp(3}U#jWmJTo8mz~5{l z#^tuRx72NK;!C%ywHO}$SzeLzHvNOupFOQfD?dO_?9SZ$Uih1Q221uyUO{bT{1Gw1TpIH_T~ivK(F;>8)~1TH6k=hJ}mE3C?MWm1aKPXZ{NppHtv zoTkg4x$(cJ|I4Ijd2{9rnC;&)XWCE8$PSiadt)VYS~#Nc>HQDc;a5H;C*%GHe?Wl0 zp_IviPg7+LqHRa0dPbX5)OvtDAU#HggFpZc0000000000000Bj00Yz$RFMggAjvTe z38o`VBAyYUsy|Ir)b^;;C!`rP0g;es8fe5C0ie(T000000001F00vBfN<=~d0W<{D zCV&K3B?4g?NPr|@mXQfr2uT7;5=Eh9XrKt1q9O_i zkdY)RlBpq?Ng$;BCC7=4s>1=VGB14tjMQIbuz@X)R)D&j;L3WM`;I1(Q`$SlO`jY zq~<_!QC1PUM;ItLg(rQ;5L>BEC6yxLMI5IIP&l}Zu?jd)PA3$gIN+tlQsEpTMBw5Z zs@jxF)S51{UEvfTl0bR&8jgs2gVn>o$H-J? zkaQQZ?7f1jW+Ihn+h)j%>h$$sT$>4m*eM^P1vtFRhE$cygwy1c`LTnqans?*aycJx zcthmwd>#!Z4J*Tg7D11<7d>YW)}mkhBpbnO5G7%r%O&U~VR{Vyll24k zS7Um*G@g>5L+`PVzf;$mrKb3K`>juIFh*aXz-FJr@7jy`o`8EoK2zmbflmg1R)^A` zB3v|4D3n7-+x$&7iL^wO3;2)*km5<8uzL=A5ygyh;k$M3UK7JXMhUzZj{2gQ$;!o(l4X>fBKr-n9mO}iZnP+X_` zDeb=*9~Jwb-80WTlRo9F)?_9N!QkJ6y{W~Hm>qHxJ2h3AEif2BGC~QcB(;7RwjwY` zIg3tpn`bvR{t#$LOaqltgt{6MOhGaJXYc=C`#D1)fe33IN3EjaGw4FUtmrLdwk%k^ zg9^|)*^u%`ee?z=yAOi*3jOq)2y*55=#78@-G~{Eex4eu<_`X?PJZCQw?Ex zvR*kamCphrU+6Pg|D%$&~twmE^<|Y?S&J| zQ=`EnWLptu1TX}p!IYvIfZWJR7B|Z`;mLUVcvb2Aw~%-u zv3cd9#9kPXTE0-~5Rjxo#}jq~*q;&gY;1H-5Fz3~A=ws)LL9{4a$zplIvAorNDLs1 zkdDk{?1J54_e-_}Qd3J}K9ThZ{Qo)eGW;K3%aYr0u#>Zho@rsnvjfGG;e+MLte-c8 z?_TSRypFUm*^v%d2a&h~<6VUQjU)52GWmi;U!cS)OA16VKOc2$8X{nbD1spgk|8ok zI3>g(fP@%;ZGptDVPY}JQzXI%qeX>HG@FJhW`$ZrH(>a7mB|EFT^ukM~$3M zkjo|Il9(luY^(-%nJC57X3CynN>cGL`z zK?s#B5)N$^tP-EDo~!nR)zHG*TCp9cjFN}<%jB^mW3_6CJ5hWb9A+WRV-}kP5Jm5d zTGe8>qN*YC#K{U&&Y-kljvP&m6Mipy9-wwPNi=yg-p%4THYK!NsI&zQ(rO~f z=bi__iHzf;M+>+*&pEc`!&j@%0*47djSPf2yqTo2Fk!I4y&VX$ixsNW^ETD(2zlr%O&8Z3K=9MWig8dhRJIiN(Sjc6H_?VK>?N~9l^2)AS^f} zhHCKI@iQcm1Q>$RFpjK*%lKt2ixTDjAp^9%(Jg4aL@cyeqR2?G zB#?!LxMMgnP7L~X6o?H0k|iagCO%h?Si`egudpb~r!? zb&neR-wO5YHN;iyo3zPN=ifU@Zuce7^4#? zNJAq_AtN+El(GfyhBAO?6ecF1A!exXS`tZGmWCLKhKh=~L?oF2kRpO531KEmJUase zN)i%4#8NOvNx|UhA!md_#33v!$V?>35F=6$1QR5UCxRU%<8y(?4pK5h0SQdR1c1p5Y;rHF9<^t?Luov;sEHF%dHWxnPrj)fSHB~C6ZMl3So$tWE;h%0x3Lf zoF^p8lMv5iVldEzRZ>(WGQlJp7^xYzGMYj-8f;@FCN>>Lv4D+;CrbBcny*>W``S{@TfFX zD-!eP;=-SyoiCq7Jh-kon5y#0C>}id+(aAJ0M|M$T)v^m z1&}gD>YS#T$U#suBs1IDuU-#pIbz3FxX8VD%tvMw&II(GBK8ErLU~0$Gav`Y1MG@I zvKRvL&CR)sGk3O-5=xpJ2#u7+xvf>u>({PZ zTIc7CPK)gvCJ=#mNc=>f2{R-^)?>H~!UM#TWjG$Y;ISo}Sp6OYmfvT{_0!7cUW`6WRhno# zF9?WY0gZ%8k``*aD|S=jXV8)+NH~9Y`(}2R67Rmox|vt+F+1&=UbA;v5!aB$jH5W=U(Q!T=*NI7(H?*Q4hjDdAJH0B8a8 z=I~kY@HF~(6Nft3%uH7kgl@4pjEgxnTXSf%YS-=FsXOL6csgM_&Y9vd>r|kqVj?ok zGZtZ)FQWEUbeNH#Aik9Mq-i9AbCx0sEET&2izvoZEK}~!y#8bF_&(+b_$OEJKK{<- zB=nT&D5vlC+d}~h5hS@}nt!B3XLa)K#*XO7BATSPYCE-=D*8rcCKIWF8FdRh0>Pq( zxPdDY(hC32Hpl3lsTcuBki!KmBcybSQc@EV6Bvrv)yyW4t7E<=*>kL)K(&M}7l}*7 z(vXNZApm?Ki?5Z{w?}*JwD4md3}YDN{O{X#ZRB}6yIQxT-jljrc#HDo@1p!mXgvx? z>ncfe*Pmk>0uCJ+cb;Z=@b%3M)eF7i z{$%_cp44KVhrr$7oJ_{njOfHiXD1$!h#-WSNRnW|IEV;4!-#Qf zu+D3NCmM)JBd~U^^xemJI^k-b88}^TlXkHtH#43QWQZ7n(HX|v6M*ZJ$UxK025|&L zLT-tL4oheT+e=#hik@Vr!~{r=@mP40ypf8A7>Xf|mNiQ1fYXG$ zSWcuy6A02|cOl>zOW=jOt1IyyKQZ?}7iNn$vY5t;KbYcVleYb0=& zMWG+BIB^Sq>~@*oxFQU=~OiweMQSeu&+$AcI>S%^L}_5K6v&IaO^&<+!r7;aUTDa{Y|J`p+fCw>9<<`GzE){j0 z#;U2ntPnuMh^ z^KsWlv9H6!wR!6HF-3XhGYZVVjLE-m*nY>oyE_8p2EOkuayt&z#zuyO85z~}DJGs^ zlJlvZ&ubH0D+wQ67=BNlFySNax~GKW%NuCmY$OaJhDkMOBoQzq(TZ7BX3`9kzx|j zHfZw5P1#lnF~zy zVB%Y*n1(p2WH&Z9Cge0NYNh%UXwoud$;P#g7^bSWj8`bQaKwfv-L<(vrub=&ZJQ9? zVKQVHiIiap%o$;n`b2yP2LsAu@xL?mQ}Vai+^BP_VI;7TxLZ|ukppL&fs3q)S!6o_ zl8!M0$Rq8;es@dJvPKwy2qGA_Z^YTMx~ltqqxgrQdk8)FOo0nQn*}oxvJ1j^FtH)R zP!c4$zr;K(&2!ZwM#Uevp4t5>prbHEjX;D z%SG**$pvEdhx2O`Ta0mKZX2v;sPXCh9ne@U`$HK zFa-xL2?NO-rV|DkW>d%HM>r;hc2^TLV2FUhC$chhj&QP`d@0d(!mShuBLM=-3o(ih zNIsO$wsZQ$ve`Szz)3#Tgp`QFl@Y-R#EB6BY%)IT;&_MDkp+R zsaJG0IEiW%?pUn1*Vh5mApY;vr5LOBex^;#7NXpH*H? zu2lyQ3Ehu3zsj5Cj3_^pO`TmyQ{>>(9NQeeV)X$Kq{%Liuj<$j-Ysw`VPQ7pg>3FG zZJob(hQW*0uxl6503T$5Zd3V9crtv;>zgz{s6$YQ6xAqv1SF&kLkvXBh$IpSLkWm+ zC1^!(GEg!SLPQd*$v{a0CX^FM(jn;4P#lptjDWfk$Ji|ghdG&ee^SOwixY4dvUF@K4ND@f_9fM1c~pND)B-u`CQCLkloOKtM#KvINS?%>a}%i3AKm5X2D#N>ZT^ z6hkEe46MU5Gce37NYqpj5dbt$#DLT!sD|1MVHH%wkt(VMAxNo6p-3o1h|&to0!b>d zEXt@cAufUbXvD{KK~X9S!%oo)aVV z<&+UXWU`nfG9H2kLnciNP#If5rrE0#W<=~~UPBzV-POGu^O@kOly^qU9z=%d|7zBX z6!$-&B)SY4`Mq704k_q7~1jdzZ306REP8>Xq5aB@(7jiw8n+Z@$@VM{UvA`e8J;aJSx2@!nou5 z7xdR?v>$R0i0ny5RmXqk`xcv@&p$o(LNhXFN0Ld&VzAr;Z)Gh?WD{LkD74LpDiM(@ z6zcsKwqhb)ts-QHFKAbVU0m-`i!O(v>MsJs_Y<90YIXf0^jAZWu9f8N9YbNxPD#C_ z%i6Uj^s-Kg*`)4HS{lfHj>x_+jzKEqqn}$dgdBT=HX$6w)b1SEm=bY5RL)VH5 zj?OMq269-jCS)=!mXQn+ct-Bjz2L3ASfap}R>;#~r0v}E86d@oc_Sxez!bPF7dj3N z5@1Z_T%4CSCJWf@1?bI<7SC77qp(663l^tJ$y!Y(QsA7^f^tr=$Suu>gt(Uy*l0Wa zI-M$X$r#BQ-m_)jPLCsDhNmoJA4Sh^7gj+2c@BuDMI1;$+Q=5~J)@`3M}FJSGpROg zC@J#?M;1VWH9M^YXy)Y@oJDAyp5bp<+-LfiK+g89*Pe)3E}iad?v>GV6Ow-%@B}IQ z8ZNF;gf-rSv2(JkfDW(QlYFKF1PKCa5X8{?99VL94`UuSY3}jgECEOn z1W&M7M~PDkNL;EU`4uODI=_QMVwCJZfRY8{Nyh%E>@Vn`zZck^I5<}7u0Dsqa z4k;V@tO8;VK7I{ZJ07np+=j^?AHNy$C$`|eC?)xZ`0OVqs|kU0 zc#0A<{a~?5#0#)?tQPfLfxkt*mhe2c58Ce5c%HY|-@87JIy^W#vJZ`ilPdk0VZ2q{ z2q~CO=?XJ!(gxu51fyfMB2W;l2@3gP$pNSYu#vBINx{}3GD-0^)NK~>Xl|60X^^nQ<32+V!SOWoLmGyu$ zxY@zH`9HzeU=B-~Rd%Y(i+&|0Z=wRhqU)}LGnk>FP=0ec?m!mP&yzxavX<6 z(z%J4_?UMbJh>CwGGxk}n|@t9+#b%knxk6b(TKEZ#N6?5%Q2A`vbP}`Ar6P3qQhh* zSYaIr(w-y<=Wi;igX^wOn z*BD}Lu6S=_l3GfskcOtkRD)FOAE%mvzV$nq?z%(V=(}{oswG~3Ee6kd#%dtyu zA@_%7Y(aiL@=PaHR`1{pJ*$=pe0ir1Huy6_#N!V^l~=S!$TRPFk8{kGy}&gFb2S0} z1p2(T2Hf+T`7dTj1_&mI#~)($y~!uR>ACqq;V`+dSFjdbEOfPNDrs)NFS5vXOrG@p z-@77oeL7-as+v>xRQjpG$ZtKslt_=s^YRIAV!iwajhhc+B!-XPBn?K4nNg#+W>9R_ zOiW`VERLQgO+7|O#Od#Hc~Rglp>j6o-QDmGyLyV6}fy%OzDLpf4pH3~hB_PM^RzRuXjH)93Q!2bPznyVc6 zn4XRBa()_!&>8Ld8V=|Xd~qk{KAyf6$-tOS$CgW2k_m}BAbci@`a#7_dlEcuV!lE6 z9P}_Db7FFD-0XH4m>{puMIMWHEH)aDk&l8#L4nu>VoMf286zZQqQ_S{*b=@yyo+DS z{Z~iH?D+5yRWqG&)N03XaJQcK9G@w*wXJ z)uAE!Kt0oTq7Nm+uLrZ!O5r=+TbFV69=O{hC6$ho6V%Ch%0(jzd(Ukuc%J~6N5mRC z60kxtq$Y#B*kD9~OG&{UMbwP01&u4pyUDs!BtV@RBrL2fGQ1L9mv;IH@~M-O3o-P( zzoTvlOs0==7u<*ivmKhC`43`fX(sPyk@rXTrg$PvluvG@8j0R>cg8d zFd871WWD9rPm6V~L2`OgIb$X><20}5ir$RLp}BnTXNOW+dE#2$E> z+~eGw?LJ(d@3^TjLE#$<)j*sYpMzll@C9J;1v4$+{10Klg?LWiF+3Iw7&;#l+`9c? zr6as3Vh9&|*7M=y${ahBU9651VDY9aIJLvk@Pda6k~cI3ndq2<_n@Buy3*ky&XjXhUQn zgGX!$-rNSm^+!fd+lYv&^g>5z9%EhnVBdp5_!{GegtpBj;gSfxH-!QuB23d1mYCQF0zLGF@tc*DX+fg&RC zE|Li$fJkUaFkw9w#mqwe)X9VKG|5DvfN(-wlYDY=I2PfsBuEl@ktj;^IHaTGXfjk; zGNAxKldvT_oudoMlg{=f&p>?7fcP*bFNEpGGpw0Ts@cSv$5(B!o!9e899+&Lp17B1eQ2}(RJP(^yk zOpb^f!i{6*AAe%P)LNiP6X|X#Oo{3qNFoRAgZ9WaR2DoO8TyGHQK_f&}a__=y~^qp3Nn4F*e^C+(&P2j+GS5&Axt6J(%X1o*WHBob~8A`%nL z31l~7zz}jUe2fCj3*6>AoEE<`$drr;5}_rLgx6TTlF=Ywfl%xcnzN`}<=9(yZ`KX2 z)XQ?r7@Lf3WSE)YnRQnB>st#&?Bc5Dyeux`Gtuy^f>G~cgUKd}yaA)|KEr!0;|3J+ z6dG&ZNq({?v|ZO3MvSVvpSZ_D;p1&N+l-fKlXPbB!&KhO4rH~5fKDLd6l_wI!vV-2w-#t(!*r#eT`Ag70rJ-t`Jz>unXid zd}#<0M1UW|pBUJ`3u2FBJgZsph~T4@i7=*w@V7KySR~cLn~uU|u|%I0&}{LAGY3jQ-$z1J@RgA&lPr=Y z(u#oCeLO@&L`3`}p-r0D3S<9QGjk&lAo+xx_jJ$t*k#M$+g9qXQS7vxbt&R6AJdc*|(Se^b9Kqfr+dfsX0KQJB75SMicrafq9nWbq z$tsx17K5rt{b~pJ`1b(jPE{lZ>Xbl08Y8{;!mHs~6M1aA<=ZYraKX?X9C>e{V)R-I zupKEq-R|ji4^>BVO2$0%DcsYkI~AOhw?>Lx{oPW^!7^mJ>}wiWX^Xd}k1T_d#m+Aa zqe*ZG6Pgk!I4oI&a}vK^(-F*e5(43|83F{dz?~VM$+$;KM)=yi3kbkE{$lvce%r2T zcHWyk{p&Zl4?3L}m3j<(Zf}S))tJu7jXk?vn$-4Xysy83;Yi7EXphP8?HGF=*;npp zlW+%k!~zTSBfd|ky^KV99}pj$|j%Bee&V=Bz1af4! zAA7%0{NDm82B&Q11kAene7U}GQ0yhEUNgo()(b@#lq7fK&spJ zN9+`IXa|p>msmbJlO@Jap#VEF%2D8gfTO}N_@t2QB!wn(5jweeD3VYlfMJ|4B@Hdf zVhY}6>{XmD6r-(1aIx@agsewlJrAQcx$6B|hl(G+l7L(vt-sc7TWph}kO2J(EmTj?Oy_ z1}qni4q%Sa&uu19=ID7{(%3(5nlm=;K_)lBJErE27&6O-4V3YknvgsNi=~3dX9ERX zw&%99YaYfOkZuccnm9s9#Lsf&%ddl7CC+w-8nSU}Ab?(>n5Z}yIDyD`B)Q2uC?q^Z zk3zd%3{BEwyLk@BGNyYP4V%)i3s=<8WD@(u@2I_E_3oYQIsJPik^rqW5ciOg7vw^jLT( zB*}t8gt9p}C|L3`-=QF$&M{A6Re?DOMC65)zNMBX!zAdKI){Cv)X6;Miqc$4)-XGs zZud5^=9x}u!b%3 zCCFxIjsnHf#5N4la-1i7w%A-2VLCcfns#)h$)PiDXJr)-X&nj{1#FT5@)h=0W&KP; zhEdVXyp!g3OPX0P3b~E0!HLN{bsP)GEL;<`d@0_YDSGPdES5{oTbFQiF0MnFZa7v? zumRe*{C=8L^n8!fW4-x2B*IH57ERxt_|b%fV3t%OR$2I=OkE|TOfh2(>CV|$e6q$% z>#il1r4kTda{-?zkPF^9*m<9tI&fz(5$I)*EUNs~TO)L- zIsl{RY@b{;1Rm;|CzajJt)Lm2pP76d{u7k@2{Lz8U^o-Z=h8lVb}o*CPRdqM(lA`N zn};`;zBOZ=i2guNbv!1zo^AZ2g9>#WrS2&!+QM784M56L)eY7tJb0RLp%7dNpob9& zl9J^Fhm)zqnoQ8pw2SR~nLJnv!Q2BO#y#~;J&qHTDcDIl{FZE_1?}3fCt;KD-^<56 zvECf;B!j>wH9!U(ryHBcDzPy(#MJdnnx5qJ^z?aSv@XQ$DKMNT2{(>Ud`(4BK@s1+ zOcy6N*iv>NBp{E>1=QL+8fW!f%4?s?MVF~M0t|3ncVGbZb1~S({A8X^#fkR|X-{D< zZcXr+Sr0_Yz_^J0T<*rifI7|4KWKpOv@!fc%SFq?9AnH-o0EdE7Q#Vrh6ON%ht;eL zaw7_z5$NAHM}F7Mk7ak0A~JA$2gv64Ang1FCXbo<5|i}z9etm_RE_}sBrQZnI4Jn} zfO+@%;{n8@f177}{R7Ac!3Lrqcw=}D0>{2`QR>0y+MCKN!*36$K!&PUJg~~_0-q0I3n3w zCTSAVNiZ#d2nn%5y~~Lz_#@oGihl4O3Ns3n5!-~>a?0GXFDdi#WVT^TmLdttJ{2cX zz#W_7rhd=P_dW-gjh69rW4_Z9&kLeU&% zcRs(mqa>7Ujs^5U4KP3tM+v(hiKAZ%m_YnD4<#B1%qvR$Pe&o3aT%CrCIXC&9v%1a zM2oo=?iNy2$G&nkJKg~V{OZ3RO96$b!&1gC0-IOn(#m;7-Y@GRes1#j-cADjWv%CC zCy_bX&9wB8XV#39GlDQ<3ge%!Qbvf##b5FW&{D`)`OKb%ehQfSy-#HI=hd9`(#EGr zgYh_)l*uWW%v<9;Kmm;yIm&H$N(92dY%PrI1#zFYc zZetA0TX;Mk4Ws=(&#Kl^ml=wO^=XtHE9@}-3F*DNo!#Mg+xxp0vWoK&MHO)=HL4WL zd5}UxibDqRJz_6T%*R@V8mnOT=_|301j28SF$ji8j1`J3!3!mn$#G2KhBrGOo!R?1 z^64)(Pc=663NtH9EwBp6vWX0$-a(F35R?VIVS$S*P=>}5<_8wBAi+rF(SPJ*`hhr) z(|P+h3=<>s<{Y1txB-F(?UCWf_Q^Sefi{eO$;S0_OmgPn{x^jhUiJ5|1&92vq_hd}*R+(5xXlK#*dwo(y*63vr$s zP}^E6z+R@q(s5{EhD;31Gc%GcB>{mYX(A}X&_@bJlu@<5-XioNNkfT2jp#~FlSn2J zwbj}@zjxT3IDJ8Rh32I4S8{Rbz3^4kox9bz_rc%}fcZh7atGrF*nzk_;OW|z)vLm- zwO4#Sr2T;YAbt_rISicqkj~Ymwpp6#wH=9xiIQ?v^d=5>)q0K1&vqBw?DZgo=K*}9 zq;QSa%ZO-A11WRyMnfuP)hxbL&y$}`hsc<52c~$Z91&s*P_;1BP8G7RXe@>!7&=Bj zn2awvk5^8rKEohS%>3FEKLoK=Ev>53mFyXJm=_emD(*~DX)`hzVlgo)e1j0JSqvEZ za-}*RCa-}!YWb@0e?tf6KSW+-=-!_k_h;3gJ$kz;d$bRr8C4BoPh7q4KQ!x4te=qV zPp+9K1jS-pOS+N1OLFnaZ|UBpxqV06c@{#@ao8&c&^5zmFpN74azNaJclbgelr*_L z^e0jDuc3WDIh6By&x&7bTVCDo<~Zfh$7*dK6a0a>ioC%pz{0V>bbk$Cr7iqSe*&Mf z1z{iKAG_yj`LT_OZVpLH2?~8=ntO@)1jy38A1j*-0IV8$|EOtsX9d^N4O;-Zc z{<^}~A^kYtZKYGh0*A>Qhh%n-5WJhmJ+;ZgNn!&o*kOM-K%MZA&90J(1O>eZ;XzyH zI&LnA5#p9bu?IjLCiJ!k@PWXseY+#VV@)A|boTaXy z5DV)e!_mUGP7_~y7nw0}^6S%Qn#<@Nsjfiq2MCgq6rljHP%U7!Ap^L3>I-J6s&FYu zB_LPiSr3&~D!$mof!_R#e(UsprU#KhQEe$qlQ6^(C6*US#I=x+tD#wPM+;RX;-|V_ zv!yw!39@XTPmkX3_bJ=)oTt*5ue|%;U(|BL8XvV+LR=g^)N=f%i@o_?F2}1K9awdBb#-9yY!*&PAc1n5;K>9Q29^Lk zp2U!Q5J3bM4onhcGGNH`NuwrAh65o%(FX^yl8hW4#Gc0ou|adO*x9oofb0|u*MGY z*G8BSc|0(uqq2Un&|A|-M_g_V5&NWj9Zj8@B$M?{1C+ugx34$T??2)NV=kwpKergk* z{BL?Ogb9b@r69-hJ6AoTJWfk^j@zs54oiGjYMx_sa>vTY$6{MYBvTK=r-qqj*wE#M z9tM)(;PgQUdh*Gd+(dY=RTe*YbFwUUIulK=tZ+jxW6DTi`y04y&gj7b#Av1ngAfEy zynZIcp0q|vB$}sJB)=G#{dg=v&CI}=A0`t23g@}bjiYXT$R-V#@Z!)D18^ajTaiI% z(gv7DL$8&ZnM;IJV#Pl-#hz8ulY1RiKEFks)5AH4kI3S%^ceB!@;Oepb;C z*@6wLf{0QYAkhhO#$iaHkhEyRaOOeJ%Qqt?U~PtAz2NL)F&$M@MO6k(kQz=SGv}pQ zisuI~O$;t{WI5zZFrUCl07I+K1_=Xk#tlKAB^owmVbGgO3DoZ+G$mZ$7DnPolit!` z;O|xr?75(E!Iax#!bB6;?v3Z1zeIQVqp2f_*Np*tiM1;qPDAH`>VmhC@AED+CJ#Zu z)=m~zbGY-gz+E#wfQK5rBOo~)t19puAAn^WBjP@NWmBEq6TQBHD#2UcjcPkmKh-Pz zD$>3aqY1)UAD~JzQ}kDZDc-^z)%ozOtDz?7-?ZS`wz|1jQjbdY(PYIh%!HEydrCZv z3=c+4L`AJ}Dt!qiz1J4H>BXWK;g2RcKdH{Ob0%WZ5El7zjS1NtFtO~70&-ELVBMr7 zj~1SB$&8o_7_dYkvM+RToF4kZmeGG9C4{sVqiUM~zeia%LaVO{KSK*}lQ2YwB3*kf zj!2+30cx~Gx->}M04t**lj(jdG?y?)UxilHfYcyQ3an^@0!ph$QfG2+f=n3`CA)Lc zZ;!n%u3nPdzPWSSotHBt<&ESts6uoHd+~n9V>!_jeahf2jE96}$)0Wc{xie#)OGDl zCSRtf?C|DfPqL$LchLMY#d%8+``Ps>VmB<8YzN^_;Vbqg`+)lC@qLntDL(eZA8Q$^ zDVWS=Gk+Ux{%S9SPsa{>e2H8kx5&PZN=Mem@6mf*IlNlMpR(>YP40Ec@%CN6?&zaNUu7jKLE&LIX7GYSkEd zm>I*zkPrk}$ z8n)dHrY42FTq$kwrbAcpJIVd*{-&?u%WX>;EN?wd=egXL+ikgN78O<}S{tSYlf^wr z!8lvkH~nHZ%qo13Q6@~4kG;#6J{l;Zs6&Kcv15>;ian^JkDyUS9d5;o9S3DklTYsc z{qo`;1v?et3mF^&5<(}xdX z)8S24eWCmmz3be*33N+VCX))eCe*a0`b(wK>$7qDWWvu%pUNmiAVLxJujK<~%$qW2 z_oQD;227bUSQtkr_ngT%}%Gn<*)w@DSiEoKno6`jW~dxr-O96h}><&GAre6;yW%6`56i1s=f?N!{ds zN<5=otJ7!kPIg#CdpeuL@5@2jhIPkjDcr(lIk`VR~%?br)~9S0|>C@7GVB%2;l z;Zw?_qh(2-g!GTgHs#_G^cpzoTnphx9U4D!LQIl(HMp_J_g2C9>A$t2s5@}i??&Fy ze&QZ{{Wm*)FuWXdOc^XeBp!`oj)%HFE68}a^%)Nv4*XN_j~lnRR(VH{C>{&*=ibM^ zyngqr8u%p1;IRafNWsoYSxIw5mU>FzaiWv}T0o`0B@31w7BPy*RRqX+E{%of;>5lj zS9J}=@O(8sT&wJRzo+(bGU;dXjH+#v{yrN!Ym?$+2fNayQb@4X#R!(`hCqx)X{2cj zKyd*GmfSN0!yQ16(4+Rzu<(DNj!6D_U|-rKqtLWM}= zF1Xe)i3b>NbAs@^4{{4g0=W1}# zZ~A)3|AVRNA$n;etG%F;~ru6PhdOp1MHky5RaO`d+pifxIaN8ZIWM121&Q3 zzi2e7zw{rBYF{1YwH5oEqF??HsQ>pUhx|mR{iL6eN`w4a|H1i31pT&8;n4_R>pxGC zK11~aN9S`(E7e!^|Bhk1eju(3U&l$W>6|Zn{h4c!uQ5)~?9#5Qg@^ZgKi1_F>#5zQ zbG{E^isRy{H@7g@q}qwb*zg^ zeLwpcglHUZbsZlDGm>u&e>lBg_|b7?qr1DgI)bBD_?YoB^Mr5x1%Edt*OBLUr-*wV z5?kNF^}cs~f*a+08`Gg(9FKExUx_3HvP_dm~e}S*YH2U{2}ywtQ#C7 zwmgtJW_OpHN@g5#_w8B5@!}0`T%JtE}*fS2S^G;$u+CHBQS$A&pVk0rb z+1_~HQFIPT@zz4s@O|^z?)5xz8a2!(&&JC*h+3!eCEtFf+nXFLqp_{ZxP{T@*4-2@ zvA+CsuK(^q^pf^?KiB8eWIK@Po|)icJ%gX?%kJV^@t1BRZX>cu=t;*3Bk;reZ?M0z zr$!v7YnMlMgG*Uye{=sB1EhLnLI;)g`*TG7pR?j2LC3Y`Z8d+R-#jzmG5{@;cwV!L zdtSYF2;m__Bjt5zE;1K(h079)c84T(Vlwx>k1U8gPqp%UZs-HrJm0Ghzi@7hN4=(V z&>WIE8-@ACP=_%RUlkmG^!XhfbEaz%+iP|aB$5&lM$yKPv~zu-9^yNsU`J(->g?7! zPwR92CF-ub0_zrspm9mMZ$3oaRF`Ixe7|?FmPC?VQDzwZdaL@weyLTy`4B(r6#nag z0spM0_0R+^Ib$AKEIxxE>;K8d207gC!|z_q>|;kSj&=|SA(u^m@4*A<|AVy;`I-BV z&TTwSDg3;se>)Wq>D5?@`fra?{eAw0B46i4Oj!c4BOyi@D8jKNSxi<|RR$@FvdI=A zLm4S>r`=EP)agI9-J~z-w9x<9^l5*~;b{*>9tYiWcuM4l2g%JjMWgx04lWKJMv`MN zObDd^I4NPwf9?dKN&bK*L4oASVvmsQkL>T7!YCv-fqRM2q?EF2{5eU7Yyu)lKs<-f zDpHXWyA$VkuRrY>7-0WlV?o2<_pYSim9K4j>-Q111bV1b*z=GjoRB6Ek6B>z^_XIS z$+D0yU{J#b#CXu7l7-^LN)V0#!ww!fhjw9*q<(18{9buHA8|kDIY<7HM~ERgB?$LNyCMFuB;5#X=a$=H3~=s z_StI_+Nh*3(R1v5XpBTg{np6Pd2sFMuK|YN9E($ z%lf%a&FY<<^{QcIb!n6(WL-xkcm*iZR6st0K!%6oFqu#<8CS>ghg=l{z!D&*%~~$4 zt59M_GNm_UYav2ee58W-E(uWIZ+VE|Vf~DL%C~fT+gnd#4j9WA#$;iGCJeCc$sbMM z@qN41ex~A7+Pl3LpY>i)s^)q$>7UZVhq9{1v!8QQ(tPI*$+-8IYP-xw=uf{j2kc?x z4`x^4V$6ufGX)4FXfOssCG|@EW`&*6TWBBJ9xfUzcdv={K zy2hgKV>SKuwE7d>Abyg6S{bFw>R|loL1QKGP*VuF1JXAyMe1*eh=_=YAn)MD!zJ>m zpa{~+l@Lmhh9reaog;K^i%3C@$;D+W0?9LuTwBQ*q{8~yi(6j_R7A?x|w9UOW`d;b~<7V!uzy3t}RNd zaFqNE4IL&@Tztt8>=Pgr7!>eK^9Hdi>QvmV27i^Rw4nanVytCD84)p*4fcK0&5J@y z0!|W9WhtP)v2pk)LdyP9y?7}H0gM@xk_ZCUEi|(#%thi(t+$3&d(6Hx@)W*K1nCE> zx%Vo^gBq;JmU&7}lJra0sAfy=%YKJPd)1QAtXBD;q1@m@XBZPHh72wbBP26=d+M&w zsq9XVMDsjfajB)2Gdx+!mW%K>aNDaor+2rqs=OFe8fr(cB0hzYZCN;jUQZ<1aU89N zxOmd5rZXYaO;4p8eu}%A#Ct+!>dvKcq4Qt2yghEfJ(SUs z&<^X;4>!ii=#lOFMbD5=@;+7l8iMgpd_qA#JFmjpQJFs;Gckju-IDdyWxq7zJ4$+C zCknvjpzX_oi@KdhYu@&LIf#C-3BETg7`A$FFr0*xcncR3a7kVe@JQltS2$J`#nB*w zARZv&unD0|z4n5he_JX|v2^$+5M!*K6}m*qS^B!lt71Z{l{L_>l)?GTAEX!|PLPh~ z>nzJDOJw0Zfu5}XOpkiYC78(=!z&WQ>afFRRwRCu!|@bkr#IFEnLe>s*5zBRJ`JJx zDy%KN&W)JU8+%WdDD?{F9|lLcG_*a1$LTq%f*FsY^8KxRGW$X4RdEImwhYE1{aRI; zvg@^FX`^_|(pXoqlHog5UbfZddSJ*%V}EmG00ayOAC1k3wVT`K1n$x(9Dsjj{wKOEKg{JRm_XL)ufvbKwyWUztHI7RxW$uhbr+^k*q+7dz`~}L zSdvtL&06J(1PYk$?J6Bif!AYPXq;PQqWRkEJHxe2WZhNEdln12%?7fX$z@haSy$XK z0VEs%$dv${XPCW`MYI7zREs>N+gfZSl`M}0LPbBMl=M~>x!_K4<0-6>5$5llI`AhI zh8Y$U9rL+5I`1wzgVH%uOv;#Fdm5;2kCGVkCvNB7{PiQX@=5%&LrV;;GG8?g?g#h< z_7A4|b?4Hj)j60rA5Dkka-@9_#(qy76X8{Her*+6F(mk(t%(n*-fCFLb5F{dEAQJQ z>~5cb`3(I7^76&@v*!DsH>>OLh`X^RnM!vVM0agn#x*f%c**qooye!v?bTmlZWrrvh%GI+ zl1a8ha)enmQU!S+R?7tZh)xN_IMorNa7O5)n*5mROqnuZ ztct9!quF1g{C=O4!_(DDSKh)_3=KT`<&Inis;`+*of%i-URAsmv*e(c$B=d1Q}as| znJ>fQ_hSAY6F5(y{>A%g>`wkt%jEd)?v|h#iNn=$W*LM-B&xF_gsf31GD!rOm}Qb` zm|t>>^q#SB$>%9GL+!fg_xML<0be<&YM+T&JU2$>%N|OSQqM+N6IIYL+yNalglI>7%KR;seQQZf{(kE zB>Ge^g|@6GAVOgv{7>C5CnaB+aFI%QB28GUS{Ku5EerA!v z6umT2e^VFGmH1SjV5SN5zbel*UEYeXm2bn0xm*?374D5Y{#^w9EL~XUbziV#CH&{$ za1cccC7Bh<0eBZW#=+!2`aV-{14g2-U51Wne$3d_9V^PSvhPamd{pCBdw&?eU6;uU zdaL6szQ6#K(40m!cRU%CVq0ZKVp^3LwJIN|7)33cKIkxnLjC_J)0d_`;;pu)RwbR9>@2S7VP;VB5bu@o26*%AnF;c#h=N&E zm8Kw2sl;NI_L)s63`1*Gth$_VA5X63#eA~V>lFGqQq!yjph<*;SV(%V6P)5hc3&zo z$C!te#7xJ=pu-Y@LIAXl3NX~5)s=~6J8+{_OoB{c?s=d&Vn(gjkP>oo%Q2p-Vnc-` zjVyuT9;<>eh%CNcv4+X=;tx7w3^DhPvisSL3XB+XQ~}?RK3`M!zoy%!`mclpB1D+| zUfFJZjF$f%HEF!kEZo)H<@rkjbvGdXT!pWhu{wkbg2G%w?_{^VnjY3&rH6spI;NtB zuEi!jX^X&vK}|H%PfrHL_0!0oLJAuO+t5DJ`W6_mplIx2k z$tIVcSy1#&_!)mU?S6`O_mdWN=W<363JLJgOLq{iNHK#e}7IB7FcFvn8aBRv)=XkK1a0mycK?~ zl;aOoGEbVGG44-9<74&r4k#av9~?^BKJOveIH&;%9d2AebkSTxCEr} zOr{gsNCAdY7#2>34ITwq(r|zQ(&5&amX;cpy6)!6ZY@;OGz6&(0BCe1KtP1BE#$mo zAUH^Q4i#q+5_m@(j~Gsc=K<6hSY8w8sl>t;Gl&zX3=cL>9MX~KMX@X3JA?y*K`ktc z72wLo0Psg4Xhs?cLJ|bzI*5r>V2G9Z6thgI&5c)Ve?Z{Xb}%_%Y;YhV1j1rNLkk5g z(IOgPrkKU$>Z1GVFW>#|O!jyk(J$KfOz`zMC!;jVdH(zEy?q^NFQ?YS@(eEK#j*Cs z~M1_DPn2?B(`%11224rZ>QGj8MFvboVGz>yKk)WZ2 z8PHS)Oee4L`q1;e%s+(my1LHoP;!*zSgXv(%PHjo;CNTpgYkohtLZ~U+-SL#(1c4$ zkpVzSEUb_eq*VgasT>?Hm5y^GpKb@GruA z@5=lS*70rlnEnGAY5HHoZABD*@%!h4+7BuT;q&lxte`)mazAz*{N?A+sJ_HLa*1I` zVfp~E7%*gVRojZUtQ#(FNam~>mJ9N7O53PVIe#)G=ysOnW>m*@EH0|a`;ye3d5GCQ zujCJ4m#}DZ*`d&2$A8-U`O4Qu8Kq})(dkV#K9=X}C1xAb5>2ssb9AOwv1*^8diPDH zB|r_R|@=HosD}o>~MNQdEl`a6`3-rkXOs5 zv+^_eCk(%=Z=c-7D%)*64XAL+A7)dME9gjRJS+jEe8-3d4^=RoJqZlNhY8W6K*(cc zA|n=@K|qvtP}IUP0Y?bf3>tNd7=+Go5St&Q6MX_iP?01^6s!jgLQODI z!bvkRDL}yy6H7%R#T;NpU{Wsyv5NF#^5=2JAr`SxI;RdllboFO#+Gp? zg3=)pg(xsWM|yj}THb7~Gi}BcC`*R*j7l-NR@uG7Sfh*=1rq>5Dn_9GN&Q`rN!l=1q%z|jCG2MmH-Nd@Ml{whRQb`8L zF;9+kzTx?rA<4%jfW?@e#swj$56M*f<_K4{_S7D&X5Gm1Mtr2HkuEw{EV8 z_Zm98iw|R@^J2%0%aGBl<0i~%H0tYhYT6kPmlNk?AYf`s5%Tn3okvRZ>qeOyZ z&6^fLv|HG{az})73_yd&GOG2C)TT0l|G`uGYg1v;OhU^ldN@wbcuwuCZOeV)*nrSwQ1`=4Hnc=K$8`r#O(Z zzKI^OH-I7pUZDn_vUDIVxZzAC7qq4*WGuirgjBf*b`bN0eOyjP)Xd4IldYlV&r7^> zR_t9E*AokEns;Q(nT3Y78>&}dKMl?~YMREfQ!-AgMWuI-7~)-~Cl`lyk=G2w4vZ90B=#c7a>XeM19BAJCAK1YCQ;H| z-Au`qcphtsSGRIZahgmFZ5U9PtD1o)zOI}p-T{dah)*g@;WGK-@2B1-g7^<+j?${n zY19aG5wZaB!f-&ehhSY#F(f8PY+6Ct02Nb3&GBJ8@TsD;;pOGRs@&l@i*D16C3<7i zDVWSGWN%FN7X~lVA<+bmH^+VyQv_LEEAf4rNb>Mzi70@H9$;h0@&FJ%k)BbEiJccl zjFGGfYZ6HzIy6$yj2RgY#pL%Of(S6`(}w}U;Zshg zCY}s2rwn5ZF^ppmiKd-ec4^teP8>Ah!?Oc0BVq_RyhG|n%^A7GVt0IIIx3fTCAdu2 z6xc!rLA@ZtPdDBJR}#Zm1eWg|DK7JF&{ZF6I&bMc} zU3+(m>4hx6Cv@)kJ9aHBxRt!509ydmh|Hw3IYH=au=pxF+t~}wacnyC$WwS zQ);Yz18Ezhh<^9qCV2qRVEO&`bjalxM~y}4NL6ho9i@4+g(|ZP>@m;>gMiWBV)K}K zFiA&j7qFU6%F%_j`bHS-!Qi9uD`W|d`4dF&CmA;=NtBHgNGCL)G0)tfvFa$b0JN&W+g)r-xz-hmMJ{ zoPh)vEG4YkXs0$ICK#?6(ctpuSrfAZq=bk~Oi*XmPHev$crzuQ{)~e zv+)H3tvb(B_qj09q{H~nDP>lTRWay3q}A|zFy|V^WG%CKEgq3E7p|)I$o_=IQz@2i zlAf>|Hp7C-i}V-g2Q4s1bKmjryn-a6ezKok47$UD72`tic5u3tVq2n|%i+-JQ`_{3 z?5B~Jiw?gBQ{9l$9+_i385XieWZU1iw$iLv!$;bFXYD^*+Nt4}xP{vCRq-Uo;j@wb z?t4cx_?tPU=jM%Gtfum|+e)+E|LY`Yx%GE?UCKe7ktnlpNG)iFuk}VAmZq+LjAX(V+^udS(rly3~Hz2?FVtn;I%z) z#p-UQ3&Df<10bJ)!Lc^74w3m%kYFLcAI^A1T@%}->)Gr(-tUx}clv!3?B_w`w8qIV zMl^+ts6vDz3c@b|NiZC#fUL+CPV!_8oPmWf@T%Qj6~8mI=lGrpd;pnT>kg1+T=s;vFX7my)(kx+Dx&fZLbbl}IX>9wLz3%2S z4;hRw$(dpd5D6rsK*~U^IQdMV2MIXG(rbImuOH)Ra&ctP$f)U?_L$Va}% z^0XGZyeainYKZz^Oc^*l;SfUv`%h6dL>T7pvF6aQJwrDOv`A}L5P>2Ml&MxBZX5|% zHbQ$~2E|MQGd3`p65Ak65EPQ$Wn_UZ2p_Z~1X($~(u=m>wYqAoSnR6d3f=DH?optG8CFN5fjgs^5tUaeWN;g> z#9;^)3`59AIc$x@wG(i`3a*j1z(`RD+?hm_h4iCo+OI~f)dyD4bgI1u7aW-V&E2@l zyI?fa$s*m|lZV?rrzfz4;_U1@_VX5{GCvJf#SZmhb31OfF0KGHWSz+x;gwC2$Zn7( z-V@EFODO|AmGnNy#exPj4B<+FNkBQ)i%jkcfldUNDu(OwdA3~`rP6J>GN9;PIqX;o zkuoWf508&zMIeL$wdRkBJ?+KjQpc)IU#9DV)(#5`qXF4yKJL=$thJSU1`MZ1CBWF6 zBg~sDB=h>zCw}}EEfKCIO`UQE6|7uNYVbC7(URd};1QWFWgFbLeVxOX7w;Vj9=bV! ztSY>$M5U z%3_O@G-{Qg*%B@AG*KyPTNJIlnBJ&Ild;DGae&kSEJ7h=NG`2O5G3_Wq0Q`I_M-W8 zdV#giu+dl&90rO^+WacMY#6@vDFKoY>>4P{l*Nk&Mhrp)wJZcHBuE@W@t3XNKvttz zbc{qG1-7;WMcZ8qCa61?lxr6)Yo2QFo~`zU^|DA#a`QsFd;~b`4wK9BS7P^dqM#K! z_ddt83+uusO2R+`D=8UBWirlF>^?>Wkmt@rVWrwc9HEHGEJTp~#ibGgA{98W93c>- zGI_}Kl_^?82P(-M;A8YFNa11Yx7x9ox)*tPrq@o3Ea13Qyhd0oScPSgt@=u*O7~CS zPGRv?+`6~%y+S)>DxQo5nL;xV`-()dJsem{!*{&DcGg+%><$*)YOYJ!l{b%{%^pj_!D6WU><_~7-xa;^@Jrtr51eE#Q`dIl znTo2$S&=g+Y_gc0!Ii3>=g#!=m30%zBPYM|_#eFeUsLmajR)29v822CoOmCu1^I~- zZ#f54BIs2dqE29urXiq6OvVxfs8k@?EU@ebh=9YC13(EuN0B%RnF5q&nIOax;1I&J zttF;N$Sj7Y5pNTD2poZ2K%!X?Fb)|PBn&{Nj2I}%1O)+U$h<#%RL&Xv0Jwwi?79AC zanHTieaSl#zYWjv91p~qbH#M?)`9E4d&&4{$12Lq2f7TDemQihAJ6_Tua}AkDx}Po zwLTTbaYb^;d-$KAsm*Q+>+Nm)l+wKBc&|2>@^g<(L&apqClySf;+8mG_b^Pr(FrRk zL`@LO48%-;O3L?v=kNmRz7Qj);VX$+eTaeEN+y+joL6o!W?E(RebC`@sou;J zv+48ho{u({?^}3RI@QzKcRLjhgDcJ6(UD|WKI(BTIQ@S^ws)-5N7EDY zR6dA-=?El3w71&}E(<^mLm?9-Aofu3iie;eZ^iE)sJ@G!9Rnr$Y^$^lvMilxc~%@; zJ$Sf=Rio^tGGj0^3a!^Qs^vJeKR~7`bxWBqCndEGMhRkPeH_PVY1CJ{6lfbG;>b&W z7WZBl(#93Jbq|J@rrq#MDvg(kg^hi{zQ27pD?QrG_g)%(Y@ayqe{g!Q79-sjEUBhc zj?9c^p5yX9Z@Sm$&y#P7%4-H>=N5)cV5CS124r0bEJE;r2uM)F3_=S~3>2^-5lAGX zJ2>u45WoS@FcfHDlv)^-V3H{50geHa6)a7N0~|A`k${yYP{dH^N;n433CX|-ILg>@ z(n?ofYG#}=))`DrYtsWr2$b4J@Kq`{z{2gvomp6yimGQYD~QKm?`!`UZzHWQp# zl_LWR0trYWghXgkgan8J82~70R*@!X7KJFFB1)S8`eZ+(Q_)CPRqgf zUxoblv8S>8_SA(z3x`WT+4a_+0+dlOR`F=b1_EP||A zRfY^EP-7z9>FoUtr^8;;iCamOb=<{1c9Cn+a^?+_3vfL=AHL#F?#Wk(x{{}p=%jq%aK>%kWF&rRtZ-d(?d@z02}X zvi*mv^TmDw{7hi>GeXryAk);snoRRgVs%av3pl`;iyaEojpc;8U^FIvX5Yh2={=8E z@GBp#yxsLi44$Ke5fPar0$F8QSy9kC=rZzws&!C2i<3eWtSKW90EGf22#iPwL?aTR zNYaTA2f21qGRPZJu?cGx48;%B*Gu5`m)pKxS8OY;<}rfWKGAPZRNDB`rs<{@(-m9N zYv#7&W=9R|J5_j6cqhkweH7B+TJwV=+T^#HVQfo;&Y3rt6sx3WR6nI}R%krr={AFD#%%0`q^w$f*hzHvV80=A$ z12Kbq775@--eIQwyctT~Ny9ag>yN`s4YHb(Ma~;m*)c4pR2f=gOmMU%s}km8SxDz{ zn>Mb;CsRxf@mDJu7sqvD*;2Q`^zl!1#3q>!*t0g$J)k5}Zn*cK9Tv7k1%a9-hX*q;f?b{u#o z)NE|69qYFStHq5uiqp|2QYJbmEJEEQd$C2JM$iPQ2^9)JFG5HRlTIj-!tDkU51uW8 zz!pt+qT|6Ng9z+Qk}2n*Q{e;QHpiNt84n(b$sHyiOt5^C`*QYfgP*-v$uW%2%@bu! zESBbyv69Rc=`<1dB~21t{&lu$=(<(0sz< zd7{>cXR4cJG%BUw`yt!zDDGF;++*Yhb1#WBzq6U@q2I(K?Y@yPA@zwR1@;pZNaO*P zag@dgNl?m|X-7bTC<_KM>|tCfMJPmw7|DP`Mgj~hu8f4`$WS2!7{(07C~&3~2^_FU zGlEbtjI96$U4sZhDoZFajG1s?Sdn1J36#RXsd>j zEQ{nW;4t+{_8|40*S$5=gQ?M1W-XU~lN)uhcKDrY@uc!+em#eOzOB%F>`9#%YO2O6 zW;s~x+g*Huf%9$QRcYJF(;jWituWtiqWajA>Z&nE*Ykm1q55oAk3LtNr)}o#l&x7u zt%YAIqld@DOPSJGuM^*`Hbzs`UAD~3%P`5uWVXsZY+a9%oB`qGT9EB6EIjcq=N)C{ zo^YNijLH|0i{C25K7SZ5Mpb4p7-D3v5WY3`(-0qOn4T663G#kw0rJEiqZ&kG-l7!Y z#DgGu<17edc;Q_M5(18ZVh)kVn=ENTe-S@WITYk5#Y#TH06$9temm_UUcm^-hh*?J zO+WtfILr5u~-CnUtEuQVXD4 z$e9#d-XjDdFwzm}8|E{;uxL&&sUsO}*Cw}49eRA);iKp}81mg;Xh3G_!i1(U8AJ&g zjXHrWSwN5~6fon)K;ZC?2RA5+-bMo$)8pm9QV7%hggoT2Jc_m`@j99{oLO;+xy)Iqv$(@05KHWiN!x zdFhm}?)cAl;rz;+5%~8>UITcCobc1!&u%o6om64JW(ZPCX?og7zHgkAy@yOYRo5LH z@0M{jgik{_?EExjxYi*%D+>mCq z`8-x=p=886m6>g2O1a&fw<=DJT<~Fz1!JIROxYRBKx>(*qcv#+xL|H$>j47l;^|sI zRJai1cQ7r&;XD~F!0{T@jHBICI>}5svdZ%zcIn92T8?M<&~+OIMy4E@cU`?n5V)|t3Il@8u>m@`zB>JRQV~# z?I%?7o~2)Leh744s6ABXo$|km)S3$u>|E2>@3cNVe6N>jzWl@G-m4qyKQ-2ugcx>w z#v3|A4~aaQsQ8$AxvIE^OtMd%I+x2yw{o$JVEeTloRv(zdaLezP18EVP2WU?k13PR zWyiSm-r&rn^k;dAT^us%HH@8~FV3Gg(eCb^xrO#HwE5}HM^bajUTz;Z%R@3u$r#F( z89g-m3^uH!CIUtRQ6t(&nWo``9hF>6fg{PnNXgBWWPdNg`_w*P0(dkMwooA14gt*p z=PI}+hKq_ovA6`m9Of~cCnvBe@09FU=M?Nap9<2RfMQx%d{yT6ew}zw{Nu3u!v|Zn zPgmR3ecxmfz8DgE7wN@0Vz`l2`3$II3}KlIU7ogb$&c9X+i#R>F*M=pacp@pX?Z$5 zb&RGrie@H*C6Lop9(gs9Xvk{|8qr@GZ$pH$BxWdMi$SM!l~=}wWK)hXx69OArN1nt zTmgl4cPO@qKVZm(hEa1<)hu2c?f26>309+sF;#2eHD)TU?Ob>R)P-{?ZyZe4nsDck zGl(B*T5=V zF!&pDJ3`r9ET!4$fXZ-G{Mp&1btFN ztLxPl`yZ&5)uix=@d{;r$9)!`RN?gc#P$6y67o!n`-j%Uq#IUrWJ3>nOA7C$kjkf< z5@QCk4KTBr4iRNhjzImt;AsZ%b=z&w>f+Ih7dk}-(sI(rCN@h=%tXXs0Etw`$a(65 z^<^T$VpDcr90b7F>A`X_IPuXt)*=)oQUOJoL&O=OXo{C9wg8igT!tb5m(>|qJQ(qF z@`+8yR=V!4d8w)nFlw;FhBYj{R!t73oWpCABY3lVnlYrwl~$pxu;KXI={3k87^Fjpk}0kElsITl_@S!Hc?o_F*eDh(^Tx+ z4P9Jn<)aSt2X7aj!mKsPG{3TYS{3yimm2~s4I(@`wymhQNxgDJ6$ zGbbF2I&UW!P19o&MWI_tjq=nLl)p_k^UkK_BaURo^-^t;&9XEw4e)KpDqx(j z@EKL%gyaHB%5XWjE0tLDm(9mssmpy?VzA6jD@3;1#+wfHaC9)i3}H-wm|<-Ri5LnT z9alO5IS`{JB{X4+csjp}FHh*7y4U2oyAIhge3H?tW-vqqXu-$UbROX(?1Kf5q*t<} z{le=_C*VvQPOs%(A@95K#8|OZ$(?svJ*e@Qipdd%mj$$O#YOos#|m&Go-|)Sla}es za+^m-g=}ZzoVNz3wkPjDP0q{bYVT9l?CM8txPbHv3rXVt% zBB_pG;333L936=O%C16}2SZ`7h6X?npp?MA8H1u3OmLOL?x}dKjF>DAG?~ibP1fSL z($ccAVd(KtJ0%FHeIec_1elNvL8L&HnpBhuhDZ!E^s2GJQi(|EfFbThC(n3`36if{ z0^?ds?hN_ra@8Eu73xf_<xjHvUJqe?T@kE1Je2|>O3BY0oP~xi~ z7)+|cmL-&#b}+Rt5i10;vavD7noN^a)5P?vu}Nqs(!f=nBUyOsj*@gjf7mVh<-^Rm`GKA{OIE{A>O$=+fsC3 z2aI-8pv0{94tHc>=~FeQcT;;99Rci(NuKh!#vQD!iyKPGSzRuywC`}D2Z~)KCwX5l z5dOd0^OwI+syq2G?dssaB170d?}$^&7pTl3NE0!FU;-F}QUQoGsQ_T0@QCooyqAqt z%}z3to}tmFv*OWu$&wh>sJQ3U3#$~BbZ6pU6w;C3fzv9?6dkcHtd}`QQcRF?HB2EG87uc%)oA7?N-vjPKqC$|Vh{Ec}mXz0)qI?P_QvG3iJTWbx+zgX}<-I7E zPO6Xgyl>OpR33i0a#cQ{ycGCY@H@JnG>hN3O;%YGKAWo0KJ|@`rQ-!cRwhzFl6^_J!$1R}#1x?EQ2EtG@~cQO3qWO3Mt4!~Lyz;)VJ&akAT-3m zZ!}#jYe70Gw@VyOH_naHZq(sovf13xIhNxUGa|+XZFqWImsF$r)AE`vi3GSs4g!?U z_-U5RTV*jO8G{(4cB!P>jFmLt4OaVad>sykxS5<8EPA*;#Oc+NVWI-&91^i0)dm?? zZE9L+xxFsonqiY1I4P15f*#1|5*R}sq&RTuTNuL$jFpQP>a2-A)9rP4Z}rcEZguY} zu#B^MG!~;RvYv4s(=`wHD7v%54<4MeB zNnjxx5EvDduwZz~VKFlZ#AFC@4q`zf00~CGzqo{PTb3zDbMV`D zVGPQ8qR#je=+kC-?E+)Gbp}HPm>xJW_27Z7>BxWIEqqX zUjgzc$qcU$L)ad1-Asl{u7|+=I2Ce!TC0NfZXNA@1G>a!2Z_seH1+S_xZ`e|=?~;} z?d})XO(pQB80Rj=VqA%>n`I;v}CX{4j3*OG(nS0s=FIm3#z`P`ET55qO3_^crjPo zvC`wN9(rDCI_H?G+E4^^s3Mf8i>)YvhPKjVW-&7*EWz?1cq%@;z{@j%RBm`cofW8hviO+>g> z_FMX%_61I?g<4u7$zaTpU$T*<@#MCs^E7H$StGm$et7Pe(EFNRuNrYp)r<$L3T&}@ zKUL!|I`c^4J4+#zVk}rS;oap4-g|91cwoV!`0U>E{oHZWKrT-IR0 z2%Z#!G7L-*z>p-Q00d7G6A}!m1tUsZ21KSAa$wSx2=YTnq!$x{W#&w#A^=E8Q3z!M zQiK8}VTw{Hpk<0wB0+&jqk`&801&dkAV5qK^5HKMB&k{xs=#n~fynAT)G~BP9FRn^ zz(7Va;z9_CWC=nD76}4I0wh*O=LdkbNhrrToFo$uF^KPSah2(_K_Y~)lG!u~XdsOQ zM2w|_2}+q5hzAQJpis#Jg_0N{0>d)|OH&zGO$IRNK#7+`niAC{EeSyz215YGKnYEe z#0rvBsR4c194Yvpj`yDx(c3ys!rnEy)mAGFx4hd%Sy^p0R|SW5s1M&vl;~6Q!eyR$87bBWU z_Ry}qnK318hMAc&*A<01615oBx}>yB5MhY}2Fe#9ImZK(fd>NOnw!CIX|QY!#W7ZVgo*{8t~RI zF5)vt z$JM%h?x=+IxY-qf)^%b0LBIq$pwK+E0W71&;cn7NfOEK zDjW)sFV~9zp@sx+D||K)?^Ww7&X`u0AUwc4VG~R?YxB>+q|MB(>wnVR&g-Ki^=Z~& zyBN$!K`=}c3@}b{m}eNwOlZR%5;FwE@LXml4?I>9IOR^pR;lk~j@r>o2tf!KIZZse$$GlCQ;UFP-G)v} z;W@|O9SMy_lE=Na1@G0b*dE&Ix@RH6WSqq2hIK}gx+LU1c_sWH0jI3#5_Q#+G zQ_0NXSTK1ziEu0`upkk2Rte<6(-qBG3f^XT^uvRA^GznswQ+_c;2w1zWN}YUa8^5U zc^wuIg`ow&lVE{MBi9N~=GsWO66MnfZj6=H&SxKq%hq+PIfk93qo!_BK9UcWR~}QI zQbien65HTT14`Q_ zg>>XgABAM#CpS}?49bwxK-fqL0+m@7Rau4X5i>`cwrsK&F|^^sZg;;*(jlg>zE?wJeI}S=LygaF?WjkR^K*B$Q|@fN4Es z&rw;dhIH)3yl0}C6HG1)sC2;aB|?HH;eg>MksNou(FDG;VK}5Ii3$KaA*67!p{2o- zCxRTngsl5q7>Pob7D@Pd?jFjn>9csk5mL%q&F)HVZWK_i~ z>I^$_q5>ESOdBD` zs|3KD5eS{Dn>+)Gdh^aOF?`|vH*e!D1j-(=(%aC0`$=hdW{K#8HIIlY#Ei3 z9~32S3m8bKLXyp?WFpE!W+E0XaYHEDl%Y2Xlx+lESRzp|UEsQ2;C2$o%Em1UO~kP% z3A>C^u}LYpywcNQl1N4Z#G@n9Fc)B{GDx?z6g;Y}BS-Q-lX39^m-PeC$4Km|;G)RL zl2#I2rVC;S1Ig9n+dHbvmWz<_-=m&Y@u2+7KFsDDeunOR|7Z7mi_;I1ejUxrvlAFG zWXhOdV*~WRnmkvLbo4(Hg|~O;)a5aG|6cuvQ@0y&&u_Pb23A+5<(Tv0hN{Ynm$sYu zPrUobDbK2$1gr!GcLxa7vZ|p7{c;0 zLrf_hGGD%#F8J9W9uDRz@W($=e9cSW@#wh+;Qh95MvY%SNP4`}RbKz4^4HV*Rd47n zoj1J(7PgU_(wdr_bO)VTSC_#(h3=K{*)T91J}G??=6ui0+?)@==&eg~$!eI6h|{{J z1`{QIhsO0j$B5}y&ePz=ipF7@S%xDFLeoS*=p1kfz`ZH5I|5M6b%7EK#tz^ zSCIT6>r{RGv)szk^KI~BNcrBsb$1sf)#dpYs_33>UAWXA(eU_hrc2i`@|bx%wa4F9 znJiW^)USuudey`44W4a>^{*WD=H59kU5P94b=RlM>V3Wf{)-olWfoRb3@6a-E8NXS zTb-wI^G&OF+n%BiK0SjHBqcaFd9^bQu`vN;W1umTS~H794C5))G4_P%VKv*9gU3!q z_XeQ-7mRrNyU#zF&#>8wgZ4-@91>BLam>dYMbEKkL@5w{gBm*$PD_<`;2V1>YEvMZ z>d6Jj13)tX7?22q5h}PM7XzChW`*}@VD;8*G8ysNb=7^6*6y5Tu3;mBrx8pp1{3cU z9NY{Mn(i^k;kKI5$(%*HxvMJ5u~1RiH7hGCE8q{S<5hfcOeeIqWxRS>hC#_O9TGz{ z!ep5wXT~-Tk@F7ZgoK>&P0GG1KR@F&1JR?=wfMgu#e6YiWu2pPK2%8eBP>J8>to2OXQg2IyS!RjkZ7;F*Z7GT+AMiEgFD zPAw})$z-usLlUtpba-l&vaCx6StcWo-Latqe2_r|f;)DB&492N;8f`65{%rZ9vu?# z?vxFtNM=av@a=UVog5T7z1|V9#S&7780!0Yc_9NtoH-=E_{EHX$#{rK6DqKXu)q+c zgSvDL;^DdK?+IE+`v-vJaLQtI%eHhb!Vw@?6dM@i3^PO=UWrO|8f+XvEXhFFy0Zdd zItO97+f+-&6)dE3teY#CC1md)8&bfJK_W`0U2#g2L>dt=TErBgFl|S8*(h0Cpr=!``pDrm+`3a>H7Hd+>VX-QVs2sEw$ z;Q+C@Ob}EFEfE1WAkB~ilv4_>RODnZYK}mQ0Sada7*^)ljuG8nFAA<~Opr_%S46H7tTT3O3OGE`$QUQaI zDo*Avb-8Gs6|5_6c;qg1JWn=LlI)i#)g8@@mJaTDD%kDbnlxN^wM}qmc_PFmgpqAj zR}m#Cn8wZwKuH7;Y?4Tl?V>d*#0dvPrE(;J&Na$dI>BP|tH#zPaBce!VF=jKvMw;2Nwr>MGH4W-Tl*psDMJ^w2Gd|nu zdF|rHF^ps0oXclsRP{@8YCEi|yDwc_!L@|`x~j?hzNd?DyXSp;_wV|L;?6$R>N^Q~ zRbJxJ>$4uCGR86tVH(Kaumi>^4;#Vr?%M?+8y_fhEU+Vj0pZPvP6kX2K_rXlphyYX zBdLtAfO>7=af;(!4dsPUJdp$j{^C?)hAoULx>tqJEnFBK`{-^uGF-ChV@ECO2MxsR zROYC=XJQ?MH9J=24`O_jc>W{o*jSE$$1-u64G**wa2*N0{`4@7FFWQJrD)C{lSIz#UffX31G3*12+ z&XSsx_}j*pls3Z00iz}HKMMQTPub?4$82jDd)K92!#{4lUn_fm4S~ijV#38da;Ho- zs=%yFp1mffOF%^W{l}#Gfc0fCK5-s|R1mm^Mdv>)9;SxjA0y!q<>pEeZ%{;S+Fd4{ zX{F9Di96o1NF5&XUMHqIG#j9}Srq$|?D*dR#M7*tKBe;#ZpvmOcuE#!1U)!(iA##aDy!I2Vt8AC z#z+Z>BzPn#WLWj=5=zMz2pxDN;BhkggS``r((%CY9qWOT6qU<>BM_W0I6&etr7LN{ zl!qC;YZ&1HiGrIlVhAt~r#R0y4p$C1Exom46Mgo2E+&jW-3nHb5{H#vddK)GO{^s<7>Dm94~7=p~L zuFzmLx31i6_z#TSTGL(}DdKvmr?!^aD>7FBXqJnYCXcm>YUd#_h+I87pl6ZR#Y4-B|g7aldB{@4dyQP$2iQ)uXM+) z{l|!OUbD3(>!Gg)XWC=;SZj1}CqgOxIzN$3H3h<+Jbs!F8E#Y}^e9C22~))%^6RxhLC+bxb(p~5oVS5(cK`-3R9Jyw7;XB*rrs{)ox?zij{bKV+^ZpR@Fa7OJK83ZtphYqw7u-^6z52#*+#?>@S&OsZWrCAYxa?;+a0=5>vtp_apokrEO+mGJXwj z8+Y4r%kJBbtbF-ft}3ylXnhQX-CM_oQodyO`Y(1ksaIJzxUp*(-3JM{eb1lgtCIMA zcfwkY@9Fd0G7Nm}EW}RCD(UmX`y|6FEX1DoS}vteY-d$fnuaKq+SnY9aV9s~5(GKw z@L)aE$js>tv`%|A=NX$X1yT5@WX2WOa;~ELUuElim)Sczu}Jvg_e7<8>F#>pL-i!L z`j3+&(FfzPEwk#SjKyGn=heQ+Lnw|b_5J&w*Ucx&eF5-;d~ngU8b=8N>3%%CINBK+ z!qR3|wG+dnd9gY=s&cZdvj#DeI?0n28>+A!TbCTTB>ojuklDUIEK}N-Dd%$&r!=%I zm7{~V&$?Q372XDNLE+3dTjF^1Cm!;@iqamL!VJkP&F1oBed}qXMyjo7XvE731c`KM zT0qbtl~@!ybZw@X#@oyHnE4rXFC_T<^Ehh`8E?GbYOB@FY(p=EM)o&K;V`XOGLy?G zFWAWl{vXQFKN}`3F9`eR)@I^G&IY#66ybbEPVkR!y&ZCT@vja#JHPifq1;W*ME z=z7fX`TSlLndygLU05bCA=ay_A=;9eSs7XeB4SV|0#;VavntA&=oy};)}0FAIjaFa z@*mZg+Cn;HemM+JxO=#YeAvqSUAW745s1?m-chNAKH%?KIO&dOr$5%2E_rCDLq;ad zZW?ahSL{XZS1dG&3&ilW9oS!;IdN}>^xs(HTu25?T#vot zt2L>=P&ms`z~PN@PAgzzGBLSs+0eEJ3uRbUt@XaoomrBwu)4ZL6k{(qlmQAMNJ-RE zDV7wtIv6#=u35`$vCp;#ly*Q>e`qNE)Pw>}IC(t@e3{c%nheXPanZdJA z%&t#~_SnbH{BDnp^Sm}5ewMryj9G<@-izvazG`bGljisLJ6}rxW981{w-u~vm$mV= zHf^b@##Ul_%TCEYVWa6?zHdhEJyIPn4(}#L;;SsZc69JiRr5;jq0pn0uG9M!IvFJl z7*$4OQW<2h#$XdEf>}&~MhaiSX-!SI&lZ_6ULrdb9F>R+P&E-W@&X4T{2;V?U(Iir zcgMR~uFHw(34A9CmKeT;^hcYOCQ`c%jbW5ZpxSsjOCA#HgbpK*y#c{ z2I#z^b%FXb1B!tapa`OoCEI##9Y0hrzAx7c_z`wh?sHm8Rxj}8NpB&%DgFJuG{648 z>~nCOz|^#$kI=%W_QQWtLVl;t5}!48Q~nT?fdBM591#0R$_DV31c?jNI0{w<;^e?d z{aD5pXQ+lz@a?{JaV)cyVcVXxZZZ}&-m zaLDe3ug;~-)Z!Rtkj}?Xdf=CoKSCd6pl^TvN=XJ#e*40pDxm~r9YvN2*Q17rjn6ne zPw57u?>=Nn5PtmdJ(vN_^`_eF&BJ$ZKk4ZKZa=(@fQj=7R3M&%U)?T6>+vS$m%aex zzfpHADf#j6cH%=mUb0ZNS9)(}0H~LSfKT_|K85v%GU$E(_T0{F^ive}2N~1wdzSB@ zyG6{kziDps@lodM+|T1v2JpQDAPg;D-+iz5mEptN529wJlu@O8@1H-p#0Q{URSuKH= z53F}rN9{|pT7EJC84A{U04QO2o%}sfhv9W8*HZ)_Pv`yp2MmC_Tra?PAnEVGI~oQ3{z>Bp6eZ(Mn&C8mzHQo+vfRqh&l37`ee5d|MHY_%L@8zuo&_7-G{|S@b`Ytv+@?DJO z-$+CK($<2Rj5;Pm>{bF9%e@S;UNX?Vmt-_#nmVs<-5(JSy_LrTdVH<);ZNpkiBE8O zO^_`!>wEH7n`9sm$nHDYKc)X5Mn-l^?aeE)P%(Oq^gAGybnV+Yu^Quxf1B!|8w}>M;0-1?eiP@<-9Jv-{68cSY4U{lUX9}Znz6f zQy-kz+ZDmj&kqsN*U;eR<~C3P*!g#vF2`S`8)3fs-#%gB2X%m$LsKj)AGarV>oQs1 z6NxdifE!RpFhx^?5gI^-^pBOIdH#OXbd_?FcDT4qGVlZ!U%pF* zn;QflXX^R4m|)+Djj8dXH8r2cZZ*Zrv&(F9M=-*0k?Mh-(e4M3%_^BSHdBPy>T{9vEvVv6QAxSy|7BfJ2A01vln?0 zyg=W1_9F+gJ2X6dfQnTl2Zr`P!Y2wIKuh)*u8E|Q^U2ai#VPQozkYLT34Pi%CzYwY zOenoz)2;0r(tDB`+`mGqYsn-_J5AfJv~V<)F%E&A98EKGkrDqf!GgMGKXmr!vv=@e zor!X>k%{x6fjjUl{G~cQao0%KC`cY36S220$|$xg9nYkAH2L>KzFW--@9!<`2=xd_ zH;eAy=;^~Mr!*s`B_~jDc5NmzxO5UdVy>@=8~WTac3Y-RB`?@9XfiL^l6AmZ7EKCH zlt}_)mtVG30UxccsQ;E`Wa#snY`bD;o993C-f=cYwdAx?k+RtaNg+0jzDmTRLrm02 z7lW?_mDZHG2||m()=j+>W^_D3I=^11k@~PgixpQD^1D0W+Ny65kv0-Tta7Z`=s3h< z&qE7#Eh5ZGJsT-{m6|l5^_>(?ABFcMuEZ9L27P4id<QiX00oK%f2|7$?|6vJRrAt*(=Q#(mT4+$Lw#uWmt3scfvR)V-qTnfxf28q zKzM1pTljPHRN3bAZE6G9a^kj~c1|j#PgmX()+dCrVbjeYV(Co*wa#S`lOxF^E}IOy znG4%~N;4G~Au%|9jcXirA5xt<`tDw=NDNBAni`MLG@DUF>sKC3F7-P*woQgQZ zkBT575kaMv8U;jaQR-^2-2%R(UIT)zHyY&OOQO#f73ofQmD5c(E`$JZmHH5du=_%k zbIDfmbkzt}GkyNj{xkvp-hgpJ>RDSCX}|b^tb*9Z_>qT~PL@4mA0t&+ez>plH^U09 z&-6^G?+zFOxVd>A#dkN6-!_lNBO)Xd{=_EyrS4#@?7dRSR;hbj_Mh^E04Z z524Xtmgri`_j20tDI=gE>Bg zPNEvNhEA|~PX~=gd%P5s#l0_9OiIwFDW=ERzTf3S99xT=$!X1@oHVLyFn1I&>-bS4 zjxDrZMCTQ&dtBZaVnij`od-GgkB!+wo;FTIh(oZYx!JXwj&WZzDi``=A8q!!R(XQZ z!XiKe$#3=g4P$zC1sX*<$+%a@0T?#_?Vt~2mHh4i>+qiwI+d1>luU+LJdk&3_wtBtYplzFGSlHW!S+8)_Fx4G!8I3G#FX) z3^pz{_HSoY1{YIt=n%bQ*+&1F1@*}|GpBqK>BFO1QCq%iEom)=T^K|brEdzMuH!DC!l z_>yrV8dhnQR(;l*W&_-HH~}h%wK+EFgSE0*mk|wPv|p?hbuvzr*#%}@tt682xC7v( z!a7fap{P;9A_#cG0E){&Bnmzw3UiU&mgpVm23hr4)w|IbP+L=Arx~AJXfWm2wW6VlzN^f zn1*O>Yx){oq;|b9lXp7V=Jz>3mqGP=C37@WrR9SZYf;MH3ag|Ie!eH1h()b@kRf4rS+vZL?a{=1*PzhV1UN#^M-o`<0W zzK=}T{=OaorT{maYj|cKZG~DCp53LieS`m|6KFFLUIO%cQ^1th2~vB4J0LWg>foN( z1ul`a7dtk8kBr+n>|AgI{c8tg1tuOO(eqGoPvD1kjaJyjPq&vo_rPlYWEAYHx0rf7 z-wI#-CHLV8f3p2Fnfm>GCh-~28r&fQO)QT@e$lPB=e zaC-}MK}=Br)Str>LS6OCs1B^JAL;jF6hrlJ&#aqG>)$@4k;0#f>0`C%b5g&^bV_iF z>9n;IXDmu$xqR zIbd9m660CL^}>Le64w7X8uTCP&@?)nHk!9eKYjyK(l$gBu`)G8xH+8-;r6}=QkQ1! zh?xaepNx;4>%P%dvmGxoo1J98qm{hO0k=Qv5c zNYpXfuSMKZA^NGE^=gqWJvqpd4-unbpHb6Qnxx5{q^TQQ0K=)Ah@+VLk^r5Z^BE{_ z2le-3l4ZY_n!7EnpN~pH{9C*mmM~t{nhw61{R5;$Y%6Og3Rujz03dT5XQU*2O$m#*-hsl-bB~# zDqC`Z6vi^^kCYIs9aLZhGq?$>{R}S-W*_cw8_r(@PZ6aYco5BG0DNeco)BM@wK+gf zu++zXdBvukmnkanQY-eBCvFjIH4Va3z`-J_RUq+KUu`pirFg-6_?!}ZHb zqoXQoC2CTPL9vzp4T>Wh!DC?OTb~DLsl*E*zw>o&bHA_iR`!y=u&RGz-%|3#j1~T< z@=c*eN1;xvisZM+Q?}Tf`MKD1R{#;L3P|5t(0veU*uToHneSx-eYDA+Fv|?gtk9%? z6VZGH7`=k}2WvXAMatyCf)&FK+v+asw)0(cH2wfO`5LDZ1L7n$ZDU+NDmi70Wv16= zSQ3M)1hc4q@8P{wrwh+{eM37b(_O0baJ@P$!dci;nl9R&0vC8E+gmbMY~AM}~O zMZ-f|auK5m`9&r)h3hLSDXVItdP2s#=*2?Tk~_AKF67VG4@R?QOKXLfV)3!oW!0Ln?lA}fr);hd z2^28Z9tbM*f5!=RG6ab3=(KorsEZkjTU3}ND{qw47z~I$>aqY58uUK8oa*dB=VWdg zwxkcTWrYuTiqzWlW?SL@&{QbU(VrFyIIL@Zahg;>97^rkk!4v$#lh%ct&03!xkj9* zBebSGr%u*;DKzl)hzLBNG0Lq$^Hl@n&`|sUO+>O)F+LjE zXTTr3y53m^PDhwqh{ALYf4_2ysT8-)7#)ZjaCv}Uw+36&i>1`h7;XijEe*A=6>WFKb-9NtY|4(KaQ~F7u==$jRxBqqU zn_s^3+Jff}qLqrDb9E-DFH$QoN5zFJ8w=A=MB9T22l?}$)Oc+~I8I{V3^TjbGV|=4 z*{*b)l6l2^<@tkuA?t&;kuT?TzInn%7rSb*+{CbPB4qe_71g`mxIEG1tnB{7w0P_w zHXlLUJyX18cpW03R1`ewRnVWx!!a8q>#y)Q__!YnEm=VLyP77QOaxf0`JbE`1o@Rs+Hd}M;ZZSE4`T`dA_$NY zlK?oeD4l$U-&&MgNt8xh!@P_#C`~=w8k`P}LYS3xS&ITHEQGkilX3>b-;Gu!>p(9<+7IrD?CiN{_MQP5Dm;H8RQQ{15i zN)u3(X3leLqP|A#)8gByGUqD?*TI(@sxAbfXh?^MM9iVZMFsjtRV*M4+@1OeviM`< zTTY7oaI{bIfV$T`3pGeoKU30eon)O( zALlt=VhB#;)$lLBwA5?j7l}{0kKVLV-!DzmOOC63``YqpK1z*W<(`g(FbD#Gm;q4t zo>x_VFm~0j0>760l8nTDjd^3Oh7$or3o{zfQ!|@uJpv=+4Z*D4d^? zxB^ho&=rngevm{t@a1nf~u}_hcbIHVc6xI1@asj9?Z2Tt=NMyL0AwmR^F2 zBg5KOZc@Zg7Tr02h;cl+jvqftX`hGjF+4c+xoWkcV~{twjeSup+#a0yyVm=b3-*T_ zV!J4Lr|xmcLnkQBi4XXPJHO_@j}CoBZ^2aAfM`LE0=oH`QqfHhh+@2R+G2{F-RO|g zDYzpKu>^zJZBHDx04|gc3yS3NZpZAiLO)zicWe$+sDT+XiA<6S!xvn8toQ4fA}?-T z4{y-DYRs=^iZlj8_77}ro%c``d;NPh9|jzt-1YW?-#Y8qB6(eKPBQMsJXBGQr=vYK zPRO$+#VK7WweX9~036v#7lE0twH9Fg?pS3_KxfKgahj;l=AHb_H z5{+3d-yPG4^zR9A zSt555)-z|c9m$c5KLDE;Sq#!iZAQ!FV zJ8C0eovsH;{8qXwi)>3;h#qI0lfbpkj-%cg_AI$=I!)g}O&|v|c6f_r1YpXQX=FFZLrc=7ME!XYO1we~`4w zwE7nF{I7IE7Q#j$xUNn_;*pO@=hrRM*21NRh=TE zKZhHAUB^}f8%hs-4P?CM{^+qfkYL#whHd%}hgck5mJ<1S|9o;Z7C>t2-#IGFV}?q4QaK_bWHBo`tE zMRQXcb?e<^wI8ghYDw+1X4b&mY^n|2tkc*jME;qL3rqVGt@M4;QG$g-i0x6mGJ$^& zm8sQLR}59zQx)*(s5G1Osn$Zt=?~FPVK8Bi#u>gEi;Xq?t7t*yDY*BM+gQx{mTb)e zqjkm*yRoRC>FSwWZaUu@KSn3Rd_$n#Qz$dyex-CB%kMI(V z;#1n1v>n0M09LTMH_(65ter@MGMhmEW<1w6hMo6A42-U1um-r`X3GM1s}5NL806I~!| z9ypk^XABR9*Xl#nrD^IKFCF70?^@FqYdbW5@##oDT zgfTf_iIz()7(P4}E?;(DokmedhRW1Bvsa{6Q@u(|qXws? zK|Z)3#Cv+ny*7r250x@i-(MyFQ82IABI>@}%2ym&Pt}q<@GPyp>*6J(+=lHb!EUsY zh7aWExWd{}(0-#mM&%JVQox)EHYD0al2ZVQR?eE{pX1Rw)+?}(Y=9Y zqeZlSnp5>nvtbnWpa>=as{uu87dR0aVi5ic_KpFwd}YPo_H>mc`Yk)Oy_nd(gWJ^D1e5f)MLb{eENZ!`78z|_9T)vH_ z7lUiTtSy5~B3-@y41{xOpx>^CFR4CDQ{KF@1wnK=)tn}3uFeH>djD$fKN5P{J{jnI z^`lD*=36BCbS~|5Wz6|Sn*ZeanRw)mT1!jkS@kyR!5E9Dp!srVF5|5sj`X@Dtf^8U zaS%%Ta~$P+sld+8=X*IHu&ZUFa4pk7EI)4JZC)piYNegwm;3|RgE3Pv1M=Oa>oy^k zMa{ugCj}b?XS~M+4O0`0)>RQltd_r3=HkRic!?2U6+bhzex*i=k}uo`@@jh0ZY$9g zoKmtJEA%~mX2N7~T|f!7HY?FoX5?9|z8e!!?Bu}41kbvFvLov_M5a$#fDYy5m@7}_ z@29;*$gaSU#KX1dltPmor{BbKW=&={i-W+e$>C$5Cq{WbGoB@v3pWyJQ>~d}oeeSU zlB(ua``-4-tiDuUt@=4;3`jOd_uqt6cY0uG_^C044V$@n;5^H8S4VvCm7r)_q|%Nt zRYgT(y@Ml8NOGlR3sTMl5eclE+_ZPeUvK%bOI>U@qUog@0_Rkl_~gD(D}7a-a(uQx zV=VLo1NS`-Ol)8BNNa8x;+sJz+$7s6Fa=4XS@az=DnqpDkCJO5M`E zt%2!7yCSafv^dEkNr(c2ee`ih(1z2+LTAgy+J2nHXcNO?IrP4mbvyr^=st}@R(E`r z*d108`~15aqYoW$Kliy8Xyme+lMh;^f*%Kk*}IDc$wzJZ9r`uQD}nl(tBl8+F_x_p z3YIB`unAKCw)kv)^p|GbowX3*01Aa!V^)T6zqpQ)EjO;Z?`vMYfrlKHO1u9av~a)e zturZ9o2tPjs9_ZI)iO6^dZ%0PFT3n)#h)3bxzuoGl_~O`kB0$4MmxmsI}o+DafEvW z5`#@#jeMc!quyg0q8OAdO#?36Um3(Sk1gZsY#!Sx(gUf{RH-JivRlQ-%p-O|L3aZY zM+maF{0GMJXKVgp<=79>9RF6uRiA&ne-004pMyS6A*^X+bES1Yy@%0urGZc;-O{MP z@^e=j)5D>6g7Dgy?@_tudqq*Q)k;G5?fGmuVxW@WF{h{JSq?mChk&7naF2bN_$S5e zrK3CW?S6-@nZ3)qKhFcy{s^gK{SLvUNiEYEj^aC&Sc9zsEE57LVwqlmW@T7Xr|fIo zTe+JilmX3Wr@Yc%OQnO_D|q^P78G*){<9b3FRCuW4Ph`3D>b<`ir60>-s+0pcdx@F zmKE@xdM$1^Zyk%#K4@xlY7<@a^FaiLwZZ1}e@c0S(Ia10IGg$m@N1Ht?x(YUP+{x-6QX_ma?6eTBp|LJOcR_b3+7f zil&^y#J<|!B_PFv8ugDMaS0~T?)7Rv@Gk6ch=Y#Hb%Xtkf!VDvrNF561@75|arsMQ z5$~Sw7@{|}!iD$UYZbVHK;zHkHCw#X_n#)t=77A~ybmGwxQJGg?Ohnjh65UxD7pS= zcF;(b1>Emw!nkfND*L23wepyaO-t;sXvCzZq8wDI9vbc!BgFN`m6d)lj?zwBrN)wX zIc601#1<}RSl1MvTS%y1b5EDQF@)?7Y4|y$s@?-(#|n*7Sx{Xgb`eurC8I8G#hQ{3 z$P{~Vw4UE!C~>Sie(KM(AG;Uzq5NQumi;j*Ub}#IMGNh}Tuil+qCYxVM;BkrCL|-* zSozsa=jcf-^hv!-k6q%jMYF~B=;)9^p>G9e`XXVTvMP{6(EU$(SYMRb39Yz_LBm$J zsWxRj^00kvLBm0t)DszN{9sfo`x&acxEnp+5pl1%N1W)EIj36T@nHuSPz%E?eH^mg z>OwmUah%SKw-ii;h4uy)y$V$4J@eDMQpk|YY-MSo^QiZ23A7^Rkkr{kXywz^M}FJi<$C5xJ`JbG#1@zEy_4+va{Kz` zVyQx!2cY%M-8WjUp4F`ShwwpWa8_Ob(X|-fF zcPwJ?F6mNRT7!NKL>ya3oV!?6}ugIW} zc6bL4M_yc-%Foiy_Bb0~H_se*D)0uJ&l@W#Lw2LIimoODSoTzFGm3=VmuTVw9pZ(A zeD~Bdx*&9f8`2;udX-7GZ!JeozWzchUMjd4H#9QC;M?p?V#|Hzk7=l=cmHYkPtBc+Br8WG|4Jfp8e+ycg^!;4TsyNH$ zqgf#Nq|8jPx8IsS2yIFi*&MvUX^Kf+H=%OC1x&!*JV|?9hA2?~avhB7Sf-)Hycm#z zoy2I>L+>!E)%S~_0edG63mYhz^lD<$pJh+W4t6F>wvo1I&8ohIud>GL%N`S%VM?(} zr#s@-=QKQn<#&ym%c}eR%2L!FnniyO*%E^^QG}uUtv>!}OxUm;jiXfLv}E0a9%i6y zMqSiEe~d{?#Bm7TdIKGsUzJOabBX-3RuK7X;K+fQB6O$N+ILkvXYbAC&q^pCRdpRr z-{SV6*QQqXgMQdpof8i&zIvT>iD<&5H3o?bEO1J8&o?kR_gUP)z)uAL7L?>~xp;wz z=zE^iG$%H>{6#Ta*{RlV)cqD{{MXqh8XfIHZo{5lp?ecsB@ zQ!)6HkZmXw~J4xp$>pRSt-)3|MKb zHfpLsYBFyg6o(=!8T%y5g#=)`K z2}!!Dbd{1c2Prv}%+J_k8ad=eL6$67G!2IW*pJoA_yS#tCsn_38k-mz_2B8KD`?-| z80(Q4Y0<*{%sPWp^ubx=Q7hlO!Sm%$GCSs$#up?qy8R>Hd;40-+CjE{PVYcr%@^l& zP^k0lK3sgp9aiy2LMy;mu-U7+=$+A0*w2Y6b0ZtUT95hYAT;>*3cIiCuR3Pq^RDWl zVdHXzxoVlcnE+7J%*gcdwM|_5ijlNu-mtB`VVUlWFWBTr#oqbu<6~XJ65L^?mq;LHPOP6=S0K6xZ<`PxjB|%XaNqsy?I=$mKrP1 z;K^!{trT&FVsHyhl+9@DHk`8af*CfB{EE|=YL#}LkoQAFs^jec$ojjlq+G0l$DJj1 zz8Twj1K;^XQ#e#*co~R%I~B`L+g|2iFl)B=m7ewpYZo@D6Z2TqdgN8PI&iUsuAgYi z%$bk?3YvsFu1@-785{j>^qdKu8^>Lxxn7WFvPM#AJB6GsoTOu)rC>VCh8q!ry>FvYprm5aP25fau#--L>aZlLlA5TVALBR5?c$m{PZA%U*x+CZ8 zRQ%aUGY&8Thr^TvYj>n+-Th(?7TxH$@-q)vmAHOx8#qY_`WABCV$k4P8FR(hn1UR$8tSvwaEn?v?ND>r$-oqjEiOec8IHIqr3Q zUv!paVWSB&Z$@26NifO8fA<1%eW{u%!KT3TGObY7z&RRfCV7EfKI>Uz?Q{ggHk*-? zmJQ!0iP@Hp9L(z(htMjHw=Q+Nvn@7;vnc20a-X_j(}#sC#w1{hKW$QGi{HG2P);KQ zZe6K75IDFi-ibpVvSjbjY?<#I6Csz^Mmt&8i2fOePAQ>R2@3%$sXVZ4`80{VI+cc% zf6OnatpDe!?k5LngXmWgC))2f&*-BMWqQF~{}_Q76o` z^GQQWBZu5ydvh|P&PJBb&-qUGbQ&T)>>7%zcEAYlI2>UH~6hKY%anSypJ=XjTV`#HICBdn?hg{i{XY?l0>Zo-nh6emZ{V2gZ5^5LvLI`UPDPfFM`dB<01@O1N4YNnE>%;<*92YXzKUO)ur-9Q2L2~NcB zST{Iyo`b(&zJL0J0(9x^$JOhC+XW7nM;e~r{8DG)wDCDY9824?}< zI@z>IXNzhfuD$7*?3q+9>@KSibsX{A<=nRt1t35nHFtZ`wOKmd{@rLy1VSI;hlw2iA{O;oBsUk@lu%&Za#$xDC8qOFZRl0?*ofzj-LGzH?L< zOz6Fc3p+P`|JRB3nGzr%lGwiU+s_e4|7T%H=EwN=cRG4jAJ<=!hu=n+4Ka4CWdMF% zZBa22O(?WLA5Pk;k2Vzp4NIfo`%E6l&Lo09Aa{v6{FG#0YJ}03YfV|uxlj~nI?Lf2 z(L8JLZ_O4fZX0p63=GC!V$($xy5#3Z505yjoqUzh%U6z2Azq(0mub~Um^yF2-}NXp zUkY06r7>MKsR_Te>*eAF+VVd=yXiezKDf3yEKdplbiR9nOLbNPn;7~*Rm53rP20OS zS4cPE#`AeQK`AcND$MmO6eI$f>s|*C?jBK4-C{{M*j0`*0isqym z>Kg4EaEyOb<4&+b-#v&qgN8xmI~){aGFe8PFXtL?#z338*5C`KeuLUUYZyR4k9k4#C3?}#G{J0{&HE9dEqLaD_yW4YOexbA8e`9Ogi>5IQ}ix-6(ps+&GZgy)*cR_ zj`}y_2rUpd?g4bOQ-S%~>%ztCiu|Y_R_@Y zX;1AwIqR3>c(nuR#s>$f@}78=uHp@;Bg2w-|FZPV)B1vYwAml>!9oiys;n67G(cw%s%+%kRnT!r#pDE+z_meVmmOK z;JXM9v&Zahoe{l_ig%+=&t1kS8au_q>JKk^=Gk}IjAKjmr$qFP*N zN3ZvAZ`Xw}q-9pxm5_a)ZTX0cvtsbfU}T8vQPTN*Zu-gT1^t=`$Z}PC23r1!;=#Z{ zj_x^+=wb1j>(1#Aw!RfbW`eV44*fw!Zs2l|huyxxzapgM{pI0PM3|7*Mu@V&gm@C; z1Al>Q6g*m;kzc=2eb*#fonSQaVjzGqZmeuerufZfrnYp_g8Wh0?1miookX*Dh4#Ri zoUfZv(IR?kx`uUp%XT~c8Fp+B-saHPY{?8(BR#b?Y7W!ocz$e2$_V0qjUJh(*FBds ziRR`92d#OwA)KDrwiN`FgEy-zhQ7PEdZ5*H_WtGmMEPcOR+H5Eq7@e}U(9=&T?pZD zijqTK3z1IJwK;1X#9zxzRTxH`N^$&yiI_p%ArD>d=Hlw4m}-8JIHxSlrsixq>Bb<| z!vZPq%~5AB*9nMVi@NaN0`n0Z&-$SA+Q1<;+ z)b5VUOhNOy?5q(TH1TAbo#kLC_ZQ3btYyHcq1u_pOwV1rZE4+{S(5;Ux+l-L%Ya?= z+au0R()}bucWD}}YI=IlH81-#E8K_++|w7$K-lr9TM6UvC75?X)`CSvVk{ky^RBMu z5i^cbByYDr*p=yJ?@l~ykIffrjderAh?gA!{y4#Oq^Tm*xpUS->jB=ocV>z9cm{O)QH0?37)oG}-_Imqv)bO_uHrXTYKkKr>a4 z)3-|4xl2!q&F=1`kC7Zj_&-h~&cuWrxr|A!pW9}Q4_;Bq%^nKPJgKetmoQkBI3jwl zZ(Kb)?{M4WXL~m_V^i;058hOem?&KPBgJ0oDlb@o?saEERe$rN(TdIZHMe5=X?{bq zG`ZgymQnB2}?9Kow?=kdr$dh&EPcJQ+au%7kF8S{u*TWluR|z=EKfhd29RqB-Ju@djb(O(Hfk)88hdYO-M;OREo$=Qd z(B;Cr43M<{zT8_kf9+r2WE=fd`rXl0-ei1h?rOlp^Dn2@KWql#i&j2nmmU-pvK|IL zp<*uH!=DTdHLKetsCnvmX7jxJJn{A|Ue?j%>`Uo7ns;{C`A5h_$ zSKn*vAAd+5`fJYJbcj`Nc6R*##WMQ$@86o5nvj(L52>$K6?9Oe%N(2MPkUNo0^KK_ z#3iO#Dx6!@NBndL-6ZAK=)ZRMC3)!T9?L7vx0GB+&Ak5YqL@c#m}0Q=D#djw4$ItyeYD|CRQR+`u+d3ETmJtjAB; z-jFAGJ)8!*YCd~vrC$1thf9e2`Ko)C7SDr*Bvs7jhU#A5DOPnAQCCgT5x+(YE-rtJ z>1bAjjF%_wx2A7^bUi%4&SiNG4JB>i4GohdaO73Tk5!LE=$xIMRWn@#!)l$WubrJmSM-xt1DYwg%Oyn< zPLV~o8v}sS9 z#UbGO{k7L=d=PN#v}ec2)KqQgPh1DZ!9=nBW6JjqE<#CPrKrfU2d#x6r7Oq56WnWr zLt7%-_t(qpdMqmDAL)vZLlY4?T~%8Z%h39|Xy+~3jR zzJRsoiJ0EQ&z>lOmt2-d>y8*7RtHOPbo`3Xd`)c}fdgDmm zffKQPfLnN@;8un~=H>)~EAElW4FEXR-5x%ya-%N`fx5S*o6qLxWW`OHz6|nI%+?lu z^quYqx{E3)k8^)4qo5qN>_5|`EK5pEe<(%S`^d{@bLEcYFYe6G^q;=--}h7CG(Gyy z*ErWkE$^C6q783f9=;bcO@b&6NB#m&(f$|l`0{Oe;Fxqk`?1gSHC2ag{~$}2!-?(k z>vE*fFVh!+*sG`8g?u-C7k5v{=Ycgqo(6xzgbkofL=2?@vce4+w?{^Zs6a?Nam%M%-^Dt`((fx7bQ_LMmKd`(fv8-2~{`}n( zWOI(X*^X}WuZs(CN9470-lNL&y&r1#KRL^L$^b6ZPQ*Or-YdPgR>niEwR>P~i7|!oK>w!9+h;Vd^n10DqJ(zqyC0iX_aJ`A^z7U%w0j}~B%5JjnQD0oQ z{b2C3lS5=`iZM4&E9={1R zbqOo{+-cXR@8+-A8RQCIsQk+9Q8}l&xh&+|+z|RRZuEEL!%Toj_ta?Yq0f3hrdhL= z)pP&_<=}WYifPR#dLJ1+Dp_zkbl0$;TX)^jrl$m>;P*vtv9b7_sbje-=EO7xjqn7I zzPz$A+K0H(eJu7awk;1C*gK&%%uT?6Wpl;Uz-tk>-`lMQHHv;T%We8uSvIe|Y@YkM z906y6o2V^U$w8$g&W`#u>6y0bt@sC~@)tK}RZ&O(+kI$C|5G{e4K&vHktQXuF`o6% zS8=3r`@`9FI@iu?GA~)o^9imS;(cXkQB-H)b-LsrNL zrM;MooT!@Yd6%{Oam3qX`p@=t3DB4S6{pViY2JPMpYX{ED+S#<RBA#U=X?UHw}G(hZ-7^8t5cRjUFpEPMjh|gU1B+6Js4P0+Kkku1q`8@L!;D5S?7?rX)@%Rc$2c|A zn*m}(1e3E78^!MA*>ZPHer0QAvd>CXOg#0I;E-fG!|d+sPZz~ zEEagT#|n0kFHqV#n8>-ntqN=g+xWMES+2#SOe;Xt_bC7VPlP*+jNd|8*tyz{22DWg-YK1_@26WJJIFPGGdq5K#IIyL9j`BIwO? zScRZIr6TG5rm$n4h5@7g6-u>ZAo_n_ zHLAHa(vntcWV<{=NRMPbEZkE$&^dT|Fd+=Y)20zbY=^&JC*2p#R#utyRA&SUwha&Q(Z>Al`O*%*5DZA9* zEAmc3{>B%MA|Z|uiO@Z~!CMgjyY%O4#6za4Dsz2}sII@YlW4Vm)5Y>~WwYy%SY?Yi zag{J~-hUJWJjkwNO+7df(XKwK`iFL0KXI@eKyjyoczI_^XZlxA=Y;xZk%2{yRUcFa z#wQZx<-kIpRX{!JknCt^uf-M}*##cT7TEjKldvtB*I@8MeFUO-vO|%*j`}&&+<>a8 zS6=&OU{x71ioA@hTr{T_Nr}j4D2#prtM<6ocf8FJ??iW0aVZO{e`X6I~^62&DsaQNW}# zM(kNsOc5KnOuwv;@hgfCCCMEz&~IS<(6Ox7;iF-)b6I~?+PmcsHyq_g0Jkh}u#Kv} z%#)9AyM*>NmCrnlNq}8hxztSUMy=>9G zxc%uR>Kf7K13%kR!e9m{;QMxK(=f{FKhZ^3Iqx^n)SZ4AvzIzo14&>j!=dVSQ>$Yo zMsFri!QsqPBErB*bmIL@ZXs|Z>lTaqf5UZ1bfzey_d3exWeB5-=n=ik>;3Y6dC$7nI_F;N z+@H>ed+&X&ef>UzOdy660qp6BjzmxGb{=&d%?etQbd3zINhT^jf7Kd14B;CAurP%C z(B|NR>dM7x1ntnrgLj&v8$Hz}>A9S6p!&R?C$qpV0gVLRno^)HMmXQ3SC(sJdm>3> zy)P71Y8|O0x+%)H8@co6Wo_@@U*8he7~YJDgP_JU;F%7dv$%ac%5o2_e9!qkv_Mn- zc&qZ!1{f7wU#`Ec;vEm({`?-;Ll>85DZeF2mBeKpPKv~ENfN* zIG_|ln{#qoyQbM<%D_3`lP)_KMsp8$KZ4Su~ zRWbU(Ei1Nl%rKYw2b4VHu4PP?qxRd|<#)Ype;_jXa?sIPa#B`~0+m2T*Br!Oi#e z;QjZAzfWNA^Bc?`i0&Aa3T{281XXnXHz(SFTbnSW3*(30EV8^$K)XD>{*Cn+ApB?O z*3Hoq8*j-^V;K+dqFrp=EjB>#mrNCAo!8>`OlNp&y2XEL2hUyi_?7_%k)?VBZ|0fA zY7+h5GFWY}O8eFmx65EuZ9Axd+^8KC_?(UzD@GDyqkI|xqoH!Z+%a=O?L(V{y&Z*2 zYejRoWg5o#l|?puwp4VIC+NMRr{#xJBoMtH^l1$FILlTxfInDh$ zBOGj*iIo&kZXG@i7NlWZ#yf6w18k*8&|{U2h+`VfQU^%(P%jPGxQyrd;NZtaXE8f{mL_^h^9*qeE3z5 zS4zH3A0R{;!uq^wPP$JCZh4mvU;1FH(iL7)>{@PLb$s`y82D2=g5D__Ti<^D;jd!S zQ>p#kobgzR6$7bb=C5`)H6T3D&vi*}{xFokd~ck6)*P-@Q|LgM@1G@4W<8pi)9TSv zCUHhS$95H6(v;YF{gD9_On(CRokT~?Ry>!HY^qeIJ?q`RjM-5m**+xk`&ItQE0ZLt z+LVetdWW=&1{cDyWNjQw01uVY?tx2_OuD9z{Q}s<906)VNBS|zb;$v#n@Io@ymIFG z#dn-#n%s|!o5CImNMy19yTftUj928TWZq~KV4M7Xm+)Iov*a*{Seq0A0<{(DqN)`R zi++xV*|OM#j5<3Ri{BLm!N(;`qqm41rPjclu*YL9@V*yS6$pJ|86*@($6qsC?@^5+ z<1$$aNxGHxAOSViSlXPfw?0!TxDx08O=BL3NhgxoI)Py(+F@33AZAo(oJQMFalLTZ z>Y@(vlIn6&?C5#+pF7>_7N}T`XwSzaMw345pKhK{GaG_2;6L|Ej+GY1L@w{AU%2QRGi%@Hgo!3oXB>=%; z-Zuv{)iPXdBjw+4{A;EI57AeC0Mi(~^YTS$yasJT!1D*%36Fb#PBGon|J+5|RGC25 zAF;XF7I9v_S(kE0HUXSzPl4fLqSw7``{(aA+dF!dDhDNo+egN3W?6_2URU2f@zE@Rzvr@`*Q3sCsgl>Yto2|bhQE`cO`jIe_7#Sp>rJd5tu7A4PIfu8Uu|}Yv zC`QrLQXoOqzOC~yirfoCuoYP$5^YS%1>gufh?o>YnuS(11+V|1FCs!396V_5wfOB8 zK=;lJWWAPQmNQ(uGVeFcJSk}dJ7e#K_R#n!M)ROUk-6Nulw=2{y@MCHH{48r2kmB! z(U;IDb`m`WkiHK)*qu7lLWb?=Y0OQHIq1_37D#nvXxFf5W*9Kr_8&Op$js5Ej83v@ z&5ST@(6-yQ5T_HyoG#l1x>7iK;dJ}444{=;v@)vU>5x0ZK4 z@QDJr`MN=tFz{Uv1a+~(E8S? zOqY0bAPU{Ms8m8g!v(gwlGf}$Z_lLvh&vZ`G4BClHJuGYs znY(m70%FjzW5JHQ+mZTB0herPm*XU7V(L8?yR8;_q8H6F_svKrF#nc# z2lfgF)?K%a=X6AKG8R2EMf)p>EHtsxH>!kZ26J(pDa}BBZdqL1p0fQoUUF?Iz|_hD zIzUX0Ghq(>>Tc22;Oq}9-Yk}SvI3T%llZ6^1W9I0_Hu4KRg>8O4m&tJ-kHpv>fQu z^DHz$B@b81(Ms+XIsEd8PsrvpTtq`{FER_-bD5f*(%ShX8OLu5#{eLeb~H)54BWEA zH)80=+vCztNjm3YcU{p*Z$U{( zapzlmqV8FfStCi|kW7J_iJ9)moc^VOqD=aDYOG z{AiQd2ev^KAXLw2yN0guC*st+&-_6d|43_?p@c8mIHI#LAk>@Fi(l?Zbhtqc-cTw1 z`jiZb%xSRUzeVcymxGx4ad-_4ilWDHQIJ}y=d@FJx7Dh&E`6X>4KA{7+J5U2VWvN} zk^Aj>a3IdiZ-z?$44V3ccKhw?^;KMsQO#skKL_5VT-s){R$PK**L1YcJ{2l$jgYqK ziMmU1u>XbhO8q9t-nWwBm#)*_ulx4aQ({qNf`B72z(FyC*10$8X{Eqkw5ws99KhE? zoVhu4sX+aP&8)ei`}k^UIt%rgESG-HaVo1?{d>Io4b+5>d$k9u9WBK%OWaOG z@L>49Jx`zT&#?ck8I1i%^GOGAaatq#*$s`0(WZ94>ZC`W>Sasy3P5W-dwwi^@2yso zBHs^<2()ul3IAA(cHU8_`2{}VU|{a)*l zOX!-f-F_p=!}P}uRx!(f%#2j0jjiZs2+m~0c|<;S;ODYNcK@ACtQ0apRTKzT(|aX;&MB=3FOIIzKO z3Qcn*w=dk3MNXaO0kwJ}beI!O%CBk^+lSSLw*#G`#Q1F2kG|ze(-a*U&WTVO?DUjM z)HS0Pp3q`rmhHkA*GjG%l<@1hA-*msh%d=jkST!Z#R^&+v$eD|3OoxYJ6hX=1H&b3 z4})Bz$L{Yy3=vA^nRUvN?{X5DJR_sU40qf_XEJ;}enqPka4>4r0R^GY!%d%DX#jezbrYBTO0#`H1Q}A)fBmaJU(7+%YcGJ&~y}&N7LCZ@t_{w`H7E z&We(8X7>-PxMDx~6(tBqG2YO&6(T>|oo=HEQjRC+03dQJpbVH>pA5}&N$g6vA};H> zL9x;ACmvO6NhhZJiWE$Wbr^R~-E1wo&)(gcnrH7ZY*yL(5w+E^;>n)vZ;WF&Yz zCaSoHK*Lq^~uIB?*LzinaLjo}}dd{G$f}qjCW1-omv- zKBv|vZ+mq0-l)Tt%_XgN!N&6{9^z|r|Lf6S;}9t*?<}SjL%S_*S2wC`NdzZpiQf4M zkqi#(1cCQOK??S%6wXxH9BZmc(SjD!C^M}(7M!(WY;1{i=iMsqOes9tXkY=hEBqwHrb`2OE+e;=~%EJ|I}F&?iP&?VEtqf1*H= zPh+>>4`lA(a3(Yr#u%-^pS4B)aT~LNiuCX8OU*v*Pb`{fU-r;f2Lw^kZVh>6Sv|{} z!D^x{97R=2|MSazzCBT>fZ2kGTvDLI`>y7jaToocQpH$+Y6tQ7M`fy$n0x6?-)Zm+ zAEU3!wz0SHSQ|O+hX4?ns(5iEh=62HL{ivu#85@B-n+8w3D;rF7#3*=La6IMauit1 zIkj|DvuZq=0L>D!B8h=Mri?#&g^z^7!%T9=`5j?2s82RyVWIYRA+Y>17HtmW!yLgs zbVDP}Kikp9zqwmyHo_q0Lp{NqRLR-P=T+#dZs0o2AEGNF-39RGZa>Y~7NfTBOaEq$ z4DS57NR0h{jIFbJN_V%rw`B)r*@$qp#od`?c~wP6fIlmQceGwrP0{wsDQrIhqsk?D zvKP_@AiWwRj*#u9(;9BoAjryX^&R|ePAwkxOC4KudiZNs+AvFk=9a-q12E4%qf$pC z@GH4NKePXg!2gaRXIzW~`1lT(bZ~C=Hb-4Fa_5cliq#YRr&E-wLnPXptq}S#vOG$& zQn(Y`kjl1e!ooP$Z>s$D(s<8fyk=KYk?e={Qhjf){-aLVUlr|+bu@`3)Y(giK~a)( z?RbMNRQ~g%JjK~Pu6@;Nqk(}smPh=DI<4RwLmCZ1`r(;9;hWN!;FoQRnmz!Xx z?dYhoU?K-25E~;ET+(CHwQ1>TG)@B%YX_=9?6isDd!;mnLU?i#klzN?E**N6NuY#L z2puFQ)r74R3@u8~*0;+PZ~I~EXhJ@c&-&Ue-tP#2B2d~38S1xFLtb}oCIG@x|3c*< z4S;KgPY%$-?Q-GM26aA_{>FT+eqf?PG4pq_xfH# zY;ZtYmKV?jAPS{ItB-kwi2zH-mkVo`-S`5(D^_UB*JmgrBO`5uyVDZJ{7Jhwc@zTR{*>Ln3vvSRN1PURRV=_`go5=m^v9p#i+KQy^130lwi}WEvu*tk0U%b-S z{W8A=N1Rt~$OcXvUIjk=gCgM*TB{kVT5cAPGTzfO&+VNI&Q4p>aNthIqquC225czO zAK!ry!l+kpvA)M;Z{v?7X3lcDjxUsF{+!H!8u~K}$M0`V`e{8K4#vhgv zrcSgnMYp6FYly;SlxSsUQyQi_f`_xqAIZJDFi-_bd%iL8TTKgBFWf&^cx zt3C%Ff)eQ>nVRuU!0Yg=Rx+F)=hELYM(e@m`R;i*m-bZ*;j_Pba z%dFr$)#s#Wm^DgI&o!eY^vAQs%M+DgxHSi|vhti>GiFoge8!6AgxQdaxn`zr%8PiF zIX8kAM@f z9ZY69>D0ywHMq0C9>4xfgp0HqJgf{&x_GL?6Y&@7%)Qh+DwGUsK zZkQn}&H;vtOk!_&#ppl3&ZJvIz!x)RS!~2}PcywYV9VRMR6x9ZHyoHt`KfLosdlgP zN>$Q{HLt-*3fZdY1!Xn5BxmjwaC(;KEHkh7LX)7W(Xzc!Mo#@3GVIdG{<}{byO)`$ zgZkcyzn**57jg3*uZgSFt%uq%vYcr4Ga6nm(mHHvR{zy0ad6zzpnsGCxzqooq{OI6 zd~WgaP6~e}>%BBIQl=>!z&sECwAjPyg!aU|+36{Cq%i@KL@qN|FK=vn<%flsHArP} zt*-TR_Ne^`4?~363J#&wpU6-LM@XN^ z#>YBpAafN_h1T#D0HVfX$WFpWOGENs56L=U;VyW!F&o?^>ASrGj)?*lpdsSJnWZb_ zv<&@2~_loL*DRD^)U$J95USa+)2FamYHUG~@CJK)`aXBu2^ z@Wk^Jdp0K_b3=E$?&81LUZabzXAw$cO|nhLo;-tsul3TOCvfec5L}hNnwpEA_vm1Q zNtTWl&6|2*Gb=y3(%%34Gv5t}DjCf^V{HKv`3syx-{-{{I|D5`zTaU-zCfs(GuJUc z7hXHf+AVv;@;a0EOVoEF|MRTK*cPeSXviWt5}9A8GxEq#84RLbOr1u}fjpb;cqT@J zKjYaRz{oI(fMVM_zaZ_&e6u1?RB*{{`R!bujc)F>ZevLBZ1FRVbnp{nL7mVzb7SeG zrOYSvk;RR|zKS=W;`ntxtWrAD!BYgTS^;m|lhS#0ZR~RL2dBKyP_cZ|a8S-Gicbsm z*4l?9W>Z@1)+-ObW8=@yW$uv9MQSzIwp6q+Apcl=5V3VUm3;B?1Y9exSF)4ysu-x3 zAG<6--uBy%tPI*YVkiyd=;-}aF9L_?i-{hF?KWBR#12AE-d$eDt%=?{<(^6QM)+P& zP10;AXX;c_6XW+4*zP>dZeELt>t!ZsSUhZxV-9(j^!mopTYHVdZw6WRausoc(BLGi zo_3-3Rm(mioD?OXGrH26Vh0F=UOf4ecAB;c}mAW$2R#(8M3LK$d1yf34ydDQiz5kzIOQP@1sEQ=ax>! z>*7d)%nfV>9e~b>qk`-L4u3ZaTSVbr&thDm2?|u&+`liKqB6_`Fu6Gl*G$rRdq{}m^?!i#~x6nmvP?iWD} ze*Y16dVDzsU2);0x z(TJ=W2I8E4z^AGeM8Ea0milZaeWNmfSpffq#nvc=xY z@&46?<|v$Dqf2@8ySeFk%dpl=BGnIBtg*Dpnv;z_Ngoboa#zDDn@fHb4q~X?e1AiI zN-a_$)Rviz9NtKaB!G)}sK1-l-Z)Df>lZux2|Y!XzE%WpS1R6H{KS2R8(X18oa@ov&y{^2Fm7Mj<6hOO4fc|HPR37Ln2{(ETj6gRNW3 zy-KSXdXiOfW>LX^&KnK}h|O%G-InkdSEh1`hf2J5k!hBhSYDeUtr6O_bo_O*<`Ai( zbc%-h#SS5M!#zta0%I+!!(pFhg~8B41%`g4IlCsEU}#0!BJ4!kY)E0Nb~2H$aW)j3 z=-%QWpOjB6;92OpHt`H%#%YbM3qL zG$B9ZWww8lZbCy&m#qTaS=qM8A)la@%?@rx@Pl z;9E&`1z~~u)MP=iXox-**dyORKq~-kLfaz?G-WGE>|+Q!naB0xbae#^E2uDJG4CAM z9?~tAUS{OUB96e56ivM*)+aDu1(M z_noH**_4mCnUQ2pZS|^4Y)mN^zG&n^)d@lh=4(uC7I;4U>XLDb+d&F=5dhN9{u&?69po^STH(E<7PDC!vhKs-SD3GhV zJKMtn)q2w+-yI$1T19{p*z-ljfOXxI47CQshr$MjiN~sb*u%N(+B@4PURt9M^lmTn zFp4VCS`b}v3HE*#P%8p5X(zzc$sVN@M91;k_Fk{i48FBp3Y9q3!y(njg07Vvwwlv- z0Oy-B*DZaTnh|MZODn7Tjzqs@!M$u9cc*)IGZ!SG{cA;66IFHPsQ7sRpf=wtR+O|1 zg)x5`!`;S{5>rh2gi%0z9}9D&ONrIWD@763f6-@k%wC1wTF*YBeLi=$kkFP89;*wa z(&U@sai*cREWDAuIFemU8<*cxq?(A(2%NlQXAqQV13n95BU#RIIJCjncE#}c4)`@^M`+MI<0MN z;L@s8Y~Amo;94`rcM_IF^+cIaOJ?TT=%LaEEKET&sQhq{s@#>CeoizTyL_)y$uMX` zo6A4;>fcSiFY-C+HopHh6zbDHv;?dfWKP;CV|ZpuBd7G*^FRaG#@rt!?y_$(&I=P; z&5A@VfXX7#@19rKpdY;$bSSS5(0xEc#d;GUW?5H`;%o|qbN@DzL>6OsCQ^mEP|}x{ z<&|}os>b3k{J)@gxHn$!_Nb;{XJOqUt^v_MIokTTfcRH!0LX2O0LIX$L{m1b?9n}e z7hy(ydC*u-Gp?(8JI%6LHp%1{zO)^Q7`U6WF0u7b^uH91Jo9WuBKI#9HW1V5vcV30 zV|KcaSKjGOC?7?Pu;Fhxpz`K$!I{mw-3T|ADI(OWoE@=y`OVbB>W|SarqsgF6QSLQId}#5&yaICo3(E55&~%f)~At zarc-}QSZiKSp#AmCW#eBi(Gz}cR}OJp4G+TDn3hr_umb$EHrvD+u?E0a^9~_incm+ zpav6EvNk6^Wema!Gp>Z;n(toPT|43V*lg2>X7d*+6J(9V+G zQ&0N3(*Hyc`TV$eJ9ZgPiX|0XJ6~NB{3mmte*4bOB3{Efv1<~mma)ZGFG0ycMcr&3 z7V00~ZcQ@i1y0gqD{(dxBS395T9ysKnhT_P-L2p%EASdYFO2U?5EX$R6cj1P?Saod z!3YOPDBc<)X>aQZAALNX`h&tTTvv&$7}KdBVPFn2E! zz72%}@yy$y7N;c%j1PMtCX514V6`)U!kI+HJf3H+e?F6`BLEG7dNdmNhfSra7t3hV z!l&f=d3N0K`+|J23IZi)66vJsa#v&`t+WcNkx5$S_@4igqyd0zL22zFn!c zPC9@;hj)~KmW_K=xB2~*3BPk*puIxw@Ix)V(o}bXeh(^7%1X_O3zck69Br^3Zd6#p zaHSqdus&Wj1%U4~ZLl9L+dx9?mYtsGm+&8V^WyNOjci>+5%X1@CsQLZ->9ML6DTH$k$Ehq5H0Z8ZU3ez%Ih>C_|= zu%j=q2(<_lPKK$|&Q=qOV`qO1#l7h(&4*$zFnr{wNV~RF8B5BQS1VL4HOj0qyEM$C zk4K`fBAz0ZvL~G=TAfuU3v?_dvcsv{fdGWc=s1Ghy7EQ`W zf(xx>!i3o|os~D)2}p`Kum>F?-f2ITitVLwfw6S1!5zZhbikqUL_BSjC_g+&g;&bn zP8!?}vjZpEl{wU=R#3wt6&AtyfZTljkJvK88wxD-5$sCul})rs&9i$mo@%I_J3;__ zEhW%a5|D7QUhkyRK3YR>yF4g_hCSb&8N;8gw=21jmfXps&hk4H#XI>41_x=G>Bmfo zNd6v1Pv@MV87TgGtNBkY6NYs|_i^+?=7Ti=Kf%MW8F_QV0t4-HBJKZAT#zCI$S8Ors^ zSU`;~GZGdpFJ~gZevlsh(6cPa`os*U&g5%zgc5kGLRSS zr+ev%fzq=_HbiF!T0XH<7x7UEmsNK2E16CT!;V`PmhIp?9J*uBB2T3Ep!Lh~Ue<;tFQxkBngD_k{Bj7S^`c0JuMY@}m&&$psat~3BWo{g#Kw$wrLmd0 ziK4}E2YKGlxOW-&)%Ch|g9y!eyE#8d;OcDdc(Gn0XLSiGJW(|7_AdD)k)+nxKBPH> zousw?Cn~UC%vnZ<7(EIp92F?bf#KL@e~#~)@aVRC1MzlK<=|9ymP3Q_mu-_-S@nV1+SPeo zyW15Cnc_gApr;EfXdAuu0A1!#ZIcwK(vFTc#OFmk7>mC$(hQ#~{YkW`0cXabUH{vq zLo$Xj`Q)A19UFMJmEWzh^M3c#&QzW==M5-1Fe3>8Ns)=%n#iBfirQmv@RMZvoo|?& z95WlRgP8+|daUCR({Gan(cLA|q|wuvbCscnQ!PiYy?XTcNb%9j#Q?+&62WVCf5msj zhikufQdCiiW{?IZb`Cj;#u1X13A6x&2zj5K;M=!7=WK5co$IUkB|ThgR+~lof~4au z^ICRwbrhPAzpd*`=eD2oqClwUX>!zA>g;bM$z*lZ4;L^HQD2mr^G;JN{Ha_{OlV*L zo$0dAXkqP0m(npc8ewS)?7~vb=p{lNt)oj*!pxD?9PYhq5@6T27NW40dFo55iXxcm zw4qC=t)!1@i2fBlToATC8>ZUNLYQ{9cM30c&26w2_3zk#gyxPvtzOG7EJmrz&I^8_rtEFKZd@DDpRsGT64}v34EDRYCOnY$T(%d`a|G?cicK*1$;R=V|npK!-Ty_wL{HT7(o zP%=He(t?Yuh1#V1;$Gmj988viGr}3oC|SZwB#<1@P%+wPU4cV!asp`KWooe2#qL>a zoG2CbPRr*mN&wH6&x@kPqe!OMVPrul$5`~Do%?690#aZSO3NE1L?$jhf;nK+N;~|( z13z6-M{4@pZ%I0q8$W1)M%Gb2W__KBb0eqrNIY@z5Dh>(RMAgwU;hl_*aWf|M$9VT6`Y$tVZGv} zGtWRCXpo>LK>cZn(74{8`kV5&SF2t*2IE@_&#htAYotXc&zoTh*aEPiHP z7|`yvw?Y6+gss=QHYJNqPJCKe9DT>h83^wz_aWu8Ey}+0402hEH+zoSwlz%&Kdwv5k zz_Q02cwlv|Lzm@>f!yW&hu7qP=084{br$}KR+>J)rB?b_kGWn#qWW?)HaUHDGIkWS zCeoT{gd5A8+QIFWbk2VZjtZ8Qn>$UKtc1|f*@cm*k8*@g2>L~kV=pgTnxg?jXXw7G zt{IiTLSBSgEF(2s)o%Dyr2n@+_$~eKA5TzR!MeO2cvd9-$?5&i)pfEOq?6lmDdFiH ziSNxVbb>sJOW`V@6S==Br%t_g6c5@Dj2ue!Ci8Nic0xNZFN|rHX>!#<8L){IYdo(mXK4qp!&{~PRbw0Jgrs4g;T zQxeXu3J95)NzJJI1A8-sI9&OjsS&?Ev;8GFKSLe#sC4F;1L?`PU(Y9xOL`SDvGA_- z)C|uvt&OIo?WTf>eClF!)mg;@qfZ{UzQ*4MhTT@+Gl+om*=NctzeN2uPran4jCA@{ zT>h-I-xbeV?Pyu;yfQi8iU?^t*qJ@`nhULQ-%tmi20B*MGLuD3Icub? z*7#v6U=v~<)w-(v=5JN2Lqqqh=hR}s(dy=RcK&XI+7(|ij6J)~d{QzV_G#1XZ<;Btv-hozzLI9y zTroP+w|&RGL?>91btC+6PTTUy-jjqGFq-*~t0ZMZtB|@6nQJtobmlN77%0U42sUFG zxxB$b%+F6P!rkA&KYCresFk|~gpb^G`CIC%F}`Ljf$mrQZHV=18!Iqioy-Oi zsI^PRzJ1ZGg(i=g{V{DuJF12v;)rcpk5}wj+^GUJVQH%bui}HQJ5SpGGb=7&9+)JY z&>azfInq0WVnqI|a*KR3E24~WJ*&q~`~bm=kF2eyZp}NpViKU1#*Mm zw+3&{tDgP#dvi&lwj%Y1D|MAiIl7x5HN_dd#iGviZ-d<5u)A^9rcRqs+Xv7RSBz<% zYt==qc~u=>Jtw)I-F=noov?>L0K1NJ<@Q^Wm78zvJb;xUONpLU>@3=Ct~`WMb{)i;x_(g2-M{dR5(6&Gv-CxLFpF4QJY3Rq%aS%hv_r zA#r3%FMfJdG(r_8?3mZnD{wxgLIsr?!ZtivpP#D|yKCvhS8aYYM6tfC0+U5{8PQ(~$k=i^I_J)Q}tAFDLWoZ^c8 zI*fdsf0hXKwvU=|%MRJL=6c*%QDf5XPN*k;yX})gg!e=V%G&E?C$|wEwOa8g)MgQC zsmvGuNi#gte9Ajr44F`}c6jSvTadOxaZ&?Y)t>p#<(S0uAV6PD=^VfqMI5J(>GbFI zZqAvi`u!aR4+pM+q#O+|^A~+&jLEE9)griaAkO&V*4vLye~3OtF)bNcuiF(${qpX? zRZg5oBdbq_V&Ud6gW37= zn~k0EZA9_rbQ#qUF>g1+9GJk_MrG`C03D?OX0o!+So1MB5)LscyQdS=(UYWmYGn&E z0DUF_!FZxhWbaAjNYtK2q~$+nIRg?Z7zOOff|0it@&aC^rNRN+f3bZK2u@lh^>FUi z4i0N6{eh<7?)+3JGNhqZ4Y|3>9jSAt#A>MZAofbYeSIkS`0VDv(k9n^AJx)zDKG92 zlCdAyw?C`fgNtSLFEAuZ!|200a$-s@#)mr7MmScaE*>(dHM#v=}+0q z=Q{{HvNKlP91nxi3L~QMouwVfA)76_jvD6eHEa5afb>`O*~v0|Sx03|$Tn?qHnj~v z7cj+FAz@U)*C+z|)W?C&HU8D)9R#&A`|IQeFywunk3?;8iz{c z`mEQg`}eF|G|7rD|DJsj9csSqGlktNt_%DXXo;BORAdVLy;m`~n3_oezCF;#tH9a+baX0txoy+OPY;R6B%O_nbujeY^mps5Qr{6JD<|LrZkcu@Sv6QjyT04I+SkKSxqA8AH`AUJ>ne@!juJ^M{%j#lW z@cf;UgY`x>sTa2`y)J2Uo;tXrBWs-KSC`Y)dqstuoJOK6E1)-y9>13q#-RGjnf+C= z^0+6zX_|{0Huh-uC=tuz-lfQOfHXBqhLglnb{z=JDbOD71vYT-TbUuf{d?3U}OiCR-&5a}P)m|LbS6ZkI`TgkQJqTlLBS&D%AQeeOz$2-Yuow6u zRxwRr9Ql&M{orQ|TWq&pF*iyEa0!7v75NtL*PNtRK>g+jsm#c+t12nxHt912>SwSa zXk^8rnaDQfY^}CbW^^xx_fq~I#72ks*Z~ecb8wvxl*F|@bA?F<$V{nZmR!1^<+zi0 zH!5J77rb$AyI#5q{Iu26ta#^>;JDUfd`B`n>7IENctbnJozqA$A=A1dV_ockod=xy zqr`a;dv@a23&3EQPd6V_LYWuqSi9fbO9M=LMV${PR_3PrCv3bho*f#)(xq z-bAlN>AmsVuY$elYNF@Qc65GxV~u4>|rJ{VD6Buka!P0C~Q60;a;O^BN-eG{UHKh5H!rypwSIgHu33km#|ZCkJe5cyN`&lwM9{=CmLe)FVrYFBif*McCm1 zqU;FyB6+eTgWnI|8Uj6w#z@|TcOcqvS;0S?DkHO*n)!KA>A~b@14ehi|LQhAyaU1M zs0FM0{{YB;E7LDyPPcGk(e!V zB`q3Z+WnJ5N@;|!K`g(1Jru$i_6=I!$i8d~Q?d5QGu>P{^~QK!-8sbnoM}w`jt9l0 z8U5}7Ptmy$RupHd%umhj*VT^HsB14iZx~y2Q%D$xME3fc1h>A~=@}>2XoNl%7++4Z0jiGYNi5Ihx*0FR0oQ1z%wkh9MFi6SUx_uk-Q@5^K$*U{L|R zUgdzGsNE7)v;0R4a#waHvtU59;WqioawjNjLN$sqq0Gf^JU)49^p|QLBaL~2&=V6R zxs7VwWFpPU>e-*|kB?g<_J5<+jF*tM3Pjz%D!EqA+{8Sv{9t?sFZtZYNo2$L?1rM) zzbVlFXv^5FLO+uu63L%1k8STE7-b}zBT-=z)L#`kh?KseBX`}Wk;->m{#pyxR9HrG z`aeE1d8nK2^Bdu6)kfX#WDO*yYd<-UpV(Pw|kuMVSM|h zLYBp+2GwBX72yDU{o3iyi5mf>+|I_1<7=L?A9Ibf&g|LvsrNe5=O1O>ldQ349v_8y zLv7kb`83aml*U@P#~>z50l5z|I3EU2pzuGt|M@#?9Zlr6Ey6**B(m<=a2J(R^~O{P$xbqo2y1Ua>H+^~d$IC-v=~W>6E65S7=Lx8Df!7d^ZoxvC;xjHc(Hl5{dbUc?(Z6CvF4ArUc)~J z*HR9<8htgRSIlNfQ^_d@iUajAGuIR~v6Hc?Pp)0V-rjJSnfVQJMk>wk&B(Oeot}Pu zJ+(k?qUx#B0Y`Z`P4TvqqU68wsvHxpjba;ET_;gJ2cenF_Q4b|dl zWp#C)g{-J-YTQ5nyLL@(En@v}RmRF|9Zk=E?K(B!n(TG1kP-*g^1vz9M$`{U@0kXl z$$E=H$-wfWjVN+eS7XL+9~WPP>FFh^q^tc=<5P-P;B-z=prV(auTg^MciR4#Z?|8g z-`xIhL+ILTO{JCkmfK^E0UJ*PG;0fK8j&Ba)mOWk%YUQm^eNC?F6{jGf1@C!>gr<0 z;>x0@Uc-7!smbLp>hZ(w{h{=Jhu**MWA)V;wcCCV24?TKSJk&B^;(4NG-+$ePcJtA7d}7-*#W{TlS&l;!?F6Kdew@GS7<_~GG^)%d>0boK*my%Ke# z2w84wcATizpwF+?CnqR|KP1x0P*j_3m`dE$m9Klwp6DC!5mfP z+bZymQ8gXGP$fD&3R~LiT>wx|KVevQH_h;hneI@jq(@;e)LGL53MNjyQN4AG@78}h zw-XFC1IP9YDs{30(p0ZN>IYIf++Wyb?Pb{>b~C)bB9~tQ*4yZ0>8@rv+3T<9t`;;O zzg~gSuStElMtgOhSJTk7p&|BbS9o-~E6V!S{-Jw`n!F&nk2I-<6uE?{)Yws@-4L~m z*SjBcMr5y8?KB@~K1h9Fzap~#zah(L^!4*U*BDh^$o5DBGm1_#qVf9DkeWZResJdOa|(s;@L zuNC0+hsRc7iMIi_ZvU(KKs5`2jLR4LBEjd+q5*$WM(T~YIb4?=Mq%0@DTPysd9yr!QqbBXA z4Vh;P&L-y9|MR_W+Eu6VDC3(gY#rx4HvcPOY%h3lk?8b#L_~{H1X&6wDN!9~QiCBf zB#AN+0(~G8i_ExSNF2CLK7^mogdKaEJaSD|tK!}st+H<2mN3f`O%-wz>cd?z_UV)V z0=jXx6&mDox}@SdrBrHc*;_oC&em^t`MgndKesA2u834LfggjTB*vCln9x?Fx)2xb zu~A7#pd8yeQ4+8jiaGzT5B>w3Qqt#Cm>2(>Sa5annmkILV59%R2b(nVP_!RG`KmA zQ^OlOO}iZnP+X_`N$-ByPc`~~m7aOznfEPcFcyOFa#tjA0TyJ$BbZeP(UoZ&La`}` z1olQd&#TkEmFQm=t!d7)Z06?Qx(x{lfifym7ehi~iI4Q&|L;HTWH}rmSzL#k39>K7 z5-0Qc6D&;$Qm3L+lG0~fhYJt7j9IqB;eM0j90W7>UhB|g)2y)w5@7Oa&NgV=v@&H@ z!_(N6>&KfelF61ws-xRU{Q8ed%C$GVeh$;|2jAxKb>MD462y~*BNiq>_r$U-sV*&3 zBHT2!*|Q%?tB~XQ@ye7L&nm|TVyi5~o+-TWc$1MDddy|ZK2uS1qfZxuO&wL-?^ex@=VPJD@A}&Nd2jAKQS3Di zFRLT==8rzIJt1e+hn62!N73{gjz}MDpGYUnh=SvHyqqQ~U?@_I(;XSSKV_|KwD6~m zFt=stRi#{NWD^dR69#!@q#^>d6x^;5Nue%j%mt_}M$Wvt-Hb}E6pHvURi#PP*@F$F z#$UUT`m2{KIQ~Ba$>;KM+nX{mdE3h{Pdhf_vw0s^#q~bf7>bBlRwbDsRaB5jVa7Hf zid>(XNY=(MxK2`{!d)h!R8V2_Gd6enpDc{~q%)v&d}ql0JdYKAZv1x$@`yNPEBZUo z=*~XRJPvv7cy!3nCl2~MX6?(*9@U%8iQQDp`axpQMX!+f{VpF*C!vV`? zYIb&tr3#PlhDZ!8>4~ zl8d(Zw{B4^9}hA|{7jnYiR|&7%as@6>FD^rg|T>f?_!9=3D5L_Vy!PEG!-2|#ZMQBk`$?(K{lKb!-=t? zZ^iFp))PaNlSiSS7A|mXPWulIU7in#xm^u3HcMFA zP?t&xsK&1Z23VMP2FM}~kD;e?$?uliL|&2GPqV0O{a&eTTKTouC@nW6?g65v&D#*m z1GK%tJKM^aJPw>Xh6ctYIxm6g>*!u4awgAmdg93N_Dg4B@kbhwvG}(}$+*49_#nw< zLw}e~MrY>lCFFLP?}|m;)b{{#<@BU0G4K+KZ)LoUEEs-@>@sBbdU_na&ez zC_I&PDS{Q@!zM9=GlM%}VnEJtn_*W53@Dpq1p5*qoK7YYU9no$kz25g$Y(u7TFOee zyS%&zV}u_>P6sdr6#qq%pO2RCegW6hrZtPv4arVKF%VF#c6Lq?R;m4@nN zu2wU9m;EQqPc5=m_I;d2OH{L*#GRI7d5n8kVXPzr&w6~&;0}B?TH~CLAp;Opq(2TE zL!3hvGbl(wBTFG8G(wQK$0T6@(g;LNKtjw%mV|;9rJ;r*VWOhp5RzqB0x6*hVJ1pE zb_NE7BqW50q+pJdgTthSo)n})62i=c!bFsj2sI%K1j!(IDPZygl%$ZrLQ^peicpf> zCu{`lJS{{OO#n;6R}$?=Ye3>xqGK+!M#5p12q+1eAc9yRQXr-niG~5Zw7^9tnllBtB;%qr5f#QAtf1~GB;ZRc6oPwW%QTvb|f9+&h`pT~N? zHU#+CaczZ#l6SnB3F5OU=|tj}FvVq&Mj-&Anq@E{;=sKF@}%@R@)0!%Q#I)}b;$>W zwncimv(ArF#_mkokZQ<0oe2E01`-p+6ZDu>`JjEVKz`&9u7k0$mx;;Z)QGn&$wHWI zFb&ush=779K5OQJg-ZHlSM8qCLWs!Fe)r}`k!eHOIHG7NiD)0Zh@O^8u)&I}Z24%Z zR@D)Ee`D`>=)ld4(io0!x#FJ|6;K$t1J{=5oMH9fm4A+ zl^Qx;w-zo-lD}K9-KX2`dC2dZljJAqg=}CCiTIGFfxV$+GuN9u>|3&*37=6UOb~GY zANry+4T0PF=OF_BBBQL)iRRSts;XHDbmX!mtN2z4AprSI(@IGO8Nht45I2Flh;e2^ zXLFo(&pMnSSj?ya0i0PU3=8*?6Lvx{t6ZTxM`lSrZpMeUXHz9~tu-rD4mR#E__ z%gfv~Wxor^HSQW`b1-XNO{H^=I8P#F&bSVT#5WIybW3#r7X=`IlnLdYS#Vm*3d;>b z_O0_w7pCo(SzxAHI*J5&Ti0pGcSODJ9QePh%SchmzgcN=Zsg{SMDl0wIB28D)JMOI4L8 zn;D5UmRJs^5GH!BwXt@oQQD7D& z6om8+r-6I6dBzKoBz1Q`p&yG;>VlEte1@lFY+BXTO=e9>rEHYBG>}JN<1tGE5in7}F>v5$;1pztj?PX!BNH+c zDH2Q=Clmx7;lwz#*(WqPsD?=F9IL%Iao!HNTBn8%7h9y=tU-;;?hsib1|W1sakm8E zn&k38H1k26K@$+0qGSV-+{Fe=<)R6eNF|}A6tQtI!oFUcT|BDmt^NI)^RB-3NbugU zzhTZUnj5pIB9thQhGQ;3v_u3zV><7Xv)Hdvpz$YUe1y-|-&@Q?K;TF|Ryr?lhq8o- zoy*{aK@1CVI`eGb;!pLK0Y!mAqL4U5^LFj!W*Do6PmZvXER+#IOp_FGq$d!R1m?!U zt6tB zY>N|eXiOH6tqefYwLCV)3{^~|%tS3wOH>R>5JZrX1j50?DTqYmqvh<7ILDB>u&Ps6zQfcoF7XicsLJsn<@gaF56$~*IBy_Q=R}yGExF(oEsVzTeVH1tjVv%0IzGS z>~nnWLE5ZOe3<)O_ww85?{ML;rn&WOpf0J`q}sIxEp`j`shrA56rJx$9cVzj`&oZY z_dbx{&+qg^e7xZ9^yAps3Q0uqSoLG??iQsL)YNDc+PS1@iCx`2EnMr=mJP`gDi%bH zyL}Tm4N}omg_ZD;gN1^eRArcWKtZZoBq*xpHL!l;Wq?A61JylG0Oi5`3rX&DCYBZt z2h#n=fnsiKGagJ}^|KIsGxYuQ>CO`Gyp}rTyME7ywXoy!nI(RA=xiNt(>TM7^FeNK z)-mRaih=7`O3VC=6HgZkAe>yH1!_RBVxPoL@F&#we)r*xW&_@)0nnecrn|qu0}*5( z`!)9_fHSt5=}GO{CW&0tx2KAs&sU9Ar1-+(uX)uPlw1{rmP~jllBJ(?BrCV=o8IyA z`-u(Tm@R8Oe+`= zMOj$;?*EE5{O_Ofqlf4E;@%Miza$AipYNZ-{Q>YZM_rs&2+t<@i0kbcO)~8whM<^7 zNYOBrmZ~WsF93ztOx(e?N2czW@_l6K_M_3<_Pu}Hc73jHq33!zYf%^dm@Q79^9qM@UmD@InW` z2d79yWdn}~imKz0)5n3pKsd65kSz(2Uqf|-dKQQmhQ{duH-MSiNEVdc_vw99Ub1>|mk@;Gr&dBi?hpJ)UJHI`H(pe4%|M zC<OC)=zix)B~OF9*M?97kj3^Y|4TBtz9W z`jU6KHvm}WHwS~`*p+e&2tR@wI=Ygl#lfgKwmE$w^#Kqh$u5tl=CB{Awbqsv18ztb z&f@m(^$^fr)t*ga`XB@95RJ-z171v?*8KZzG_pZuv<0heknK@qQc%MYGbjlJh!R3# z9VKW%aF9}v5=cZ6tjR!0049VJNK%if5m533<}xVgM;}RP@y=#uX^4f0AbW&R%(BTa zNYpOON@*iOk}WBM5`HTOyd=s|TPed?Y^EF;nSo-@(V~(c6EO+1!sL zZ6n(!o3mE7@1BRGlOokv+4>&wyhx;#g|IVZ*a&&Y1p!ABks!07p&rfBkc zJ(RxSh7t%x4YLVhY_v~xxsaC=JR}v7VCM#5E6*+%s-!ZSZDQW!C*V+?#mgT9<3ABT zC%M6b<`{6N<=?US`pTJ(y|w6l4u7Q$`7C>863N1NDh&x--iq*ho(u#D>Ulmz88)nt zoSA+|G)qL91;kXzK*C?XRe1LK0|nu3nM@_JlL?|;v>iM~j*JFAC5@bfoRo5WW;g9t zi(1&m?;@0n3eqagrp?9M<>P%0K(7kWUst<$I`Lh@pWW)d23ZE`oAQ&n)jPRgt1651Q2aY-Gs zG`T7?REIL=>cMh~a#V%y5y?{^?v0i`5QgCXy=b5hfxv4{F(0%p|Cz|&$v8fIa#4%y4)#C0>U8#5P<^wUWb!|kub2k6v0FZShc$N{cUp~5L_JtWdl1f2FsZi>4HS) zq%CVvI-p;4ER$%yqCs{HA&9;o!ja8d0njp_P#ghtxKOk#3wS7jGA@O-6iOjn`itPb zfzX{zkjGRm&PgbdGJGs_Cl>o{mc)1{0}BSGGC^}^0$7Y;Wo3FXHc`jpb$a;SHL&yG zFQCFqCBng03nsYcJr5}U=iIMC--K7CI2Rm$CjPB=586Hv*(DfO{y%%zi=V!JOKgN@ zWX4ZINy%cc-Cey2Y7-!u>d8f>Y(Y?riCCvs=)P`5OI={(vc5tdv!6%0OBL2nYn+c< zicgq!uVC}~g+50MkVAm<>|F~&><1w>VJqZdn@CYQle-DvPFRyEC-|ZPeBd0YRmlfF z+cSV1dx;a>6r2;qCsgo%f^K@i*!5G<(L*TgQZPXOKOoA9%+CTt zvMh|=ikT4k<&PXDqOL1t##Jdqk7UE{?vxg??`B>9MjQf&XWFLrtI9OdR zh57@7U_wMD(-n}gP`Mfj3kTaiOk{&G1m-Uh48Oo9GH9A5Cs8*i1lC)zI-VML>a1wC zG(lpIp@Qc=?tRl73Uk2coYcWX=0anp{glC+mMlq`42vbCLj;~dyR|QPD{odPuqDN? zG}vi7@Onl_F=8G_$=YBFTowzR2L_2VfpBtI*qbk7y5CM)Ikx59zb7|&Va(XX>QKUA zG?xcp+#G|*xdki~uOQeP15BAD>)VmSM;1X=L3*XruMYD;OpVo5@tgDRa$0>jcP^(k zopD|J2Hq#Q==A9E-t)}rO`9mA(mFV>1QDs-Xd_(QqZ5d&6O-Jxu6G&!iO`e1i*@Is z7E7m#n>+<{T*Ty`zdQj7e*;C;$S}I`LD_S(R|@rh`8Ud7!3aQ_gfTQ8#}-VU4`Uv7 zZ950CdO#pHCj^6_U>$zKXb*U5C)3;i3#pY=vP+6tPEI&{gIpF&Oxr z4P8x(_26E}8-<|IlAJW2>2Z8s{o{)hUs4jleMtxs%QHf7{vd8w!18J%&08JW9hF+K z;}=Yw?T%{#aYp7;mjn>vk;S}b@OJ*Q5+UV4V; zxnSBFLGyEeA^TtR~L=NN8A<6(^LllAP%r{YaB@tHNND;1oXwIN-Auqp5jqC!&xyNQatwXdgRIX33YfeWpG&KeQ*Ys8#p(gL;SUN zuO-bQyG3SEzY>!-(FKFhzo((P(X*pU_7lsr^6SkUyBJ9o2XdYLj>ieao5C%7ROoE) z-XZFX7Ai*OpPL>Hk4{$PhGxzbCK%c^9nH5|u@|zpAQ~YKlcb`tOl1}+bjhkumE=d&|Q@~h~dM~Wy>3EN0(n{Xo8iP5Sfd43c9$P7HdCmO`*^&W* z38FE_)V;5AN%DHPKLI#QE^HO-1(ypQEn32wTd&9HvK^*RdVa6fkvcwoF)n2*Q;w!( zEG>nquK^%PjZFODN$`_mz8CgvJ&ckXKT#lRG-S$+9rnm2fq;OvrIs9b6wf7xwa2l! z-y?GEh{~%YrAC@1Mr6lKYAu$Xy z_Vpy%o}-l_gHQ>ugR{l(an*R>-Z72X!E^3E$lv6O$3A8!qkJ5ncA_)}d-%;B0bahi z`d=rXttTf`aCf|>Hra~Hj>q7dE9VClHS9?7xr+FoanDHz7d9s*{m%D!nN_c+TJvq- z+BS`23+u?lSm+wWmbbx@GDb?bS31}dzJ0v~uigC4kBi&q$U#)jb;nVw9s7m7JX~^o zX64VAmlEFv9SU?{3jqLfzLoKY%zB*Wr~3K$`gd9qADjc>H)EL=w!%LNI$!$&x88VJbY5Ue0x~56VfS zXyG3pSIKxHIh{Ea^$$Tg6ItU}u_wbbUb_whB7=h#()z)Iuws9hC&Vs2TADIt8)&4o z(X16>NI6Ikzr72P$*Kx9J!d%+U(bW^7mns)&cyuDC+rv#0O%WXO(SN^t`a2p zljr3RM+)KOdU|b_YD3DwWfqNGLWsSg+FYq)}hJ;t~qZ&SWLP#;gdMYQ+i?&`mfwLR|U^PMdw6= z>PhgcLy%?xI6_t|`AtbTg1O0ncGPATP9O?^#|z!$2K|aaOht6j#|a+Cg;s7$6^jG$*d)i1|+i4#xX7 z_&AZq&DB_q(NJ~rjrb#H;RmM^Tbz57ou|i>-S-712t0#idaeyuz}W-9Ru3>!GTslk z_DmQTgzw}hlEH%qN#=YPU!*i7c!3N-0&sesEOtVHV`5I2Lc&l1(2y)yn;uTYko(b1 zin1h>PRKGT*pN!Wr;TtW#M9sFx$u@s_3lnU#6AgoAoT~LxLgmLgwcTc(PId#sR}`V zyz$=tD*#zFVc;V0irFlD!>;ZRDS4H)sTHCkP=QGopySw@FKRz{U41kcE?CyOI425m zTFvvQh$3>8g2v1-MFEAE3dUt<36D*M1|Tgf#8R1v7Q$rcQ_wG9+3$kH4v>UyaJ!qL zvmYRQVv$_*5J7<`vEb<7x#$!pg;zJ+fRrapfEI_zKuD{OXK27W7ip-7_M=yV<0v-r zck+{Jy#VKJkXyygMlKSsIIbIF$0_0*DzCX_$5A#$oFcr*H#+ydt1wSDGenYV>6D<+G8^oM*ZLv( zJ-NI1Dk4t(ggWM5NGFD z_Tl)sd}x$C79#MB4yd5$cj7!r-OZ(MXRKst9+E2+C0irfVZ85EB(p2YnB1PhJR=>? z9w%77D7NoXbBe{3LK+eb7*A5zxrkq~nJ|6knJAPnrU*-$Jsbz4 zo2%sN?{txg$tusMtG2#Py6+A{&d$oUJ={Mcy0u$8P7M77k3ec{nNh=N1GMG( zJ`%`3H1>TUHhY5w!-5D{IR}7ns#bb|^F(+$J~l;hi*=j6p#H?A6b2u{U{J`V(fd?- zijmgUl4@ zg1bd~9HdOCJRPIK!E5t8p+LZqDiT;2b=EIrv`82s1Um^9NYJLl=}Pf#QCd3&3n@at z^jYBmz~4YI><;gVI4P9;Fo15tSY5_vqu?!x2gQmHLQNHT9UpP^OWAK2FsGqGroH5s z=^}eY-Eoj;$}7411Q-U#O$mA}0O=qp0xAm4vS^1N23^w3-YO*HSkEDeaCZZi5<@kEMXcuRlIN2KTpkZ;Gsz;D$rgjENc{8<>&Lph$;hOtTvCV#14MYf_(f<-C{zoS zSK)iwQY?E}5>F(Oa3j~~=uSc6L!${*-)uTEb0?H9B6sANNO<^jMJW=cM`dMVQx!S* z;oo3xN}JK;!5}sQ1m=W_P74-b9K^5FxrpXF5(4JHWC#+=0(543O~5)*H^#%RF*1(N zvR^@O-F8hb>(^($dd>KcG)}SS9@wvyy!M6iwa!e(t4Yn79+qm!_fYMkV{c1-KDp9G zo$pRbJ??CDqr&lINS`A3a(texoLlC2)9LI_GFQ0Rm`;Jp=ql27Qe=na^Ir$2?Z(Zf z0D<((g~*Z2vGp=x+)iZENh-H|+4T~{-rq~U&4%7sk=Y#)gtit^Y*@!ArNN;s&V=Bz z1af4!A8Wru@#Z|uf&|vf76)N-jx1x`zd#um$h6N;EE6liIV_6!x6b=u$i>3bB0!4U z_J`^ebZJwMk(XFK`jaKnPmv0nGRa4h3IdNH!{(AhtdbO&%tY$t;G#(Yk^zQr(9+zN zAhz=_Wm&@EN;=eM3m-Exi0uzkjUapC$jR!RW=>A6BB~ZU61f+#1{mYyWn>@=nx={{ z7>d1un?;LzXrjaflJY>@9!*7!U|>iX6P-??`P(#;kfFa!+eb4@HdCudMH+V~NM6B7 zMFfS;OPw#7zk4_Wfl^n3Ff+Ls9`blOx08uGMx%zH@1>zJ8zossu+tS|w;iMgEEkOq zV2IKVTRBJD4hg^q$dGurHdh)Bo%Vop7onp z_Au;&a9fPg!V*p1ZVe46PlbF?_slZ#OVAoUEzLBPSp4o@WLz({$Hk5FB&1}5n- z;k<`uGNyYp8#kd~Mz5)$$R+oS-%)zS>)kwA#~3INuY_+BZyg)9s+68OkjCdKMUjH* z4Jy?cWXmQF?C>RLC}iJw3wBl6bhWl%x#6T$w_W2Vnwy=w?>>ANFGN)5MsLZ%28uGt(Iy3B(R-HQgcb-!fIts`eJIP(x zxg`kbP6nH|NE1oWm=&T*rv?f+ojNw;*7vU6Iz~z`mkShYZDz!|49yY1Si52y253u( zWH>cM31uPyFkwrnqXIV#37c~}D5!%#=n$|AV3mF#zQV{qq8y5|gq` z$)|K>In&Xk;JjkW;+@0hr-eG|c?Hlg3K3k2Kee89p$FiRp43oQJQrY}Hn#VS=bjr6ip-b$qUpAEjPWvtnjXNk=2S~wk-j_MN#qp~g><95E zd!gku)bnrRoETH6?q2|sz1T~5A*dM&TA{kd2cI)e1R^d3&_jrX$w_j8L(uARCX+NY zEdu*q=1(>P@OS{oagTjdk7I=7%6252{wp?80`~5(Cu1kwzmJ}8;v8&AQ)(Pl03IEQ zYD$9YFeC{?2`T81lAi%Q`SN#;;d_MQ6NKR=@yYLrsH!L;Jb1~1F@H!1BnLzCeHWyQ+K%6ob|W8!`xeX!o)qvUM+%iCRiBHvw_sRz^{ebV>{JUC>63UlmoK9J-{J#bL9 z5Gn97^~g6M8dmngM@=5xNNElvm0~N?_5tMid-`h!gX5bhuK;s%*e(u_QS}Wb4?>I* zM){k0@Qp^zI-J6~FqOhab|r|mCubaBg8_t(0V*MAQEv(@)(|m*>FkRAxGM$MqmA%z zQEH;dV)s^&TO?RX!h6za&_Iq#WL5aY0|`Ggu}~1g{3r7q`xnTNirghx2$&Phq3m*B z<$$>|^#%PvlfesLf5U>2UJga)^eL}oa7D7VOwfg-l3^PPz)gw;@LWk3$sXnmQ}&0+ zMqpBcJK#24u(z=eA^1LpVB4MJdphGBlPj8ugX zgdV-kd;5nM;NaTigG|EkN|9*`kOiVR%SWI_i=0nAvZmbgt1;cDUIc(v0FboA zRgYW~PvIiT=8@u&{n;Z=;i1EGs1*E?Q;o=^fOCPhhlz@DLu&m+t$vXKjWgvxOuAH+ z6($dGRE5}54KReh5x6M^wsGir->UD+BC=#Sfl{DyE&Coti`Yzm7?i5yDi2pXy0a zTLXE4?YXpzMl$g>r%yJqe$_P7d>Z-JQpbZ(prtN`mjgShWw#LrTpE#C%r_Eir8WUd zTDAo=hb6o<#+yp1Vp$ZMNV_RoD-H6qf(x{Rc&74M%Lb!|$kvS%!ki+rgk;k+OUCZw z+51XYrFRo&5xa!rZJ3JDIXSQVOrJrVN9^8yt-}P!{JDoG;c;9LKU|LvKf+0F3lOvn zZWdVI=8zTC+XhO=Smx@3k!=*0B;+oc0kYV2fj9V|8YYQsr#N2dQ=Bib2UITuMl(R- z139Kak~6``4qXFefrQnNxJO|9!1yb{9esiQM1`%)dqTgwY2)+d(TIz}M>fw>$er>V z?aE#+B6$-(8=AZygs*f=?`;OyZelNJnQq{nWMU#AfQW)3Bqk-8`wQ+SG9KZZq583y z`2Sgh>2U1oO@trB4V`UrkhhUj^a>+YrVRp+a1RpCdfpQ#_GACfzxoMh_pqdS(C*=B36WKQB#R8lt* zd{IXFN@kFQKQA?u!m zaST|3)GbUk6M<~2+!jL-j2#0Xyh?aPJhSKE8zPPrRSCJBj$oMBJ2=O^MMU*5uJUsWtTL38H;x+V2cOj5{~O zXgVR*s45QwNVFVqkBz7lg`nT|AE!X%K8X0o(cNs12bt|B&zetGweU9G!CcZ$80E`K z3TC2ENLUyaEDMKjYDtuzdY+P;P%8?4;rhKjD87W_gOXCnLZ3+{p8|d%GBhto#^%ER z&kL>S93BXg#{l%0Jg4hUOqkG;9h;JB#;nm}p=dNLf||q_G*2RA_PWO+JsTs9AbF_f zO*=8kKa86s8VUNe=A6>vD^d>fLb?F3DL#Q>hezaB?>|6xb$2~db9`S*<~1kK84h^7Fvt~64_d`@lQQ0~jvi4ysih zM=UW)@_5T5&E9>k>9?HG&h-XJ{Um#M>aK3nKbYV-aqpiv(IOV%HR3R=#EJ&2e07 zQ=fAi^y4G+L1GSWW(3Ik7)$&G&x4&C2Hg9>Fl@({7KUJM1TzD2DYR)_FpP&^8#OW) z2&u=zO~!0btci;;d!$&`u@!MF%t%O(FHxFyh|KzQt1(>Q<_V}==*V-*7GW?S zzElAYu{;?h3`ZC>27L-NZz~Rj+E7lXc^RZC=J>ET5=5UCWWmAWyfEhg;|ZpU5+I(> z0N!}%`Gdc_9Z4Kcyyy$uO{rM<@_ev8P*(DuK1ITW!Rj0xWZ`9ZJC9AK0_mCc0vu}e z460=|EQ`Q!eZi1y519FNkxqAYJX_`xEET=z)}y)y`ayrC7KQSi7)}zv{K7$+pP0NE zPZmJ%FUx^sT_HCH{mu=GYm1R}AoMR?SusoUAtb<_(hn&K3DJ{L5o=sZpHU>&y5iSe zIJ83i81ym8{T_9znKKrMfVanxXimYy3m(AIhb0;Y4cbCT^J(WCn9c&mED;E7i`*P% z2fndw7xW~smV(r5Q)=I%teYVf*OZ@`g}6>)Bsmi6+UVqp17H@bL|daorQurZA)lT2 ztkPV;A$}2CU^NIA;T4S#U`a)23QX=z@JWLrWVWw_tA2ogU>_jRKd=q-rjp?T7a*tx zkqAzJ@qRDa*_`N#KE-es21Cd)Y6!edgD_j^0u@$-C_~E>;GCd4sR};<4W7@P_{m~; z62bhd^^z?h0h6j4d|mLU8rW~#Mn)vbG&*XqGORzED0et!5# zv<*G!^X~#5V!xLJ^*G*lGNt`4iO7%Z6KDc7)3Tzv!CC{JAbcQAkmi%579clswGbV| z2f{#Rq|Qmq$P8``AR(wF0!Y0tWM~zdRa2+|#5))Hq!XIquue`)Ocd=BRM4LWzX#_@ zvS^>QjxoV0Kb()iIOFf8BWC;(-EqADeb2e;@;(Te=Hkj1wJRNNs}dF z#fu*86j4+muwb)iQ%yAU(@j05nrYkNvu4iYy(8F>{e34!5DcP~i0J|vT32-EO{fNG zsG^DhWSUhlmw~M5Jf5@7!%sHNn<};EzBX+0aqW?kUyPr)C#^jr+9v{HlL=sQCWyp` z>^i!;F3CUD5~R-LkJxG;s8V^P_>PW_PL57rn-Y1-a&mHVY)Vc<@X+DIhYrablbV_- z-O0(4<;1aK#f*dC{8tWzItTh;O_nxn(4~tOEJH;SQR}}Sj~O7zl5`vj{qQUTn1v)y zna2bK!uimxH+PO6k(9b!FAz*!Hf-6ZGZ?SA*h^&hlf%Z#DpVboQ-4#z^P9bmn;SN4 z^>L0Yx2;9&FUlqt-YrG?H1p|Gl{u0!3H%=;qu}JIY2mX;u`6E+!fxG&>86-$PhKDQ zKl08^j!sVOV2}%+41gf*^QnIZ2LFa zvcF=w6J#n*&EA0P7A$B#Y@&}6N%=#7eC!pua|o}`?l?&MYDau;?EOI@IVEwH>j-qfK z@YbH9-H3eQZeCoOEI}k4o^eLUkb17etA9n1`fNTNQ|=ENx3E@u2aiR3m-P0d+xiIo zUbr*xB+1~h1d=2`c%tAJ!v)$GJjoQ=3qg`#&ct2@=voH(X_!+DEGTgy3!tpxn%qTA z*aLf0#MPuBrH;5lDKQFlpe73CKx82mao-f-3Sf-kp&kETOqz!fgYet_B0L7WL2(p?Dm;R*VuN4hlrNkR@} zSH1Y6YzaDTyq+R~HpnKJEunbg;_AV#1n8|v$x#RsAa@}o5`qqXjLGVFKO{YMR?%K< z_!DE=P5|{LI#)VpwLokW!zVIKi_zmD@jt!h zeb4MYsrhH}pVocw_~gghJKKPtqX2r*?X{#I3{!AlJO~zS!TLhU75k$01(2IqBnW!2 zASd>$3JK1iQ9exGS&c#8g`@=P~x#{@hL z{4x&yk@55Yc#Pyj&I$a#_EHBn>VIDk_B12wNLrB}A~!4(T%j=$#u|P3?>+2* z0Kmg>PwH{`co+6YGjhgZcv77qVU{GlhilAO&C7Ayj>j>wFJ`I1nEw{Ex5w zqD~9@hoVd9sYmSB4;{@JP~>EC*ZWTS3s!0xxx0jf^PZSM!D59&$03U=6`T}ucf8b>YnKO0C%V0^Z5s%wcKsl|KEI{ zwXw~xPr3VFye6*??+4iFn&(*ZPYplrpD)*rwp_j?C0Zfre7DYYA6WGN!^Zi-ZP;g@ zrF%&2qrQDL_S??LKIBcoJY}6pkKIS&gZvBYk^Llars(H4aOr`Gm6CgZrYkDvVJJ`F{*Ng0 z{@3~eWq;{MeMg%t*0fC19p1 zqYRXoRtl>N46K02vKYuLNmXTlx266%zfmqr_x?CVKeaJ{|FrlRf6nOS1K>yNzwXap zZc{$*h<40J@scEGk|!z_4RnA@r@|DSDvv}GVM%u&mjaZwR8CA}8$^AID!wJcv%C!5 z=Z|!>VLCoFqQYG;N=2BQqw1HNMJ1xJO)|v2p9w zdH~zO{K^i%g90a_>3wc=5L^xx6bJ8(6iw5s*SvorKi%-?Zo!Ji%&h*|$)bBnr|S0X zzG#X5=AeGDF@6Y3WQ(aOTMM1Cux|||^l$$R#^@aZ>Lmvt89f*J{titG2kjrhQylTr z<>+*NdiFIZV~-a?dAgNk@pO$xv37G6-R!CD3I_xV8sJ;wnlU!PBs>G%=`)QPHDdtZ z+aPBp#Fe2(?~-N%21#=_ki?_bVmlo$Ya29izIk?X4Tr78-U$-k<--=;*hoeJuVdNo zk0xPsbruX4H|_r?pCI%D=)4fHbaHkU3cm3d=Zywt}4io=o!zc z5%caNgMid2D$jc@W4V%$!$r@j^rA5l8~0lSN5DQD&GHK{CU~;iB7ya=c?W>T-z;|T zK1t)bKD2%o(kHyIB^DRYSxr_FmCcHj)X&ef(jQ{Kf8m~;K{!JEJ?ZZfe>uJf4Mj_g zh9Vwr^Yd-#yZrqln_S&w*%cN}OjHoEj;>1Z3K68JfPF-i4F}9&G9X@HUq6#N;HVxV z5eO&LxF1u3bx*Z%B>?AI2ZHrl${MQKWh)wX)T=6r#n6 zRc^uyzHIOs2jr9@q``MQlmCM_5CVj}NW_0G6#(@`V3@zTDd9fwv7spsfI3sDQ2k_m z(U3nqJK*%Ped?CQV;L;8BC@bDB$ODGk>7;0m6U~uk7OaB_yge5!?Rr&NpN0SL%oB{Bi+WGYC?ai}U#gUYo@c0D6cC1g)xQ3q)Y)GD$m z2ZF==tO4l(^x6f_nUyM)N~#|Hp!l{=Q5u*&gds`YEk`yoLmR(iQfi{Vm~E4Il_!+- zX&g_rSSM9n{_8REN3RFo&$i6eoTr{w(;7B%Z^K5Vi8vl)-M*XaH{#oEwyVR%(BZcU z9ORdjnIl%Q6m!KCnb0=|;IxDo-blDOfN-#i+^$*AYU0(#T&#=$pQ|oE7YbBvNE4Zb z0}?BFGhh;NEtQ7IK|&gac5xY1-(tV?yqHrwI_;Ev?xMygDtf7bsa#niTKo_>Cexlo zlXDM)gwv$TOOKH#9fZoY7y&sFJPOPTKb98MXnvv?2k>=aGRjq!K~RVhdF=bo#!Es= z0!|VUVJV=$v2pj%g@yePy?7}H0gM@xk_ZCU9ATwt0r!G>oHEixsSUB1z5l zJrT!nDk42vq><=qK{{7suQSz^xq#=-1 z+vQgAn1HDuxx*rCLVp%D*-#mjy#o$bQN1Zx7RThPYK|vM6V6F2*Mc^@$sRN#WRy2z zPJ6b1og{J`=dtPeB7ylxP4hTd*3V7`1CS7p6k_6T0V~1|2^$<`Ai>-!TG_01nCIu-DDUbL^uzF z@KwIm{CXqzViK7Jh_J~r_p-{`u)?e9im?{&eN|hf?}+!@CdRK#w4Xv5O|C6fk2lK+ z4+x3thqYnqMkXF;+x3mc;Ln2gd$sAux;!Dx435S|V+j7)5?ohiDU3B%;FS~6WOIop zn-X{)G+P#4p64|Jr9trB*$qda<21BM>TDBGy^&Rs1gI2{u`vR$q&*AmmL$gTPs;r* zhv!ceH#I3xEAwo7Ko}I`kbx>_Ny5YUqO9Tt;5T7$5XeBptT2Qi7&tByg@hh_;w${r zB9tVPH6uRi`*g`ZN5W3c>kX<{(|i-m2pbdFy*LOI(kl{5kY=rN#Q+6NZ$h9M2vu`H zO{GH35TXy>&Qa7k!IacVH)}*$Bc!+)V3& zQh!>ogHj&guL3#reh<`<2RZH|`Ro{!vSla22Th0nbbX`fpGJ6ak@ZILM#Jco{Egs; z#!A1Fy9)IoyX|U2R#KOz@Yw_8y6q-d0);(rkPEiVpllN!m4R zhWT~qo97stL4*@`@UxP@hB){?EpiG{mLyn6Q}sS`^}PL?qAL6OC1hY}jlw)nkIiiE1iel?nF`n6{AWx36VtypNBLCPMtmWnR%; z)~fiuZA-flaGT@VOa2hq=_Np{sVN<_|G-RyGd<^-rkV&S=tBMcQcUOZjtSRCU*$v$pU` z?tJw60e$69)JNxGPg?m)FSJ#Z(40~+-0)^aU`|SnC}b35$SBCHXIbw64iZZU9E8em za7s|OARZu~Zch{197AA32&J=U+NLWo{2no|yt8J;%63*RrmJi1Z$V0x1>$unO*GTf!Z+6sKt9q68wV_h#J&}ki!>Upm6eL!!8%K%xjmU* z26}MTYne?iG_fPoJSjBz{-3K;r0~ZjLz^%>)@-xRnbB7##X}2{CYeI~*iB;{+DisR zlt7?1-GMfOQ==!n-uwog7unVG>OP0c*s7|lYPB6?Q@|lrP;Hw7t_EU5n9m^0Xc;aj z3n>G#kL}-N*`~r=i>K0N1L=s`&>xc zo=Bv85#0}3JW;lX?sSoa^r?w=ud^YwH4!ALlg!B74gF0vrt6K`41T$v=Wkdd#TpYJ zd~stlnj}e(xlil1OH)(Sn>4566u)HVKQ;CteoMQ=@k-oCXu1dL!6NcCZp+vN>ELVnBFb9Nk7KCA!;nAeR;e(8%Xs$ZTYs)HhOSXn=?l35g91EEKau2x1gT5J2BRc7z9~ccp^B ztwlL_f-JsXH^uM%2io%C$`L+)H9sJv=+K%UK>Um!c%ws!B#&tvB#Me5r9}8*R&6g2 z&AA(-)MQzlslH0BNsT3vEmb4O)1`Xt|Zr1WQ7Z0YFJCERYnWRRYkd92_nd3aJKO&$!Z+ zNI6|HXCFt>15258B zx`dXR#UUE9ZsJ&YV${D`UQLT>V6JtNnOGMMpq($jRnk+wp1LNZ*Bp`G)+`Wq%C;9d zJ!c_Dgi!7PU_t~&k`W*Pew=IY7vu*?{KKApeneM?418wPm}GvL4oI)5A)xVMGLwql zkq&msjg;ibVybCoMvW;UjgW|pT5$ykQP=}h08+GYjexRPhDO41sNkI}w)JY;pO%fE* zP?I3gOi>jeKus`G!bvj`DMCRJ5;U|>EK$ZlbfI|#v5NFIm_bI}384~F4GKF4_XWVa zeq@^@xxr>rK)6x_K!j2ii33{Zjj!gyZdqz16q4B_D5O}nDoAcujd9U;Oqajw$1Ju#T;O|pqK&y z5;X_zl!8hRG2#w;x|E8~M9`5A)e8a2-( zIP%%H!L{4bzPlsHIffxrGR11D4hyg;gSqoi&qx3baCH|3dqM~2Y67D0sx3}SD_OnNmf{~WO^zkTnB%KYK}#6QmeUS-p-0n zwoUI8J5{ntdxJf6DOVEQgBgVv-PE)u0}DV?BB6=3j=efYjp8^|k!m|?c{GuMV}hwp zhz)fm&0$If?O||TB}*_7sFG4BY93d9=E*5G;~F@46!dzaEunYZd2I|Dz~qhs5E2E1 z1JVE=2e7i;b|*kQJgLERjH%9rATez~5~SM(kz7(M1m`HSB%l{570$ea&7%U^^S~Pl z!dGBqv>`W^AqXtoEW9CTd_a=dnnTydb}7mn5OHY)c*HUZ$dD)&@B!Ik{M(Ztx`Z?k zD3Bx|hLEbHVFnVkV&>6a9uq+Dq^SySRM=9Mt0Tc%ru1Q`F$WI;EY`@|d9pK?H&XTC z;MiEw?(owGlDSN1(c^~<@maP*V|up3LCJ$*2^%=zTErIyd6@TgcNXY`bA#~ ztYut~tl2IYGMt@c1SSDB0yW^z7EvLD04-buLu)B`6=srB_>i!^q>osez!3s3P=ild zIzdLH&iu5(vltMycP-_i#$%$XcVb(F&2dG9AZ1I?q$Klw;MK(S;KnQ@6cD?% zao<#&!WuDzw#$a2j+v`vzc<#!+T$WcwrBXk+$qTF1pQ!s5Cf8pgWrCCPd@jTvLty( z!>{e^+cc6kf_dRQ@;!bBe#M0Z(|N(14apnesba%{BpX1oCNAJCb%;xW0nFT}ZgB39 zc?eqfjB~=Q{yic%h)05jdnbG+!ijpqWT8^b$rCDAGNf)t%GjEa*p(xrEDNUlW^9_V=4}0mN_}M@19jM3w;BMv_B|4~l^~#*$<=8PTLeA|;o=KnKKI_*R%# zCpsXwdFY!N$Phtt!dlIyigRKTVT$3M9#2O)$epm7NJxa##Rh$Hb7lB%j!mMlL3J4N z+Pt3R?ma%?BuO}rC-3Z23`IYM-b)f;ks`cD@1rNk`6<0+TM{*9*-ck^mP&aL^D4hd zWJ?PdNRb{;iK9yD*d+NPduz1RtKjtaclC2rw3p6azLH&mz?JJodELBS6=GYGoki;9 zT#EC2V!Wl@Sna9HY`hLn{r0CLC(gk?}D*;yohPH;LmO{8Rb z!Bfg^r3=A>`OwIR+;D77tcj$4G^7|1HM98Lh?9hRvOM(kI=z1MG1tf9eY@d1Hp|hC z^y8d1a*(J}RF*{Q)MYtS0a=hNo+QW{IRgq|;Sli<5UGKA7S;_V|C7j_kQxP%C1ywo z$kQaMX(lA%Xgt6#dDr`|7aJ#U5%@P+W>9%FV8&gY0d=dG!<4Umt0 zkKoW+;_#=@6}7BK&jMJK;PZq*3={7?kyJsBZu_2Pa(m&RtA*PV8r9GsNP}exRft=Y zb0jCV)htxNBQs*@fi!YpDNt{KA(Rq0OtR2jKn^rn3yyCV7G+?d_bHIS3V19~V2NE& zm!V~3fFIzBK@^#9;^) z3`59AIcyEYwG(i`2(E#)z(@fI+?hm_h4P_7XkR3>fO2RKB1z&YHr%h-)aSL5bFxV! zoq`EY;VgbY{H4R$Q9{m*0mU8?(kxfhhV@rmWjI|nHWxd3MPwmEXdyNs6|z|k(gfSe zdRkGmikaS%%{>WrDqdvHBxIKki4`Jp)TbSRHhSDu_KH|MJH34tgRRAPlUk1d4V^aT5P9meG`MaoJwLeOl9 z7WhgikhKk{TX`|PP!A_(91X?;P@*vc1%)8EwIo23)h>rOv4hr&< zO;C6*Aj~FacM^F|t*8|Js1N}iiR=m;{1py66G7(uq)q+_FCRo9kQOHx#|`lzpheUdOiX%9)B8V=+rHRkbl$ zE~vvvdGB@M-h`qEW`u%Cd%u`GJv}!+K{WEPN)jfMBgzrTNP~HRbxMwvLCS>Y2^wM= z1cc0CAWD!z4U)@D!Ie~EU>RaU($?_O6vz}KJjn(imjXCb3xshh5Gp_!B^2ZbBtSVR zxRnI5fM6UlE=U-VO&Bmx;3#c4M~CntmzU-WdLqBI%$&PNCYr?n4P*VL1}7-2W$&i?ox3Qp`fX{=M^J=F#$_`DEX$o?q`4ivU3*K3c|wncVEkDlrCAx3R$_HzE%6&lp~6s3Do6+r z3@>tlnn^WYxKSvSegtexZTp`WJJl{iA3+bykvT{ls6|wg*)P<&CKiAghC(JvLF}R8 zq8_3JuerX@b)LNBQ*)FvgZJt;?ACsQFt@sFq0$6S$ z6o~;K%%h}Hh+Yz`B%oo2AW^AO3Rysipb`O{oOdP(Ay=SbG?4(bF#^FPQPKk(112h1 zn-B&#XHg>o3P7QVq0p3Y4W1E`fD&1Ycit3d>W5kLYoDL{x&vO=v5D$)eaAkZZg z1W8p$f?d&gB(eCQFL(vz|1M>zFVkE^zF&GmmLc(H92t*Nl2}E2e(-%_ouezCd(<` zWoc+e5Ynb!ieFxafSYFtM}1v0o*NHvXK#u-fbNh$7)X-F5TIkpNf?XZk3@1t$f&yj zB@B8f;RBNhK9H_dFUBSgOMeiwsKSI@MM?fv#vB z)Z%6;%#4dEmO`sC0YHS3s}i6Q0K^DTHB!q5bk?YuWJbY+rL2%FLIU`~VXc)o4cd#K zp=`7)Fo`g~c3ab(Hok!t#j7c_vJJH@d<{0yVY6Be@b$qxWc)9`5=KqT^+;rTxvl0{ zTU5B2*OPg2gRU}lXXB78g&>G~FfBEW;^Dw0fSSTw1f8kQJ1-^c=V_WRX8DL>tjU>- zQWMuW5YziBcGH!%VxuW8&@#27WHN1MLmebb5a;DRg9DtTH1Z5>vm10~S9er_$ zYtHKFmSvV(0*odd2__FxLk_{JTDz+r785Km#v{`rx{2qm{@I-FI78stTltArs>y0u zPL*0ki5QG!4$_SHC$2}45bpDzr@jq{Dp`fX1VY-QC?$N&4ai zfJ7#lk<1hxvLv5TVpi2_ATm}N+Tmu3`*6m+TNNT|k+sVsm3{IkYRJe;50G$P69CFc z085BOj*}u2C6YIa$|1gy8Z{G{xyZ#0Z4-2>3G&WL^dU8|^l*fJWluTrcQp7YMwLkM zLQabkRfHGYgd!8-C5_~DPKyFC5U~xE#Ii{X0m&3k!66bjdx)|pWF|0+0Pm?G7LO^C ze>qw`>`8k;LP#H`iM51iS{6t0*tG%noEIt*FsIHE(^iY*8>g_R&8p-2(z zNdb~+#S&OufWSfW#jsghCcII)bz=!h(HxkO<=ja1r>-=w1di4Y?h(2UBA-Dh_Y>(S zrl2?cF-a04zZg*Bs9=%eVNxV$iQ?!yuKFX}WQf|5NQr2*1%W76-zb_CpaG;(VI~Ep zl7f&m@`=!XSU$i#<$>5hzEU)@GD!qZ&$K#yi4KuI-i3RSoF}GQU#7FftFLt``5f}b zO1zdNiaz3Eh#U%#t}>X!B#2>5G$Ww^kx_#gb}$Y^T18Y0WMGC?3Svr=MnZDrC=h}S zV+Lasm{SOZj#wp0!2lS>27z3=1`w1Kl0ah_GT_27Ail zk(o=4lTjfN6mo)8rUkf&@eDzU&DIzgU|cyNE((Q-lPF12LyiC9Hr@RE9=3z|v`3wVJhAq{Pxecy}VaSs?-p0SIImQbvKo9gbw!N&(^y zV@hH%r8rL_I7sVZ$`jy+3@OA`5IbZst9#R;;N^vkhA`kQSsUw>i+}s7@ZxPgaaH{2!FbQx;rZqx~TFN#khM|N< zDnu8gK#T>f!H;u}qD~-g%!`-~QcifG+;3aSQnHomgPjl*BJAeKDWG#C0ysku8dor2 zyELF1hOy{<<{Fmd^t+1 zZ^7?N3M2W+Re}Lb5CQHIo~(*FY|d8DrOwlh>nkn9%aFWX5WBG?nYoc6a%4bFlr#`! zSQl4ELei=w#vE?u5x86@gC)2gBU-VPSA}ar#1TBPKJpZQZ0~TZWN+aqA8|SbG*7t zBUZ@<$uWmmgizp*P#zT|{Km{>a$BL@hL&>QS!}Mc?^nxMm#H6B`jTuj-R}>!Ek=O6XIYYeiN6fyOu1m#L;#?P5KP9BJizDrgHA1!;`Bi*)1TX24);za5Sd>;au zID($kcd{YvQ_FagY!zb?_e-5Uw0`QaZ*|65WtDvbba5mi&x}bv->s<^lo$^PuPW*E zbg4dcQ_-|(>Q@bxNNU1c#gQ_M`K_5F-2AGls;oqN1+nl-e2_Ld6YO7-_uJF9?c!No z>l^v&!)=vWf;?BLVJ8iiav4~ zW5*vkO(dcVD6uFY5oo; z!8DXyQc;b;Wh+|7GGaAm)e-eUJ45-fPUF6Pv4VSKNl3`A!g>6DjO_#Sj$`gtRn5>| zKK&nC%P5uKPopB<#P!sYAC{1jOAu8mmccWd&39O@&(lpk<1I!udA6F9y<-!-!_G>S zj!G1URz?8EKo5>h0N{W$glwbsgyvp=(t${U8?-fbQlaapa?2Cgu5#zRs^*3j+uoAe zf%hvB7FH^7FB)X*+o#u7b_%U0BrqEJ4OxKR)ysrEiYFCQY`0mhTDQ333#zZ(2Oa_k zk?34kY)^<|49HSZ6s<5pfh?QG_AMexcM=oD4O;68kfBYOlH~n2Hb!pL!wtp|IPjEm z^5-x_2yjw_z(}t+h;bn3*F*2&I6`q1=qD5%>B-5CpjDKpp=@b0$tr}9860SNC1G4+ zGAq$e`EAV&Pg?kTMdiq{u{Hah8KZw%-y6$fP3k2}5Z$=4#AX`#EXxPGA9o4e+J>(M zPT5q^ZoA_1>v?8N219!!U#|C8#}#WUb>AhrKIX+=W?nMXpKe~riGEm5mnu7L_GPr%;Jj;=<+@*TeTOT~@r^pk%?^7LNh{J&^<*o?%Jo*|=a=8-L!S_Q#^VvPe_ zC$4!H!7;*>E`eYZA5?7mJj8kZ4TSGSNS|T#sl-X5&Q<}H=%HmDW>sV^`xLQ8SQwMp1+5H%*)B&0(qyr_H2uK^q0;@EZXTxf z;Jp-(YK)SU(%~!Kv4fF~!%4Yh)h@Cytda~2(wjdcTcXM%=JS~ePcnHbaAAn&cx4Q& zNK~LgQ0`}8llNmK%aJrB)R0A~wMgzr(Ys99Au6P((-B$Cr807DlXexm7>xrJ6?#m^ z3yh4J7E6i519Gtfng#;G<1OOCREdo7<(-sx`pO>^rvQj4JKzoJ$vY@?9xM)1C>%jY zv4Bv4mD_N6%^Mg_WiUAdjv(A2_`0}aLhFQ_9Phh_h{Pnjm>TXautc+(mMwVSHFjSIjV@xQWLJg*k|7Hrz~_pIkJ2eA#7R?&u_|~-nIVMWkR~M*@SaOb8!<*m*;d-EVWJv{(@B`H10uN!Ty)rM zA(WM0v{)C$VCaTZ93^nOs$MSum{M1`OT_3W7l1EvSr}N!(ZUU^S`r@vZAOu0SQw^R z0Sh##2o(&F7-#B5V~QoKBDP>u+YuIVwuGcnCz{B&)|C0G&vaZ`mBC_K#}#dGYQ57( zLu-_W)|WRqRfQ#)Q{EgUs+n=>$Bu7Mrz=_{R%A;`p+b!cgp$BSNJJp3RYgdVLEMNG zER_^ZQx!}q))vtlC2EbA&0px<fRzo)>VO0t&7;}h*_sSHhC6Fx2 zT+NoE-;PvQXj`H3lDoE@(+lldt}d>=4n8sO&yP&%xZauMZ&!nl=ktUytqkW zE5z`dAhX)0s**`-Su)3N$hj^fMl@_#(%%+F5=n+_!)d5$wq`Q!Z3;-pG=*vw%~?Gp zS0>HgBDexz8@o@P!dqa3yI>L%hdacJrwzlW1A)V$E1;Pbj7v)N5)+UK)W#96oy)pd z0wn4+E;?@D%*QUNsDW^taifE_4i@@@pkY>1lOluw9gHSnTrU)4J~4hl9GwfK9;DI4 zc%nh9o`i=m!f{BU4kEIy6C$u>iDf2Tj4e#WK_o1Yk=$V4H}_=-(kPMaSqSAsKZ!(Q zDkPtA(Z*myy>fT9r0Pni80@D>VP~*&y8{nNOL~fNRp5}mQ#A%8%MtsoxEx5Na*9ZD z31X7CW+BzB+F4{r^Q>kYGgERlnx|A#x^Z-P5e>_oWnD?x@~gMV6w`A+QZph`y6OcaAD>*jS%=_xo# zCh|_}&WmlDkx=B3jE$;jqjAd;(*5%xtFd#ZPd#?GmZ@1&R#d>d3aP|-Hqtec*%mUF zM-m+427yyj8biQ46#$eWC=H9kGJenF^UUo#;cZx33v8;cOW%7lqlC zHY0Kvrwf40h$WSRKk>+TWnd$U*p&jNxP~@gGahrlqwL7N_Y+l?M9<5*T0`&H*yz0y z$+C7wy6cz0z3aP(oU)#kl&n$`1e5Gd%ZjO?#1sJO5c?>C`XbN_NYEKnft}EM(Bt~q zFqXIIATbFG%LC}fz;H&KO4>Ho_-YZUhRI}Eqoty_rp6M?sf?q3G1_yui);3G;Apla zLg5rR3R5*=NN6Bvg&|OdAb%GRo^aBybPZp9`!>N>{Fq_Jg-R9$3Y zQdJVz3RIl)CNZN}odU!XM^1$^2*D3vbRi5w9LAb$7ec8>s}fYPsFGNOeD9x=roVDe zt6dME6%tk0lM+TGtyvzT6Vy}QbX01@nPjm`xi#uWELw`6Q77&{A=We{JX}SJ^%Xx) z5DWvgVh~6GM6MKGy^VX8Ns_9h52|~du*3{>{*n2!c{d-7uIGUwIyGGisU?#s)ioiS zvNd8c2${M(L7?>`?&5u`QjiJ~SrUqqxRFSxwFMHOLx^(_p%5zq*cbF+92aU~C3Rm@ zYpWp4FBLs^>+DtMv3!lyD%%E!H0cQq$tUz51SY*Cc8hEi-BIqWk}bT3$ts}r$%w^U zBFhqPdZ8>*$uuF<;<`w%QgXraAEwC(H$OBcx^o!P!bS%T#bGjGjD;pK6=pI6 zf{(!mZsPeuLxsogiy;Wflz130Jju|=lM51sl1-FNl)?;Ju#T0rVy8IyCGCC-R;s?X zTYeBQ-@6%HCwhiCa2_`vDe#2gJ**VMIHe`EsHtkuO29OhAXucpXvAY0+Nri1>kU6^ z`z^Od)w@1P5y**HcVTqM6=4h}5=tz>Qd%p4-U5dxkR47+U1sG#SSpg8m@8azQND`6 z2LWeS8NaBHLQcu(2CNWFvP48uDvq=O0vg*1Aw(qrlF{yoB>FI)OA5yYNpj`Wzwj&O#bR>y-<``Ae^mjuZH5z?-x zeyi&#fih2Zk+63g*a@qL(icq1g6Emh-@w6S`B zY3P@kd1P{q;>t3tL|Caaw@&zjsp^>DwaA{${<-mB%8>I`O<=FVSeLFlBUI*t!pO;z zyi8S@O0dKjD(+6(&s?DMzWjU^M!{rce7DmEqm^R>gGLi5WzPa+%L|c&aiItf3Suop zj2Ho+&TFE$-(5vv)AOkvM*vdS64(VZ<+9xFIaRgP`c+v>+%XV;NPlQ3{?v9pr`r9u z&hLTI^Ao+c#uj0G63O9aRfvoueMxbk911W2Fph=9fe@6b6F_9kh&|5$cz(tZbY2xn zJGMAj0}SXXEG!9?!C<+NcO=^@L2Qa+7(nDaxX7gdO)}#yVje@F4rRzF*a&c_Xdg&a zqc%4I+?S4hff;Fqnx&7-0fZfC3?8iUued zVwDJxVG=klq{6HuvVag11iZLQ#EB{vgy^vFI04A$J=BtPNF0!>C6bCO7?`l7RZ0~I zB^V$GNC=cz8=Ou6)g&Vv=3K+fVmsU%WjbuoN+B#@whaJU2qQre0|{WlP^JbVRKURL z1TsM3WQGYA!!ra+QyExI1~BPXCS4F{OH`6HB?N3445=AagxDNHDJ4RbU$AJ8#{84m zduI-Jh~_4%H6}?VMh+b1!vsq_6D!bQ_T*K6C`mx16yFwvgccKC=$f4NX`RA?0IUa^ z24OZCM`8&ieuJ@7_C=7)B`hVNix=?=03)_Q&%{QMI{Q12Le8|jja!i?viYOa^t6YA z)vyIgRwR~Mh_JrX&`&yX%$N_MuOz}_^ATT^QmuFeOY^Z_T9WsuocdU?RCqy}hWlcK zAo_rYMsd*<43Q~JN}+~eT~upR36dxSl{$t_N*v%EMc}K%HXwlv3<)B$(0~_%!MSb` z(}AHgHKH`jggX9Z`n$w%pR$SL7lV)4?DekEbRB~-N|Aa-N?1RmfS$y|b!HP*WYtFL zj3GVwr1OAuw|6Hbw&0p?mM}` z(!eTV$~V4M-C*1;m|jPmr;KqT=X()p#DFX_2crR#xI52#6X%U`3xn* z*%S2{B?cfuDh)B1OZOXbVj8n#ywyu-d(~PM##UbrDR6B?chkJE7OT>$kBx5}l;st{ zz*Y!Y36)?fW`F{}N{4KG3YapjpR+HtG{UDd-^?81LO$N*P3{vXSD;H^#H$Gyge`Vz z@d}e_<(y&geSXHbg~Dc2F-p8MkhZ2;rjo5$3Rw`(lU1(GWs#MVJ>Av&0Tvf>eDILa ztX!Bg)CPVg;MrPRn3I)2!T??4);P$#lPIs54uI(%7$uo9_sD8@(yn2h`BsRf-)mu| z8ddZt9Y9?Qg#d*1JGUEWP-vag~?@vXjW1fk|s}NP}nH~{P$%9FhULGZ-&4<>b+rk(<0L4 zQ<+nYB56jM`my-27g1BB*YxyWlZA)v(h)(OiU2L4>)*ma;()t(Kn7CkrlL%kK0;&E|uZpkMl@SNl8j)caeL1Wt6Ti>f+wL8~U&;>+7V==qrKCA+A zXv>`5+>?my zBN3-0n^lKnTN7C$7R{Q_vD=Ht=&*zj5eDEuoKxTKQ$BuXB;gykjv&$$lcRff{B7Q6 zB$s$G%$RX>OB0nNh>~N7*AZfg3=duDdXiy!4bgbPdRR!;3LspNWHbX|r6tHAfJqg6 z1F25J5eR@4JHK>iV95oZVu%(OBr_xu18*6mNQ#2R8WReVT}z5CRU%>>HflF_F&zoJ z5!WVSEv-zPiM|BjG%m7eS58E+_N<%)=KRol;U|v)=#XGIisW)DrTW2bN2OafSqp>| zC5seZtIfdGDS`m#8iNYKDC@3qCZca;iyRdrZwE~gXmceI#gS&5+L6*S@@XZM_=6s2 zi{ykzciUx+jF*SR4=;|qspdqB%hd3~T`-d(!d!{bnniUkWYws$CSlCiUL4!Ek1l$v zy2oLpqXA(wY}M4IVFNI)UC1GjOYTj;n+sj9vtWJ462EJ4MRG*pG9uNpL`0%L8q%B7Bs#BoSd5)=S-LrCFa zLraVqJS5Bu3qJP-B2cA;l7dW_#G+7~Hd!T9eh^{~3P*~F;>0;5qHIbddu*7cWThk# zCLmn|Sc9;O3PmK`?*;fcV3m=3q~#06ixkb)PbXwzEcpgs9N=&`cSQ5V81(pBXs!C@|n!HPAI z$X}p0%qkUt0Iz$(rO#)H?H`Sa%^wHGb=A0kSG}-7sP`EkS6hZE?R1UmPlvXGodhRP%W+wVQxd_gss7BBvb)O zX4J9~Wg#;W3l_K`kZnqC$&hUXTv#GhF$X+X=$=a zBm)JB21lS^F2Pb{kZ)=zc~M#hkKO()$IJp>)(4@Ef!S5TMS+ndtR%S%7Q_&*W=^#m z79bfC>d%ta7wUi?wm^P+fYbHcP5b{(@AOB7J?Gz}QaP+DrArD@1lS-0n07$8H%6Q0 z={U?<;F3@z4es0YIUM%WZTbB)QDm}s>LsrYpkhlTl0tf79hS%g;?0e8bgnGEDQ=l zyzT({rz#v9C1`=^5V<4!VC_`R09`2qh!uVv$~-C^pE4=-*$r(G`4t%w9~775w{OCR zRfuUFZ!L3dLl+A2<>Qy6S92oB`{yK*N~rHD1}q42#Qbu~b*pMFmP4;C{qptNPj{nK zpa9$F5j2SsbRhsQ-4a5$^-V?9=8HFQ4lz|Kz%xpL6(W)nmcXxpU|#-G^2_6+*2RM% zz3HdJPAl^5QrfSlzBNs$l+j|Y6>FqeGL}+)v*dWb*I~j>gC5mniB^{q(ur7srig*i zIN(EpdQ<6}8b%0$0wE-pqS0w=6Engjny1j{gYL5Y2w5KmA2JCL`_Es3>>GoVztWzL z1n^zYY=QlsZDRrs>m_3w@TZMDbpYuzs^KNaVCu%jy9la3jomu&}Z*M_|+}EDHkA z2A&jFiGYxq4QYvoT+};espJ)$LrmcuBBR?KL(D!2=M)qc&zfUc|}KF8a(C3WvwMHsKnjHJ1B z_e!bC%8>TOAri4DQbYoi5o5&Tgve{378)p3xqZajCTaR?#GM zs509p6iI0z#G88^DH}pKNSsWD5>!&bgv6LExm}tgX&EL}j7tP9{B{WtH^~GLNF%pu z^JTCY;Y8@?5`<8RZg3;k(G_S&MPd{U9O=mf=-{Ev?(hwgD3XLY$5-3K$p{)G;mIZU z#w=t8OOO&KRbWA3fn->W*|5#-nXY?jQd(bgb5*7(Bc$XKw8m{0$8~h>?Iy-TL1@x9V@${bO=kZxpA?55s08=O&H0673Mg_ZD)p* zk!^5;Lf{S+Y;IEo6#`2{Kuw4^R^E4lIul$-$yl)|L&O1gwIZ=;VWd&H$c?DwQDP7ABZ74K=_~ zFoe)dQUf@PF3sjQY0pmvg(V#~+)1I&sxZLYqEwp^z>#7S!brBN zD~OVm%wuN`DT=D-#x6H)Z#+qCitc1iyYlM`9duZ_k=6H(>6kE#3_;xFHf^|EZh#>I zoFF>K18?M*9spEVbDsu?=*5v$Ene7TG| zMj%5-bLLmfQXX#)v%72*glv5Q%(BQ12~&qQAvhT@F$9p0s-%h?k~)~n3ckB|xW#d= z4d}p#A4k$BtYd~Pj3T;Mh0qmnU=Aw*Kw=TO4j3dZRI0W#iWfx(QK10PAQG8cQ3Kdd zs+SXF6hMQgL>j;)Y};)vZP1K)na$Sr6p}7!jszj z&%-$VebMR8vZ?GmQhFEmWb*g5!}7^q!=Z$be!MB}mx{ol0|WMyWMD~EL*r>P4uI5& zB4S7~ML{EpAYOCyVDvOM2>IUx4qlcmgqN9A)0sGoa*>I>J*evQkQI7XBNHU4E`4=( zT4j~2sE9E;DgmhW7!1m{6D`zaJN6_Z8R#1$xkGtZlK%oACO68ctOe#QiKZ;$!(FLXfOk%089)FC_=!>ed?~;!9~3}R#i_J z+Aw>E;vFL5J}CL4;*ZO!@A$`5S7lR+i0h1wsQFibmzJ3scOo`j%kb9nbh15`4i{QV$fC-n2C_)5nT0AWMZyPO5^&;W z_6K?g2c_o&$nRVXkR+~LtYd@@72q+XD{0139A@^eI6!ciDYGUZf>kqA!&5~>QA~tQ zQ7je5#XvX-Pm-_*dMoNcWJ{2`bj0^G2vW=_P?3Wy660eMUhv{5N59HTimQj5oVRhK zN|H-qRyii4az|Yeab%@m9f&Njrm&L3BrM9>?n47xUPj8=`fJx)3tDGwk~@ziW7P?& zg|Kdsf-*-gZ6_ae;xR3H-nOI6@UE3xPI2RTEKI_)F4Q%powq9b+;g&d0^s2K%fbdz z#OEwBRa?eUe7-uDI|QG6@Dr;;dbZg;abADb?n%Msb3|%R4D9Cl)%(i*vPqFY4HpWz ze37Kqp<4HCE9S~R=2v96mA#03`n4SECAJ!lH^SOk^cxo~O_E7zRrq;1YQo11GjSqt zsU~8%U`_H;`;~~d!Y3JQ$hN>6*$kB+a)xt~#Nuf&H=}W3Z;P1DmUv=mZ5E?T2P{>x zI}$!9=BMg@4OXP2n*GBIX<;ahwBl*5h8*G&&s<-HLgpE7oMIXeEBl|~4#FgLBQrB#S>h_O;bQ6!+`(Kg+%FT{o_+P2@*l)TDuF82bt zaHfTlYToJY*-czT>w`EU*}`mXymxRLdn8ZcU_5TXTOlWd!QQQPJQD^CitGjmNs0y~ z(V=MrK!!zO5b4n2j6`tc{@O>>hamPR)5JxIfUyq*=@s;{&>#@{saD%nv`yuN(<>ES z*%bSj5I>jiU_To>jd*`93mzmQ`B^4$s1uH zc%EhL^LIN*Z;d&5q_GULl~*`(u~$K6GBGe_Qz)2_3RYGXg`r_f-~nGD^`nUsVBIB< ziQuRAwfaSEi4|SRtkj71;}P0vwVIm>hAnELg@k>Bq+z!eym)W@^+~?$kZ@s9qO=&) z)sy>#RObNp{Q9xgC5n>lF(w?MXiYsN^LQuD{Y8CF@ODawsrmc9*k|_XGBj;t4E`(i z_%=#8q{Ae!OCjf2Wipp~^MW5~G36($`cYOt3vMEL3b1gwS<*NqRT8X*DNj)r0n@dh2Xp}w&A?MVQC_pU>=Xu2*IiW!4GQw~}q#9P0 z9O%uPNUc7!V?L+$vyT6Ya7t1QBvhP2#57%v7#7L7?R_e*nfV+(SIq6HCx?vA$ttC! ztE?y0;qZo7$b3DW9OuxWE8lt?_LD0F^?a;_6)7tau>yLjCWKG9WIq~f?)h29fRc53 z{5-5pkQH9_>+697@}!+49F(pibg$kL8&6d<7qAPl4^uvj8~;|R#p zYuv?)6S%$YJ8Oz@qH5hv#17Bw7NiLU{V0~(sX!4Y&3hk9$+T%zGi8b0)9P#BJzd#f|_d-x@IV|^94Er zo@l4<0-o?b=e00WxRd-8gab>+LM4A%#6SNZ?s)YN5nK)gBlY+c{^c+AijU@Th_-OM zSs(bzB9H&3#-RF1U}o~-6-DKY7Nn%QOpF#E*Cb?Sh2R(%F^NB>0FYD3RT!j-7$^c- kK|vZ+EX)z1$wyR^br~vETki)HY5(}Uk}1N3h45S8;C^+cvH$=8 diff --git a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js index eebd714d6d..676213bd8a 100644 --- a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js +++ b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js @@ -1,80 +1,7 @@ /** -* plotly.js v1.31.2 -* Copyright 2012-2017, Plotly, Inc. +* plotly.js v1.32.0 +* Copyright 2012-2018, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.Plotly=t()}}(function(){var t;return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return i(r?r:t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;oMath.abs(e))c.rotate(o,0,0,-t*n*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":38,"mouse-change":460,"mouse-event-offset":461,"mouse-wheel":463,"right-now":511}],38:[function(t,e,r){"use strict";function n(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}function i(t){t=t||{};var e=t.eye||[0,0,1],r=t.center||[0,0,0],i=t.up||[0,1,0],l=t.distanceLimits||[0,1/0],c=t.mode||"turntable",u=a(),f=o(),h=s();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,i),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,i),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,i),new n({turntable:u,orbit:f,matrix:h},c)}e.exports=i;var a=t("turntable-camera-controller"),o=t("orbit-camera-controller"),s=t("matrix-camera-controller"),l=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+p;if((r=a-p-m[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)e=t[n],r=e.y+e.dy+p-a,r>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(v).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(m[1]-(t.length-1)*p)/e.sum(t,f)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),g.forEach(function(e){e.dy=e.value*t})}(),n();for(var o=1;t>0;--t)!function(t){function r(t){return u(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,f);n.y+=(i-u(n))*t}})})}(o*=.99),n(),function(t){function r(t){return u(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,f);n.y+=(i-u(n))*t}})})}(o),n()}function c(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}v.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),v.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function u(t){return t.y+t.dy/2}function f(t){return t.value}var h={},d=24,p=8,m=[1,1],v=[],g=[];return h.nodeWidth=function(t){return arguments.length?(d=+t,h):d},h.nodePadding=function(t){return arguments.length?(p=+t,h):p},h.nodes=function(t){return arguments.length?(v=t,h):v},h.links=function(t){return arguments.length?(g=t,h):g},h.size=function(t){return arguments.length?(m=t,h):m},h.layout=function(e){return t(),i(),a(),l(e),c(),h},h.relayout=function(){return c(),h},h.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,f=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+f+"C"+s+","+f+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},h};t.sankey=i,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":113,"d3-collection":114,"d3-interpolate":118}],40:[function(t,e,r){"use strict";function n(t){var e=s.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=a(t,new Float32Array([-1,-1,-1,4,4,-1]));e=o(t,[{buffer:n,type:t.FLOAT,size:2}]),e._triangleBuffer=n,s.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}var i="undefined"==typeof WeakMap?t("weak-map"):WeakMap,a=t("gl-buffer"),o=t("gl-vao"),s=new i;e.exports=n},{"gl-buffer":156,"gl-vao":277,"weak-map":566}],41:[function(t,e,r){function n(t,e,r){e="number"==typeof e?e:1,r=r||": ";var n=t.split(/\r?\n/),a=String(n.length+e-1).length;return n.map(function(t,n){var o=n+e,s=String(o).length;return i(o,a-s)+r+t}).join("\n")}var i=t("pad-left");e.exports=n},{"pad-left":483}],42:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;ni&&(i=t[o]),t[o]=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!d(t[o],e[o],r,n))return!1;return!0}function v(t,e,r){d(t,e,!0)&&f(t,e,r,"notDeepStrictEqual",v)}function g(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&e.call({},t)===!0}function y(t){var e;try{t()}catch(t){e=t}return e}function b(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=y(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&f(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&x.isError(i),s=!t&&i&&!r;if((o&&a&&g(i,r)||s)&&f(i,r,"Got unwanted exception"+n),t&&i&&r&&!g(i,r)||!t&&i)throw i}var x=t("util/"),_=Object.prototype.hasOwnProperty,w=Array.prototype.slice,M=function(){return"foo"===function(){}.name}(),T=e.exports=h,k=/\s*function\s+([^\(\s]*)\s*/;T.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=u(this),this.generatedMessage=!0);var e=t.stackStartFunction||f;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},x.inherits(T.AssertionError,Error),T.fail=f,T.ok=h,T.equal=function(t,e,r){t!=e&&f(t,e,r,"==",T.equal)},T.notEqual=function(t,e,r){t==e&&f(t,e,r,"!=",T.notEqual)},T.deepEqual=function(t,e,r){d(t,e,!1)||f(t,e,r,"deepEqual",T.deepEqual)},T.deepStrictEqual=function(t,e,r){d(t,e,!0)||f(t,e,r,"deepStrictEqual",T.deepStrictEqual)},T.notDeepEqual=function(t,e,r){ -d(t,e,!1)&&f(t,e,r,"notDeepEqual",T.notDeepEqual)},T.notDeepStrictEqual=v,T.strictEqual=function(t,e,r){t!==e&&f(t,e,r,"===",T.strictEqual)},T.notStrictEqual=function(t,e,r){t===e&&f(t,e,r,"!==",T.notStrictEqual)},T.throws=function(t,e,r){b(!0,t,e,r)},T.doesNotThrow=function(t,e,r){b(!1,t,e,r)},T.ifError=function(t){if(t)throw t};var A=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":556}],48:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],49:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return 3*t.length/4-n(t)}function a(t){var e,r,i,a,o,s,l=t.length;o=n(t),s=new f(3*l/4-o),i=o>0?l-4:l;var c=0;for(e=0,r=0;e>16&255,s[c++]=a>>8&255,s[c++]=255&a;return 2===o?(a=u[t.charCodeAt(e)]<<2|u[t.charCodeAt(e+1)]>>4,s[c++]=255&a):1===o&&(a=u[t.charCodeAt(e)]<<10|u[t.charCodeAt(e+1)]<<4|u[t.charCodeAt(e+2)]>>2,s[c++]=a>>8&255,s[c++]=255&a),s}function o(t){return c[t>>18&63]+c[t>>12&63]+c[t>>6&63]+c[63&t]}function s(t,e,r){for(var n,i=[],a=e;al?l:o+16383));return 1===n?(e=t[r-1],i+=c[e>>2],i+=c[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=c[e>>10],i+=c[e>>4&63],i+=c[e<<2&63],i+="="),a.push(i),a.join("")}r.byteLength=i,r.toByteArray=a,r.fromByteArray=l;for(var c=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=h.length;d0?r=r.shln(f):f<0&&(u=u.shln(-f)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":53,"./is-rat":55,"./lib/is-bn":59,"./lib/num-to-bn":60,"./lib/rationalize":61,"./lib/str-to-bn":62}],55:[function(t,e,r){"use strict";function n(t){return Array.isArray(t)&&2===t.length&&i(t[0])&&i(t[1])}var i=t("./lib/is-bn");e.exports=n},{"./lib/is-bn":59}],56:[function(t,e,r){"use strict";function n(t){return t.cmp(new i(0))}var i=t("bn.js");e.exports=n},{"bn.js":69}],57:[function(t,e,r){"use strict";function n(t){var e=t.length,r=t.words,n=0;if(1===e)n=r[0];else if(2===e)n=r[0]+67108864*r[1];else for(var n=0,i=0;i20?52:r+32}var i=t("double-bits"),a=t("bit-twiddle").countTrailingZeros;e.exports=n},{"bit-twiddle":68,"double-bits":124}],59:[function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&Boolean(t.words)}t("bn.js");e.exports=n},{"bn.js":69}],60:[function(t,e,r){"use strict";function n(t){var e=a.exponent(t);return e<52?new i(t):new i(t*Math.pow(2,52-e)).shln(e-52)}var i=t("bn.js"),a=t("double-bits");e.exports=n},{"bn.js":69,"double-bits":124}],61:[function(t,e,r){"use strict";function n(t,e){var r=a(t),n=a(e);if(0===r)return[i(0),i(1)];if(0===n)return[i(0),i(0)];n<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);return o.cmpn(1)?[t.div(o),e.div(o)]:[t,e]}var i=t("./num-to-bn"),a=t("./bn-sign");e.exports=n},{"./bn-sign":56,"./num-to-bn":60}],62:[function(t,e,r){"use strict";function n(t){return new i(t)}var i=t("bn.js");e.exports=n},{"bn.js":69}],63:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[0]),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":61}],64:[function(t,e,r){"use strict";function n(t){return i(t[0])*i(t[1])}var i=t("./lib/bn-sign");e.exports=n},{"./lib/bn-sign":56}],65:[function(t,e,r){"use strict";function n(t,e){return i(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}var i=t("./lib/rationalize");e.exports=n},{"./lib/rationalize":61}],66:[function(t,e,r){"use strict";function n(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var n=e.divmod(r),o=n.div,s=i(o),l=n.mod;if(0===l.cmpn(0))return s;if(s){var c=a(s)+4,u=i(l.shln(c).divRound(r));return s<0&&(u=-u),s+u*Math.pow(2,-c)}var f=r.bitLength()-l.bitLength()+53,u=i(l.shln(f).divRound(r));return f<1023?u*Math.pow(2,-f):(u*=Math.pow(2,-1023))*Math.pow(2,1023-f)}var i=t("./lib/bn-to-num"),a=t("./lib/ctz");e.exports=n},{"./lib/bn-to-num":57,"./lib/ctz":58}],67:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],68:[function(t,e,r){"use strict";"use restrict";function n(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.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},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=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|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],69:[function(t,e,r){!function(t,e){"use strict";function r(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function i(t,e,r){if(null!==t&&"object"==typeof t&&Array.isArray(t.words))return t;this.sign=!1,this.words=null,this.length=0,this.red=null,"le"!==e&&"be"!==e||(r=e,e=10),null!==t&&this._init(t||0,e||10,r||"be")}function a(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function o(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}function s(t,e){this.name=t,this.p=new i(e,16),this.n=this.p.bitLength(),this.k=new i(1).ishln(this.n).isub(this.p),this.tmp=this._tmp()}function l(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function c(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function u(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function f(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function h(t){if("string"==typeof t){var e=i._prime(t);this.m=e.p,this.prime=e}else this.m=t,this.prime=null}function d(t){h.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).ishln(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.sign=!0,this.minv=this.minv.mod(this.r)}"object"==typeof t?t.exports=i:e.BN=i,i.BN=i,i.wordSize=26,i.prototype._init=function(t,e,n){if("number"==typeof t)return this._initNumber(t,e,n);if("object"==typeof t)return this._initArray(t,e,n);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36),t=t.toString().replace(/\s+/g,"");var i=0;"-"===t[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.sign=!0),this.strip(),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initNumber=function(t,e,n){t<0&&(this.sign=!0,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),e,n)},i.prototype._initArray=function(t,e,n){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3){var s=t[i]|t[i-1]<<8|t[i-2]<<16;this.words[o]|=s<>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}else if("le"===n)for(var i=0,o=0;i>>26-a&67108863,a+=24,a>=26&&(a-=26,o++)}return this.strip()},i.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6){var o=a(t,r,r+6);this.words[i]|=o<>>26-n&4194303,n+=24,n>=26&&(n-=26,i++)}if(r+6!==e){var o=a(t,e,r+6);this.words[i]|=o<>>26-n&4194303}this.strip()},i.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,s=a%n,l=Math.min(a,a-s)+r,c=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.sign=!1),this},i.prototype.inspect=function(){return(this.red?""};var p=["","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"],m=[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],v=[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];i.prototype.toString=function(t,e){if(16===(t=t||10)||"hex"===t){for(var n="",i=0,e=0|e||1,a=0,o=0;o>>24-i&16777215,n=0!==a||o!==this.length-1?p[6-l.length]+l+n:l+n,i+=2,i>=26&&(i-=26,o--)}for(0!==a&&(n=a.toString(16)+n);n.length%e!=0;)n="0"+n;return this.sign&&(n="-"+n),n}if(t===(0|t)&&t>=2&&t<=36){var c=m[t],u=v[t],n="",f=this.clone();for(f.sign=!1;0!==f.cmpn(0);){var h=f.modn(u).toString(t);f=f.idivn(u),n=0!==f.cmpn(0)?p[c-h.length]+h+n:h+n}return 0===this.cmpn(0)&&(n="0"+n),this.sign&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toArray=function(t){this.strip();var e=new Array(this.byteLength());e[0]=0;var r=this.clone();if("le"!==t)for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[e.length-n-1]=i}else for(var n=0;0!==r.cmpn(0);n++){var i=r.andln(255);r.ishrn(8),e[n]=i}return e},Math.clz32?i.prototype._countBits=function(t){return 32-Math.clz32(t)}:i.prototype._countBits=function(t){var e=t,r=0;return e>=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},i.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},i.prototype.bitLength=function(){var t=0,e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(0===this.cmpn(0))return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},i.prototype.iand=function(t){this.sign=this.sign&&t.sign;var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},i.prototype.ixor=function(t){this.sign=this.sign||t.sign;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)},i.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);for(var n=t/26|0,i=t%26;this.length<=n;)this.words[this.length++]=0;return this.words[n]=e?this.words[n]|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)},i.prototype.isub=function(t){if(t.sign){t.sign=!1;var e=this.iadd(t);return t.sign=!0,e._normSign()}if(this.sign)return this.sign=!1,this.iadd(t),this.sign=!0,this._normSign();var r=this.cmp(t);if(0===r)return this.sign=!1,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=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>>26,a=67108863&r,o=Math.min(n,t.length-1),s=Math.max(0,n-this.length+1);s<=o;s++){var l=n-s,c=0|this.words[l],u=0|t.words[s],f=c*u,h=67108863&f;i=i+(f/67108864|0)|0,h=h+a|0,a=67108863&h,i=i+(h>>>26)|0}e.words[n]=a,r=i}return 0!==r?e.words[n]=r:e.length--,e.strip()},i.prototype._bigMulTo=function(t,e){e.sign=t.sign!==this.sign,e.length=this.length+t.length;for(var r=0,n=0,i=0;i>>26)|0,n+=a>>>26,a&=67108863}e.words[i]=o,r=a,a=n}return 0!==r?e.words[i]=r:e.length--,e.strip()},i.prototype.mulTo=function(t,e){return this.length+t.length<63?this._smallMulTo(t,e):this._bigMulTo(t,e)},i.prototype.mul=function(t){var e=new i(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},i.prototype.imul=function(t){if(0===this.cmpn(0)||0===t.cmpn(0))return this.words[0]=0,this.length=1,this;var e=this.length,r=t.length;this.sign=t.sign!==this.sign,this.length=this.length+t.length,this.words[this.length-1]=0;for(var n=this.length-2;n>=0;n--){for(var i=0,a=0,o=Math.min(n,r-1),s=Math.max(0,n-e+1);s<=o;s++){var l=n-s,c=this.words[l],u=t.words[s],f=c*u,h=67108863&f;i+=f/67108864|0,h+=a,a=67108863&h,i+=h>>>26}this.words[n]=a,this.words[n+1]+=i,i=0}for(var i=0,l=1;l>>26}return this.strip()},i.prototype.imuln=function(t){r("number"==typeof t);for(var e=0,n=0;n>=26,e+=i/67108864|0,e+=a>>>26,this.words[n]=67108863&a}return 0!==e&&(this.words[n]=e,this.length++),this},i.prototype.muln=function(t){return this.clone().imuln(t)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.mul(this)},i.prototype.ishln=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=67108863>>>26-e<<26-e;if(0!==e){for(var a=0,o=0;o>>26-e}a&&(this.words[o]=a,this.length++)}if(0!==n){for(var o=this.length-1;o>=0;o--)this.words[o+n]=this.words[o];for(var o=0;o=0);var i;i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o){this.length-=o;for(var c=0;c=0&&(0!==u||c>=i);c--){var f=this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip(),this},i.prototype.shln=function(t){return this.clone().ishln(t)},i.prototype.shrn=function(t){return this.clone().ishrn(t)},i.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,n=(t-e)/26,i=1<=0);var e=t%26,n=(t-e)/26;if(r(!this.sign,"imaskn works only with positive numbers"),0!==e&&n++,this.length=Math.min(n,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},i.prototype.isubn=function(t){if(r("number"==typeof t),t<0)return this.iaddn(-t);if(this.sign)return this.sign=!1,this.iaddn(t),this.sign=!0,this;this.words[0]-=t;for(var e=0;e>26)-(c/67108864|0),this.words[i+n]=67108863&l}for(;i>26,this.words[i+n]=67108863&l}if(0===s)return this.strip();r(s===-1),s=0;for(var i=0;i>26,this.words[i]=67108863&l}return this.sign=!0,this.strip()},i.prototype._wordDiv=function(t,e){var r=this.length-t.length,n=this.clone(),a=t,o=a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.shln(r),n.ishln(r),o=a.words[a.length-1]);var s,l=n.length-a.length;if("mod"!==e){s=new i(null),s.length=l+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*n.words[a.length+f]+n.words[a.length+f-1];for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(a,h,f);n.sign;)h--,n.sign=!1,n._ishlnsubmul(a,1,f),0!==n.cmpn(0)&&(n.sign=!n.sign);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.ishrn(r),{div:s?s:null,mod:n}},i.prototype.divmod=function(t,e){if(r(0!==t.cmpn(0)),this.sign&&!t.sign){var n,a,o=this.neg().divmod(t,e);return"mod"!==e&&(n=o.div.neg()),"div"!==e&&(a=0===o.mod.cmpn(0)?o.mod:t.sub(o.mod)),{div:n,mod:a}}if(!this.sign&&t.sign){var n,o=this.divmod(t.neg(),e);return"mod"!==e&&(n=o.div.neg()),{div:n,mod:o.mod}}return this.sign&&t.sign?this.neg().divmod(t.neg(),e):t.length>this.length||this.cmp(t)<0?{div:new i(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new i(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new i(this.modn(t.words[0]))}:this._wordDiv(t,e)},i.prototype.div=function(t){return this.divmod(t,"div").div},i.prototype.mod=function(t){return this.divmod(t,"mod").mod},i.prototype.divRound=function(t){var e=this.divmod(t);if(0===e.mod.cmpn(0))return e.div;var r=e.div.sign?e.mod.isub(t):e.mod,n=t.shrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:e.div.sign?e.div.isubn(1):e.div.iaddn(1)},i.prototype.modn=function(t){r(t<=67108863);for(var e=(1<<26)%t,n=0,i=this.length-1;i>=0;i--)n=(e*n+this.words[i])%t;return n},i.prototype.idivn=function(t){r(t<=67108863);for(var e=0,n=this.length-1;n>=0;n--){var i=this.words[n]+67108864*e;this.words[n]=i/t|0,e=i%t}return this.strip()},i.prototype.divn=function(t){return this.clone().idivn(t)},i.prototype.egcd=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=new i(0),l=new i(1),c=0;e.isEven()&&n.isEven();)e.ishrn(1),n.ishrn(1),++c;for(var u=n.clone(),f=e.clone();0!==e.cmpn(0);){for(;e.isEven();)e.ishrn(1),a.isEven()&&o.isEven()?(a.ishrn(1),o.ishrn(1)):(a.iadd(u).ishrn(1),o.isub(f).ishrn(1));for(;n.isEven();)n.ishrn(1),s.isEven()&&l.isEven()?(s.ishrn(1),l.ishrn(1)):(s.iadd(u).ishrn(1),l.isub(f).ishrn(1));e.cmp(n)>=0?(e.isub(n),a.isub(s),o.isub(l)):(n.isub(e),s.isub(a),l.isub(o))}return{a:s,b:l,gcd:n.ishln(c)}},i.prototype._invmp=function(t){r(!t.sign),r(0!==t.cmpn(0));var e=this,n=t.clone();e=e.sign?e.mod(t):e.clone();for(var a=new i(1),o=new i(0),s=n.clone();e.cmpn(1)>0&&n.cmpn(1)>0;){for(;e.isEven();)e.ishrn(1),a.isEven()?a.ishrn(1):a.iadd(s).ishrn(1);for(;n.isEven();)n.ishrn(1),o.isEven()?o.ishrn(1):o.iadd(s).ishrn(1);e.cmp(n)>=0?(e.isub(n),a.isub(o)):(n.isub(e),o.isub(a))}return 0===e.cmpn(1)?a:o},i.prototype.gcd=function(t){if(0===this.cmpn(0))return t.clone();if(0===t.cmpn(0))return this.clone();var e=this.clone(),r=t.clone();e.sign=!1,r.sign=!1;for(var n=0;e.isEven()&&r.isEven();n++)e.ishrn(1),r.ishrn(1);for(;;){for(;e.isEven();)e.ishrn(1);for(;r.isEven();)r.ishrn(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.ishln(n)},i.prototype.invm=function(t){return this.egcd(t).a.mod(t)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(t){return this.words[0]&t},i.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,n=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},i.prototype.cmpn=function(t){var e=t<0;if(e&&(t=-t),this.sign&&!e)return-1;if(!this.sign&&e)return 1;t&=67108863,this.strip();var r;if(this.length>1)r=1;else{var n=this.words[0];r=n===t?0:nt.length)return 1;if(this.length=0;r--){var n=this.words[r],i=t.words[r];if(n!==i){ni&&(e=1);break}}return e},i.red=function(t){return new h(t)},i.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(!this.sign,"red works only with positives"),t.convertTo(this)._forceRed(t)},i.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(t){return this.red=t,this},i.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},i.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},i.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},i.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},i.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},i.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},i.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},i.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};s.prototype._tmp=function(){var t=new i(null);return t.words=new Array(Math.ceil(this.n/13)),t},s.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),r=this.imulK(r),r=r.iadd(this.tmp),e=r.bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},s.prototype.split=function(t,e){t.ishrn(this.n,0,e)},s.prototype.imulK=function(t){return t.imul(this.k)},n(l,s),l.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}t.words[n-10]=i>>>22,t.length-=9},l.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e,r=0,n=0;n>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},i._prime=function t(e){if(g[e])return g[e];var t;if("k256"===e)t=new l;else if("p224"===e)t=new c;else if("p192"===e)t=new u;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new f}return g[e]=t,t},h.prototype._verify1=function(t){r(!t.sign,"red works only with positives"),r(t.red,"red works only with red numbers")},h.prototype._verify2=function(t,e){r(!t.sign&&!e.sign,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},h.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.mod(this.m)._forceRed(this)},h.prototype.neg=function(t){var e=t.clone();return e.sign=!e.sign,e.iadd(this.m)._forceRed(this)},h.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)},h.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},h.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)},h.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},h.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.shln(e))},h.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},h.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},h.prototype.isqr=function(t){return this.imul(t,t)},h.prototype.sqr=function(t){return this.mul(t,t)},h.prototype.sqrt=function(t){if(0===t.cmpn(0))return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var n=this.m.add(new i(1)).ishrn(2),a=this.pow(t,n);return a}for(var o=this.m.subn(1),s=0;0!==o.cmpn(0)&&0===o.andln(1);)s++,o.ishrn(1);r(0!==o.cmpn(0));var l=new i(1).toRed(this),c=l.redNeg(),u=this.m.subn(1).ishrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var h=this.pow(f,o),a=this.pow(t,o.addn(1).ishrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(l);){for(var m=d,v=0;0!==m.cmp(l);v++)m=m.redSqr();r(v=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},d.prototype.mul=function(t,e){if(0===t.cmpn(0)||0===e.cmpn(0))return new i(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).ishrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},d.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],70:[function(t,e,r){"use strict";function n(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var l,c=f.mallocDouble(2*s*a),u=f.mallocInt32(a);if((a=i(t,s,c,u))>0){if(1===s&&n)h.init(a),l=h.sweepComplete(s,r,0,a,c,u,0,a,c,u);else{var p=f.mallocDouble(2*s*o),m=f.mallocInt32(o);o=i(e,s,p,m),o>0&&(h.init(a+o),l=1===s?h.sweepBipartite(s,r,0,a,c,u,0,o,p,m):d(s,r,n,a,c,u,o,p,m),f.free(p),f.free(m))}f.free(c),f.free(u)}return l}}}function o(t,e){u.push([t,e])}function s(t){return u=[],a(t,t,o,!0),u}function l(t,e){return u=[],a(t,e,o,!1),u}function c(t,e,r){switch(arguments.length){case 1:return s(t);case 2:return"function"==typeof e?a(t,t,e,!0):l(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}}e.exports=c;var u,f=t("typedarray-pool"),h=t("./lib/sweep"),d=t("./lib/intersect")},{"./lib/intersect":73,"./lib/sweep":77,"typedarray-pool":549}],72:[function(t,e,r){"use strict";function n(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),i=["function ",n,"(",w.join(),"){","var ",c,"=2*",a,";"],l="for(var i="+u+","+p+"="+c+"*"+u+";i<"+f+";++i,"+p+"+="+c+"){var x0="+h+"["+o+"+"+p+"],x1="+h+"["+o+"+"+p+"+"+a+"],xi="+d+"[i];",M="for(var j="+m+","+b+"="+c+"*"+m+";j<"+v+";++j,"+b+"+="+c+"){var y0="+g+"["+o+"+"+b+"],"+(r?"y1="+g+"["+o+"+"+b+"+"+a+"],":"")+"yi="+y+"[j];";return t?i.push(l,_,":",M):i.push(M,_,":",l),r?i.push("if(y1"+v+"-"+m+"){"),t?(e(!0,!1),o.push("}else{"),e(!1,!1)):(o.push("if("+l+"){"),e(!0,!0),o.push("}else{"),e(!0,!1),o.push("}}else{if("+l+"){"),e(!1,!0),o.push("}else{"),e(!1,!1),o.push("}")),o.push("}}return "+r);var s=i.join("")+o.join("");return new Function(s)()}var a="d",o="ax",s="vv",l="fp",c="es",u="rs",f="re",h="rb",d="ri",p="rp",m="bs",v="be",g="bb",y="bi",b="bp",x="rv",_="Q",w=[a,o,s,u,f,h,d,m,v,g,y];r.partial=i(!1),r.full=i(!0)},{}],73:[function(t,e,r){"use strict";function n(t,e){var r=8*c.log2(e+1)*(t+1)|0,n=c.nextPow2(k*r);E.length0;){I-=1;var P=I*k,z=E[P],O=E[P+1],R=E[P+2],F=E[P+3],j=E[P+4],N=E[P+5],B=I*A,U=S[B],V=S[B+1],H=1&N,q=!!(16&N),G=l,Y=c,X=m,W=L;if(H&&(G=m,Y=L,X=l,W=c),!(2&N&&(R=_(t,z,O,R,G,Y,V),O>=R)||4&N&&(O=w(t,z,O,R,G,Y,U))>=R)){var Z=R-O,J=j-F;if(q){if(t*Z*(Z+J)=p0)&&!(p1>=hi)",["p0","p1"]),x=m("lo===p0",["p0"]),_=m("lor&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p>>1,h=2*t,d=f,p=a[h*f+e];c=b?(d=y,p=b):g>=_?(d=v,p=g):(d=x,p=_):b>=_?(d=y,p=b):_>=g?(d=v,p=g):(d=x,p=_);for(var w=h*(u-1),M=h*d,T=0;T=0&&n.push("lo=e[k+n]"),t.indexOf("hi")>=0&&n.push("hi=e[k+o]"),r.push(i.replace("_",n.join()).replace("$",t)),Function.apply(void 0,r)}e.exports=n;var i="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],76:[function(t,e,r){"use strict";function n(t,e){e<=4*h?i(0,e-1,t):f(0,e-1,t)}function i(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 c=r[l-2],u=r[l-1];if(cr[e+1])}function u(t,e,r,n){t*=2;var i=n[t];return i>1,v=m-n,g=m+n,y=d,b=v,x=m,_=g,w=p,M=t+1,T=e-1,k=0;c(y,b,r)&&(k=y,y=b,b=k),c(_,w,r)&&(k=_,_=w,w=k),c(y,x,r)&&(k=y,y=x,x=k),c(b,x,r)&&(k=b,b=x,x=k),c(y,_,r)&&(k=y,y=_,_=k),c(x,_,r)&&(k=x,x=_,_=k),c(b,w,r)&&(k=b,b=w,w=k),c(b,x,r)&&(k=b,b=x,x=k),c(_,w,r)&&(k=_,_=w,w=k);for(var A=r[2*b],E=r[2*b+1],S=r[2*_],L=r[2*_+1],C=2*y,I=2*x,D=2*w,P=2*d,z=2*m,O=2*p,R=0;R<2;++R){var F=r[C+R],j=r[I+R],N=r[D+R];r[P+R]=F,r[z+R]=j,r[O+R]=N}o(v,t,r),o(g,e,r);for(var B=M;B<=T;++B)if(u(B,A,E,r))B!==M&&a(B,M,r),++M;else if(!u(B,S,L,r))for(;;){if(u(T,S,L,r)){u(T,A,E,r)?(s(B,M,T,r),++M,--T):(a(B,T,r),--T);break}if(--T>>1;h(x,E);for(var S=0,L=0,M=0;M=d)C=C-d|0,i(v,g,L--,C);else if(C>=0)i(p,m,S--,C);else if(C<=-d){C=-C-d|0;for(var I=0;I>>1;h(x,S);for(var L=0,C=0,I=0,T=0;T>1==x[2*T+3]>>1&&(P=2,T+=1),D<0){for(var z=-(D>>1)-1,O=0;O>1)-1;0===P?i(p,m,L--,z):1===P?i(v,g,C--,z):2===P&&i(y,b,I--,z)}}}function l(t,e,r,n,o,s,l,c,u,f,v,g){var y=0,b=2*t,_=e,w=e+t,M=1,T=1;n?T=d:M=d;for(var k=o;k>>1;h(x,L);for(var C=0,k=0;k=d?(D=!n,A-=d):(D=!!n,A-=1),D)a(p,m,C++,A);else{var P=g[A],z=b*A,O=v[z+e+1],R=v[z+e+1+t];t:for(var F=0;F>>1;h(x,M);for(var T=0,y=0;y=d)p[T++]=b-d;else{b-=1;var A=u[b],E=m*b,S=c[E+e+1],L=c[E+e+1+t];t:for(var C=0;C=0;--C)if(p[C]===b){for(var z=C+1;zZ)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?f(t,e,r):"string"==typeof t?c(t,e):h(t)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function s(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}function l(t){return o(t),n(t<0?0:0|d(t))}function c(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var r=0|m(t,e),a=n(r),o=a.write(t,e);return o!==r&&(a=a.slice(0,o)),a}function u(t){for(var e=t.length<0?0:0|d(t.length),r=n(e),i=0;i=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return 0|t}function p(t){return+t!=t&&(t=0),i.alloc(+t)}function m(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(n)return U(t).length;e=(""+e).toLowerCase(),n=!0}}function v(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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function y(t,e,r,n,a){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:b(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):b(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function b(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var 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}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o239?4:a>223?3:a>191?2:1;if(i+s<=r){var l,c,u,f;switch(s){case 1:a<128&&(o=a);break;case 2:l=t[i+1],128==(192&l)&&(f=(31&a)<<6|63&l)>127&&(o=f);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(f=(15&a)<<12|(63&l)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(f=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>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 S(n)}function S(t){var e=t.length;if(e<=J)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function z(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function O(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 R(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),W.write(t,e,r,n,23,4),r+4}function F(t,e,r,n,i){return e=+e,r>>>=0,i||O(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),W.write(t,e,r,n,52,8),r+8}function j(t){if(t=N(t).replace(K,""),t.length<2)return"";for(;t.length%4!=0;)t+="=";return t}function N(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function B(t){return t<16?"0"+t.toString(16):t.toString(16)}function U(t,e){e=e||1/0;for(var r,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 V(t){for(var e=[],r=0;r>8,i=r%256,a.push(i),a.push(n);return a}function q(t){return X.toByteArray(j(t))}function G(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t){return t!==t}var X=t("base64-js"),W=t("ieee754");r.Buffer=i,r.SlowBuffer=p,r.INSPECT_MAX_BYTES=50;var Z=2147483647;r.kMaxLength=Z,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return s(t,e,r)},i.allocUnsafe=function(t){return l(t)},i.allocUnsafeSlow=function(t){return l(t)},i.isBuffer=function(t){return null!=t&&t._isBuffer===!0},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=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 x(this,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return M(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var J=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||P(t,4,this.length),W.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),W.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),W.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),W.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){z(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){z(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},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||z(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},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||z(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},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);z(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},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);z(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},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||z(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||z(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},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||z(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},i.prototype.writeFloatLE=function(t,e,r){return R(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return R(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return F(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return F(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0;){for(var u=r.pop(),s=r.pop(),f=-1,h=-1,l=o[s],p=1;p=0||(e.flip(s,u),n(t,e,r,f,s,h),n(t,e,r,s,h,f),n(t,e,r,h,u,f),n(t,e,r,u,f,h)))}}var a=t("robust-in-sphere")[4];t("binary-search-bounds");e.exports=i},{"binary-search-bounds":84,"robust-in-sphere":515}],81:[function(t,e,r){"use strict";function n(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 i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}function a(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-i){c[d]=i;for(var p=(u[d],0);p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=i))}}}var v=l;l=s,s=v,l.length=0,i=-i}var g=o(u,c,e);return r?g.concat(n.boundary):g}var l=t("binary-search-bounds");e.exports=s,n.prototype.locate=function(){var t=[0,0,0];return function(e,r,n){var a=e,o=r,s=n;return r1&&d(r[u[f-2]],r[u[f-1]],n)>0;)t.push([u[f-1],u[f-2],i]),f-=1;u.length=f,u.push(i);for(var p=c.upperIds,f=p.length;f>1&&d(r[p[f-2]],r[p[f-1]],n)<0;)t.push([p[f-2],p[f-1],i]),f-=1;p.length=f,p.push(i)}}function l(t,e){var r;return(r=t.a[0]g[0]&&l.push(new i(g,d,v,f),new i(d,g,m,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],f=0,_=l.length;f<_;++f){var w=l[f],M=w.type;M===p?s(x,b,t,w.a,w.idx):M===v?c(b,t,w):u(b,t,w)}return x}var h=t("binary-search-bounds"),d=t("robust-orientation")[3],p=0,m=1,v=2;e.exports=f},{"binary-search-bounds":84,"robust-orientation":517}],83:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),s.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},s.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},s.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],85:[function(t,e,r){"use strict";function n(t){for(var e=1,r=1;rr?r:t:te?e:t}e.exports=n},{}],89:[function(t,e,r){"use strict";function n(t){var e=x(t),r=b(y(e),t);return r<0?[e,w(e,1/0)]:r>0?[w(e,-(1/0)),e]:[e,e]}function i(t,e){for(var r=new Array(e.length),n=0;n=t.length)return o[e-t.length];var r=t[e];return[y(r[0]),y(r[1])]}for(var o=[],s=0;s=0;--s){var m=n[s],c=m[0],v=e[c],g=v[0],x=v[1],w=t[g],T=t[x];if((w[0]-T[0]||w[1]-T[1])<0){var k=g;g=x,x=k}v[0]=g;var A,E=v[1]=m[1];for(i&&(A=v[2]);s>0&&n[s-1][0]===c;){var m=n[--s],S=m[1];i?e.push([E,S,A]):e.push([E,S]),E=S}i?e.push([E,x,A]):e.push([E,x])}return o}function c(t,e,r){for(var i=t.length+e.length,a=new m(i),o=r,s=0;se[2]?1:0}function h(t,e,r){if(0!==t.length){if(e)for(var n=0;n0||d.length>0)}function p(t,e,r){var n,i=!1;if(r){n=e;for(var a=new Array(e.length),o=0;o>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return e===!1?[r,n,i,a]:[r/255,n/255,i/255,a/255]}var a=t("clamp");e.exports=n,e.exports.to=n,e.exports.from=i},{clamp:88}],92:[function(t,e,r){"use strict";e.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]}},{}],93:[function(t,e,r){(function(r){"use strict";function n(t){var e,n,l=[],c=1;if("string"==typeof t)if(i[t])l=i[t].slice(),n="rgb";else if("transparent"===t)c=0,n="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1),f=u.length,h=f<=4;c=1,h?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===f&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===f&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),n="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var d=e[1],u=d.replace(/a$/,"");n=u;var f="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===f?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==s[t])return s[t]}return parseFloat(t)}),d===u&&l.push(1),c=void 0===l[f]?1:l[f],l=l.slice(0,f)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),n=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)n="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(a(t)){var p=o(t.r,t.red,t.R,null);null!==p?(n="rgb",l=[p,o(t.g,t.green,t.G),o(t.b,t.blue,t.B)]):(n="hsl",l=[o(t.h,t.hue,t.H),o(t.s,t.saturation,t.S),o(t.l,t.lightness,t.L,t.b,t.brightness)]),c=o(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],n="rgb",c=4===t.length?t[3]:1);return{space:n,values:l,alpha:c}}var i=t("color-name"),a=t("is-plain-obj"),o=t("defined");e.exports=n;var s={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":92,defined:122,"is-plain-obj":304}],94:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t,e){if(Array.isArray(t))return t;null==e&&(e=!0);var r=n(t);if(!r.space)return[];var o,s=r.values,l=s.length;for(o=0;o1&&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[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),e=Math.min(60*e,360),e<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":96}],96:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],97:[function(t,e,r){e.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]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,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]}]}},{}],98:[function(t,e,r){"use strict";function n(t){var e,r,n,c,u,f,h,d,p,m,v;if(t||(t={}),d=(t.nshades||72)-1,h=t.format||"hex",f=t.colormap,f||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!s[f])throw Error(f+" not a supported colorscale");u=s[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);u=f.slice()}if(u.length>d)throw new Error(f+" map requires nshades to be at least size "+u.length);m=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=u.map(function(t){return Math.round(t.index*d)}),m[0]=Math.min(Math.max(m[0],0),1),m[1]=Math.min(Math.max(m[1],0),1);var g=u.map(function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1?n:(n[3]=m[0]+(m[1]-m[0])*r,n)}),p=[];for(v=0;v=0}function i(t,e,r,i){var s=a(e,r,i);if(0===s){var l=o(a(t,e,r)),c=o(a(t,e,i));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,i)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,i)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:o(c-l)}var f=a(t,e,r);return f>0?s>0&&a(t,e,i)>0?1:-1:f<0?s>0||a(t,e,i)>0?1:-1:a(t,e,i)>0?1:n(t,e,r)?1:-1}e.exports=i;var a=t("robust-orientation"),o=t("signum"),s=t("two-sum"),l=t("robust-product"),c=t("robust-sum")},{"robust-orientation":517,"robust-product":518,"robust-sum":522,signum:524,"two-sum":548}],100:[function(t,e,r){function n(t,e){return t-e}function i(t,e){var r=t.length,i=t.length-e.length;if(i)return i;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||a(t[0],t[1])-a(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(i=o+t[2]-(s+e[2]))return i;var l=a(t[0],t[1]),c=a(e[0],e[1]);return a(l,t[2])-a(c,e[2])||a(l+t[2],o)-a(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],v=e[2],g=e[3];return u+f+h+d-(p+m+v+g)||a(u,f,h,d)-a(p,m,v,g,p)||a(u+f,u+h,u+d,f+h,f+d,h+d)-a(p+m,p+v,p+g,m+v,m+g,v+g)||a(u+f+h,u+f+d,u+h+d,f+h+d)-a(p+m+v,p+m+g,p+v+g,m+v+g);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}e.exports=n},{}],104:[function(t,e,r){"use strict";function n(t){var e=i(t),r=e.length;if(r<=2)return[];for(var n=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}function a(t,e){try{return o(t,!0)}catch(c){var r=s(t);if(r.length<=e)return[];var a=n(t,r),l=o(a,!0);return i(l,r)}}e.exports=a;var o=t("incremental-convex-hull"),s=t("affine-hull")},{"affine-hull":42,"incremental-convex-hull":296}],106:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],107:[function(t,e,r){function n(t){return t=Math.round(t),t<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r=parseInt(e.substr(1),16);return r>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(i!==-1&&l+1===e.length){var u=e.substr(0,i),f=e.substr(i+1,l-(i+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=o(f[1]),m=o(f[2]),v=m<=.5?m*(p+1):m+p-m*p,g=2*m-v;return[n(255*s(g,v,d+1/3)),n(255*s(g,v,d)),n(255*s(g,v,d-1/3)),h];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],108:[function(t,e,r){"use strict";function n(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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}function i(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=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]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n}e.exports=i,e.exports.derivative=n},{}],109:[function(t,e,r){"use strict";function n(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1}function i(t){var e=new n;e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===o)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===o){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===o){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,a(e)}var a=t("./lib/thunk.js");e.exports=i},{"./lib/thunk.js":111}],110:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r,i){for(var a=e.length,o=r.arrayArgs.length,s=r.blockSize,l=r.indexArgs.length>0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(var u=0;u0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}function l(t,e){for(var r=e[1].length-Math.abs(t.arrayBlockIndices[0])|0,l=new Array(t.arrayArgs.length),u=new Array(t.arrayArgs.length),f=0;f0&&_.push("shape=SS.slice(0)"),t.indexArgs.length>0){for(var w=new Array(r),f=0;f3&&x.push(o(t.pre,t,u));var A=o(t.body,t,u),E=a(v);E3&&x.push(o(t.post,t,u)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+x.join("\n")+"\n----------");var S=[t.funcName||"unnamed","_cwise_loop_",l[0].join("s"),"m",E,s(u)].join("");return new Function(["function ",S,"(",b.join(","),"){",x.join("\n"),"} return ",S].join(""))()}var c=t("uniq");e.exports=l},{uniq:551}],111:[function(t,e,r){"use strict";function n(t){var e=["'use strict'","var CACHED={}"],r=[],n=t.funcName+"_cwise_thunk";e.push(["return function ",n,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex-->0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}"));for(var u=0;u=0?(a>=T?10:a>=k?5:a>=A?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=T?10:a>=k?5:a>=A?2:1)}function i(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=T?i*=10:a>=k?i*=5:a>=A&&(i*=2),ee?1:t>=e?0:NaN},s=function(t){return 1===t.length&&(t=e(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},l=s(o),c=l.right,u=l.left,f=function(t,e){null==e&&(e=r);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);nt?1:e>=t?0:NaN},p=function(t){return null===t?NaN:+t},m=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},v=function(t,e){var r=m(t,e);return r?Math.sqrt(r):r},g=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i0)return[t];if((i=e0)for(t=Math.ceil(t/s),e=Math.floor(e/s),o=new Array(a=Math.ceil(e-t+1));++lh;)d.pop(),--p;var m,v=new Array(p+1);for(a=0;a<=p;++a)m=v[a]=[],m.x0=a>0?d[a-1]:f,m.x1=a=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},I=function(t,e,r){return t=x.call(t,p).sort(o),Math.ceil((r-e)/(2*(C(t,.75)-C(t,.25))*Math.pow(t.length,-1/3)))},D=function(t,e,r){return Math.ceil((r-e)/(3.5*v(t)*Math.pow(t.length,-1/3)))},P=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},z=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r},F=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},j=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},N=function(t,e){if(r=t.length){var r,n,i=0,a=0,s=t[a];for(null==e&&(e=o);++i=u.length)return null!=s&&e.sort(s),null!=l?l(e):e;for(var o,c,f,h=-1,d=e.length,p=u[n++],m=r(),v=i();++hu.length)return t;var n,i=f[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],f=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return f[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},u=r.prototype;s.prototype=l.prototype={constructor:s,has:u.has,add:function(t){return t+="",this["$"+t]=t,this},remove:u.remove,clear:u.clear,values:u.keys,size:u.size,empty:u.empty,each:u.each};var f=function(t){var e=[];for(var r in t)e.push(r);return e},h=function(t){var e=[];for(var r in t)e.push(t[r]);return e},d=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e};t.nest=c,t.set=l,t.map=r,t.keys=f,t.values=h,t.entries=d,Object.defineProperty(t,"__esModule",{value:!0})})},{}],115:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=I.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=D.exec(t))?i(parseInt(e[1],16)):(e=P.exec(t))?new l(e[1],e[2],e[3],1):(e=z.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=O.exec(t))?a(e[1],e[2],e[3],e[4]):(e=R.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=F.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=j.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):N.hasOwnProperty(t)?i(N[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new h(t,e,r,n)}function u(t){if(t instanceof h)return new h(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new h;if(t instanceof h)return t;t=t.rgb();var e=t.r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new h(l,c,u,t.opacity)}function f(t,e,r,n){return 1===arguments.length?u(t):new h(t,e,r,null==n?1:n)}function h(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function d(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function p(t){if(t instanceof v)return new v(t.l,t.a,t.b,t.opacity);if(t instanceof M){var e=t.h*B;return new v(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/V),s=g((.2126729*r+.7151522*n+.072175*i)/H);return new v(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/q)),t.opacity)}function m(t,e,r,n){return 1===arguments.length?p(t):new v(t,e,r,null==n?1:n)}function v(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>W?Math.pow(t,1/3):t/X+G}function y(t){return t>Y?t*t*t:X*(t-G)}function b(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function _(t){if(t instanceof M)return new M(t.h,t.c,t.l,t.opacity);t instanceof v||(t=p(t));var e=Math.atan2(t.b,t.a)*U;return new M(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}function w(t,e,r,n){return 1===arguments.length?_(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function T(t){if(t instanceof A)return new A(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(rt*n+tt*e-et*r)/(rt+tt-et),a=n-i,s=($*(r-i)-K*a)/Q,c=Math.sqrt(s*s+a*a)/($*i*(1-i)),u=c?Math.atan2(s,a)*U-120:NaN;return new A(u<0?u+360:u,c,i,t.opacity)}function k(t,e,r,n){return 1===arguments.length?T(t):new A(t,e,r,null==n?1:n)}function A(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var E=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},S="\\s*([+-]?\\d+)\\s*",L="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",C="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",I=/^#([0-9a-f]{3})$/,D=/^#([0-9a-f]{6})$/,P=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),z=new RegExp("^rgb\\("+[C,C,C]+"\\)$"),O=new RegExp("^rgba\\("+[S,S,S,L]+"\\)$"),R=new RegExp("^rgba\\("+[C,C,C,L]+"\\)$"),F=new RegExp("^hsl\\("+[L,C,C]+"\\)$"),j=new RegExp("^hsla\\("+[L,C,C,L]+"\\)$"),N={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};E(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),E(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return t=isNaN(t)?1:Math.max(0,Math.min(1,t)),(1===t?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),E(h,f,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new h(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new h(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(d(t>=240?t-240:t+120,i,n),d(t,i,n),d(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var B=Math.PI/180,U=180/Math.PI,V=.95047,H=1,q=1.08883,G=4/29,Y=6/29,X=3*Y*Y,W=Y*Y*Y;E(v,m,e(r,{brighter:function(t){return new v(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new v(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=H*y(t),e=V*y(e),r=q*y(r),new l(b(3.2404542*e-1.5371385*t-.4985314*r),b(-.969266*e+1.8760108*t+.041556*r),b(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),E(M,w,e(r,{brighter:function(t){return new M(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new M(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return p(this).rgb()}}));var Z=-.14861,J=1.78277,K=-.29227,Q=-.90649,$=1.97294,tt=$*Q,et=$*J,rt=J*K-Q*Z;E(A,k,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new A(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new A(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*B,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(Z*n+J*i)),255*(e+r*(K*n+Q*i)),255*(e+r*($*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=f,t.lab=m,t.hcl=w,t.cubehelix=k,Object.defineProperty(t,"__esModule",{value:!0})})},{}],116:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}function i(t,e){for(var r,n=0,i=t.length;n0)for(var r,n,i=new Array(r),a=0;ah+s||np+s||if.index){var l=h-a.x-a.vx,u=p-a.y-a.vy,g=l*l+u*u;gt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e1?(null==e?p.remove(t):p.set(t,s(e)),l):p.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},b=function(){function t(t){var r,l=a.length,f=e.quadtree(a,c,u).visitAfter(n);for(s=t,r=0;r=m)){(t.data!==o||t.next)&&(0===i&&(i=d(),u+=i*i),0===a&&(a=d(),u+=a*a),u180||r<-180?r-360*Math.round(r/360):r):E(isNaN(t)?e:t)}function o(t){return 1==(t=+t)?s:function(e,r){return r-e?i(e,r,t):E(isNaN(e)?r:e)}}function s(t,e){var r=e-t;return r?n(t,r):E(isNaN(t)?e:t)}function l(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:P(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}function s(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:P(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}function l(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:P(t,r)},{i:s-2,x:P(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}return function(e,r){var n=[],i=[];return e=t(e),r=t(r),a(e.translateX,e.translateY,r.translateX,r.translateY,n,i),o(e.rotate,r.rotate,n,i),s(e.skewX,r.skewX,n,i),l(e.scaleX,e.scaleY,r.scaleX,r.scaleY,n,i),e=r=null,function(t){for(var e,r=-1,a=i.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(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:P(r,n)})),a=R.lastIndex;return a=(a=(m+g)/2))?m=a:g=a,(u=r>=(o=(v+y)/2))?v=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+g)/2))?m=a:g=a,(u=r>=(o=(v+y)/2))?v=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}function r(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-(1/0),h=-(1/0);for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},f=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},h=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},d=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},p=function(t,e,r){var n,i,a,o,s,l,c,u=this._x0,f=this._y0,h=this._x1,p=this._y1,m=[],v=this._root;for(v&&m.push(new d(v,u,f,h,p)),null==r?r=1/0:(u=t-r,f=e-r,h=t+r,p=e+r,r*=r);l=m.pop();)if(!(!(v=l.node)||(i=l.x0)>h||(a=l.y0)>p||(o=l.x1)=y)<<1|t>=g)&&(l=m[m.length-1],m[m.length-1]=m[m.length-1-c],m[m.length-1-c]=l)}else{var b=t-+this._x.call(null,v.data),x=e-+this._y.call(null,v.data),_=b*b+x*x;if(_=(s=(p+v)/2))?p=s:v=s,(u=o>=(l=(m+g)/2))?m=l:g=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},v=function(){return this._root},g=function(){var t=0 -;return this.visit(function(e){if(!e.length)do{++t}while(e=e.next)}),t},y=function(t){var e,r,n,i,a,o,s=[],l=this._root;for(l&&s.push(new d(l,this._x0,this._y0,this._x1,this._y1));e=s.pop();)if(!t(l=e.node,n=e.x0,i=e.y0,a=e.x1,o=e.y1)&&l.length){var c=(n+a)/2,u=(i+o)/2;(r=l[3])&&s.push(new d(r,c,u,a,o)),(r=l[2])&&s.push(new d(r,n,u,c,o)),(r=l[1])&&s.push(new d(r,c,i,a,u)),(r=l[0])&&s.push(new d(r,n,i,c,u))}return this},b=function(t){var e,r=[],n=[];for(this._root&&r.push(new d(this._root,this._x0,this._y0,this._x1,this._y1));e=r.pop();){var i=e.node;if(i.length){var a,o=e.x0,s=e.y0,l=e.x1,c=e.y1,u=(o+l)/2,f=(s+c)/2;(a=i[0])&&r.push(new d(a,o,s,u,f)),(a=i[1])&&r.push(new d(a,u,s,l,f)),(a=i[2])&&r.push(new d(a,o,f,u,c)),(a=i[3])&&r.push(new d(a,u,f,l,c))}n.push(e)}for(;e=n.pop();)t(e.node,e.x0,e.y0,e.x1,e.y1);return this},x=function(t){return arguments.length?(this._x=t,this):this._x},_=function(t){return arguments.length?(this._y=t,this):this._y},w=o.prototype=s.prototype;w.copy=function(){var t,e,r=new s(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=l(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=l(e));return r},w.add=c,w.addAll=r,w.cover=u,w.data=f,w.extent=h,w.find=p,w.remove=m,w.removeAll=n,w.root=v,w.size=g,w.visit=y,w.visitAfter=b,w.x=x,w.y=_,t.quadtree=o,Object.defineProperty(t,"__esModule",{value:!0})})},{}],120:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.d3=e.d3||{})}(this,function(t){"use strict";function e(){return g||(x(r),g=b.now()+y)}function r(){g=0}function n(){this._call=this._time=this._next=null}function i(t,e,r){var i=new n;return i.restart(t,e,r),i}function a(){e(),++h;for(var t,r=u;r;)(t=g-r._time)>=0&&r._call.call(null,t),r=r._next;--h}function o(){g=(v=b.now())+y,h=d=0;try{a()}finally{h=0,l(),g=0}}function s(){var t=b.now(),e=t-v;e>m&&(y-=e,v=t)}function l(){for(var t,e,r=u,n=1/0;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:u=e);f=t,c(n)}function c(t){if(!h){d&&(d=clearTimeout(d));t-g>24?(t<1/0&&(d=setTimeout(o,t-b.now()-y)),p&&(p=clearInterval(p))):(p||(v=b.now(),p=setInterval(s,m)),h=1,x(o))}}var u,f,h=0,d=0,p=0,m=1e3,v=0,g=0,y=0,b="object"==typeof performance&&performance.now?performance:Date,x="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||f===this||(f?f._next=this:u=this,f=this),this._call=t,this._time=n,c()},stop:function(){this._call&&(this._call=null,this._time=1/0,c())}};var _=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},w=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=_,t.interval=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],121:[function(e,r,n){!function(){function e(t){return t&&(t.ownerDocument||t.document||t).documentElement}function n(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function i(t,e){return te?1:t>=e?0:NaN}function a(t){return null===t?NaN:+t}function o(t){return!isNaN(t)}function s(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}}}function l(t){return t.length}function c(t){for(var e=1;t*e%1;)e*=10;return e}function u(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function f(){this._=Object.create(null)}function h(t){return(t+="")===_o||t[0]===wo?wo+t:t}function d(t){return(t+="")[0]===wo?t.slice(1):t}function p(t){return h(t)in this._}function m(t){return(t=h(t))in this._&&delete this._[t]}function v(){var t=[];for(var e in this._)t.push(d(e));return t}function g(){var t=0;for(var e in this._)++t;return t}function y(){for(var t in this._)return!1;return!0}function b(){this._=Object.create(null)}function x(t){return t}function _(t,e,r){return function(){var n=r.apply(e,arguments);return n===e?t:n}}function w(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=Mo.length;r=e&&(e=i+1);!(o=s[e])&&++e0&&(t=t.slice(0,s));var c=Po.get(t);return c&&(t=c,l=J),s?e?i:n:e?M:a}function Z(t,e){return function(r){var n=co.event;co.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{co.event=n}}}function J(t,e){var r=Z(t,e);return function(t){var e=this,n=t.relatedTarget;n&&(n===e||8&n.compareDocumentPosition(e))||r.call(e,t)}}function K(t){var r=".dragsuppress-"+ ++Oo,i="click"+r,a=co.select(n(t)).on("touchmove"+r,A).on("dragstart"+r,A).on("selectstart"+r,A);if(null==zo&&(zo=!("onselectstart"in t)&&w(t.style,"userSelect")),zo){var o=e(t).style,s=o[zo];o[zo]="none"}return function(t){if(a.on(r,null),zo&&(o[zo]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){A(),e()},!0),setTimeout(e,0)}}}function Q(t,e){e.changedTouches&&(e=e.changedTouches[0]);var r=t.ownerSVGElement||t;if(r.createSVGPoint){var i=r.createSVGPoint();if(Ro<0){var a=n(t);if(a.scrollX||a.scrollY){r=co.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Ro=!(o.f||o.e),r.remove()}}return Ro?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function $(){return co.event.changedTouches[0].identifier}function tt(t){return t>0?1:t<0?-1:0}function et(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function rt(t){return t>1?0:t<-1?No:Math.acos(t)}function nt(t){return t>1?Vo:t<-1?-Vo:Math.asin(t)}function it(t){return((t=Math.exp(t))-1/t)/2}function at(t){return((t=Math.exp(t))+1/t)/2}function ot(t){return((t=Math.exp(2*t))-1)/(t+1)}function st(t){return(t=Math.sin(t/2))*t}function lt(){}function ct(t,e,r){return this instanceof ct?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof ct?new ct(t.h,t.s,t.l):Mt(""+t,Tt,ct):new ct(t,e,r)}function ut(t,e,r){function n(t){return t>360?t-=360:t<0&&(t+=360),t<60?a+(o-a)*t/60:t<180?o:t<240?a+(o-a)*(240-t)/60:a}function i(t){return Math.round(255*n(t))}var a,o;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,o=r<=.5?r*(1+e):r+e-r*e,a=2*r-o,new bt(i(t+120),i(t),i(t-120))}function ft(t,e,r){return this instanceof ft?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof ft?new ft(t.h,t.c,t.l):t instanceof dt?mt(t.l,t.a,t.b):mt((t=kt((t=co.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new ft(t,e,r)}function ht(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new dt(r,Math.cos(t*=Ho)*e,Math.sin(t)*e)}function dt(t,e,r){return this instanceof dt?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof dt?new dt(t.l,t.a,t.b):t instanceof ft?ht(t.h,t.c,t.l):kt((t=bt(t)).r,t.g,t.b):new dt(t,e,r)}function pt(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=vt(i)*Qo,n=vt(n)*$o,a=vt(a)*ts,new bt(yt(3.2404542*i-1.5371385*n-.4985314*a),yt(-.969266*i+1.8760108*n+.041556*a),yt(.0556434*i-.2040259*n+1.0572252*a))}function mt(t,e,r){return t>0?new ft(Math.atan2(r,e)*qo,Math.sqrt(e*e+r*r),t):new ft(NaN,NaN,t)}function vt(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function gt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function yt(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function bt(t,e,r){return this instanceof bt?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof bt?new bt(t.r,t.g,t.b):Mt(""+t,bt,ut):new bt(t,e,r)}function xt(t){return new bt(t>>16,t>>8&255,255&t)}function _t(t){return xt(t)+""}function wt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function Mt(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(Et(i[0]),Et(i[1]),Et(i[2]))}return(a=ns.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 Tt(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 ct(n,i,l)}function kt(t,e,r){t=At(t),e=At(e),r=At(r);var n=gt((.4124564*t+.3575761*e+.1804375*r)/Qo),i=gt((.2126729*t+.7151522*e+.072175*r)/$o);return dt(116*i-16,500*(n-i),200*(i-gt((.0193339*t+.119192*e+.9503041*r)/ts)))}function At(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Et(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function St(t){return"function"==typeof t?t:function(){return t}}function Lt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Ct(e,r,t,n)}}function Ct(t,e,r,n){function i(){var t,e=l.status;if(!e&&Dt(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=co.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=co.event;co.event=t;try{o.progress.call(a,l)}finally{co.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(fo(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},co.rebind(a,o,"on"),null==n?a:a.get(It(n))}function It(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}function Dt(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}function Pt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i=r+e,a={c:t,t:i,n:null};return as?as.n=a:is=a,as=a,os||(ss=clearTimeout(ss),os=1,ls(zt)),a}function zt(){var t=Ot(),e=Rt()-t;e>24?(isFinite(e)&&(clearTimeout(ss),ss=setTimeout(zt,e)),os=0):(os=1,ls(zt))}function Ot(){for(var t=Date.now(),e=is;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function Rt(){for(var t,e=is,r=1/0;e;)e.c?(e.t8?function(t){return t/r}:function(t){return t*r},symbol:t}}function Nt(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:x;return function(t){var r=us.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],f=r[7],h=r[8],d=r[9],p=1,m="",v="",g=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,v="%",d="f";break;case"p":p=100,v="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":g=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],v=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=fs.get(d)||Bt;var b=c&&f;return function(t){var r=v;if(g&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=co.formatPrefix(t,h);t=l.scale(t),r=l.symbol+v}else t*=p;t=d(t,h);var x,_,w=t.lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(x=t,_=""):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(x=a(x,1/0));var T=m.length+x.length+_.length+(b?0:i.length),k=T"===o?k+i+t:"^"===o?k.substring(0,T>>=1)+i+t+k.substring(T):i+(b?t:k+t))+r}}}function Bt(t){return t+""}function Ut(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Vt(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=L[o in ms?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}function n(t,e,r){w.lastIndex=0;var n=w.exec(e.slice(r));return n?(t.w=M.get(n[0].toLowerCase()),r+n[0].length):-1}function i(t,e,r){x.lastIndex=0;var n=x.exec(e.slice(r));return n?(t.w=_.get(n[0].toLowerCase()),r+n[0].length):-1}function a(t,e,r){A.lastIndex=0;var n=A.exec(e.slice(r));return n?(t.m=E.get(n[0].toLowerCase()),r+n[0].length):-1}function o(t,e,r){T.lastIndex=0;var n=T.exec(e.slice(r));return n?(t.m=k.get(n[0].toLowerCase()),r+n[0].length):-1}function s(t,e,n){return r(t,S.c.toString(),e,n)}function l(t,e,n){return r(t,S.x.toString(),e,n)}function c(t,e,n){return r(t,S.X.toString(),e,n)}function u(t,e,r){var n=b.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)}var f=t.dateTime,h=t.date,d=t.time,p=t.periods,m=t.days,v=t.shortDays,g=t.months,y=t.shortMonths;e.utc=function(t){function r(t){try{ds=Ut;var e=new ds;return e._=t,n(e)}finally{ds=Date}}var n=e(t);return r.parse=function(t){try{ds=Ut;var e=n.parse(t);return e&&e._}finally{ds=Date}},r.toString=n.toString,r},e.multi=e.utc.multi=ue;var b=co.map(),x=Yt(m),_=Xt(m),w=Yt(v),M=Xt(v),T=Yt(g),k=Xt(g),A=Yt(y),E=Xt(y);p.forEach(function(t,e){b.set(t.toLowerCase(),e)});var S={a:function(t){return v[t.getDay()]},A:function(t){return m[t.getDay()]},b:function(t){return y[t.getMonth()]},B:function(t){return g[t.getMonth()]},c:e(f),d:function(t,e){return Gt(t.getDate(),e,2)},e:function(t,e){return Gt(t.getDate(),e,2)},H:function(t,e){return Gt(t.getHours(),e,2)},I:function(t,e){return Gt(t.getHours()%12||12,e,2)},j:function(t,e){return Gt(1+hs.dayOfYear(t),e,3)},L:function(t,e){return Gt(t.getMilliseconds(),e,3)},m:function(t,e){return Gt(t.getMonth()+1,e,2)},M:function(t,e){return Gt(t.getMinutes(),e,2)},p:function(t){return p[+(t.getHours()>=12)]},S:function(t,e){return Gt(t.getSeconds(),e,2)},U:function(t,e){return Gt(hs.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Gt(hs.mondayOfYear(t),e,2)},x:e(h),X:e(d),y:function(t,e){return Gt(t.getFullYear()%100,e,2)},Y:function(t,e){return Gt(t.getFullYear()%1e4,e,4)},Z:le,"%":function(){return"%"}},L={a:n,A:i,b:a,B:o,c:s,d:re,e:re,H:ie,I:ie,j:ne,L:se,m:ee,M:ae,p:u,S:oe,U:Zt,w:Wt,W:Jt,x:l,X:c,y:Qt,Y:Kt,Z:$t,"%":ce};return e}function Gt(t,e,r){var n=t<0?"-":"",i=(n?-t:t)+"",a=i.length;return n+(a68?1900:2e3)}function ee(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function re(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function ne(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function ie(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function ae(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function oe(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function se(t,e,r){vs.lastIndex=0;var n=vs.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function le(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=xo(e)/60|0,i=xo(e)%60;return r+Gt(n,"0",2)+Gt(i,"0",2)}function ce(t,e,r){gs.lastIndex=0;var n=gs.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function ue(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,f=i*l+u*Math.cos(s),h=u*o*Math.sin(s);Ms.add(Math.atan2(h,f)),n=t,i=l,a=c}var e,r,n,i,a;Ts.point=function(o,s){Ts.point=t,n=(e=o)*Ho,i=Math.cos(s=(r=s)*Ho/2+No/4),a=Math.sin(s)},Ts.lineEnd=function(){t(e,r)}}function ge(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ye(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function be(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function xe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function _e(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function we(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Me(t){return[Math.atan2(t[1],t[0]),nt(t[2])]}function Te(t,e){return xo(t[0]-e[0])=0;--s)i.point((f=u[s])[0],f[1])}else n(d.x,d.p.x,-1,i);d=d.p}d=d.o,u=d.z,p=!p}while(!d.v);i.lineEnd()}}}function Pe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(Re))}var d,p,m,v=e(a),g=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=co.merge(d);var t=Ve(g,p);d.length?(_||(a.polygonStart(),_=!0),De(d,je,t,r,a)):t&&(_||(a.polygonStart(),_=!0),a.lineStart(),r(null,null,1,a),a.lineEnd()),_&&(a.polygonEnd(),_=!1),d=p=null},sphere:function(){a.polygonStart(),a.lineStart(),r(null,null,1,a),a.lineEnd(),a.polygonEnd()}},b=Fe(),x=e(b),_=!1;return y}}function Re(t){return t.length>1}function Fe(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:M,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function je(t,e){return((t=t.x)[0]<0?t[1]-Vo-Fo:Vo-t[1])-((e=e.x)[0]<0?e[1]-Vo-Fo:Vo-e[1])}function Ne(t){var e,r=NaN,n=NaN,i=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(a,o){var s=a>0?No:-No,l=xo(a-r);xo(l-No)0?Vo:-Vo),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=No&&(xo(r-i)Fo?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}function Ue(t,e,r,n){var i;if(null==t)i=r*Vo,n.point(-No,i),n.point(0,i),n.point(No,i),n.point(No,0),n.point(No,-i),n.point(0,-i),n.point(-No,-i),n.point(-No,0),n.point(-No,i);else if(xo(t[0]-e[0])>Fo){var a=t[0]=0?1:-1,M=w*_,T=M>No,k=p*b;if(Ms.add(Math.atan2(k*w*Math.sin(M),m*x+k*Math.cos(M))),a+=T?_+w*Bo:_,T^h>=r^g>=r){var A=be(ge(f),ge(t));we(A);var E=be(i,A);we(E);var S=(T^_>=0?-1:1)*nt(E[2]);(n>S||n===S&&(A[0]||A[1]))&&(o+=T^_>=0?1:-1)}if(!v++)break;h=g,p=b,m=x,f=t}}return(a<-Fo||aa}function r(t){var r,a,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=e(f,h),v=o?m?0:i(f,h):m?i(f+(f<0?No:-No),h):0;if(!r&&(c=l=m)&&t.lineStart(),m!==l&&(d=n(r,p),(Te(r,d)||Te(p,d))&&(p[0]+=Fo,p[1]+=Fo,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=n(p,r),t.point(d[0],d[1])):(d=n(r,p),t.point(d[0],d[1]),t.lineEnd()),r=d;else if(s&&r&&o^m){var g;v&a||!(g=n(p,r,!0))||(u=0,o?(t.lineStart(),t.point(g[0][0],g[0][1]),t.point(g[1][0],g[1][1]),t.lineEnd()):(t.point(g[1][0],g[1][1]),t.lineEnd(),t.lineStart(),t.point(g[0][0],g[0][1])))}!m||r&&Te(r,p)||t.point(p[0],p[1]),r=p,l=m,a=v},lineEnd:function(){l&&t.lineEnd(),r=null},clean:function(){return u|(c&&l)<<1}}}function n(t,e,r){var n=ge(t),i=ge(e),o=[1,0,0],s=be(n,i),l=ye(s,s),c=s[0],u=l-c*c;if(!u)return!r&&t;var f=a*l/u,h=-a*c/u,d=be(o,s),p=_e(o,f);xe(p,_e(s,h));var m=d,v=ye(p,m),g=ye(m,m),y=v*v-g*(ye(p,p)-1);if(!(y<0)){var b=Math.sqrt(y),x=_e(m,(-v-b)/g);if(xe(x,p),x=Me(x),!r)return x;var _,w=t[0],M=e[0],T=t[1],k=e[1];M0^x[1]<(xo(x[0]-w)No^(w<=x[0]&&x[0]<=M)){var L=_e(m,(-v+b)/g);return xe(L,p),[x,Me(L)]}}}function i(e,r){var n=o?t:No-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var a=Math.cos(t),o=a>0,s=xo(a)>Fo;return Oe(e,r,vr(t,6*Ho),o?[0,-t]:[-No,t-No])}function qe(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=s.x,f=s.y,h=0,d=1,p=u-l,m=f-c;if(a=t-l,p||!(a>0)){if(a/=p,p<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-l,p||!(a<0)){if(a/=p,p<0){if(a>d)return;a>h&&(h=a)}else if(p>0){if(a0)){if(a/=m,m<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=n-c,m||!(a<0)){if(a/=m,m<0){if(a>d)return;a>h&&(h=a)}else if(m>0){if(a0&&(i.a={x:l+h*p,y:c+h*m}),d<1&&(i.b={x:l+d*p,y:c+d*m}),i}}}}}}function Ge(t,e,r,n){function i(n,i){return xo(n[0]-t)0?0:3:xo(n[0]-r)0?2:1:xo(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(t){for(var e=0,r=v.length,n=t[1],i=0;in&&et(c,a,t)>0&&++e:a[1]<=n&&et(c,a,t)<0&&--e,c=a;return 0!==e}function c(a,s,l,c){var u=0,f=0;if(null==a||(u=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==f);else c.point(s[0],s[1])}function u(i,a){ -return t<=i&&i<=r&&e<=a&&a<=n}function f(t,e){u(t,e)&&s.point(t,e)}function h(){L.point=p,v&&v.push(g=[]),T=!0,M=!1,_=w=NaN}function d(){m&&(p(y,b),x&&M&&E.rejoin(),m.push(E.buffer())),L.point=f,M&&s.lineEnd()}function p(t,e){t=Math.max(-js,Math.min(js,t)),e=Math.max(-js,Math.min(js,e));var r=u(t,e);if(v&&g.push([t,e]),T)y=t,b=e,x=r,T=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&M)s.point(t,e);else{var n={a:{x:_,y:w},b:{x:t,y:e}};S(n)?(M||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),k=!1):r&&(s.lineStart(),s.point(t,e),k=!1)}_=t,w=e,M=r}var m,v,g,y,b,x,_,w,M,T,k,A=s,E=Fe(),S=qe(t,e,r,n),L={point:f,lineStart:h,lineEnd:d,polygonStart:function(){s=E,m=[],v=[],k=!0},polygonEnd:function(){s=A,m=co.merge(m);var e=l([t,n]),r=k&&e,i=m.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),c(null,null,1,s),s.lineEnd()),i&&De(m,a,e,c,s),s.polygonEnd()),m=v=g=null}};return L}}function Ye(t){var e=0,r=No/3,n=lr(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*No/180,r=t[1]*No/180):[e/No*180,r/No*180]},i}function Xe(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,nt((a-(t*t+r*r)*i*i)/(2*i))]},r}function We(){function t(t,e){Bs+=i*t-n*e,n=t,i=e}var e,r,n,i;Gs.point=function(a,o){Gs.point=t,e=n=a,r=i=o},Gs.lineEnd=function(){t(e,r)}}function Ze(t,e){tHs&&(Hs=t),eqs&&(qs=e)}function Je(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ke(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ke(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}function Ke(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Qe(t,e){Es+=t,Ss+=e,++Ls}function $e(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);Cs+=o*(e+t)/2,Is+=o*(r+n)/2,Ds+=o,Qe(e=t,r=n)}var e,r;Xs.point=function(n,i){Xs.point=t,Qe(e=n,r=i)}}function tr(){Xs.point=Qe}function er(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);Cs+=o*(n+t)/2,Is+=o*(i+e)/2,Ds+=o,o=i*t-n*e,Ps+=o*(n+t),zs+=o*(i+e),Os+=3*o,Qe(n=t,i=e)}var e,r,n,i;Xs.point=function(a,o){Xs.point=t,Qe(e=n=a,r=i=o)},Xs.lineEnd=function(){t(e,r)}}function rr(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Bo)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:M};return s}function nr(t){function e(t){return(s?n:r)(t)}function r(e){return or(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})}function n(e){function r(r,n){r=t(r,n),e.point(r[0],r[1])}function n(){b=NaN,T.point=a,e.lineStart()}function a(r,n){var a=ge([r,n]),o=t(r,n);i(b,x,y,_,w,M,b=o[0],x=o[1],y=r,_=a[0],w=a[1],M=a[2],s,e),e.point(b,x)}function o(){T.point=r,e.lineEnd()}function l(){n(),T.point=c,T.lineEnd=u}function c(t,e){a(f=t,h=e),d=b,p=x,m=_,v=w,g=M,T.point=a}function u(){i(b,x,y,_,w,M,d,p,f,m,v,g,s,e),T.lineEnd=o,o()}var f,h,d,p,m,v,g,y,b,x,_,w,M,T={point:r,lineStart:n,lineEnd:o,polygonStart:function(){e.polygonStart(),T.lineStart=l},polygonEnd:function(){e.polygonEnd(),T.lineStart=n}};return T}function i(e,r,n,s,l,c,u,f,h,d,p,m,v,g){var y=u-e,b=f-r,x=y*y+b*b;if(x>4*a&&v--){var _=s+d,w=l+p,M=c+m,T=Math.sqrt(_*_+w*w+M*M),k=Math.asin(M/=T),A=xo(xo(M)-1)a||xo((y*C+b*I)/x-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(a)},e}function ir(t){var e=nr(function(e,r){return t([e*qo,r*qo])});return function(t){return cr(e(t))}}function ar(t){this.stream=t}function or(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function sr(t){return lr(function(){return t})()}function lr(t){function e(t){return t=s(t[0]*Ho,t[1]*Ho),[t[0]*h+l,c-t[1]*h]}function r(t){return(t=s.invert((t[0]-l)/h,(c-t[1])/h))&&[t[0]*qo,t[1]*qo]}function n(){s=Ce(o=hr(g,y,b),a);var t=a(m,v);return l=d-t[0]*h,c=p+t[1]*h,i()}function i(){return u&&(u.valid=!1,u=null),e}var a,o,s,l,c,u,f=nr(function(t,e){return t=a(t,e),[t[0]*h+l,c-t[1]*h]}),h=150,d=480,p=250,m=0,v=0,g=0,y=0,b=0,_=Fs,w=x,M=null,T=null;return e.stream=function(t){return u&&(u.valid=!1),u=cr(_(o,f(w(t)))),u.valid=!0,u},e.clipAngle=function(t){return arguments.length?(_=null==t?(M=t,Fs):He((M=+t)*Ho),i()):M},e.clipExtent=function(t){return arguments.length?(T=t,w=t?Ge(t[0][0],t[0][1],t[1][0],t[1][1]):x,i()):T},e.scale=function(t){return arguments.length?(h=+t,n()):h},e.translate=function(t){return arguments.length?(d=+t[0],p=+t[1],n()):[d,p]},e.center=function(t){return arguments.length?(m=t[0]%360*Ho,v=t[1]%360*Ho,n()):[m*qo,v*qo]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Ho,y=t[1]%360*Ho,b=t.length>2?t[2]%360*Ho:0,n()):[g*qo,y*qo,b*qo]},co.rebind(e,f,"precision"),function(){return a=t.apply(this,arguments),e.invert=a.invert&&r,n()}}function cr(t){return or(t,function(e,r){t.point(e*Ho,r*Ho)})}function ur(t,e){return[t,e]}function fr(t,e){return[t>No?t-Bo:t<-No?t+Bo:t,e]}function hr(t,e,r){return t?e||r?Ce(pr(t),mr(e,r)):pr(t):e||r?mr(e,r):fr}function dr(t){return function(e,r){return e+=t,[e>No?e-Bo:e<-No?e+Bo:e,r]}}function pr(t){var e=dr(t);return e.invert=dr(-t),e}function mr(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),nt(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),nt(u*n-s*i)]},r}function vr(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=gr(r,i),a=gr(r,a),(o>0?ia)&&(i+=o*Bo)):(i=t+o*Bo,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-Vo+Fo&&(e=-Vo+Fo):e>Vo-Fo&&(e=Vo-Fo);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(No/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=tt(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Vo]},r):Er}function Ar(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return xo(i)1&&et(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function Pr(t,e){return t[0]-e[0]||t[1]-e[1]}function zr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function Or(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function Rr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function Fr(){an(this),this.edge=this.site=this.circle=null}function jr(t){var e=sl.pop()||new Fr;return e.site=t,e}function Nr(t){Zr(t),il.remove(t),sl.push(t),an(t)}function Br(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];Nr(t);for(var l=a;l.circle&&xo(r-l.circle.x)Fo)s=s.L;else{if(!((i=a-Hr(s,o))>Fo)){n>-Fo?(e=s.P,r=s):i>-Fo?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=jr(t);if(il.insert(e,l),e||r){if(e===r)return Zr(e),r=jr(e.site),il.insert(l,r),l.edge=r.edge=$r(e.site,l.site),Wr(e),void Wr(r);if(!r)return void(l.edge=$r(e.site,l.site));Zr(e),Zr(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,v=p.y-f,g=2*(h*v-d*m),y=h*h+d*d,b=m*m+v*v,x={x:(v*y-d*b)/g+u,y:(h*b-m*y)/g+f};en(r.edge,c,p,x),l.edge=$r(c,t,null,x),r.edge=$r(t,p,null,x),Wr(e),Wr(r)}}function Vr(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);r=o.site;var s=r.x,l=r.y,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function Hr(t,e){var r=t.N;if(r)return Vr(r,e);var n=t.site;return n.y===e?n.x:1/0}function qr(t){this.site=t,this.edges=[]}function Gr(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=nl,v=m.length;v--;)if((a=m[v])&&a.prepare())for(s=a.edges,l=s.length,o=0;oFo||xo(i-r)>Fo)&&(s.splice(o,0,new rn(tn(a.site,u,xo(n-f)Fo?{x:f,y:xo(e-f)Fo?{x:xo(r-p)Fo?{x:h,y:xo(e-h)Fo?{x:xo(r-d)=-jo)){var d=l*l+c*c,p=u*u+f*f,m=(f*d-c*p)/h,v=(l*p-u*d)/h,f=v+s,g=ll.pop()||new Xr;g.arc=t,g.site=i,g.x=m+o,g.y=f+Math.sqrt(m*m+v*v),g.cy=f,t.circle=g;for(var y=null,b=ol._;b;)if(g.y=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:v,y:l};r={x:v,y:c}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}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.xa||f>o||h=x,M=r>=_,T=M<<1|w,k=T+4;Ta&&(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:bn(r,n)})),a=fl.lastIndex;return a=0&&!(r=co.interpolators[n](t,e)););return r}function wn(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r=1?1:t(e)}}function Tn(t){return function(e){return 1-t(1-e)}}function kn(t){return function(e){return.5*(e<.5?t(2*e):2-t(2-2*e))}}function An(t){return t*t}function En(t){return t*t*t}function Sn(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)}function Ln(t){return function(e){return Math.pow(e,t)}}function Cn(t){return 1-Math.cos(t*Vo)}function In(t){return Math.pow(2,10*(t-1))}function Dn(t){return 1-Math.sqrt(1-t*t)}function Pn(t,e){var r;return arguments.length<2&&(e=.45),arguments.length?r=e/Bo*Math.asin(1/t):(t=1,r=e/4),function(n){return 1+t*Math.pow(2,-10*n)*Math.sin((n-r)*Bo/e)}}function zn(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function On(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 Rn(t,e){t=co.hcl(t),e=co.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ht(r+a*t,n+o*t,i+s*t)+""}}function Fn(t,e){t=co.hsl(t),e=co.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return ut(r+a*t,n+o*t,i+s*t)+""}}function jn(t,e){t=co.lab(t),e=co.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return pt(r+a*t,n+o*t,i+s*t)+""}}function Nn(t,e){return e-=t,function(r){return Math.round(t+e*r)}}function Bn(t){var e=[t.a,t.b],r=[t.c,t.d],n=Vn(e),i=Un(e,r),a=Vn(Hn(r,e,-i))||0;e[0]*r[1]180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(qn(r)+"rotate(",null,")")-2,x:bn(t,e)})):e&&r.push(qn(r)+"rotate("+e+")")}function Xn(t,e,r,n){t!==e?n.push({i:r.push(qn(r)+"skewX(",null,")")-2,x:bn(t,e)}):e&&r.push(qn(r)+"skewX("+e+")")}function Wn(t,e,r,n){if(t[0]!==e[0]||t[1]!==e[1]){var i=r.push(qn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:bn(t[0],e[0])},{i:i-2,x:bn(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(qn(r)+"scale("+e+")")}function Zn(t,e){var r=[],n=[];return t=co.transform(t),e=co.transform(e),Gn(t.translate,e.translate,r,n),Yn(t.rotate,e.rotate,r,n),Xn(t.skew,e.skew,r,n),Wn(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function li(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;++oi&&(n=r,i=e);return n}function bi(t){return t.reduce(xi,0)}function xi(t,e){return t+e[1]}function _i(t,e){return wi(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function wi(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 Mi(t){return[co.min(t),co.max(t)]}function Ti(t,e){return t.value-e.value}function ki(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Ai(t,e){t._pack_next=e,e._pack_prev=t}function Ei(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 Si(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,f=-(1/0),h=1/0,d=-(1/0);if(r.forEach(Li),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(a=r[2],Di(n,i,a),e(a),ki(n,a),n._pack_prev=a,ki(a,i),i=n._pack_next,o=3;o=0;)e=i[a],e.z+=r,e.m+=r,r+=e.s+(n+=e.c)}function ji(t,e,r){return t.a.parent===e.parent?t.a:r}function Ni(t){return 1+co.max(t,function(t){return t.y})}function Bi(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Ui(t){var e=t.children;return e&&e.length?Ui(e[0]):t}function Vi(t){var e,r=t.children;return r&&(e=r.length)?Vi(r[e-1]):t}function Hi(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function qi(t,e){var r=t.x+e[3],n=t.y+e[0],i=t.dx-e[1]-e[3],a=t.dy-e[0]-e[2];return i<0&&(r+=i/2,i=0),a<0&&(n+=a/2,a=0),{x:r,y:n,dx:i,dy:a}}function Gi(t){var e=t[0],r=t[t.length-1];return e2?Ji:Xi,l=n?Kn:Jn;return o=i(t,e,l,r),s=i(e,t,l,_n),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Nn)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ea(t,e)},a.tickFormat=function(e,r){return ra(t,e,r)},a.nice=function(e){return $i(t,e),i()},a.copy=function(){return Ki(t,e,r,n)},i()}function Qi(t,e){return co.rebind(t,e,"range","rangeRound","interpolate","clamp")}function $i(t,e){return Wi(t,Zi(ta(t,e)[2])),Wi(t,Zi(ta(t,e)[2])),t}function ta(t,e){null==e&&(e=10);var r=Gi(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 ea(t,e){return co.range.apply(co,ta(t,e))}function ra(t,e,r){var n=ta(t,e);if(r){var i=us.exec(r);if(i.shift(),"s"===i[8]){var a=co.formatPrefix(Math.max(xo(n[0]),xo(n[1])));return i[7]||(i[7]="."+na(a.scale(n[2]))),i[8]="f",r=co.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+ia(i[8],n)),r=i.join("")}else r=",."+na(n[2])+"f";return co.format(r)}function na(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ia(t,e){var r=na(e[2]);return t in Ml?Math.abs(r-na(Math.max(xo(e[0]),xo(e[1]))))+ +("e"!==t):r-2*("%"===t)}function aa(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=Wi(n.map(i),r?Math:kl);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Gi(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;h--)o.push(a(c)*h);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return Tl;arguments.length<2?r=Tl:"function"!=typeof r&&(r=co.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function xa(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,v=h-u,g=d-f,y=v*v+g*g,b=r-n,x=u*d-h*f,_=(g<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*g-v*_)/y,M=(-x*v-g*_)/y,T=(x*g+v*_)/y,k=(-x*v+g*_)/y,A=w-p,E=M-m,S=T-p,L=k-m;return A*A+E*E>S*S+L*L&&(w=T,M=k),[[w-l,M-c],[w*r/b,M*r/b]]}function _a(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],f=-1,h=e.length,d=St(r),p=St(n);++f1?t.join("L"):t+"Z"}function Ma(t){return t.join("L")+"Z"}function Ta(t){for(var e=0,r=t.length,n=t[0],i=[n[0],",",n[1]];++e1&&i.push("H",n[0]),i.join("")}function ka(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 c=2;c9&&(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}function Ua(t){return t.length<3?wa(t):t[0]+Ca(t,Ba(t))}function Va(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,c,u,h,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,c=Pt(a,0,l),m=p[n]={tween:new f,time:l,timer:c,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function ro(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function no(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function io(t){return t.toISOString()}function ao(t,e,r){function n(e){return t(e)}function i(t,r){var n=t[1]-t[0],i=n/r,a=co.bisect(Jl,i);return a==Jl.length?[e.year,ta(t.map(function(t){return t/31536e6}),r)[2]]:a?e[i/Jl[a-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=oo(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=oo(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Gi(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],oo(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return ao(t.copy(),e,r)},Qi(n,t)}function oo(t){return new Date(t)}function so(t){return JSON.parse(t.responseText)}function lo(t){var e=ho.createRange();return e.selectNode(ho.body),e.createContextualFragment(t.responseText)}var co={version:"3.5.17"},uo=[].slice,fo=function(t){return uo.call(t)},ho=this.document;if(ho)try{fo(ho.documentElement.childNodes)[0].nodeType}catch(t){fo=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}),ho)try{ho.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var po=this.Element.prototype,mo=po.setAttribute,vo=po.setAttributeNS,go=this.CSSStyleDeclaration.prototype,yo=go.setProperty;po.setAttribute=function(t,e){mo.call(this,t,e+"")},po.setAttributeNS=function(t,e,r){vo.call(this,t,e,r+"")},go.setProperty=function(t,e,r){yo.call(this,t,e+"",r)}}co.ascending=i,co.descending=function(t,e){return et?1:e>=t?0:NaN},co.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},co.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},co.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 l/(u-1)},co.deviation=function(){var t=co.variance.apply(this,arguments);return t?Math.sqrt(t):t};var bo=s(i);co.bisectLeft=bo.left,co.bisect=co.bisectRight=bo.right,co.bisector=function(t){return s(1===t.length?function(e,r){return i(t(e),r)}:t)},co.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},co.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},co.pairs=function(t){for(var e=0,r=t.length-1,n=t[0],i=new Array(r<0?0:r);e=0;)for(n=t[i],e=n.length;--e>=0;)r[--o]=n[e];return r};var xo=Math.abs;co.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=c(xo(r)),o=-1;if(t*=a,e*=a,r*=a,r<0)for(;(n=t+r*++o)>e;)i.push(n/a);else for(;(n=t+r*++o)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,c,u,h,d=-1,p=o.length,m=a[s++],v=new f;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(co.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},co.set=function(t){var e=new b;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}},co.event=null,co.requote=function(t){return t.replace(To,"\\$&")};var To=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ko={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},Ao=function(t,e){return e.querySelector(t)},Eo=function(t,e){return e.querySelectorAll(t)},So=function(t,e){var r=t.matches||t[w(t,"matchesSelector")];return(So=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(Ao=function(t,e){return Sizzle(t,e)[0]||null},Eo=Sizzle,So=Sizzle.matchesSelector),co.selection=function(){return co.select(ho.documentElement)};var Lo=co.selection.prototype=[];Lo.select=function(t){var e,r,n,i,a=[];t=C(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),Io.hasOwnProperty(r)?{space:Io[r],local:t}:t}},Lo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return t=co.ns.qualify(t),t.local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(D(e,t[e]));return this}return this.each(D(t,e))},Lo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=O(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},Lo.sort=function(t){t=q.apply(this,arguments);for(var e=-1,r=this.length;++e0&&(e=e.transition().duration(L)),e.call(t.event)}function s(){_&&_.domain(x.range().map(function(t){return(t-T.x)/T.k}).map(x.invert)),M&&M.domain(w.range().map(function(t){return(t-T.y)/T.k}).map(w.invert))}function l(t){C++||t({type:"zoomstart"})}function c(t){s(),t({type:"zoom",scale:T.k,translate:[T.x,T.y]})}function u(t){--C||(t({type:"zoomend"}),v=null)}function f(){function t(){s=1,a(co.mouse(i),h),c(o)}function r(){f.on(D,null).on(P,null),d(s),u(o)}var i=this,o=O.of(i,arguments),s=0,f=co.select(n(i)).on(D,t).on(P,r),h=e(co.mouse(i)),d=K(i);Bl.call(i),l(o)}function h(){function t(){var t=co.touches(p);return d=T.k,t.forEach(function(t){t.identifier in v&&(v[t.identifier]=e(t))}),t}function r(){var e=co.event.target;co.select(e).on(x,n).on(_,s),w.push(e);for(var r=co.event.changedTouches,i=0,a=r.length;i1){var u=l[0],f=l[1],h=u[0]-f[0],d=u[1]-f[1];g=h*h+d*d}}function n(){var t,e,r,n,o=co.touches(p);Bl.call(p);for(var s=0,l=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,fs=co.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=co.round(t,Ft(t,e))).toFixed(Math.max(0,Math.min(20,Ft(t*(1+1e-15),e))))}}),hs=co.time={},ds=Date;Ut.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){ps.setUTCDate.apply(this._,arguments)},setDay:function(){ps.setUTCDay.apply(this._,arguments)},setFullYear:function(){ps.setUTCFullYear.apply(this._,arguments)},setHours:function(){ps.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){ps.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){ps.setUTCMinutes.apply(this._,arguments)},setMonth:function(){ps.setUTCMonth.apply(this._,arguments)},setSeconds:function(){ps.setUTCSeconds.apply(this._,arguments)},setTime:function(){ps.setTime.apply(this._,arguments)}};var ps=Date.prototype;hs.year=Vt(function(t){return t=hs.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),hs.years=hs.year.range,hs.years.utc=hs.year.utc.range,hs.day=Vt(function(t){var e=new ds(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),hs.days=hs.day.range,hs.days.utc=hs.day.utc.range,hs.dayOfYear=function(t){var e=hs.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=hs[t]=Vt(function(t){return(t=hs.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=hs.year(t).getDay();return Math.floor((hs.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});hs[t+"s"]=r.range,hs[t+"s"].utc=r.utc.range,hs[t+"OfYear"]=function(t){var r=hs.year(t).getDay();return Math.floor((hs.dayOfYear(t)+(r+e)%7)/7)}}),hs.week=hs.sunday,hs.weeks=hs.sunday.range,hs.weeks.utc=hs.sunday.utc.range,hs.weekOfYear=hs.sundayOfYear;var ms={"-":"",_:" ",0:"0"},vs=/^\s*\d+/,gs=/^%/;co.locale=function(t){return{numberFormat:Nt(t),timeFormat:qt(t)}};var ys=co.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});co.format=ys.numberFormat,co.geo={},fe.prototype={s:0,t:0,add:function(t){he(t,this.t,bs),he(bs.s,this.s,this),this.s?this.t+=bs.t:this.s=bs.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var bs=new fe;co.geo.stream=function(t,e){t&&xs.hasOwnProperty(t.type)?xs[t.type](t,e):de(t,e)};var xs={Feature:function(t,e){de(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ge([e*Ho,r*Ho]);if(g){var i=be(g,n),a=[i[1],-i[0],0],o=be(a,i);we(o),o=Me(o);var l=e-p,c=l>0?1:-1,m=o[0]*qo*c,v=xo(l)>180;if(v^(c*pd&&(d=y)}else if(m=(m+360)%360-180,v^(c*pd&&(d=r);v?es(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e):h>=u?(eh&&(h=e)):e>p?s(u,e)>s(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e)}else t(e,r);g=n,p=e}function r(){_.point=e}function n(){x[0]=u,x[1]=h,_.point=t,g=null}function i(t,r){if(g){var n=t-p;y+=xo(n)>180?n+(n>0?360:-360):n}else m=t,v=r;Ts.point(t,r),e(t,r)}function a(){Ts.lineStart()}function o(){i(m,v),Ts.lineEnd(),xo(y)>Fo&&(u=-(h=180)),x[0]=u,x[1]=h,g=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tFo?d=90:y<-Fo&&(f=-90),x[0]=u,x[1]=h}};return function(t){d=h=-(u=f=1/0),b=[],co.geo.stream(t,_);var e=b.length;if(e){b.sort(l);for(var r,n=1,i=b[0],a=[i];ns(i[0],i[1])&&(i[1]=r[1]),s(r[0],i[1])>s(i[0],i[1])&&(i[0]=r[0])):a.push(i=r);for(var o,r,p=-(1/0),e=a.length-1,n=0,i=a[e];n<=e;i=r,++n)r=a[n],(o=s(i[1],r[0]))>p&&(p=o,u=r[0],h=i[1])}return b=x=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[h,d]]}}(),co.geo.centroid=function(t){ks=As=Es=Ss=Ls=Cs=Is=Ds=Ps=zs=Os=0,co.geo.stream(t,Rs);var e=Ps,r=zs,n=Os,i=e*e+r*r+n*n;return i=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],f=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(l).point,n=o.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Fo,f+.12*c+Fo],[u-.214*c-Fo,f+.234*c-Fo]]).stream(l).point,i=s.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Fo,f+.166*c+Fo],[u-.115*c-Fo,f+.234*c-Fo]]).stream(l).point,t},t.scale(1070)};var Ns,Bs,Us,Vs,Hs,qs,Gs={point:M,lineStart:M,lineEnd:M,polygonStart:function(){Bs=0,Gs.lineStart=We},polygonEnd:function(){Gs.lineStart=Gs.lineEnd=Gs.point=M,Ns+=xo(Bs/2)}},Ys={point:Ze,lineStart:M,lineEnd:M,polygonStart:M,polygonEnd:M},Xs={point:Qe,lineStart:$e,lineEnd:tr,polygonStart:function(){Xs.lineStart=er},polygonEnd:function(){Xs.point=Qe,Xs.lineStart=$e,Xs.lineEnd=tr}};co.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),co.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Ns=0,co.geo.stream(t,i(Gs)),Ns},t.centroid=function(t){return Es=Ss=Ls=Cs=Is=Ds=Ps=zs=Os=0,co.geo.stream(t,i(Xs)),Os?[Ps/Os,zs/Os]:Ds?[Cs/Ds,Is/Ds]:Ls?[Es/Ls,Ss/Ls]:[NaN,NaN]},t.bounds=function(t){return Hs=qs=-(Us=Vs=1/0),co.geo.stream(t,i(Ys)),[[Us,Vs],[Hs,qs]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||ir(t):x,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new Je:new rr(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(co.geo.albersUsa()).context(null)},co.geo.transform=function(t){return{stream:function(e){var r=new ar(e);for(var n in t)r[n]=t[n];return r}}},ar.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},co.geo.projection=sr,co.geo.projectionMutator=lr,(co.geo.equirectangular=function(){return sr(ur)}).raw=ur.invert=ur,co.geo.rotation=function(t){function e(e){return e=t(e[0]*Ho,e[1]*Ho),e[0]*=qo,e[1]*=qo,e}return t=hr(t[0]%360*Ho,t[1]*Ho,t.length>2?t[2]*Ho:0),e.invert=function(e){return e=t.invert(e[0]*Ho,e[1]*Ho),e[0]*=qo,e[1]*=qo,e},e},fr.invert=ur,co.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=hr(-t[0]*Ho,-t[1]*Ho,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=qo,t[1]*=qo}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=vr((e=+n)*Ho,i*Ho),t):e},t.precision=function(n){return arguments.length?(r=vr(e*Ho,(i=+n)*Ho),t):i},t.angle(90)},co.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ho,i=t[1]*Ho,a=e[1]*Ho,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},co.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return co.range(Math.ceil(a/v)*v,i,v).map(h).concat(co.range(Math.ceil(c/g)*g,l,g).map(d)).concat(co.range(Math.ceil(n/p)*p,r,p).filter(function(t){return xo(t%v)>Fo}).map(u)).concat(co.range(Math.ceil(s/m)*m,o,m).filter(function(t){return xo(t%g)>Fo}).map(f))}var r,n,i,a,o,s,l,c,u,f,h,d,p=10,m=p,v=90,g=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(v=+e[0],g=+e[1],t):[v,g]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=yr(s,o,90),f=br(n,r,y),h=yr(c,l,90),d=br(a,i,y),t):y},t.majorExtent([[-180,-90+Fo],[180,90-Fo]]).minorExtent([[-180,-80-Fo],[180,80+Fo]])},co.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=xr,i=_r;return t.distance=function(){return co.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},co.geo.interpolate=function(t,e){return wr(t[0]*Ho,t[1]*Ho,e[0]*Ho,e[1]*Ho)},co.geo.length=function(t){return Ws=0,co.geo.stream(t,Zs),Ws};var Ws,Zs={sphere:M,point:M,lineStart:Mr,lineEnd:M,polygonStart:M,polygonEnd:M},Js=Tr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(co.geo.azimuthalEqualArea=function(){return sr(Js)}).raw=Js;var Ks=Tr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},x);(co.geo.azimuthalEquidistant=function(){return sr(Ks)}).raw=Ks,(co.geo.conicConformal=function(){return Ye(kr)}).raw=kr,(co.geo.conicEquidistant=function(){return Ye(Ar)}).raw=Ar;var Qs=Tr(function(t){return 1/t},Math.atan);(co.geo.gnomonic=function(){return sr(Qs)}).raw=Qs,Er.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Vo]},(co.geo.mercator=function(){return Sr(Er)}).raw=Er;var $s=Tr(function(){return 1},Math.asin);(co.geo.orthographic=function(){return sr($s)}).raw=$s;var tl=Tr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(co.geo.stereographic=function(){return sr(tl)}).raw=tl,Lr.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Vo]},(co.geo.transverseMercator=function(){var t=Sr(Lr),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=Lr,co.geom={},co.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=St(r),a=St(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+f;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Fo)*Fo,y:Math.round(o(t,e)/Fo)*Fo,i:e}})}var n=Cr,i=Ir,a=n,o=i,s=cl;return t?e(t):(e.links=function(t){return cn(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return cn(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(Yr),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,h=n>=u,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]=pn()),f?i=c:s=c,h?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,f,h,d,p,m,v,g,y,b=St(s),x=St(l);if(null!=e)m=e,v=r,g=n,y=i;else if(g=y=-(m=v=1/0),f=[],h=[],p=t.length,o)for(d=0;dg&&(g=u.x),u.y>y&&(y=u.y),f.push(u.x),h.push(u.y);else for(d=0;dg&&(g=_),w>y&&(y=w),f.push(_),h.push(w)}var M=g-m,T=y-v;M>T?y=v+M:g=m+T;var k=pn();if(k.add=function(t){a(k,t,+b(t,++d),+x(t,d),m,v,g,y)},k.visit=function(t){mn(t,k,m,v,g,y)},k.find=function(t){return vn(k,t[0],t[1],m,v,g,y)},d=-1,null==e){for(;++d=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=dl.get(r)||hl,n=pl.get(n)||x,Mn(n(r.apply(null,uo.call(arguments,1))))},co.interpolateHcl=Rn,co.interpolateHsl=Fn,co.interpolateLab=jn,co.interpolateRound=Nn,co.transform=function(t){var e=ho.createElementNS(co.ns.prefix.svg,"g");return(co.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Bn(r?r.matrix:ml)})(t)},Bn.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var ml={a:1,b:0,c:0,d:1,e:0,f:0};co.interpolateTransform=Zn,co.layout={},co.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=Pt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return li(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=fi,r=ci,n=ui;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(si(e,function(t){t.children&&(t.value=0)}),li(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},co.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&(o=l[co.bisect(f,s,1,d)-1],o.y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Mi,i=_i;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=St(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return wi(t,e)}:St(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},co.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,li(s,function(t){t.r=+u(t.value)}),li(s,Si),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;li(s,function(t){t.r+=f}),li(s,Si),li(s,function(t){t.r-=f})} -return Ii(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=co.layout.hierarchy().sort(Ti),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},oi(t,r)},co.layout.tree=function(){function t(t,i){var u=o.call(this,t,i),f=u[0],h=e(f);if(li(h,r),h.parent.m=-h.z,si(h,n),c)si(f,a);else{var d=f,p=f,m=f;si(f,function(t){t.xp.x&&(p=t),t.depth>m.depth&&(m=t)});var v=s(d,p)/2-d.x,g=l[0]/(p.x+s(p,d)/2+v),y=l[1]/(m.depth||1);si(f,function(t){t.x=(t.x+v)*g,t.y=t.depth*y})}return u}function e(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;o0&&(Ri(ji(o,t,r),t,n),c+=n,u+=n),f+=o.m,c+=i.m,h+=l.m,u+=a.m;o&&!Oi(a)&&(a.t=o,a.m+=f-u),i&&!zi(l)&&(l.t=i,l.m+=c-h,r=t)}return r}function a(t){t.x*=l[0],t.y=t.depth*l[1]}var o=co.layout.hierarchy().sort(null).value(null),s=Pi,l=[1,1],c=null;return t.separation=function(e){return arguments.length?(s=e,t):s},t.size=function(e){return arguments.length?(c=null==(l=e)?a:null,t):c?null:l},t.nodeSize=function(e){return arguments.length?(c=null==(l=e)?null:a,t):c?l:null},oi(t,o)},co.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;li(l,function(t){var e=t.children;e&&e.length?(t.x=Bi(e),t.y=Ni(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Ui(l),f=Vi(l),h=u.x-r(u,f)/2,d=f.x+r(f,u)/2;return li(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=co.layout.hierarchy().sort(null).value(null),r=Pi,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},oi(t,e)},co.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)u.push(o=h[l-1]),u.area+=o.area,"squarify"!==d||(s=n(u,m))<=p?(h.pop(),p=s):(u.area-=u.pop().area,i(u,m,c,!1),m=Math.min(c.dx,c.dy),u.length=u.area=0,p=1/0);u.length&&(i(u,m,c,!0),u.length=u.area=0),a.forEach(e)}}function r(e){var n=e.children;if(n&&n.length){var a,o=f(e),s=n.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(i(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);n.forEach(r)}}function n(t,e){for(var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*p/n,n/(e*a*p)):1/0}function i(t,e,r,n){var i,a=-1,o=t.length,s=r.x,c=r.y,u=e?l(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=co.random.normal.apply(co,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=co.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rf?0:1;if(c=Uo)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,v,g,y,b,x,_,w,M,T,k,A=0,E=0,S=[];if((g=(+l.apply(this,arguments)||0)/2)&&(v=a===Cl?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(E*=-1),c&&(E=nt(v/c*Math.sin(g))),t&&(A=nt(v/t*Math.sin(g)))),c){y=c*Math.cos(u+E),b=c*Math.sin(u+E),x=c*Math.cos(f-E),_=c*Math.sin(f-E);var L=Math.abs(f-u-2*E)<=No?0:1;if(E&&ba(y,b,x,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),b=c*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(f-A),M=t*Math.sin(f-A),T=t*Math.cos(u+A),k=t*Math.sin(u+A);var I=Math.abs(u-f+2*A)<=No?0:1;if(A&&ba(w,M,T,k)===1-d^I){var D=(u+f)/2;w=t*Math.cos(D),M=t*Math.sin(D),T=k=null}}else w=M=0;if(h>Fo&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=tNo)+",1 "+e}function i(t,e,r,n){return"Q 0,0 "+n}var a=xr,o=_r,s=qa,l=va,c=ga;return t.radius=function(e){return arguments.length?(s=St(e),t):s},t.source=function(e){return arguments.length?(a=St(e),t):a},t.target=function(e){return arguments.length?(o=St(e),t):o},t.startAngle=function(e){return arguments.length?(l=St(e),t):l},t.endAngle=function(e){return arguments.length?(c=St(e),t):c},t},co.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,i),s=(a.y+o.y)/2,l=[a,{x:a.x,y:s},{x:o.x,y:s},o];return l=l.map(n),"M"+l[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=xr,r=_r,n=Ga;return t.source=function(r){return arguments.length?(e=St(r),t):e},t.target=function(e){return arguments.length?(r=St(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},co.svg.diagonal.radial=function(){var t=co.svg.diagonal(),e=Ga,r=t.projection;return t.projection=function(t){return arguments.length?r(Ya(e=t)):e},t},co.svg.symbol=function(){function t(t,n){return(Ol.get(e.call(this,t,n))||Za)(r.call(this,t,n))}var e=Wa,r=Xa;return t.type=function(r){return arguments.length?(e=St(r),t):e},t.size=function(e){return arguments.length?(r=St(e),t):r},t};var Ol=co.map({circle:Za,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*Fl)),r=e*Fl;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/Rl),r=e*Rl/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Rl),r=e*Rl/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});co.svg.symbolTypes=Ol.keys();var Rl=Math.sqrt(3),Fl=Math.tan(30*Ho);Lo.transition=function(t){for(var e,r,n=jl||++Vl,i=to(t),a=[],o=Nl||{time:Date.now(),ease:Sn,delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){32==co.event.keyCode&&(L||(b=null,I[0]-=f[1],I[1]-=h[1],L=2),A())}function m(){32==co.event.keyCode&&2==L&&(I[0]+=f[1],I[1]+=h[1],L=0,A())}function v(){var t=co.mouse(_),n=!1;x&&(t[0]+=x[0],t[1]+=x[1]),L||(co.event.altKey?(b||(b=[(f[0]+f[1])/2,(h[0]+h[1])/2]),I[0]=f[+(t[0]=2)return!1;t[r]=n}return!0}):w.filter(function(t){for(var e=0;e<=o;++e){var r=y[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&o)for(var f=0;f>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:78}],125:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return i(0|t,e);break;case"object":if("number"==typeof t.length)return n(t,e,0)}return[]}e.exports=a},{}],126:[function(t,e,r){"use strict";function n(t,e,r){r=r||2;var n=e&&e.length,a=n?e[0]*r:t.length,s=i(t,0,a,r,!0),l=[];if(!s)return l;var c,u,h,d,p,m,v;if(n&&(s=f(t,e,s,r)),t.length>80*r){c=h=t[0],u=d=t[1];for(var g=r;gh&&(h=p),m>d&&(d=m);v=Math.max(h-c,d-u)}return o(s,l,r,c,u,v),l}function i(t,e,r,n,i){var a,o;if(i===I(t,e,r,n)>0)for(a=e;a=e;a-=n)o=S(a,t[a],t[a+1],o);return o&&w(o,o.next)&&(L(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!w(n,n.next)&&0!==_(n.prev,n,n.next))n=n.next;else{if(L(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,f,h){if(t){!h&&f&&m(t,n,i,f);for(var d,p,v=t;t.prev!==t.next;)if(d=t.prev,p=t.next,f?l(t,n,i,f):s(t))e.push(d.i/r),e.push(t.i/r),e.push(p.i/r),L(t),t=p.next,v=p.next;else if((t=p)===v){h?1===h?(t=c(t,e,r),o(t,e,r,n,i,f,2)):2===h&&u(t,e,r,n,i,f):o(a(t),e,r,n,i,f,1);break}}}function s(t){var e=t.prev,r=t,n=t.next;if(_(e,r,n)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(b(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&_(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function l(t,e,r,n){var i=t.prev,a=t,o=t.next;if(_(i,a,o)>=0)return!1;for(var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,u=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,f=g(s,l,e,r,n),h=g(c,u,e,r,n),d=t.nextZ;d&&d.z<=h;){if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(d=t.prevZ;d&&d.z>=f;){ -if(d!==t.prev&&d!==t.next&&b(i.x,i.y,a.x,a.y,o.x,o.y,d.x,d.y)&&_(d.prev,d,d.next)>=0)return!1;d=d.prevZ}return!0}function c(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!w(i,a)&&M(i,n,n.next,a)&&k(i,a)&&k(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),L(n),L(n.next),n=t=a),n=n.next}while(n!==t);return n}function u(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&x(l,c)){var u=E(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}function f(t,e,r,n){var o,s,l,c,u,f=[];for(o=0,s=e.length;o=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=u&&b(ar.x)&&k(n,t)&&(r=n,h=l),n=n.next;return r}function m(t,e,r,n){var i=t;do{null===i.z&&(i.z=g(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,v(i)}function v(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1);return t}function g(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function y(t){var e=t,r=t;do{e.x=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function x(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!T(t,e)&&k(t,e)&&k(e,t)&&A(t,e)}function _(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function w(t,e){return t.x===e.x&&t.y===e.y}function M(t,e,r,n){return!!(w(t,e)&&w(r,n)||w(t,n)&&w(r,e))||_(t,e,r)>0!=_(t,e,n)>0&&_(r,n,t)>0!=_(r,n,e)>0}function T(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&M(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}function k(t,e){return _(t.prev,t,t.next)<0?_(t,e,t.next)>=0&&_(t,t.prev,e)>=0:_(t,e,t.prev)<0||_(t,t.next,e)<0}function A(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}function E(t,e){var r=new C(t.i,t.x,t.y),n=new C(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function S(t,e,r,n){var i=new C(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function L(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function C(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function I(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],127:[function(t,e,r){"use strict";function n(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var n=0;n0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,a,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],130:[function(t,e,r){"use strict";function n(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}e.exports=n},{}],131:[function(t,e,r){"use strict";function n(t){for(var e,r=t.length,n=0;n13)&&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}e.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}},{}],132:[function(t,e,r){"use strict";function n(t){return new Function("f","var p = (f && f.properties || {}); return "+i(t))}function i(t){if(!t)return"true";var e=t[0];return t.length<=1?"any"===e?"false":"true":"("+("=="===e?o(t[1],t[2],"===",!1):"!="===e?o(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?o(t[1],t[2],e,!0):"any"===e?s(t.slice(1),"||"):"all"===e?s(t.slice(1),"&&"):"none"===e?u(s(t.slice(1),"||")):"in"===e?l(t[1],t.slice(2)):"!in"===e?u(l(t[1],t.slice(2))):"has"===e?c(t[1]):"!has"===e?u(c([t[1]])):"true")+")"}function a(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function o(t,e,r,n){var i=a(t),o="$type"===t?h.indexOf(e):JSON.stringify(e);return(n?"typeof "+i+"=== typeof "+o+"&&":"")+i+r+o}function s(t,e){return t.map(i).join(e)}function l(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(f)),n=a(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function c(t){return JSON.stringify(t)+" in p"}function u(t){return"!("+t+")"}function f(t,e){return te?1:0}e.exports=n;var h=["Unknown","Point","LineString","Polygon"]},{}],133:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1)for(var h=o.length-1,p=t-e[r-1],d=0;d=r-1)for(var u=a.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},c.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},c.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=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},c.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},c.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},c.idle=function(t){var e=this.lastT();if(!(t=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":67,"cubic-hermite":108}],134:[function(t,e,r){"use strict";function n(t){t=t||{};var e,r,n=t.canvas||document.createElement("canvas"),o=t.family||"sans-serif",s=t.shape||[512,512],l=t.step||[32,32],c=parseFloat(t.size)||16,u=t.chars||[32,126],f=Math.floor((l[0]-c)/2),h=t.radius||1.5*f,d=new a(c,f,h,0,o),p=null==t.align?"optical":t.align,m=null==t.fit||1==t.fit?.5:t.fit;if(Array.isArray(u)){if(2===u.length&&"number"==typeof u[0]&&"number"==typeof u[1]){var v=[];for(e=u[0],r=0;e<=u[1];e++)v[r++]=String.fromCharCode(e);u=v}}else u=String(u).split("");s=s.slice(),n.width=s[0],n.height=s[1];var g=n.getContext("2d");g.fillStyle="#000",g.fillRect(0,0,n.width,n.height),g.textBaseline="middle";var y=l[0],b=l[1],x=0,_=0,w=c/b,M=Math.min(u.length,Math.floor(s[0]/y)*Math.ceil(s[1]/b)),T=d.ctx.textAlign,k=d.buffer,A=d.middle;for(d.ctx.textAlign="center",d.buffer=d.size/2,e=0;es[0]-l[0]&&(x=0,_+=l[1])}return d.ctx.textAlign=T,d.buffer=k,d.middle=A,n}function i(t,e,r){if(s[e]&&s[e][t])return s[e][t];var n=200*r,i=o(t,{size:200,fontSize:n,fontFamily:e});s[e]||(s[e]={});var a={center:[i.center[0]/200,i.center[1]/200],bounds:i.bounds.map(function(t){return t/200}),radius:i.radius/200};return s[e][t]=a,a}var a=t("tiny-sdf"),o=t("optical-properties");e.exports=n;var s={}},{"optical-properties":480,"tiny-sdf":541}],135:[function(t,e,r){"use strict";function n(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 i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){var r=l(t,e.left);if(r)return r}var r=t(e.key,e.value);return r?r:e.right?l(t,e.right):void 0}function c(t,e,r,n){if(e(t,n.key)<=0){if(n.left){var i=c(t,e,r,n.left);if(i)return i}var i=r(n.key,n.value);if(i)return i}if(n.right)return c(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 f(t,e){this.tree=t,this._stack=e}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){for(var e,r,n,s,l=t.length-1;l>=0;--l){if(e=t[l],0===l)return void(e._color=g);if(r=t[l-1],r.left===e){if(n=r.right,n.right&&n.right._color===v){if(n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=g,r._color=g,s._color=g,o(r),o(n),l>1){var c=t[l-2];c.left===r?c.left=n:c.right=n}return void(t[l-1]=n)}if(n.left&&n.left._color===v){if(n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=g,n._color=g,e._color=g,o(r),o(n),o(s),l>1){var c=t[l-2];c.left===r?c.left=s:c.right=s}return void(t[l-1]=s)}if(n._color===g){if(r._color===v)return r._color=g,void(r.right=a(v,n));r.right=a(v,n);continue}if(n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var c=t[l-2];c.left===r?c.left=n:c.right=n}t[l-1]=n,t[l]=r,l+11){var c=t[l-2];c.right===r?c.right=n:c.left=n}return void(t[l-1]=n)}if(n.right&&n.right._color===v){if(n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=g,n._color=g,e._color=g,o(r),o(n),o(s),l>1){var c=t[l-2];c.right===r?c.right=s:c.left=s}return void(t[l-1]=s)}if(n._color===g){if(r._color===v)return r._color=g,void(r.left=a(v,n));r.left=a(v,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=v,o(r),o(n),l>1){var c=t[l-2];c.right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+1e?1:0}function m(t){return new s(t||p,null)}e.exports=m;var v=0,g=1,y=s.prototype;Object.defineProperty(y,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(y,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(y,"length",{get:function(){return this.root?this.root._count:0}}),y.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(v,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){var i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(var f=l.length-1;f>1;--f){var h=l[f-1],i=l[f];if(h._color===g||i._color===g)break;var d=l[f-2];if(d.left===h)if(h.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=h.right,h._color=g,h.right=d,l[f-2]=h,l[f-1]=i,o(d),o(h),f>=3){var m=l[f-3];m.left===d?m.left=h:m.right=h}break}h._color=g,d.right=a(g,p),d._color=v,f-=1}else{var p=d.right;if(!p||p._color!==v){if(h.right=i.left,d._color=v,d.left=i.right,i._color=g,i.left=h,i.right=d,l[f-2]=i,l[f-1]=h,o(d),o(h),o(i),f>=3){var m=l[f-3];m.left===d?m.left=i:m.right=i}break}h._color=g,d.right=a(g,p),d._color=v,f-=1}else if(h.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=h.left,h._color=g,h.left=d,l[f-2]=h,l[f-1]=i,o(d),o(h),f>=3){var m=l[f-3];m.right===d?m.right=h:m.left=h}break}h._color=g,d.left=a(g,p),d._color=v,f-=1}else{var p=d.left;if(!p||p._color!==v){if(h.left=i.right,d._color=v,d.right=i.left,i._color=g,i.right=h,i.left=d,l[f-2]=i,l[f-1]=h,o(d),o(h),o(i),f>=3){var m=l[f-3];m.right===d?m.right=i:m.left=i}break}h._color=g,d.left=a(g,p),d._color=v,f-=1}}return l[0]._color=g,new s(r,l[0])},y.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(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(y,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(y,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),y.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},y.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 f(this,n)},y.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 f(this,n)},y.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 f(this,n)},y.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 f(this,n)},y.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 f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},y.remove=function(t){var e=this.find(t);return e?e.remove():this},y.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 b=f.prototype;Object.defineProperty(b,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(b,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),b.clone=function(){return new f(this.tree,this._stack.slice())},b.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var i=t.length-2;i>=0;--i){var r=t[i];r.left===t[i+1]?e[i]=new n(r._color,r.key,r.value,e[i+1],r.right,r._count):e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count)}if(r=e[e.length-1],r.left&&r.right){var a=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var o=e[a-1];e.push(new n(r._color,o.key,o.value,r.left,r.right,r._count)),e[a-1].key=r.key,e[a-1].value=r.value;for(var i=e.length-2;i>=a;--i)r=e[i],e[i]=new n(r._color,r.key,r.value,r.left,e[i+1],r._count);e[a-1].left=e[a]}if(r=e[e.length-1],r._color===v){var l=e[e.length-2];l.left===r?l.left=null:l.right===r&&(l.right=null),e.pop();for(var i=0;i0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(b,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(b,"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}),b.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(b,"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}}),b.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)i=e[a],i.left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},b.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(b,"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}})},{}],136:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)} -var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],137:[function(t,e,r){function n(t){if("Polygon"===t.type)return i(t.coordinates);if("MultiPolygon"===t.type){for(var e=0,r=0;r0){e+=Math.abs(a(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}var c=t("geojson-area");e.exports=n},{"geojson-area":137}],139:[function(t,e,r){"use strict";function n(t,e,r,n,o,l,c,u){if(r/=e,n/=e,c>=r&&u<=n)return t;if(c>n||u=r&&p<=n)f.push(m);else if(!(d>n||p=e&&s<=r&&i.push(o)}return i}function a(t,e,r,n,i,a){for(var s=[],l=0;lr?(x.push(i(c,p,e),i(c,p,r)),a||(x=o(s,x,v,g,y))):d>=e&&x.push(i(c,p,e)):h>r?dr&&(x.push(i(c,p,r)),a||(x=o(s,x,v,g,y))));c=m[b-1],h=c[n],h>=e&&h<=r&&x.push(c),f=x[x.length-1],a&&f&&(x[0][0]!==f[0]||x[0][1]!==f[1])&&x.push(x[0]),o(s,x,v,g,y)}return s}function o(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=n;var s=t("./feature")},{"./feature":141}],140:[function(t,e,r){"use strict";function n(t,e){var r=[];if("FeatureCollection"===t.type)for(var n=0;n1?1:n,[r,n,0]}function s(t){for(var e,r,n=0,i=0,a=0;a1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),b=this.tiles[y]=p(t,g,r,n,x,e===d.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,i){if(e===d.maxZoom||e===i)continue;var w=1<1&&console.time("clipping");var M,T,k,A,E,S,L=.5*d.buffer/d.extent,C=.5-L,I=.5+L,D=1+L;M=T=k=A=null,E=h(t,g,r-L,r+I,0,o,b.min[0],b.max[0]),S=h(t,g,r+C,r+D,0,o,b.min[0],b.max[0]),E&&(M=h(E,g,n-L,n+I,1,s,b.min[1],b.max[1]),T=h(E,g,n+C,n+D,1,s,b.min[1],b.max[1])),S&&(k=h(S,g,n-L,n+I,1,s,b.min[1],b.max[1]),A=h(S,g,n+C,n+D,1,s,b.min[1],b.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(f.push(M||[],e+1,2*r,2*n),f.push(T||[],e+1,2*r,2*n+1),f.push(k||[],e+1,2*r+1,2*n),f.push(A||[],e+1,2*r+1,2*n+1))}else i&&(v=e)}return v},i.prototype.getTile=function(t,e,r){var n=this.options,i=n.extent,o=n.debug,s=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var u,h=t,d=e,p=r;!u&&h>0;)h--,d=Math.floor(d/2),p=Math.floor(p/2),u=this.tiles[a(h,d,p)];if(!u||!u.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",h,d,p),c(u,i,n.buffer))return f.tile(u,i);o>1&&console.time("drilling down");var m=this.splitTile(u.source,h,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var v=1<n&&(o=r,n=a);n>s?(t[o][2]=n,f.push(c),f.push(o),c=o):(u=f.pop(),c=f.pop())}}function i(t,e,r){var n=e[0],i=e[1],a=r[0],o=r[1],s=t[0],l=t[1],c=a-n,u=o-i;if(0!==c||0!==u){var f=((s-n)*c+(l-i)*u)/(c*c+u*u);f>1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return c=s-n,u=l-i,c*c+u*u}e.exports=n},{}],144:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},l=0;ls.max[0]&&(s.max[0]=u[0]),u[1]>s.max[1]&&(s.max[1]=u[1])}return s}function i(t,e,r,n){var i,o,s,l,c=e.geometry,u=e.type,f=[],h=r*r;if(1===u)for(i=0;ih)&&(d.push(l),t.numSimplified++),t.numPoints++;3===u&&a(d,s.outer),f.push(d)}else t.numPoints+=s.length;if(f.length){var p={geometry:f,type:u,tags:e.tags||null};null!==e.id&&(p.id=e.id),t.features.push(p)}}function a(t,e){o(t)<0===e&&t.reverse()}function o(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;i0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}function s(t,e){var r=new i(t);return r.update(e),r}e.exports=s;var l=t("./lib/text.js"),c=t("./lib/lines.js"),u=t("./lib/background.js"),f=t("./lib/cube.js"),h=t("./lib/ticks.js"),d=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),p=i.prototype;p.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(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,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(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]}),s=!1,u=!1;if("bounds"in t)for(var f=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)f[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=f[d][p];if("ticks"in t){r=t.ticks,s=!0,this.autoTicks=!1;for(var d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,s=!0,this._firstInit=!1),u&&this.autoTicks&&(r=h.create(this.bounds,this.tickSpacing),s=!0),s){for(var d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});h.equal(r,this.ticks)?s=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(s=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||s)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=l(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&s&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=c(this.gl,this.bounds,this.ticks))};var m=[new a,new a,new a],v=[0,0,0],g={model:d,view:d,projection:d};p.isOpaque=function(){return!0},p.isTransparent=function(){return!1},p.drawTransparent=function(t){};var y=[0,0,0],b=[0,0,0],x=[0,0,0];p.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||d,i=t.view||d,a=t.projection||d,s=this.bounds,l=f(r,i,a,s),c=l.cubeEdges,u=l.axis,h=i[12],p=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*h+a[7]*p+a[11]*_+a[15]*w)/e.drawingBufferHeight,T=0;T<3;++T)this.lastCubeProps.cubeEdges[T]=c[T],this.lastCubeProps.axis[T]=u[T];for(var k=m,T=0;T<3;++T)o(m[T],T,this.bounds,c,u);for(var e=this.gl,A=v,T=0;T<3;++T)this.backgroundEnable[T]?A[T]=u[T]:A[T]=0;this._background.draw(r,i,a,s,A,this.backgroundColor),this._lines.bind(r,i,a,this);for(var T=0;T<3;++T){var E=[0,0,0];u[T]>0?E[T]=s[1][T]:E[T]=s[0][T];for(var S=0;S<2;++S){var L=(T+1+S)%3,C=(T+1+(1^S))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,E,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(var S=0;S<2;++S){var L=(T+1+S)%3,C=(T+1+(1^S))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,E,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(var T=0;T<3;++T){this.lineEnable[T]&&this._lines.drawAxisLine(T,this.bounds,k[T].primalOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio),this.lineMirror[T]&&this._lines.drawAxisLine(T,this.bounds,k[T].mirrorOffset,this.lineColor[T],this.lineWidth[T]*this.pixelRatio);for(var I=n(y,k[T].primalMinor),D=n(b,k[T].mirrorMinor),P=this.lineTickLength,S=0;S<3;++S){var z=M/r[5*S];I[S]*=P[S]*z,D[S]*=P[S]*z}this.lineTickEnable[T]&&this._lines.drawAxisTicks(T,k[T].primalOffset,I,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio),this.lineTickMirror[T]&&this._lines.drawAxisTicks(T,k[T].mirrorOffset,D,this.lineTickColor[T],this.lineTickWidth[T]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(var T=0;T<3;++T){for(var O=k[T].primalMinor,R=n(x,k[T].primalOffset),S=0;S<3;++S)this.lineTickEnable[T]&&(R[S]+=M*O[S]*Math.max(this.lineTickLength[S],0)/r[5*S]);if(this.tickEnable[T]){for(var S=0;S<3;++S)R[S]+=M*O[S]*this.tickPad[S]/r[5*S];this._text.drawTicks(T,this.tickSize[T],this.tickAngle[T],R,this.tickColor[T])}if(this.labelEnable[T]){for(var S=0;S<3;++S)R[S]+=M*O[S]*this.labelPad[S]/r[5*S];R[T]+=.5*(s[0][T]+s[1][T]),this._text.drawLabel(T,this.labelSize[T],this.labelAngle[T],R,this.labelColor[T])}}},p.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":149,"./lib/cube.js":150,"./lib/lines.js":151,"./lib/text.js":153,"./lib/ticks.js":154}],149:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}function i(t){for(var e=[],r=[],i=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],d=-1;d<=1;d+=2){r.push(i,i+2,i+1,i+1,i+2,i+3),f[l]=d,h[l]=d;for(var p=-1;p<=1;p+=2){f[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),i+=1}var v=c;c=u,u=v}var g=a(t,new Float32Array(e)),y=a(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=o(t,[{buffer:g,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:g,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=s(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,g,b,x)}e.exports=i;var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders").bg,l=n.prototype;l.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),l.disable(l.POLYGON_OFFSET_FILL)}},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":152,"gl-buffer":156,"gl-vao":277}],150:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eE&&(_|=1<E&&(_|=1<h[m][1]&&(O=m));for(var R=-1,m=0;m<3;++m){var F=O^1<h[j][0]&&(j=F)}}var N=v;N[0]=N[1]=N[2]=0,N[o.log2(R^O)]=O&R,N[o.log2(O^j)]=O&j;var B=7^j;B===_||B===z?(B=7^R,N[o.log2(j^B)]=B&j):N[o.log2(R^B)]=B&R;for(var U=g,V=_,T=0;T<3;++T)U[T]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 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 colorChannel = abs(normal);\n}","precision mediump 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}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":261}],153:[function(t,e,r){(function(r){"use strict";function n(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}function i(t,e){try{return l(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}function a(t,e,r,i,a,l){var u=o(t),f=s(t,[{buffer:u,size:3}]),h=c(t);h.attributes.position.location=0;var d=new n(t,h,u,f);return d.update(e,r,i,a,l),d}e.exports=a;var o=t("gl-buffer"),s=t("gl-vao"),l=t("vectorize-text"),c=t("./shaders").text,u=window||r.global||{},f=u.__TEXT_CACHE||{};u.__TEXT_CACHE={};var h=n.prototype,d=[0,0];h.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,d[0]=this.gl.drawingBufferWidth,d[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=d},h.update=function(t,e,r,n,a){function o(t,e,r,n){var a=f[r];a||(a=f[r]={});var o=a[e];o||(o=a[e]=i(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,c=o.positions,u=o.cells,h=0,d=u.length;h=0;--m){var v=c[p[m]];s.push(l*v[0],-l*v[1],t)}}for(var s=(this.gl,[]),l=[0,0,0],c=[0,0,0],u=[0,0,0],h=[0,0,0],d=0;d<3;++d){u[d]=s.length/3|0,o(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(s.length/3|0)-u[d],l[d]=s.length/3|0;for(var p=0;p=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r}function a(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 a(t,e){for(var r=l.malloc(t.length,e),n=t.length,i=0;i=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}function s(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||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(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==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 a=t.createBuffer(),o=new n(t,r,a,0,i);return o.update(e),o}var l=t("typedarray-pool"),c=t("ndarray-ops"),u=t("ndarray"),f=["uint8","uint8_clamped","uint16","uint32","int8","int16","int32","float32"],h=n.prototype;h.bind=function(){this.gl.bindBuffer(this.type,this.handle)},h.unbind=function(){this.gl.bindBuffer(this.type,null)},h.dispose=function(){this.gl.deleteBuffer(this.handle)},h.update=function(t,e){if("number"!=typeof e&&(e=-1),this.bind(),"object"==typeof t&&void 0!==t.shape){var r=t.dtype;if(f.indexOf(r)<0&&(r="float32"),this.type===this.gl.ELEMENT_ARRAY_BUFFER){r=gl.getExtension("OES_element_index_uint")&&"uint16"!==r?"uint32":"uint16"}if(r===t.dtype&&o(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=l.malloc(t.size,r),s=u(n,t.shape);c.assign(s,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),l.free(n)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,h,e):i(this.gl,this.type,this.length,this.usage,h.subarray(0,t.length),e),l.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(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,t<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=s},{ndarray:476,"ndarray-ops":470,"typedarray-pool":549}],157:[function(t,e,r){e.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"}},{}],158:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":157}],159:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.numPoints=0,this.color=[0,0,0,1]}function i(t,e){var r=a(t.gl,l.vertex,l.fragment),i=o(t.gl),s=o(t.gl),c=new n(t,r,i,s);return c.update(e),t.addObject(c),c}var a=t("gl-shader"),o=t("gl-buffer"),s=t("typedarray-pool"),l=t("./lib/shaders");e.exports=i;var c=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],u=n.prototype;u.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,l=this.numPoints;if(l){var u=a.gl,f=a.dataBox,h=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],v=f[2]-f[0],g=f[3]-f[1],y=2*p/v,b=2*m/g,x=(s[0]-f[0]-.5*v)/p,_=(s[1]-f[1]-.5*g)/m;t[0]=y,t[1]=b,e[0]=y-t[0],e[1]=b-t[1],r[0]=x,r[1]=_,n[0]=x-r[0],n[1]=_-r[1];var w=h[2]-h[0],M=h[3]-h[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(u.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(u.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(u.FLOAT,!1,16,8),u.drawArrays(u.TRIANGLES,0,l*c.length)}}}(),u.drawPick=function(t){return t},u.pick=function(){return null},u.update=function(t){t=t||{};var e,r,n,i=t.positions||[],a=t.errors||[],o=1;"lineWidth"in t&&(o=+t.lineWidth);var l=5;"capSize"in t&&(l=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var u=this.bounds=[1/0,1/0,-(1/0),-(1/0)],f=this.numPoints=i.length>>1;for(e=0;e0&&(A*=_),E<0?E*=w:E>0&&(E*=M),v[b++]=h*(r-p+A),v[b++]=d*(n-m+E),v[b++]=o*k[2]+(l+o)*k[4],v[b++]=o*k[3]+(l+o)*k[5]}}for(e=0;e=1},f.isTransparent=function(){return this.opacity<1},f.drawTransparent=f.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||u,i=r.projection=t.projection||u;r.model=t.model||u,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],c=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*c,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var h=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=(n+e)%3,o=[0,0,0];o[a]=i,r.push(o)}t[e]=r}return t}();f.update=function(t){t=t||{},"lineWidth"in t&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m=f.slice();m[c]+=d[1][c],o.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},f.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":167,"gl-buffer":156,"gl-vao":165}],162:[function(t,e,r){"use strict";function n(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&&h.drawBuffersWEBGL(y[f]);var g=r.getExtension("WEBGL_depth_texture");g?d?t.depth=s(r,c,u,g.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=s(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=l(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=l(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=l(r,c,u,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==r.FRAMEBUFFER_COMPLETE){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);for(var v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(a),c=0;co||r<0||r>o)throw new Error("gl-fbo: Parameters are too large for FBO");n=n||{};var s=1;if("color"in n){if((s=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(s>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(s>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+s+" draw buffers")}}var l=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&s>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");l=t.FLOAT}else n.preferFloat&&s>0&&c&&(l=t.FLOAT);var f=!0;"depth"in n&&(f=!!n.depth);var h=!1;return"stencil"in n&&(h=!!n.stencil),new u(t,e,r,l,s,f,h,i)}var d=t("gl-texture2d");e.exports=h;var p,m,v,g,y=null,b=u.prototype;Object.defineProperties(b,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return f(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,f(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,f(this,this._shape[0],t),t},enumerable:!1}}),b.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},b.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.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){t=t||{};var e=t.shape||[0,0],r=t.x||o(e[0]),n=t.y||o(e[1]),i=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,f=this.bounds,d=f[0]=r[0],p=f[1]=n[0],m=f[2]=r[r.length-1],v=f[3]=n[n.length-1],g=1/(m-d),y=1/(v-p),b=e[0],x=e[1];this.shape=[b,x];var _=(b-1)*(x-1)*(h.length>>>1);this.numVertices=_;for(var w=s.mallocUint8(4*_),M=s.mallocFloat32(2*_),T=s.mallocUint8(2*_),k=s.mallocUint32(_),A=0,E=0;E2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,a),x.color=u,x.radius=s*c,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),h.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,c=this.pickShader,u=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,c.bind();var f=c.uniforms;this.setProjectionUniforms(f,i),f.width=o*l,f.pickOffset=t;var h=c.attributes;return this.lineBufferHi.bind(),h.aHi.pointer(s.FLOAT,!1,16,0),h.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),h.aLo.pointer(s.FLOAT,!1,16,0),u.bind(),h.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),h.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),h.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},h.update=function(t){t=t||{};var e,r,n,a,o,s=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=i(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var f=t.dashes||[1],h=0;for(e=0;e1,this.dashPattern=l(s,c(d,[h,1,4],[1,0,0])),this.dashPattern.minFilter=s.NEAREST,this.dashPattern.magFilter=s.NEAREST,this.dashLength=h,u.free(d);var m=t.positions;this.data=m;var v=this.bounds;v[0]=v[1]=1/0,v[2]=v[3]=-(1/0);var g=this.numPoints=m.length>>>1;if(0!==g){for(e=0;e1;){var k=--n;a=m[2*n],o=m[2*n+1];var A=k-1,E=m[2*A],S=m[2*A+1];if(!(isNaN(a)||isNaN(o)||isNaN(E)||isNaN(S))){T+=1,a=(a-v[0])/(v[2]-v[0]),o=(o-v[1])/(v[3]-v[1]),E=(E-v[0])/(v[2]-v[0]),S=(S-v[1])/(v[3]-v[1]);var L=E-a,C=S-o,I=k|1<<24,D=k-1,P=k,z=k-1|1<<24;y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=D,y[--w]=C,y[--w]=L,y[--w]=S,y[--w]=E,_[--M]=P,_[--M]=z,y[--w]=-C,y[--w]=-L,y[--w]=S,y[--w]=E,_[--M]=P,_[--M]=z,y[--w]=C,y[--w]=L,y[--w]=S,y[--w]=E,_[--M]=P,_[--M]=z,y[--w]=-C,y[--w]=-L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=D,y[--w]=C,y[--w]=L,y[--w]=o,y[--w]=a,_[--M]=I,_[--M]=D}}for(e=0;e 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 highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp 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 highp 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\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":261}],176:[function(t,e,r){"use strict";function n(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 i(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 a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(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.dirty=!0,this.pixelRatio=1}function s(t){var e=t.gl||t.scene&&t.scene.gl,r=m(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 n=v(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=l(e),a=c(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),s=d(new Array(1024),[256,1,4]),f=0;f<1024;++f)s.data[f]=255;var h=u(e,s);h.wrap=e.REPEAT;var p=new o(e,r,n,i,a,h);return p.update(t),p}e.exports=s;var l=t("gl-buffer"),c=t("gl-vao"),u=t("gl-texture2d"),f=t("glsl-read-float"),h=t("binary-search-bounds"),d=t("ndarray"),p=t("./lib/shaders"),m=p.createShader,v=p.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=o.prototype;y.isTransparent=function(){return this.opacity<1},y.isOpaque=function(){return this.opacity>=1},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(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)},y.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},y.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],f=0,p=0,m=[[1/0,1/0,1/0],[-(1/0),-(1/0),-(1/0)]],v=!1;t:for(e=1;e0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,v=!0}continue t}m[0][r]=Math.min(m[0][r],g[r],y[r]),m[1][r]=Math.max(m[1][r],g[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=f;if(f+=n(g,y),v){for(r=0;r<2;++r)l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,v=!1}l.push(g[0],g[1],g[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],g[0],g[1],g[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],g[0],g[1],g[2],f,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],g[0],g[1],g[2],f,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(f),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var T=t.dashes,k=T.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,v=o*u,g=s*l,y=s*c,b=s*u,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+v))*x,t[1]=(h+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(h-b)*_,t[5]=(1-(f+v))*_,t[6]=(m+g)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-g)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,v=o*f,g=s*f,y=l*c,b=l*u,x=l*f,_=n[0],w=n[1],M=n[2],T=i[0],k=i[1],A=i[2];return t[0]=(1-(m+g))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(h+g))*w,t[6]=(v+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(v-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+T-(t[0]*T+t[4]*k+t[8]*A),t[13]=r[1]+k-(t[1]*T+t[5]*k+t[9]*A),t[14]=r[2]+A-(t[2]*T+t[6]*k+t[10]*A),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,v=a*s,g=a*l;return t[0]=1-f-p,t[1]=u+g,t[2]=h-v,t[3]=0,t[4]=u-g,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+v,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((o-s)*l*.5),t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,f,h,d,p,m,v=e[0],g=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],T=r[2];return Math.abs(v-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],v=r[3];return a=c*d+u*p+f*m+h*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*v,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=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,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":198,"./mat3.js":201,"./vec3.js":205,"./vec4.js":206}],204:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=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},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=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},i.transformMat3=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=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.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":198}],206:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=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},i.subtract=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},i.sub=i.subtract,i.multiply=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},i.mul=i.multiply,i.divide=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},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=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},i.max=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},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=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},i.scaleAndAdd=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},i.distance=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)},i.dist=i.distance,i.squaredDistance=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},i.sqrDist=i.squaredDistance,i.length=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)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=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},i.normalize=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},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=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},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;v+=m[u]}return Math.abs(v-1)>.001?null:[f,o(t,m),m]}var l=t("barycentric"),c=t("polytope-closest-point/lib/closest_point_2d.js");e.exports=s},{barycentric:49,"polytope-closest-point/lib/closest_point_2d.js":495}],208:[function(t,e,r){var n="precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if(any(lessThan(f_position, clipBounds[0])) || \n any(greaterThan(f_position, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId, f_id.xyz);\n}";r.meshShader={vertex:"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection;\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\nvoid main() {\n vec4 m_position = model * vec4(position, 1.0);\n vec4 t_position = view * m_position;\n gl_Position = projection * t_position;\n f_color = color;\n f_normal = normal;\n f_data = position;\n f_eyeDirection = eyePosition - position;\n f_lightDirection = lightPosition - position;\n f_uv = uv;\n}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(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\n\n\nfloat cookTorranceSpecular_1_1(\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_2_0(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\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular\n , opacity;\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(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\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 = cookTorranceSpecular_1_1(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}",attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:"precision mediump 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}",fragment:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(f_data, clipBounds[0])) || \n any(greaterThan(f_data, clipBounds[1]))) {\n discard;\n }\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(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}",fragment:"precision mediump 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}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump 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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump 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}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],209:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,v,g,y,b,x,_,w,M,T,k,A){this.gl=t,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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=v,this.edgeUVs=g,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=M,this.pointIds=x,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=k,this.contourVAO=A,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!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._model=P,this._view=P,this._projection=P,this._resolution=[1,1]}function i(t){for(var e=w({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 _(r,[256,256,4],[4,0,1])}function a(t,e,r){for(var n=new Array(e),i=0;i=1},z.isTransparent=function(){return this.opacity<1},z.pickSlots=1,z.setPickBase=function(t){this.pickId=t},z.highlight=function(t){if(!t||!this.contourEnable)return void(this.contourCount=0);for(var e=M(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=T.mallocFloat32(6*a),s=0,l=0;l0){var h=this.triShader;h.bind(),h.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){var h=this.lineShader;h.bind(),h.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){var h=this.pointShader;h.bind(),h.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var h=this.contourShader;h.bind(),h.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},z.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||P,n=t.view||P,i=t.projection||P,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,pickId:this.pickId/255},l=this.pickShader;if(l.bind(),l.uniforms=s,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),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l=this.pointPickShader;l.bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},z.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;as[T]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n],a.uniforms.angle=g[n],c.drawArrays(c.TRIANGLES,s[T],s[k]-s[T]))),y[n]&&M&&(e[1^n]-=A*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=A*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=A*d*m[n+2],Ts[T]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=v[n+2],a.uniforms.angle=g[n+2],c.drawArrays(c.TRIANGLES,s[T],s[k]-s[T]))),y[n+2]&&M&&(e[1^n]+=A*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),u.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),u.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],f=a[c+2],h=f-u,d=.5*(o[c+2]+o[c]),p=o[c+2]-o[c],m=l[c],v=l[c+2],g=v-m,y=s[c],b=s[c+2],x=b-y;e[c]=2*h/p*g/x,t[c]=2*(u-d)/p*g/x}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),u.update=function(t){var e,r,n,i,a,o=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(o.length/3)],f=[-(1/0)],h=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var T=0|M.type.charAt(M.type.length-1),k=new Array(T),A=0;A=0;)E+=1;w[b]=E}var S=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,x,w),Object.defineProperty(d,"uniforms",o(p,d,r,S))},e.exports=a},{"./lib/GLError":217,"./lib/create-attributes":218,"./lib/create-uniforms":219,"./lib/reflect":220,"./lib/runtime-reflect":221,"./lib/shader-cache":222}],217:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}n.prototype=new Error,n.prototype.name="GLError",n.prototype.constructor=n,e.exports=n},{}],218:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,o,f)}else{if(!(h.indexOf("mat")>=0))throw new s("","Unknown data type for attribute "+f+": "+h);var p=h.charCodeAt(h.length-1)-48;if(p<2||p>4)throw new s("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,o,f)}}}return o}e.exports=o;var s=t("./GLError"),l=n.prototype;l.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)},l.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(l,"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}})},{"./GLError":217}],219:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new s("","Unknown uniform data type for "+name+": "+r)}var i=r.charCodeAt(r.length-1)-48;if(i<2||i>4)throw new s("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new s("","Unrecognized data type for vector "+name+": "+r)}}}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 f(e){for(var n=["return function updateProperty(obj){"],i=u("",e),o=0;o4)throw new s("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r=t.charCodeAt(t.length-1)-48;if(r<2||r>4)throw new s("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new s("","Unknown uniform data type for "+name+": "+t)}}function d(t,e,i){if("object"==typeof i){var o=p(i);Object.defineProperty(t,e,{get:n(o),set:f(i),enumerable:!0,configurable:!1})}else a[i]?Object.defineProperty(t,e,{get:l(i),set:f(i),enumerable:!0,configurable:!1}):t[e]=h(r[i].type)}function p(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){l[0]in o||(o[l[0]]=[]),o=o[l[0]];for(var c=1;c1)for(var l=0;l0&&(h+=.02);for(var p=new Float32Array(f),m=0,v=-.5*h,d=0;d=0){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(var p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(var t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},h.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},h.removeObject=function(t){for(var e=this.objects,r=0;r0){var r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function o(t){return"boolean"!=typeof t||t}function s(t){function e(){if(!w&&G.autoResize){var t=M.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*G.pixelRatio),i=0|Math.ceil(r*G.pixelRatio);if(n!==M.width||i!==M.height){M.width=n,M.height=i;var a=M.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",N=!0}}}function r(){for(var t=O.length,e=j.length,r=0;r0&&0===F[e-1];)F.pop(),j.pop().dispose()}function s(){if(G.contextLost)return!0;k.isContextLost()&&(G.contextLost=!0,G.mouseListener.enabled=!1,G.selection.object=null,G.oncontextloss&&G.oncontextloss())}function b(){if(!s()){k.colorMask(!0,!0,!0,!0),k.depthMask(!0),k.disable(k.BLEND),k.enable(k.DEPTH_TEST);for(var t=O.length,e=j.length,r=0;rE.distance)continue;for(var c=0;c>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}function a(t,e){var r=t.gl,i=s(r),a=s(r),l=o(r,c.pointVertex,c.pointFragment),u=o(r,c.pickVertex,c.pickFragment),f=new n(t,i,a,l,u);return f.update(e),t.addObject(f),f}var o=t("gl-shader"),s=t("gl-buffer"),l=t("typedarray-pool"),c=t("./lib/shader");e.exports=a;var u=n.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){function e(e,r){return e in t?t[e]:r}var r;t=t||{},this.sizeMin=e("sizeMin",.5),this.sizeMax=e("sizeMax",20),this.color=e("color",[1,0,0,1]).slice(),this.areaRatio=e("areaRatio",1),this.borderColor=e("borderColor",[0,0,0,1]).slice(),this.blend=e("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,o=t.positions,s=i?o:l.mallocFloat32(o.length),c=a?t.idToIndex:l.mallocInt32(n);if(i||s.set(o),!a)for(s.set(o),r=0;r>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),a.attributes.pickId.pointer(o.UNSIGNED_BYTE),a.uniforms.pickOffset=e,this.pickOffset=r);var h=o.getParameter(o.BLEND),d=o.getParameter(o.DITHER);return h&&!this.blend&&o.disable(o.BLEND),d&&o.disable(o.DITHER),o.drawArrays(o.POINTS,0,this.pointCount),h&&!this.blend&&o.enable(o.BLEND),d&&o.enable(o.DITHER),r+this.pointCount}}(),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.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]]}}},{"./lib/shader":227,"gl-buffer":156,"gl-shader":228,"typedarray-pool":549}],236:[function(t,e,r){function n(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],v=r[3];return a=c*d+u*p+f*m+h*v,a<0&&(a=-a,d=-d,p=-p,m=-m,v=-v),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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*v,t}e.exports=n},{}],237:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],238:[function(t,e,r){arguments[4][84][0].apply(r,arguments)},{dup:84}],239:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{"./lib/GLError":240,"./lib/create-attributes":241,"./lib/create-uniforms":242,"./lib/reflect":243,"./lib/runtime-reflect":244,"./lib/shader-cache":245,dup:216}],240:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],241:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{"./GLError":240,dup:218}],242:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":240,"./reflect":243,dup:219}],243:[function(t,e,r){arguments[4][220][0].apply(r,arguments)},{dup:220}],244:[function(t,e,r){arguments[4][221][0].apply(r,arguments)},{dup:221}],245:[function(t,e,r){arguments[4][222][0].apply(r,arguments)},{"./GLError":240,dup:222,"gl-format-compiler-error":169,"weakmap-shim":569}],246:[function(t,e,r){"use strict";function n(t){g=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],y=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],b=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}function i(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}function a(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 o(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}function s(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 l(t,e,r,n,i,a,o,l){var c=l.dtype,u=l.shape.slice();if(u.length<2||u.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var f=0,h=0,d=s(u,l.stride.slice());"float32"===c?f=t.FLOAT:"float64"===c?(f=t.FLOAT,d=!1,c="float32"):"uint8"===c?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,d=!1,c="uint8");if(2===u.length)h=t.LUMINANCE,u=[u[0],u[1],1],l=p(l.data,u,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==u.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===u[2])h=t.ALPHA;else if(2===u[2])h=t.LUMINANCE_ALPHA;else if(3===u[2])h=t.RGB;else{if(4!==u[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}u[2]}if(h!==t.LUMINANCE&&h!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(h=i),h!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var g=l.size,y=o.indexOf(n)<0;if(y&&o.push(n),f===a&&d)0===l.offset&&l.data.length===g?y?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,l.data.subarray(l.offset,l.offset+g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,l.data.subarray(l.offset,l.offset+g));else{var b;b=a===t.FLOAT?v.mallocFloat32(g):v.mallocUint8(g);var _=p(b,u,[u[2],u[2]*u[0],1]);f===t.FLOAT&&a===t.UNSIGNED_BYTE?x(_,l):m.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,b.subarray(0,g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,b.subarray(0,g)),a===t.FLOAT?v.freeFloat32(b):v.freeUint8(b)}}function c(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 u(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 s=c(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new o(t,s,e,r,n,i)}function f(t,e,r,n,i,a){var s=c(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new o(t,s,r,n,i,a)}function h(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var a=s(n,e.stride.slice()),l=0;"float32"===r?l=t.FLOAT:"float64"===r?(l=t.FLOAT,a=!1,r="float32"):"uint8"===r?l=t.UNSIGNED_BYTE:(l=t.UNSIGNED_BYTE,a=!1,r="uint8");var u=0;if(2===n.length)u=t.LUMINANCE,n=[n[0],n[1],1],e=p(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])u=t.ALPHA;else if(2===n[2])u=t.LUMINANCE_ALPHA;else if(3===n[2])u=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");u=t.RGBA}}l!==t.FLOAT||t.getExtension("OES_texture_float")||(l=t.UNSIGNED_BYTE,a=!1);var f,h,d=e.size;if(a)f=0===e.offset&&e.data.length===d?e.data:e.data.subarray(e.offset,e.offset+d);else{var g=[n[2],n[2]*n[0],1];h=v.malloc(d,r);var y=p(h,n,g,0);"float32"!==r&&"float64"!==r||l!==t.UNSIGNED_BYTE?m.assign(y,e):x(y,e),f=h.subarray(0,d)}var b=c(t);return t.texImage2D(t.TEXTURE_2D,0,u,n[0],n[1],0,u,l,f),a||v.free(h),new o(t,b,n[0],n[1],u,l)}function d(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(g||n(t),"number"==typeof arguments[1])return u(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return u(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=i(e)?e:e.raw;if(r)return f(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return h(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var p=t("ndarray"),m=t("ndarray-ops"),v=t("typedarray-pool");e.exports=d;var g=null,y=null,b=null,x=function(t,e){m.muls(t,e,255)},_=o.prototype;Object.defineProperties(_,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl -;if(this.type===e.FLOAT&&g.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.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&&g.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),y.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(),b.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(),b.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(b.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 a(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,a(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,a(this,this._shape[0],t),t}}}),_.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},_.dispose=function(){this.gl.deleteTexture(this.handle)},_.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)},_.setPixels=function(t,e,r,n){var a=this.gl;this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0;var o=i(t)?t:t.raw;if(o){this._mipLevels.indexOf(n)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,o),this._mipLevels.push(n)):a.texSubImage2D(a.TEXTURE_2D,n,e,r,this.format,this.type,o)}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]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");l(a,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:476,"ndarray-ops":470,"typedarray-pool":549}],247:[function(t,e,r){"use strict";function n(t,e,r,n,a){a<=4*h?i(0,a-1,t,e,r,n):f(0,a-1,t,e,r,n)}function i(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],f=a[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function a(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function o(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function s(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],f=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=f}function l(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function c(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function u(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function f(t,e,r,n,d,p){var m=(e-t+1)/6|0,v=t+m,g=e-m,y=t+e>>1,b=y-m,x=y+m,_=v,w=b,M=y,T=x,k=g,A=t+1,E=e-1,S=0;c(_,w,r,n,d,p)&&(S=_,_=w,w=S),c(T,k,r,n,d,p)&&(S=T,T=k,k=S),c(_,M,r,n,d,p)&&(S=_,_=M,M=S),c(w,M,r,n,d,p)&&(S=w,w=M,M=S),c(_,T,r,n,d,p)&&(S=_,_=T,T=S),c(M,T,r,n,d,p)&&(S=M,M=T,T=S),c(w,k,r,n,d,p)&&(S=w,w=k,k=S),c(w,M,r,n,d,p)&&(S=w,w=M,M=S),c(T,k,r,n,d,p)&&(S=T,T=k,k=S);var L=r[w],C=n[2*w],I=n[2*w+1],D=d[w],P=p[w],z=r[T],O=n[2*T],R=n[2*T+1],F=d[T],j=p[T],N=_,B=M,U=k,V=v,H=y,q=g,G=r[N],Y=r[B],X=r[U];r[V]=G,r[H]=Y,r[q]=X;for(var W=0;W<2;++W){var Z=n[2*N+W],J=n[2*B+W],K=n[2*U+W];n[2*V+W]=Z,n[2*H+W]=J,n[2*q+W]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[H]=$,d[q]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[H]=rt,p[q]=nt,o(b,t,r,n,d,p),o(x,e,r,n,d,p);for(var it=A;it<=E;++it)if(u(it,L,C,I,D,r,n,d))it!==A&&a(it,A,r,n,d,p),++A;else if(!u(it,z,O,R,F,r,n,d))for(;;){if(u(E,z,O,R,F,r,n,d)){u(E,L,C,I,D,r,n,d)?(s(it,A,E,r,n,d,p),++A,--E):(a(it,E,r,n,d,p),--E);break}if(--E=Math.max(.9*d,32)){var _=c+s>>>1;l(v,g,f,h,_,u+1),h=_}l(v,g,f,h,y,u+1),h=y}}}var c=t.length>>>1;if(c<1)return[];e||(e=Array(c)),r||(r=Array(c)),a||(a=[]);for(var u=0;u=a[2]||a[1]>=a[3]){var f=s(t,2);f[0]===f[2]&&(f[2]+=1),f[1]===f[3]&&(f[3]+=1),a[0]=f[0],a[1]=f[1],a[2]=f[2],a[3]=f[3]}var h=a[0],d=a[1],p=a[2],m=a[3],v=1/(p-h),g=1/(m-d),y=Math.max(p-h,m-d),b=new Int32Array(c),x=0;l(h,d,y,0,c,0),o(b,t,e,r,c);for(var _=[],w=0,M=c,x=c-1;x>=0;--x){t[2*x]=(t[2*x]-h)*v,t[2*x+1]=(t[2*x+1]-d)*g;var T=b[x];T!==w&&(_.push(new i(y*Math.pow(.5,T),x+1,M-(x+1))),M=x+1,w=T)}return _.push(new i(y*Math.pow(.5,T+1),0,M)),_}var o=t("./lib/sort"),s=t("array-bounds");e.exports=a},{"./lib/sort":247,"array-bounds":45}],249:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=m(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=m(this.plot.gl,[256,1])}function i(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,i=r[2]-r[0],a=r[3]-r[1],c=2/i,u=2/a,f=-r[0]-.5*i,h=-r[1]-.5*a;_[0]=c,w[0]=c-_[0],_[1]=u,w[1]=u-_[1],M[0]=f,T[0]=f-M[0],M[1]=h,T[1]=h-M[1];var d=e[2]-e[0],p=e[3]-e[1];o=Math.min(i/d,a/p),k[0]=2*n/d,k[1]=2*n/p,s=r[0],l=r[2]}function a(t,e){var r=t.gl,i=c(r,h.vertex,h.fragment),a=c(r,h.pickVertex,h.pickFragment),o=u(r),s=u(r),l=u(r),f=u(r),d=u(r),p=new n(t,i,a,o,s,l,f,d);return p.update(e),t.addObject(p),p}e.exports=a;var o,s,l,c=t("gl-shader"),u=t("gl-buffer"),f=t("typedarray-pool"),h=t("./lib/shaders"),d=t("snap-points-2d"),p=t("font-atlas-sdf"),m=t("gl-texture2d"),v=t("color-id"),g=t("ndarray"),y=t("clamp"),b=t("binary-search-bounds"),x=n.prototype,_=new Float32Array([0,0]),w=new Float32Array([0,0]),M=new Float32Array([0,0]),T=new Float32Array([0,0]),k=[0,0],A=[0,0,0,0];x.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,a=n>this.snapThreshold;if(!n)return t;i.call(this);var c=r.gl,u=e?this.pickShader:this.shader,f=c.isEnabled(c.BLEND);if(u.bind(),e){this.pickOffset=t;for(var h=0;h<4;++h)A[h]=t>>8*h&255;u.uniforms.pickOffset=A,this.idBuffer.bind(),u.attributes.id.pointer(c.UNSIGNED_BYTE,!1)}else c.blendFuncSeparate(c.SRC_ALPHA,c.ONE_MINUS_SRC_ALPHA,c.ONE,c.ONE_MINUS_SRC_ALPHA),c.blendColor(0,0,0,1),f||c.enable(c.BLEND),this.colorBuffer.bind(),u.attributes.color.pointer(c.UNSIGNED_BYTE,!1),this.charBuffer.bind(),u.attributes.char.pointer(c.UNSIGNED_BYTE,!1),u.uniforms.chars=this.charTexture.bind(0),u.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],u.uniforms.charsStep=this.charStep,u.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),u.attributes.size.pointer(c.FLOAT,!1,8,0),e||u.attributes.border.pointer(c.FLOAT,!1,8,4),this.positionBuffer.bind(),u.attributes.positionHi.pointer(c.FLOAT,!1,16,0),u.attributes.positionLo.pointer(c.FLOAT,!1,16,8),u.uniforms.pixelRatio=r.pixelRatio,u.uniforms.scaleHi=_,u.uniforms.scaleLo=w,u.uniforms.translateHi=M,u.uniforms.translateLo=T,u.uniforms.viewBox=r.viewBox;var d=this.scales;if(a)for(var p=d.length-1;p>=0;p--){var m=d[p];if(!(m.pixelSize&&m.pixelSize<1.25*o&&p>1)){var v=m.offset,g=m.count+v,y=b.ge(this.xCoords,s,v,g-1),x=b.lt(this.xCoords,l,y,g-1)+1;x>y&&c.drawArrays(c.POINTS,y,x-y)}}else c.drawArrays(c.POINTS,0,n);if(e)return t+n;f?c.blendFunc(c.ONE,c.ONE_MINUS_SRC_ALPHA):c.disable(c.BLEND)},x.draw=x.drawPick,x.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]]}},x.update=function(t){t=t||{};var e=t.positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,c=l>this.snapThreshold;if(null!=t.positions){this.points=e,l=this.points.length/2,c=l>this.snapThreshold;var u=f.mallocFloat32(2*l),h=f.mallocFloat64(2*l),m=f.mallocUint32(l),b=f.mallocFloat32(4*l);h.set(this.points),c&&(this.i2idx&&f.free(this.i2idx),this.i2idx=f.mallocInt32(l),this.scales=d(h,this.i2idx,u)),this.pointCount=l;for(var x=0;xF&&(F=i[x]);var j=this.charStep;this.charStep=y(Math.ceil(4*F),128,768);var N=Object.keys(O),B=this.charStep,U=Math.floor(B/2),V=s.getParameter(s.MAX_TEXTURE_SIZE),H=V/B*(V/B),q=Math.min(V,B*N.length),G=Math.min(V,B*Math.ceil(B*N.length/V)),Y=Math.floor(q/B);N.length>H&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==N+""&&this.charStep==j||(this.charCanvas=p({canvas:this.charCanvas,family:"sans-serif",size:U,shape:[q,G],step:[B,B],chars:N,align:!0,fit:this.charFit}),this.chars=N);for(var x=0;x>>1,n=c.mallocInt32(r),i=c.mallocFloat32(r),a=c.mallocFloat64(2*r);if(a.set(this.points),this.snapPoints)this.scales=l(a,n,i,this.bounds);else{this.bounds=h(a,2),f(a,2,this.bounds);for(var o=0;o>8&255,y[2]=t>>16&255,y[3]=t>>24&255,n.uniforms.pickOffset=y,s.bind(),n.attributes.pickId.pointer(f.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var I=!0;if(this.snapPoints)for(var D=i.length-1;D>=0;D--){var P=i[D];if(!(P.pixelSize1)){var z=this.getVisibleRange(P),O=z[0],R=z[1];R>O&&f.drawArrays(f.POINTS,O,R-O),!e&&I&&(I=!1,n.uniforms.useWeight=0)}}else f.drawArrays(f.POINTS,0,this.pointCount);return t+this.pointCount},d.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,i=this.size,a=this.plot.pixelRatio,o=r[2]-r[0];r[3],r[1];if(!t)for(var t,l=this.scales.length-1;l>=0&&(t=this.scales[l],t.pixelSize1);l--);var c=this.xCoords,u=(e[0]-r[0]-n*i*a)/o,f=(e[2]-r[0]+n*i*a)/o,h=t.offset,d=t.count+h,p=s.ge(c,u,h,d-1);return[p,s.lt(c,f,p,d-1)+1]},d.drawPick=d.draw,d.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":250,"array-bounds":45,"array-normalize":46,"binary-search-bounds":251,"gl-buffer":156,"gl-shader":261,"snap-points-2d":253,"typedarray-pool":549}],255:[function(t,e,r){"use strict";function n(t,e){var r=a[e];if(r||(r=a[e]={}),t in r)return r[t];for(var n=i(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=i(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-(1/0),-(1/0)]],l=0;lMath.abs(R[1])){var F=O;O=R,R=F,F=P,P=z,z=F;var j=I;I=D,D=j}O[0]<0&&(P[I]=-1),R[1]>0&&(z[D]=-1);for(var N=0,B=0,C=0;C<4;++C)N+=Math.pow(p[4*I+C],2),B+=Math.pow(p[4*D+C],2);P[I]/=Math.sqrt(N),z[D]/=Math.sqrt(B),d.axes[0]=P,d.axes[1]=z,d.fragClipBounds[0]=c(S,b[0],_,-1e8),d.fragClipBounds[1]=c(S,b[1],_,1e8),e.vao.draw(h.TRIANGLES,e.vertexCount),e.lineWidth>0&&(h.lineWidth(e.lineWidth),e.vao.draw(h.LINES,e.lineVertexCount,e.vertexCount))}}function h(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||x,s.view=n.view||x,s.projection=n.projection||x,w[0]=2/o.drawingBufferWidth,w[1]=2/o.drawingBufferHeight,s.screenSize=w,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=D,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}f(e,r,n,i,a),r.vao.unbind()}function d(t){var e=t.gl,r=y.createPerspective(e),n=y.createOrtho(e),i=y.createProject(e),a=y.createPickPerspective(e),s=y.createPickOrtho(e),l=y.createPickProject(e),c=p(e),u=p(e),f=p(e),h=p(e),d=m(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:f,size:2,type:e.FLOAT},{buffer:h,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new o(e,r,n,i,c,u,f,h,d,a,s,l);return v.update(t),v}var p=t("gl-buffer"),m=t("gl-vao"),v=t("typedarray-pool"),g=t("gl-mat4/multiply"),y=t("./lib/shaders"),b=t("./lib/glyphs"),x=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=d;var _=o.prototype;_.pickSlots=1,_.setPickBase=function(t){this.pickId=t},_.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},_.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var w=[0,0],M=[0,0,0],T=[0,0,0],k=[0,0,0,1],A=[0,0,0,1],E=x.slice(),S=[0,0,0],L=[[0,0,0],[0,0,0]],C=[-1e8,-1e8,-1e8],I=[1e8,1e8,1e8],D=[C,I];_.draw=function(t){h(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},_.drawTransparent=function(t){h(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},_.drawPick=function(t){h(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},_.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(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},_.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]},_.update=function(t){if(t=t||{},"perspective"in t&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{var r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-(1/0),-(1/0),-(1/0)],l=t.glyph,c=t.color,u=t.size,f=t.angle,h=t.lineColor,d=0,p=0,m=0,g=n.length;t:for(var y=0;y0&&(I[0]=-a[0]*(1+k[0][0]));for(var H=M.cells,q=M.positions,_=0;_0){var g=r*u;o.drawBox(f-g,h-g,d+g,h+g,a),o.drawBox(f-g,p-g,d+g,p+g,a),o.drawBox(f-g,h-g,f+g,p+g,a),o.drawBox(d-g,h-g,d+g,p+g,a)}}}},l.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()},l.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":258,"gl-buffer":156,"gl-shader":261}],260:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function i(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)}}function a(t,e){return new i(t,o(t,e),s.mallocUint8(e[0]*e[1]*4))}e.exports=a;var o=t("gl-fbo"),s=t("typedarray-pool"),l=t("ndarray"),c=t("bit-twiddle").nextPow2,u=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_55_arg0_<255||_inline_55_arg1_<255||_inline_55_arg2_<255||_inline_55_arg3_<255){var _inline_55_l=_inline_55_arg4_-_inline_55_arg6_[0],_inline_55_a=_inline_55_arg5_-_inline_55_arg6_[1],_inline_55_f=_inline_55_l*_inline_55_l+_inline_55_a*_inline_55_a;_inline_55_fthis.buffer.length){s.free(this.buffer);for(var n=this.buffer=s.mallocUint8(c(r*e*4)),i=0;i=0){for(var T=0|M.type.charAt(M.type.length-1),k=new Array(T),A=0;A=0;)E+=1;_[w]=E}var S=new Array(r.length);a(),d._relink=a,d.types={uniforms:l(r),attributes:l(n)},d.attributes=s(p,d,b,_),Object.defineProperty(d,"uniforms",o(p,d,r,S))},e.exports=a},{"./lib/GLError":262,"./lib/create-attributes":263,"./lib/create-uniforms":264,"./lib/reflect":265,"./lib/runtime-reflect":266,"./lib/shader-cache":267}],262:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],263:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{"./GLError":262,dup:218}],264:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":262,"./reflect":265,dup:219}],265:[function(t,e,r){arguments[4][220][0].apply(r,arguments)},{dup:220}],266:[function(t,e,r){arguments[4][221][0].apply(r,arguments)},{dup:221}],267:[function(t,e,r){arguments[4][222][0].apply(r,arguments)},{"./GLError":262,dup:222,"gl-format-compiler-error":169,"weakmap-shim":569}],268:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}function i(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r}e.exports=i;var a=n.prototype;a.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},a.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},a.dispose=function(){this.plot.removeOverlay(this)}},{}],269:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":261}],270:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}function i(t,e){function r(t,e,r,n,a,o){var s=[t,e,r,0,0,0,1];s[n+3]=1,s[n]=a,i.push.apply(i,s),s[6]=-1,i.push.apply(i,s),s[n]=o,i.push.apply(i,s),i.push.apply(i,s),s[6]=1,i.push.apply(i,s),s[n]=a,i.push.apply(i,s)}var i=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=a(t,i),c=o(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=s(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new n(t,l,c,u);return f.update(e),f}var a=t("gl-buffer"),o=t("gl-vao"),s=t("./shaders/index");e.exports=i;var l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],c=n.prototype,u=[0,0,0],f=[0,0,0],h=[0,0];c.isTransparent=function(){return!1},c.drawTransparent=function(t){},c.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||l,o=t.view||l,s=t.projection||l;this.axes&&(i=this.axes.lastCubeProps.axis);for(var c=u,d=f,p=0;p<3;++p)i&&i[p]<0?(c[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(c[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=s,n.uniforms.coordinates=[this.position,c,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=h;for(var p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},c.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},c.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":269,"gl-buffer":156,"gl-vao":277}],271:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\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 worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(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\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\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 (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\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_1_1(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 \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + 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",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\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 vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\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",s="precision mediump float;\n#define GLSLIFY 1\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 any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n 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";r.createShader=function(t){var e=n(t,i,a,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},r.createPickShader=function(t){var e=n(t,i,s,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},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":261}],272:[function(t,e,r){"use strict";function n(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}function i(t){var e=x([y({colormap:t,nshades:R,format:"rgba"}).map(function(t){return[t[0],t[1],t[2],255*t[3]]})]);return b.divseq(e,255),e}function a(t,e,r,i,a,o,s,l,c,u,f,h,d,p){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=i,this._pickShader=a,this._coordinateBuffer=o,this._vao=s,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=f,this._contourVAO=h,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new n([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=p,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=[_(g.mallocFloat(1024),[0,0]),_(g.mallocFloat(1024),[0,0]),_(g.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.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}function o(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||j,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=N.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],M(l,t.model,l);var c=N.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return N.showSurface=o,N.showContour=s,N}function s(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=B;n.model=t.model||P,n.view=t.view||P,n.projection=t.projection||P,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.contourColor=this.contourColor[0],n.inverseModel=T(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],s=0;s<3;++s)a[s]=Math.min(Math.max(this.clipBounds[i][s],-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=V,n.vertexColor=this.vertexColor;var l=U;for(M(l,n.view,n.model),M(l,n.projection,l),T(l,l),i=0;i<3;++i)n.eyePosition[i]=l[12+i]/l[15];var c=l[15];for(i=0;i<3;++i)c+=this.lightPosition[i]*l[4*i+3];for(i=0;i<3;++i){var u=l[12+i];for(s=0;s<3;++s)u+=l[4*s+i]*this.lightPosition[s];n.lightPosition[i]=u/c}var f=o(n,this);if(f.showSurface&&e===this.opacity<1){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=f.projections[i],this._shader.uniforms.clipBounds=f.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),i=0;i<3;++i)for(h.uniforms.permutation=O[i],r.lineWidth(this.contourWidth[i]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},F.pickSlots=1,F.setPickBase=function(t){this.pickId=t};var j=[0,0,0],N={showSurface:!1,showContour:!1,projections:[P.slice(),P.slice(),P.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},B={model:P,view:P,projection:P,inverseModel:P.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,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},U=P.slice(),V=[1,0,0,0,1,0,0,0,1];F.draw=function(t){return s.call(this,t,!1)},F.drawTransparent=function(t){return s.call(this,t,!0)};var H={model:P,view:P,projection:P,inverseModel:P,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};F.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=H;r.model=t.model||P,r.view=t.view||P,r.projection=t.projection||P,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=V;for(var n=0;n<2;++n)for(var i=r.clipBounds[n],a=0;a<3;++a)i[a]=Math.min(Math.max(this.clipBounds[n][a],-1e8),1e8);var s=o(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),a=0;a<3;++a)for(e.lineWidth(this.contourWidth[a]),l.uniforms.permutation=O[a],n=0;n>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=h?l:1-l,p=i+u,m=s+h,v=f*d,g=0;g<3;++g)c[g]+=this._field[g].get(p,m)*v;for(var y=this._pickResult.level,b=0;b<3;++b)if(y[b]=k.le(this.contourLevels[b],c[b]),y[b]<0)this.contourLevels[b].length>0&&(y[b]=0);else if(y[b]Math.abs(_-c[b])&&(y[b]+=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],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},F.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=c(t.contourWidth,Number)),"showContour"in t&&(this.showContour=c(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=c(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=f(t.contourColor)),"contourProject"in t&&(this.contourProject=c(t.contourProject,function(t){return c(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=f(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=c(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=c(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);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 n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(g.freeFloat(this._field[2].data),this._field[2].data=g.mallocFloat(d.nextPow2(n))),this._field[2]=_(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),l(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&&(g.freeFloat(this._field[o].data),this._field[o].data=g.mallocFloat(this._field[2].size)),this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var s=t.coords;if(!Array.isArray(s)||3!==s.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var u=s[o];for(y=0;y<2;++y)if(u.shape[y]!==a[y])throw new Error("gl-surface: coords have incorrect shape");l(this._field[o],u)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=h[o];if((Array.isArray(p)||p.length)&&(p=_(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var m=_(p.data,a);m.stride[o]=p.stride[0],m.stride[1^o]=0,l(this._field[o],m)}}else{for(o=0;o<2;++o){var v=[0,0];v[o]=1,this._field[o]=_(this._field[o].data,[a[0]+2,a[1]+2],v,0)}this._field[0].set(0,0,0);for(var y=0;y0){for(var xt=0;xt<5;++xt)tt.pop();H-=1}continue t}tt.push(it[0],it[1],st[0],st[1],it[2]),H+=1}}nt.push(H)}this._contourOffsets[et]=rt,this._contourCounts[et]=nt}var _t=g.mallocFloat(tt.length);for(o=0;oi||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 a(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}function o(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 s(t,e,r,n,i,a,s,l){var c=l.dtype,u=l.shape.slice();if(u.length<2||u.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var f=0,h=0,v=o(u,l.stride.slice());"float32"===c?f=t.FLOAT:"float64"===c?(f=t.FLOAT,v=!1,c="float32"):"uint8"===c?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,v=!1,c="uint8");if(2===u.length)h=t.LUMINANCE,u=[u[0],u[1],1],l=d(l.data,u,[l.stride[0],l.stride[1],1],l.offset);else{if(3!==u.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===u[2])h=t.ALPHA;else if(2===u[2])h=t.LUMINANCE_ALPHA;else if(3===u[2])h=t.RGB;else{if(4!==u[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");h=t.RGBA}u[2]}if(h!==t.LUMINANCE&&h!==t.ALPHA||i!==t.LUMINANCE&&i!==t.ALPHA||(h=i),h!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var g=l.size,y=s.indexOf(n)<0;if(y&&s.push(n),f===a&&v)0===l.offset&&l.data.length===g?y?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,l.data):y?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,l.data.subarray(l.offset,l.offset+g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,l.data.subarray(l.offset,l.offset+g));else{var x;x=a===t.FLOAT?m.mallocFloat32(g):m.mallocUint8(g);var _=d(x,u,[u[2],u[2]*u[0],1]);f===t.FLOAT&&a===t.UNSIGNED_BYTE?b(_,l):p.assign(_,l),y?t.texImage2D(t.TEXTURE_2D,n,i,u[0],u[1],0,i,a,x.subarray(0,g)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,u[0],u[1],i,a,x.subarray(0,g)),a===t.FLOAT?m.freeFloat32(x):m.freeUint8(x)}}function l(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 c(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)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 s=l(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,s,e,r,n,i)}function u(t,e,r,n){var i=l(t);return t.texImage2D(t.TEXTURE_2D,0,r,r,n,e),new a(t,i,0|e.width,0|e.height,r,n)}function f(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var s=o(n,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,s=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,s=!1,r="uint8");var u=0;if(2===n.length)u=t.LUMINANCE,n=[n[0],n[1],1],e=d(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])u=t.ALPHA;else if(2===n[2])u=t.LUMINANCE_ALPHA;else if(3===n[2])u=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");u=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,s=!1);var f,h,v=e.size;if(s)f=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var g=[n[2],n[2]*n[0],1];h=m.malloc(v,r);var y=d(h,n,g,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?p.assign(y,e):b(y,e),f=h.subarray(0,v)}var x=l(t);return t.texImage2D(t.TEXTURE_2D,0,u,n[0],n[1],0,u,c,f),s||m.free(h),new a(t,x,n[0],n[1],u,c)}function h(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(v||n(t),"number"==typeof arguments[1])return c(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return c(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1];if(e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof HTMLVideoElement||e instanceof ImageData)return u(t,e,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return f(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")}var d=t("ndarray"),p=t("ndarray-ops"),m=t("typedarray-pool");e.exports=h;var v=null,g=null,y=null,b=function(t,e){p.muls(t,e,255)},x=a.prototype;Object.defineProperties(x,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),g.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&&v.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),g.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=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(),y.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(),y.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(y.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 i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),x.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},x.dispose=function(){this.gl.deleteTexture(this.handle)},x.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)},x.setPixels=function(t,e,r,n){var i=this.gl;if(this.bind(),Array.isArray(e)?(n=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),n=n||0,t instanceof HTMLCanvasElement||t instanceof ImageData||t instanceof HTMLImageElement||t instanceof HTMLVideoElement){this._mipLevels.indexOf(n)<0?(i.texImage2D(i.TEXTURE_2D,0,this.format,this.format,this.type,t),this._mipLevels.push(n)):i.texSubImage2D(i.TEXTURE_2D,n,e,r,this.format,this.type,t)}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]>>>n||r+t.shape[0]>this._shape[0]>>>n||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");s(i,e,r,n,this.format,this.type,this._mipLevels,t)}}},{ndarray:476,"ndarray-ops":470,"typedarray-pool":549}],274:[function(t,e,r){arguments[4][162][0].apply(r,arguments)},{dup:162}],275:[function(t,e,r){arguments[4][163][0].apply(r,arguments)},{"./do-bind.js":274,dup:163}],276:[function(t,e,r){arguments[4][164][0].apply(r,arguments)},{"./do-bind.js":274,dup:164}],277:[function(t,e,r){"use strict";function n(t,e,r,n){var o,s=t.getExtension("OES_vertex_array_object");return o=s?i(t,s):a(t),o.update(e,r,n),o}var i=t("./lib/vao-native.js"),a=t("./lib/vao-emulated.js");e.exports=n},{"./lib/vao-emulated.js":275,"./lib/vao-native.js":276}],278:[function(t,e,r){function n(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}e.exports=n},{}],279:[function(t,e,r){function n(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}e.exports=n},{}],280:[function(t,e,r){function n(t){var e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}e.exports=n},{}],281:[function(t,e,r){function n(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t}e.exports=n},{}],282:[function(t,e,r){function n(t,e){var r=e[0],n=e[1],i=e[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}e.exports=n},{}],283:[function(t,e,r){function n(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}e.exports=n},{}],284:[function(t,e,r){function n(t,e,r,n){return i[0]=n,i[1]=r,i[2]=e,i[3]=t,a[0]}e.exports=n;var i=new Uint8Array(4),a=new Float32Array(i.buffer)},{}],285:[function(t,e,r){function n(t){for(var e=Array.isArray(t)?t:i(t),r=0;r0)continue;n=t.slice(0,1).join("")}return e(n),G+=n.length,U=U.slice(n.length),U.length}}function I(){return/[^a-fA-F0-9]/.test(O)?(e(U.join("")),B=c,j):(U.push(O),R=O,j+1)}function D(){return"."===O?(U.push(O),B=v,R=O,j+1):/[eE]/.test(O)?(U.push(O),B=v,R=O,j+1):"x"===O&&1===U.length&&"0"===U[0]?(B=w,U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=c,j):(U.push(O),R=O,j+1)}function P(){return"f"===O&&(U.push(O),R=O,j+=1),/[eE]/.test(O)?(U.push(O),R=O,j+1):"-"===O&&/[eE]/.test(R)?(U.push(O),R=O,j+1):/[^\d]/.test(O)?(e(U.join("")),B=c,j):(U.push(O),R=O,j+1)}function z(){if(/[^\d\w_]/.test(O)){var t=U.join("");return B=J.indexOf(t)>-1?b:Z.indexOf(t)>-1?y:g,e(U.join("")),B=c,j}return U.push(O),R=O,j+1}var O,R,F,j=0,N=0,B=c,U=[],V=[],H=1,q=0,G=0,Y=!1,X=!1,W="";t=t||{};var Z=o,J=i;return"300 es"===t.version&&(Z=l,J=s),function(t){return V=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):n()}}e.exports=n;var i=t("./lib/literals"),a=t("./lib/operators"),o=t("./lib/builtins"),s=t("./lib/literals-300es"),l=t("./lib/builtins-300es"),c=999,u=9999,f=0,h=1,d=2,p=3,m=4,v=5,g=6,y=7,b=8,x=9,_=10,w=11,M=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":288,"./lib/builtins-300es":287,"./lib/literals":290,"./lib/literals-300es":289,"./lib/operators":291}],287:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.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"])},{"./builtins":288}],288:[function(t,e,r){e.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"]},{}],289:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","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"])},{"./literals":290}],290:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","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"]},{}],291:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],292:[function(t,e,r){function n(t,e){var r=i(e),n=[];return n=n.concat(r(t)),n=n.concat(r(null))}var i=t("./index");e.exports=n},{"./index":286}],293:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=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=u):(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),e*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):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,c-=8);t[r+d-p]|=128*m}},{}],296:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return u(t.vertices,e.vertices)}function o(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=c[t+1];return i||(i=c),n(i)}function s(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=f[t];i||(i=f[t]=o(t)),this.orient=i}function l(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 a=t.slice(0,i+1),o=c.apply(void 0,a);if(0===o)throw new Error("Input not in general position");for(var l=new Array(i+1),u=0;u<=i;++u)l[u]=u;o<0&&(l[0]=1,l[1]=0);for(var f=new n(l,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2),u=0;u<=i;++u){for(var p=l.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var v=p[0];p[0]=p[1],p[1]=v;var g=new n(p,new Array(i+1),!0);h[u]=g,d[u]=g}d[i+1]=f;for(var u=0;u<=i;++u)for(var p=h[u].vertices,y=h[u].adjacent,m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=f;else for(var x=0;x<=i;++x)h[x].vertices.indexOf(b)<0&&(y[m]=h[x])}for(var _=new s(i,a,d),w=!!e,u=i+1;u0;){t=o.pop();for(var s=(t.vertices,t.adjacent),l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},h.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(var u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},h.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var e=f.pop(),d=e.vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var v=0;v<=o;++v)if(v!==m){var g=p[v];if(g.boundary&&!(g.lastVisited>=r)){var y=g.vertices;if(g.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];var _=this.orient();if(_>0){y[b]=r,g.boundary=!1,c.push(g),f.push(g),g.lastVisited=r;continue}g.lastVisited=-r}var w=g.adjacent,M=d.slice(),T=p.slice(),k=new n(M,T,!0);u.push(k);var A=w.indexOf(e);if(!(A<0)){w[A]=k,T[m]=g,M[v]=-1,T[v]=e,p[v]=k,k.flip();for(var x=0;x<=o;++x){var E=M[x];if(!(E<0||E===r)){for(var S=new Array(o-1),L=0,C=0;C<=o;++C){var I=M[C];I<0||C===x||(S[L++]=I)}h.push(new i(S,k,x))}}}}}}h.sort(a);for(var v=0;v+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":517,"simplicial-complex":528}],297:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],298:[function(t,e,r){"use strict";function n(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}function i(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 a(t,e){var r=p(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 o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?y:(r.splice(n,1),a(t,r),b)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[],r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,h),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);var r=this.left.remove(t);return 2===r?(this.left=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(t[0]>this.mid){if(!this.right)return y;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);var r=this.right.remove(t);return 2===r?(this.right=null,this.count-=1,b):(r===b&&(this.count-=1),r)}if(1===this.count)return this.leftPoints[0]===t?2:y;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var n=this,a=this.left;a.right;)n=a,a=a.right;if(n===this)a.right=this.right;else{var o=this.left,r=this.right;n.count-=a.count,n.right=a.left,a.left=o,a.right=r}i(this,a),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return b}for(var o=g.ge(this.leftPoints,t,h);othis.mid){if(this.right){var r=this.right.queryPoint(t,e);if(r)return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n=this.right.queryInterval(t,e,r);if(n)return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var _=m.prototype;_.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},_.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==y}return!1},_.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},_.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(_,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(_,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":67}],299:[function(t,e,r){"use strict";function n(t,e){e=e||new Array(t.length);for(var r=0;r=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var v=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(v)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(v))}}return u}e.exports=n},{}],307:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(o,Math.floor(r+(l-c)*f/l+h)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):(m++,a(t,e,m,o)),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],308:[function(t,e,r){"use strict";function n(t,e,r,n,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(e[2*d],e[2*d+1],r,n)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],v=e[2*p+1];i(m,v,r,n)<=c&&l.push(t[p]);var g=(u+1)%2;(0===u?r-a<=m:n-a<=v)&&(s.push(h),s.push(p-1),s.push(g)),(0===u?r+a>=m:n+a>=v)&&(s.push(p+1),s.push(f),s.push(g))}}return l}function i(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=n},{}],309:[function(t,e,r){function n(t,e,r){return t*(1-r)+e*r}e.exports=n},{}],310:[function(t,e,r){"use strict";function n(t,e){var r;if(f(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],u=c||void 0!==t.property,h=c||!u,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],v=0;v=t.stops.length)break;if(e<=t.stops[n][0])break;n++}return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?u(t,e,r,n,i,a):c(t,e,r,n,i,a)}function c(t,e,r,n,i,a){var o,s=n-r,l=t-r;return o=1===e?l/s:(Math.pow(e,l)-1)/(Math.pow(e,s)-1),i*(1-o)+a*o}function u(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{ -fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:485}],312:[function(t,e,r){"use strict";function n(t,e){this.message=(t?t+": ":"")+i.apply(i,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}var i=t("util").format;e.exports=n},{util:556}],313:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{"../error/validation_error":312,"../util/extend":313,"../util/get_type":314,"./validate_array":317,"./validate_boolean":318,"./validate_color":319,"./validate_constants":320,"./validate_enum":321,"./validate_filter":322,"./validate_function":323,"./validate_layer":325,"./validate_number":327,"./validate_object":328,"./validate_source":330,"./validate_string":331}],317:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":312,"../util/get_type":314}],321:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return a.values.indexOf(i(r))===-1&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":312,"../util/unbundle_jsonlint":315}],322:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&(r=a(s[1]),"string"!==r?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f=8&&(h&&!t.valueSpec["property-function"]?p.push(new n(t.key,t.value,"property functions not supported")):d&&!t.valueSpec["zoom-function"]&&p.push(new n(t.key,t.value,"zoom functions not supported"))),p}},{"../error/validation_error":312,"../util/get_type":314,"./validate":316,"./validate_array":317,"./validate_number":327,"./validate_object":328}],324:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(e.indexOf("{fontstack}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),e.indexOf("{range}")===-1&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":312,"./validate_string":331}],325:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":312,"../util/get_type":314}],328:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],f=i(r);if("object"!==f)return[new n(e,r,"object expected, %s found",f)];for(var h in r){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":312,"../util/get_type":314,"./validate":316}],329:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":312,"./validate":316}],330:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":312,"../util/unbundle_jsonlint":315,"./validate_enum":321,"./validate_object":328}],331:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":312,"../util/get_type":314}],332:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":333,"./validate/validate":316,"./validate/validate_constants":320, -"./validate/validate_filter":322,"./validate/validate_glyphs_url":324,"./validate/validate_layer":325,"./validate/validate_layout_property":326,"./validate/validate_paint_property":329,"./validate/validate_source":330}],333:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":334}],334:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],335:[function(t,e,r){"use strict";function n(t){return!!(i()&&a()&&o()&&s()&&l()&&c()&&u()&&f(t&&t.failIfMajorPerformanceCaveat))}function i(){return"undefined"!=typeof window&&"undefined"!=typeof document}function a(){return Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray}function o(){return Function.prototype&&Function.prototype.bind}function s(){return Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions}function l(){return"JSON"in window&&"parse"in JSON&&"stringify"in JSON}function c(){return"Worker"in window}function u(){return"Uint8ClampedArray"in window}function f(t){return void 0===d[t]&&(d[t]=h(t)),d[t]}function h(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var d={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],336:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":450}],337:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=i(this),t.arrays){var e=this.programInterfaces;this.bufferGroups=u.mapObject(t.arrays,function(r,n){var i=e[n],a=t.paintVertexArrayTypes[n];return r.map(function(t){return new c(t,{layoutVertexArrayType:i.layoutVertexArrayType.serialize(),elementArrayType:i.elementArrayType&&i.elementArrayType.serialize(),elementArrayType2:i.elementArrayType2&&i.elementArrayType2.serialize(),paintVertexArrayTypes:a})})})}}function i(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},i=0;i1?p.name+_:p.name;x[w]=m[_]*v}}},n.VertexArrayType=function(t){return new f({members:t,alignment:4})},n.ElementArrayType=function(t){return new f({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":448,"../util/util":450,"./array_group":336,"./bucket/circle_bucket":338,"./bucket/fill_bucket":339,"./bucket/line_bucket":340,"./bucket/symbol_bucket":341,"./buffer_group":343,assert:47,"feature-filter":132}],338:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":450,"../bucket":337,"../load_geometry":345}],339:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,n.prototype=a.inherit(i,{}),n.prototype.programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var h,d,p,m,v,g,y,b=r,x=f?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],v=c.sub(h)._unit()._perp());for(var w=0;w0){var E=h.dist(d);if(E>2*o){var S=h.sub(h.sub(d)._mult(o/E)._round());this.distance+=S.dist(d),this.addCurrentVertex(S,this.distance,m.mult(1),0,0,!1),d=S}}var L=d&&p,C=L?e:p?b:x;if(L&&"round"===C&&(kn&&(C="bevel"),"bevel"===C&&(k>2&&(C="flipbevel"),k100)M=v.clone();else{var I=m.x*v.y-m.y*v.x>0?-1:1,D=k*m.add(v).mag()/m.sub(v).mag();M._perp()._mult(D*I)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var P=m.x*v.y-m.y*v.x>0,z=-Math.sqrt(k*k-1);if(P?(y=0,g=z):(g=0,y=z),_||this.addCurrentVertex(h,this.distance,m,g,y,!1),"fakeround"===C){for(var O,R=Math.floor(8*(.5-(T-.5))),F=0;F=0;j--)O=m.mult((j+1)/(R+1))._add(v)._unit(),this.addPieSliceVertex(h,this.distance,O,P)}p&&this.addCurrentVertex(h,this.distance,v,-g,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,v,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,v,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,v,-1,-1,!0),this.addCurrentVertex(h,this.distance,v,0,0,!1)));if(A&&w2*o){var B=h.add(p.sub(h)._mult(o/N)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,v.mult(1),0,0,!1),h=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,f=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":450,"../bucket":337,"../load_geometry":345}],341:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),f=t("../../symbol/shaping"),h=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),v=t("../load_geometry"),g=t("../../symbol/collision_feature"),y=f.shapeText,b=f.shapeIcon,x=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,n.prototype=m.inherit(o,{}),n.prototype.serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),T=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:T},icon:{layoutVertexArrayType:M,elementArrayType:T},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var f="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,h=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,g=24*a["text-letter-spacing"],x=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],T=0;Tw||L.y<0||L.y>w);if(!d||C){var I=C||x;this.addSymbolInstance(L,A,e,r,this.layer,I,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,v,b,{zoom:this.zoom},n.properties)}}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var v=p.tl,g=p.tr,y=p.bl,b=p.br,x=p.tex,_=p.anchorPoint,w=Math.max(f+Math.log(p.minScale)/Math.LN2,h),M=Math.min(f+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===h&&(w=0);var T=Math.round(p.glyphAngle/(2*Math.PI)*256),k=i(u,_.x,_.y,v.x,v.y,x.x,x.y,w,M,h,T);i(u,_.x,_.y,g.x,g.y,x.x+x.w,x.y,w,M,h,T),i(u,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,h,T),i(u,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,h,T),c.emplaceBack(k,k+1,k+2),c.emplaceBack(k+1,k+2,k+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),k>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(P,z,O,R,T,k,A,E,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":399,"../../symbol/clip_line":401,"../../symbol/collision_feature":403,"../../symbol/get_anchors":405,"../../symbol/mergelines":408,"../../symbol/quads":409,"../../symbol/resolve_text":410,"../../symbol/shaping":411,"../../util/token":449,"../../util/util":450,"../bucket":337,"../load_geometry":345,"point-geometry":493}],342:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=c.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||h.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":450,"./bucket":337,assert:47}],346:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],347:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":450}],348:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":347}],349:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,f=t("gl-matrix"),h=f.vec4,d=f.mat4,p=f.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this,i=n.locationCoordinate(n.center)._zoomTo(e),o=new a(i.column-.5,i.row-.5);return c.cover(e,[n.pointCoordinate(new a(0,0))._zoomTo(e),n.pointCoordinate(new a(n.width,0))._zoomTo(e),n.pointCoordinate(new a(n.width,n.height))._zoomTo(e),n.pointCoordinate(new a(0,n.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return o.dist(t)-o.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];h.transformMat4(e,e,this.pixelMatrixInverse),h.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,f=e[2]/n,d=r[2]/i,p=f===d?0:(0-f)/(d-f),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return h.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),e=this.latY(this.latRange[0]),i=e-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":337,"../source/tile_coord":377,"../util/interpolate":444,"../util/util":450,"./coordinate":346,"./lng_lat":347,"gl-matrix":197,"point-geometry":493}],350:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]], -1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,f,h,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(n.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(n.u_matrix,!1,t.transform.calculatePosMatrix(g)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}var i=t("../source/pixels_to_tile_units"),a=t("./create_uniform_pragmas"),o=512;e.exports=n},{"../source/pixels_to_tile_units":371,"./create_uniform_pragmas":352}],354:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,h>>16),o.uniform2f(a.u_pixel_coord_lower,65535&f,65535&h),o.activeTexture(o.TEXTURE0),i.spriteAtlas.bind(o,!0)}}var s=t("../source/pixels_to_tile_units");e.exports=n},{"../source/pixels_to_tile_units":371}],358:[function(t,e,r){"use strict";var n=t("../util/browser"),i=t("gl-matrix").mat2,a=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,o){if(!t.isOpaquePass){t.setDepthSublayer(0),t.depthMask(!1);var s=t.gl;if(s.enable(s.STENCIL_TEST),!(r.paint["line-width"]<=0)){var l=1/n.devicePixelRatio,c=r.paint["line-blur"]+l,u=r.paint["line-color"],f=t.transform,h=i.create();i.scale(h,h,[1,Math.cos(f._pitch)]),i.rotate(h,h,t.transform.angle);var d,p,m,v,g,y=Math.sqrt(f.height*f.height/4*(1+f.altitude*f.altitude)),b=f.height/2*Math.tan(f._pitch),x=(y+b)/y-1,_=r.paint["line-dasharray"],w=r.paint["line-pattern"];if(_)d=t.useProgram("linesdfpattern"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,c),s.uniform4fv(d.u_color,u),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),p=t.lineAtlas.getDash(_.from,"round"===r.layout["line-cap"]),m=t.lineAtlas.getDash(_.to,"round"===r.layout["line-cap"]),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.lineAtlas.bind(s),s.uniform1f(d.u_tex_y_a,p.y),s.uniform1f(d.u_tex_y_b,m.y),s.uniform1f(d.u_mix,_.t),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h);else if(w){if(v=t.spriteAtlas.getPosition(w.from,!0),g=t.spriteAtlas.getPosition(w.to,!0),!v||!g)return;d=t.useProgram("linepattern"),s.uniform1i(d.u_image,0),s.activeTexture(s.TEXTURE0),t.spriteAtlas.bind(s,!0),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,c),s.uniform2fv(d.u_pattern_tl_a,v.tl),s.uniform2fv(d.u_pattern_br_a,v.br),s.uniform2fv(d.u_pattern_tl_b,g.tl),s.uniform2fv(d.u_pattern_br_b,g.br),s.uniform1f(d.u_fade,w.t),s.uniform1f(d.u_opacity,r.paint["line-opacity"]),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h)}else d=t.useProgram("line"),s.uniform1f(d.u_linewidth,r.paint["line-width"]/2),s.uniform1f(d.u_gapwidth,r.paint["line-gap-width"]/2),s.uniform1f(d.u_antialiasing,l/2),s.uniform1f(d.u_blur,c),s.uniform1f(d.u_extra,x),s.uniform1f(d.u_offset,-r.paint["line-offset"]),s.uniformMatrix2fv(d.u_antialiasingmatrix,!1,h),s.uniform4fv(d.u_color,u),s.uniform1f(d.u_opacity,r.paint["line-opacity"]);for(var M=0;M0?1/(1-t):1+t}function s(t){return t>0?1-1/(1.001-t):-t}function l(t,e,r,n){var i=[1,0],a=r.paint["raster-fade-duration"];if(t.source&&a>0){var o=(new Date).getTime(),s=(o-t.timeAdded)/a,l=e?(o-e.timeAdded)/a:-1,u=n.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(i[0]=c.clamp(s,0,1),i[1]=1-i[0]):(i[0]=c.clamp(1-l,0,1),i[1]=1-i[0])}var h=r.paint["raster-opacity"];return i[0]*=h,i[1]*=h,i}var c=t("../util/util"),u=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new u({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":448,"../util/util":450}],360:[function(t,e,r){"use strict";function n(t,e,r,n){if(!t.isOpaquePass){var a=!(r.layout["text-allow-overlap"]||r.layout["icon-allow-overlap"]||r.layout["text-ignore-placement"]||r.layout["icon-ignore-placement"]),o=t.gl;a?o.disable(o.STENCIL_TEST):o.enable(o.STENCIL_TEST),t.setDepthSublayer(0),t.depthMask(!1),o.disable(o.DEPTH_TEST),i(t,e,r,n,!1,r.paint["icon-translate"],r.paint["icon-translate-anchor"],r.layout["icon-rotation-alignment"],r.layout["icon-rotation-alignment"],r.layout["icon-size"],r.paint["icon-halo-width"],r.paint["icon-halo-color"],r.paint["icon-halo-blur"],r.paint["icon-opacity"],r.paint["icon-color"]),i(t,e,r,n,!0,r.paint["text-translate"],r.paint["text-translate-anchor"],r.layout["text-rotation-alignment"],r.layout["text-pitch-alignment"],r.layout["text-size"],r.paint["text-halo-width"],r.paint["text-halo-color"],r.paint["text-halo-blur"],r.paint["text-opacity"],r.paint["text-color"]),o.enable(o.DEPTH_TEST),e.map.showCollisionBoxes&&s(t,e,r,n)}}function i(t,e,r,n,i,o,s,l,c,u,f,h,d,p,m){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=e-this.changeTimes[r],i=n/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+i:this.changeOpacities[r]-i}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],362:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":337,"../data/buffer":342,"../source/pixels_to_tile_units":371,"../source/source_cache":375,"../util/browser":434,"../util/struct_array":448,"../util/util":450,"./create_uniform_pragmas":352,"./draw_background":353,"./draw_circle":354,"./draw_debug":356,"./draw_fill":357,"./draw_line":358,"./draw_raster":359,"./draw_symbol":360,"./frame_history":361,"./painter/use_program":364,"./vertex_array_object":365,"gl-matrix":197}],364:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=o[t],h="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":337,"../util/evented":442,"../util/util":450,"resolve-url":510}],367:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),f.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),f=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(f,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":433,"../util/util":450,"./geojson_wrapper":368,"./vector_tile_worker_source":379,"geojson-rewind":138,"geojson-vt":142,supercluster:538,"vt-pbf":563}],368:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;a=this._tiles[s],a&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=Math.ceil(t.width/t.tileSize)+1,r=Math.ceil(t.height/t.tileSize)+1,n=e*r;this._cache.setMaxSize(Math.floor(5*n))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},f=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rf-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[g]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var b=h.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-(1/0),s=-(1/0),l=t[0].zoom,u=0;u=0&&g[1].y>=0){for(var y=[],b=0;b=0&&t%1==0),l(!isNaN(e)&&e>=0&&e%1==0),l(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=n*-1-1);var i=1<0;a--)n=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function o(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hu.dy&&(l=c,c=u,u=l),c.dy>f.dy&&(l=c,c=f,f=l),u.dy>f.dy&&(l=u,u=f,f=l),c.dy&&o(f,c,n,i,s),u.dy&&o(f,u,n,i,s)}var l=t("assert"),c=t("whoots-js"),u=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new u(i,n,e)},n.fromID=function(t){var e=t%32,r=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var s,l,c;if(i>=0&&i<=a)for(s=t;sthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":442,"../util/mapbox":447,"../util/util":450,"./load_tilejson":370}],379:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){function r(t,r){return delete this.loading[n][i],t?e(t):r?(a.data=r.tile,a.parse(a.data,this.styleLayers.getLayerFamilies(),this.actor,r.rawTileData,e),this.loaded[n]=this.loaded[n]||{}, -void(this.loaded[n][i]=a)):e(null,null)}var n=t.source,i=t.uid;this.loading[n]||(this.loading[n]={});var a=this.loading[n][i]=new s(t);a.abort=this.loadVectorData(t,r.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){function r(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}var n=i.getArrayBuffer(t.url,r.bind(this));return function(){n.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i],o=a.redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);o.result&&e(null,o.result,o.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":433,"./worker_tile":382,pbf:487,"vector-tile":557}],380:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,h=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new f;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new h(e.serialize(),f.serialize(),h.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":337,"../data/buffer":342,"../geo/lng_lat":347,"../render/draw_raster":359,"../render/vertex_array_object":365,"../util/ajax":433,"../util/evented":442,"../util/util":450,"./tile_coord":377,"point-geometry":493}],381:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)b(S,z[e]);x()}}function b(t,e){if(e.populateArrays(k,j,F),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||(T=u.create({layer:w,index:I++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:E.encode(w.sourceLayer||"_geojsonTileLayer")}),T.createFilter(),L[w.id]=T,t.layers&&(M=w.sourceLayer,C[M]=C[M]||{},C[M][w.id]=T)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&g(w,C[M]);else g(t,L);var P=[],z=this.symbolBuckets=[],O=[];A.bucketLayerIDs={};for(var R in L)T=L[R],0!==T.features.length&&(A.bucketLayerIDs[T.index]=T.childLayers.map(s),P.push(T),"symbol"===T.type?z.push(T):O.push(T));var F={},j={},N=0;if(z.length>0){for(_=z.length-1;_>=0;_--)z[_].updateIcons(F),z[_].updateFont(j);for(var B in j)j[B]=Object.keys(j[B]).map(Number);F=Object.keys(F),r.send("get glyphs",{uid:this.uid,stacks:j},function(t,e){j=e,y(t)}),F.length?r.send("get icons",{icons:F},function(t,e){F=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)b(this,O[_]);if(0===z.length)return x()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),f=s.filter(i);return{result:{buckets:f.map(a),collisionTile:u.data},transferables:o(f).concat(u.transferables)}}},{"../data/bucket":337,"../data/feature_index":344,"../symbol/collision_box":402,"../symbol/collision_tile":404,"../symbol/symbol_instances":413,"../symbol/symbol_quads":414,"../util/dictionary_coder":440,"../util/util":450}],383:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],384:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){if(t)return void this.fire("error",{error:t});this.data=e,this.img&&this.fire("load")}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)return void this.fire("error",{error:t});for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":433,"../util/browser":434,"../util/evented":442,"../util/mapbox":447}],385:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":450,"./style_function":388,csscolorparser:107}],386:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)return void this.fire("error",{error:t});if(!v.emitErrors(this,v(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?f.getJSON(h(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),f=t("../util/ajax"),h=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),v=t("./validate_style"),g=t("../source/source"),y=t("../source/query_features"),b=t("../source/source_cache"),x=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&e.vectorLayerIds.indexOf(t.sourceLayer)===-1&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(v.source,"sources."+t,e)?this:(e=new b(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(v.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(v.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);return i.setPaintProperty(e,r,n),!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,f*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),f/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:f,to:a,toScale:1,t:n}}}var a=t("./style_function"),o=t("./parse_color"),s=t("../util/util");e.exports=n},{"../util/util":450,"./parse_color":385,"./style_function":388}],388:[function(t,e,r){"use strict";var n=t("mapbox-gl-function");r.interpolated=function(t){var e=n.interpolated(t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r["piecewise-constant"]=function(t){var e=n["piecewise-constant"](t),r=function(t,r){return e(t&&t.zoom,r||{})};return r.isFeatureConstant=e.isFeatureConstant,r.isZoomConstant=e.isZoomConstant,r},r.isFunctionDefinition=n.isFunctionDefinition},{"mapbox-gl-function":310}],389:[function(t,e,r){"use strict";function n(t,e){this.set(t,e)}function i(t){return t.value}var a=t("../util/util"),o=t("./style_transition"),s=t("./style_declaration"),l=t("./style_spec"),c=t("./validate_style"),u=t("./parse_color"),f=t("../util/evented");e.exports=n;n.create=function(e,r){return new({background:t("./style_layer/background_style_layer"),circle:t("./style_layer/circle_style_layer"),fill:t("./style_layer/fill_style_layer"),line:t("./style_layer/line_style_layer"),raster:t("./style_layer/raster_style_layer"),symbol:t("./style_layer/symbol_style_layer")}[(r||e).type])(e,r)},n.prototype=a.inherit(f,{set:function(t,e){this.id=t.id,this.ref=t.ref,this.metadata=t.metadata,this.type=(e||t).type,this.source=(e||t).source,this.sourceLayer=(e||t)["source-layer"],this.minzoom=(e||t).minzoom,this.maxzoom=(e||t).maxzoom,this.filter=(e||t).filter,this.paint={},this.layout={},this._paintSpecifications=l["paint_"+this.type],this._layoutSpecifications=l["layout_"+this.type],this._paintTransitions={},this._paintTransitionOptions={},this._paintDeclarations={},this._layoutDeclarations={},this._layoutFunctions={};var r,n;for(var i in t){var a=i.match(/^paint(?:\.(.*))?$/);if(a){var o=a[1]||"";for(r in t[i])this.setPaintProperty(r,t[i][r],o)}}if(this.ref)this._layoutDeclarations=e._layoutDeclarations;else for(n in t.layout)this.setLayoutProperty(n,t.layout[n]);for(r in this._paintSpecifications)this.paint[r]=this.getPaintValue(r);for(n in this._layoutSpecifications)this._updateLayoutValue(n)},setLayoutProperty:function(t,e){if(null==e)delete this._layoutDeclarations[t];else{var r="layers."+this.id+".layout."+t;if(this._handleErrors(c.layoutProperty,r,t,e))return;this._layoutDeclarations[t]=new s(this._layoutSpecifications[t],e)}this._updateLayoutValue(t)},getLayoutProperty:function(t){return this._layoutDeclarations[t]&&this._layoutDeclarations[t].value},getLayoutValue:function(t,e,r){var n=this._layoutSpecifications[t],i=this._layoutDeclarations[t];return i?i.calculate(e,r):n.default},setPaintProperty:function(t,e,r){var n="layers."+this.id+(r?'["paint.'+r+'"].':".paint.")+t;if(a.endsWith(t,"-transition"))if(this._paintTransitionOptions[r||""]||(this._paintTransitionOptions[r||""]={}),null===e||void 0===e)delete this._paintTransitionOptions[r||""][t];else{if(this._handleErrors(c.paintProperty,n,t,e))return;this._paintTransitionOptions[r||""][t]=e}else if(this._paintDeclarations[r||""]||(this._paintDeclarations[r||""]={}),null===e||void 0===e)delete this._paintDeclarations[r||""][t];else{if(this._handleErrors(c.paintProperty,n,t,e))return;this._paintDeclarations[r||""][t]=new s(this._paintSpecifications[t],e)}},getPaintProperty:function(t,e){return e=e||"",a.endsWith(t,"-transition")?this._paintTransitionOptions[e]&&this._paintTransitionOptions[e][t]:this._paintDeclarations[e]&&this._paintDeclarations[e][t]&&this._paintDeclarations[e][t].value},getPaintValue:function(t,e,r){var n=this._paintSpecifications[t],i=this._paintTransitions[t];return i?i.calculate(e,r):"color"===n.type&&n.default?u(n.default):n.default},getPaintValueStopZoomLevels:function(t){var e=this._paintTransitions[t];return e?e.declaration.stopZoomLevels:[]},getPaintInterpolationT:function(t,e){return this._paintTransitions[t].declaration.calculateInterpolationT({zoom:e})},isPaintValueFeatureConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isFeatureConstant},isLayoutValueFeatureConstant:function(t){var e=this._layoutDeclarations[t];return!e||e.isFeatureConstant},isPaintValueZoomConstant:function(t){var e=this._paintTransitions[t];return!e||e.declaration.isZoomConstant},isHidden:function(t){return!!(this.minzoom&&t=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}e.exports=n},{}],401:[function(t,e,r){"use strict";function n(t,e,r,n,a){for(var o=[],s=0;s=n&&h.x>=n||(f.x>=n?f=new i(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round():h.x>=n&&(h=new i(n,f.y+(h.y-f.y)*((n-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new i(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}var i=t("point-geometry");e.exports=n},{"point-geometry":493}],402:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":448,"../util/util":450,"point-geometry":493}],403:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=h-f,v=p-d;if(m>0)if(m=Math.max(10*s,m),u){var g=e[r.segment+1].sub(e[r.segment])._unit()._mult(v),y=[r.sub(g),r.add(g)];this._addLineCollisionBoxes(t,y,r,0,v,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,v,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,f,p,h,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),f=-a/2,h=this.boxes,d=r,p=n+1,m=f;do{if(--p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var v=e[p].dist(e[p+1]),g=0;g=e.length)return h;v=e[p].dist(e[p+1])}var b=y-m,x=e[p],_=e[p+1],w=_.sub(x)._unit()._mult(b)._add(x)._round(),M=Math.max(Math.abs(y-f)-c/2,0),T=i/2/M;t.emplaceBack(w.x,w.y,-a/2,-a/2,a/2,a/2,T,o,s,l,0,0,0,0,0)}return h}},{}],404:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),T=new i(c.x2,c.y1).matMult(w),k=new i(c.x1,c.y2).matMult(w),A=new i(c.x2,c.y2).matMult(w);_=this.tempCollisionBox,_.anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,T.x,k.x,A.x),_.y1=Math.min(M.y,T.x,k.x,A.x),_.x2=Math.max(M.x,T.x,k.x,A.x),_.y2=Math.max(M.y,T.x,k.x,A.x),_.maxScale=c.maxScale}else _=c;for(var E=0;E=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),f=this.tempCollisionBox;f.anchorX=u.x,f.anchorY=u.y,f.x1=0,f.y1=0,f.x2=r-t,f.y2=n-e,f.maxScale=a,a=f.maxScale;for(var h=[u.x+f.x1/a,u.y+f.y1/a*this.yStretch,u.x+f.x2/a,u.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m=a&&(o[y][b]=!0,s.push(d[v]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var f=Math.min(Math.max(s,l),Math.max(c,u)),h=i.maxScale,d=r.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&k=0&&A=0&&g+d<=p){var E=new o(k,A,M,b)._round();n&&!s(t,E,c,n,l)||y.push(E)}}v+=w}return f||y.length||u||(y=i(t,v/2,r,n,l,c,u,!0,h)),y}var a=t("../util/interpolate"),o=t("../symbol/anchor"),s=t("./check_max_angle");e.exports=n},{"../symbol/anchor":399,"../util/interpolate":444,"./check_max_angle":400}],406:[function(t,e,r){"use strict";function n(){this.width=o,this.height=o,this.bin=new i(this.width,this.height),this.index={},this.ids={},this.data=new Uint8Array(this.width*this.height)}var i=t("shelf-pack"),a=t("../util/util"),o=128;e.exports=n,n.prototype.getGlyphs=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]=[]),n[e].push(r);return n},n.prototype.getRects=function(){var t,e,r,n={};for(var i in this.ids)t=i.split("#"),e=t[0],r=t[1],n[e]||(n[e]={}),n[e][r]=this.index[i];return n},n.prototype.addGlyph=function(t,e,r,n){if(!r)return null;var i=e+"#"+r.id;if(this.index[i])return this.ids[i].indexOf(t)<0&&this.ids[i].push(t),this.index[i];if(!r.bitmap)return null;var o=r.width+2*n,s=r.height+2*n,l=o+2,c=s+2;l+=4-l%4,c+=4-c%4;var u=this.bin.packOne(l,c);if(u||(this.resize(),u=this.bin.packOne(l,c)),!u)return a.warnOnce("glyph bitmap overflow"),null;this.index[i]=u,this.ids[i]=[t];for(var f=this.data,h=r.bitmap,d=0;d=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=256*e+"-"+(256*e+255),o=a(t,i,this.url);s(o,function(t,r){for(var i=!t&&new l(new u(new Uint8Array(r))),a=0;an&&null!==u){var x=g[u+1].x;v=Math.max(x,v);for(var _=u+1;_<=y;_++)g[_].y+=r,g[_].x-=x;if(o){var w=u;f[g[u].codePoint]&&w--,s(g,e,p,w,o)}p=u+1,u=null,d+=x,m++}h[b.codePoint]&&(u=y)}var M=g[g.length-1],T=M.x+e[M.codePoint].advance;v=Math.max(v,T);var k=(m+1)*r;s(g,e,p,g.length-1,o),l(g,o,i,a,v,r,m,c),t.top+=-a*k,t.bottom=t.top+k,t.left+=-i*v,t.right=t.left+v}function s(t,e,r,n,i){for(var a=e[t[n].codePoint].advance,o=(t[n].x+a)*i,s=r;s<=n;s++)t[s].x-=o}function l(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(w?(clearTimeout(w),w=null,g("dblclick",e)):w=setTimeout(d,300))}function u(t){y("touchmove",t)}function f(t){y("touchend",t)}function h(t){y("touchcancel",t)}function d(){w=null}function p(t){n.mousePos(b,t).equals(_)&&g("click",t)}function m(t){g("dblclick",t),t.preventDefault()}function v(t){x=t,t.preventDefault()}function g(e,r){var i=n.mousePos(b,r);return t.fire(e,{lngLat:t.unproject(i),point:i,originalEvent:r})}function y(e,r){var a=n.touchPos(b,r),o=a.reduce(function(t,e,r,n){return t.add(e.div(n.length))},new i(0,0));return t.fire(e,{lngLat:t.unproject(o),point:o,lngLats:a.map(function(e){return t.unproject(e)},this),points:a,originalEvent:r})}var b=t.getCanvasContainer(),x=null,_=null,w=null;for(var M in a)t[M]=new a[M](t,e),e.interactive&&e[M]&&t[M].enable();b.addEventListener("mouseout",r,!1),b.addEventListener("mousedown",o,!1),b.addEventListener("mouseup",s,!1),b.addEventListener("mousemove",l,!1),b.addEventListener("touchstart",c,!1),b.addEventListener("touchend",f,!1),b.addEventListener("touchmove",u,!1),b.addEventListener("touchcancel",h,!1),b.addEventListener("click",p,!1),b.addEventListener("dblclick",m,!1),b.addEventListener("contextmenu",v,!1)}},{"../util/dom":436,"./handler/box_zoom":421,"./handler/dblclick_zoom":422,"./handler/drag_pan":423,"./handler/drag_rotate":424,"./handler/keyboard":425,"./handler/scroll_zoom":426,"./handler/touch_zoom_rotate":427,"point-geometry":493}],416:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(u.center.lng>0&&m.lng<0?m.lng+=360:u.center.lng<0&&m.lng>0&&(m.lng-=360));var b=u.zoomScale(v-h),x=u.point,_="center"in t?u.project(m).sub(f.div(b)):x,w=u.worldSize,M=t.curve,T=Math.max(u.width,u.height),k=T/b,A=_.sub(x).mag();if("minZoom"in t){var E=n.clamp(Math.min(t.minZoom,h,v),u.minZoom,u.maxZoom),S=T/u.zoomScale(E-h);M=Math.sqrt(S/A*2)}var L=M*M,C=r(0),I=function(t){return s(C)/s(C+M*t)},D=function(t){return T*((s(C)*c(C+M*t)-a(C))/L)/A},P=(r(1)-C)/M;if(Math.abs(A)<1e-6){if(Math.abs(T-k)<1e-6)return this.easeTo(t);var z=k=0)return!1;return!0}),e.join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":436,"../../util/util":450,"./control":418}],418:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",r.indexOf("bottom")!==-1?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":442,"../../util/util":450}],419:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":434,"../../util/dom":436,"../../util/util":450,"./control":418}],420:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":436,"../../util/util":450,"./control":418}],421:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":348,"../../util/dom":436,"../../util/util":450}],422:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],423:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)return void e();var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))return void e();var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,f=l.mult(-u/2);this._map.panBy(f,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?t.buttons&!1:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":436,"../../util/util":450}],424:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=f*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":436,"../../util/util":450,"point-geometry":493}],425:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],426:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=s.indexOf("firefox")!==-1,c=s.indexOf("safari")!==-1&&s.indexOf("chrom")===-1;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":434,"../../util/dom":436,"../../util/util":450}],427:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)return void r.snapToNorth({},{originalEvent:t});var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0===c||a===s)return void r.snapToNorth({},{originalEvent:t});var f=.15*l/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),d=a+f*h/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:h,easing:o,around:r.unproject(u)},{originalEvent:t})},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":436,"../../util/util":450}],428:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":450}],429:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),f=t("../style/animation_loop"),h=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),v=t("./camera"),g=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if(t=a.extend({},_,t),t.workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new f,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,v.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(g.convert(t))},unproject:function(t){return this.transform.pointLocation(b.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof b||"number"==typeof t[0])e=[b.convert(t)];else{var r=[b.convert(t[0]),b.convert(t[1])];e=[r[0],new b(r[1].x,r[0].y),r[1],new b(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount), -this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});if(!t)return void this.fire("error",{error:new Error("Failed to initialize WebGL")});this.painter=new h(t,this.transform)},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":347,"../geo/lng_lat_bounds":348,"../geo/transform":349,"../render/painter":363,"../style/animation_loop":383,"../style/style":386,"../util/browser":434,"../util/canvas":435,"../util/dom":436,"../util/evented":442,"../util/util":450,"./bind_handlers":415,"./camera":416,"./control/attribution":417,"./hash":428,"point-geometry":493}],430:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":347,"../util/dom":436,"point-geometry":493}],431:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;;){if(!(e=n.firstChild))break;r.appendChild(e)}return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":347,"../util/dom":436,"../util/evented":442,"../util/util":450}],432:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],433:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":335}],435:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":450,"mapbox-gl-supported":335}],436:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var f=0;f=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i=3)for(var l=0;l1){if(s(t,e))return!0;for(var n=0;n(e.y-t.y)*(r.x-t.x)}function c(t,e,r,n){return l(t,r,n)!==l(e,r,n)&&l(t,e,r)!==l(t,e,n)}function u(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}function h(t,e){for(var r,n,i,a=!1,o=0;oe.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a)}return a}function d(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:n,multiPolygonIntersectsMultiPolygon:i,multiPolygonIntersectsBufferedMultiLine:a}},{}],446:[function(t,e,r){"use strict";function n(t,e){this.max=t,this.onRemove=e,this.reset()}e.exports=n,n.prototype.reset=function(){for(var t in this.data)this.onRemove(this.data[t]);return this.data={},this.order=[],this},n.prototype.add=function(t,e){if(this.has(t))this.order.splice(this.order.indexOf(t),1),this.data[t]=e,this.order.push(t);else if(this.data[t]=e,this.order.push(t),this.order.length>this.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],447:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||o.ACCESS_TOKEN)&&o.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,o.API_URL+e),t+=t.indexOf("?")!==-1?"&access_token=":"?access_token=",o.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}function a(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?c.extend({},t,{access_token:o.ACCESS_TOKEN}):t}var o=t("./config"),s=t("./browser"),l=t("url"),c=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==l.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=l.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=l.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,l.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=l.parse(t,!0);if(!e)return t;if("mapbox:"!==l.parse(e).protocol)return t;var i=s.supportsWebp?".webp":"$1",o=s.devicePixelRatio>=2||512===r?"@2x":"";return l.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,o+i),query:a(n.query)})}},{"./browser":434,"./config":439,"./util":450,url:553}],448:[function(t,e,r){"use strict";function n(t){function e(){h.apply(this,arguments)}function r(){d.apply(this,arguments),this.members=e.prototype.members}var n=JSON.stringify(t);if(v[n])return v[n];void 0===t.alignment&&(t.alignment=1),e.prototype=Object.create(h.prototype);var s=0,c=0,g=["Uint8"];return e.prototype.members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},p(r.name.length),p(r.type in m),g.indexOf(r.type)<0&&g.push(r.type);var n=o(r.type);c=Math.max(c,n),r.offset=s=a(s,Math.max(t.alignment,n));for(var i=0;ithis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},d.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":346,unitbezier:552}],451:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],452:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/Users/cpsievert/github/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com", -tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/Users/cpsievert/github/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],453:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;iv[1][2]&&(b[0]=-b[0]),v[0][2]>v[2][0]&&(b[1]=-b[1]),v[1][0]>v[0][1]&&(b[2]=-b[2]),!0}},{"./normalize":455,"gl-mat4/clone":179,"gl-mat4/create":180,"gl-mat4/determinant":181,"gl-mat4/invert":185,"gl-mat4/transpose":195,"gl-vec3/cross":278,"gl-vec3/dot":279,"gl-vec3/length":280,"gl-vec3/normalize":282}],455:[function(t,e,r){e.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}},{}],456:[function(t,e,r){function n(t,e,r,n){if(0===u(e)||0===u(r))return!1;var i=c(e,h.translate,h.scale,h.skew,h.perspective,h.quaternion),a=c(r,d.translate,d.scale,d.skew,d.perspective,d.quaternion);return!(!i||!a)&&(s(p.translate,h.translate,d.translate,n),s(p.skew,h.skew,d.skew,n),s(p.scale,h.scale,d.scale,n),s(p.perspective,h.perspective,d.perspective,n),f(p.quaternion,h.quaternion,d.quaternion,n),l(t,p.translate,p.scale,p.skew,p.perspective,p.quaternion),!0)}function i(){return{translate:a(),scale:a(1),skew:a(),perspective:o(),quaternion:o()}}function a(t){return[t||0,t||0,t||0]}function o(){return[0,0,0,1]}var s=t("gl-vec3/lerp"),l=t("mat4-recompose"),c=t("mat4-decompose"),u=t("gl-mat4/determinant"),f=t("quat-slerp"),h=i(),d=i(),p=i();e.exports=n},{"gl-mat4/determinant":181,"gl-vec3/lerp":281,"mat4-decompose":454,"mat4-recompose":457,"quat-slerp":498}],457:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.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}},{"gl-mat4/create":180,"gl-mat4/fromRotationTranslation":183,"gl-mat4/identity":184,"gl-mat4/multiply":187,"gl-mat4/scale":193,"gl-mat4/translate":194}],458:[function(t,e,r){"use strict";function n(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]}function i(t){return t=t||{},new n(t.matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}var a=t("binary-search-bounds"),o=t("mat4-interpolate"),s=t("gl-mat4/invert"),l=t("gl-mat4/rotateX"),c=t("gl-mat4/rotateY"),u=t("gl-mat4/rotateZ"),f=t("gl-mat4/lookAt"),h=t("gl-mat4/translate"),d=(t("gl-mat4/scale"),t("gl-vec3/normalize")),p=[0,0,0];e.exports=i;var m=n.prototype;m.recalcMatrix=function(t){var e=this._time,r=a.le(e,t),n=this.computedMatrix;if(!(r<0)){var i=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=i[l++];else{for(var u=e[r+1]-e[r],l=16*r,f=this.prevMatrix,h=!0,c=0;c<16;++c)f[c]=i[l++];for(var p=this.nextMatrix,c=0;c<16;++c)p[c]=i[l++],h=h&&f[c]===p[c];if(u<1e-6||h)for(var c=0;c<16;++c)n[c]=f[c];else o(n,f,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],d(m,m);var v=this.computedInverse;s(v,n);var g=this.computedEye,y=v[15];g[0]=v[12]/y,g[1]=v[13]/y,g[2]=v[14]/y;for(var b=this.computedCenter,x=Math.exp(this.computedRadius[0]),c=0;c<3;++c)b[c]=g[c]-n[2+4*c]*x}},m.idle=function(t){if(!(t1&&i(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&i(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}for(var r=new Array(s.length+o.length-2),f=0,n=0,h=o.length;n0;--d)r[f++]=s[d];return r}e.exports=n;var i=t("robust-orientation")[3]},{"robust-orientation":517}],460:[function(t,e,r){"use strict";function n(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==v.alt,v.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==v.shift,v.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==v.control,v.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==v.meta,v.meta=!!t.metaKey),e}function n(t,n){var a=i.x(n),o=i.y(n);"buttons"in n&&(t=0|n.buttons),(t!==d||a!==p||o!==m||r(n))&&(d=0|t,p=a||0,m=o||0,e&&e(d,p,m,v))}function a(t){n(0,t)}function o(){(d||p||m||v.shift||v.alt||v.meta||v.control)&&(p=m=0,d=0,v.shift=v.alt=v.control=v.meta=!1,e&&e(0,0,0,v))}function s(t){r(t)&&e&&e(d,p,m,v)}function l(t){0===i.buttons(t)?n(0,t):n(d,t)}function c(t){n(d|i.buttons(t),t)}function u(t){n(d&~i.buttons(t),t)}function f(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}function h(){g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))}e||(e=t,t=window);var d=0,p=0,m=0,v={shift:!1,alt:!1,control:!1,meta:!1},g=!1;f();var y={element:t};return Object.defineProperties(y,{enabled:{get:function(){return g},set:function(t){t?f():h()},enumerable:!0},buttons:{get:function(){return d},enumerable:!0},x:{get:function(){return p},enumerable:!0},y:{get:function(){return m},enumerable:!0},mods:{get:function(){return v},enumerable:!0}}),y}e.exports=n;var i=t("mouse-event")},{"mouse-event":462}],461:[function(t,e,r){function n(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var n=t.clientX||0,a=t.clientY||0,o=i(e);return r[0]=n-o.left,r[1]=a-o.top,r}function i(t){return t===window||t===document||t===document.body?a:t.getBoundingClientRect()}var a={left:0,top:0};e.exports=n},{}],462:[function(t,e,r){"use strict";function n(t){if("object"==typeof t){if("buttons"in t)return t.buttons;if("which"in t){var e=t.which;if(2===e)return 4;if(3===e)return 2;if(e>0)return 1<=0)return 1<=0;--e)L(e,0);for(var r=[],e=0;e0;_=_-1&m)x.push(w+"["+A+"+"+v(_)+"]");x.push(g(0));for(var _=0;_0){",h(x[t]),"=1;"),z(t-1,e|1<0&&G.push(s(U,x[V-1])+"*"+o(x[V-1])),N.push(d(U,x[V])+"=("+G.join("-")+")|0")}for(var U=0;U=0;--U)Y.push(o(x[U]));N.push(k+"=("+Y.join("*")+")|0",M+"=mallocUint32("+k+")",w+"=mallocUint32("+k+")",A+"=0"),N.push(p(0)+"=0");for(var V=1;V<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 a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)}var _=t("typedarray-pool");e.exports=x;var w="V",M="P",T="N",k="Q",A="X",E="T"},{"typedarray-pool":549}],465:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_7_arg1_=_inline_7_arg2_.apply(void 0,_inline_7_arg0_)}",args:[{name:"_inline_7_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_7_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_7_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":466}],466:[function(t,e,r){arguments[4][112][0].apply(r,arguments)},{"cwise-compiler":109,dup:112}],467:[function(t,e,r){"use strict";function n(t){if(t in l)return l[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){a.push("if(1");for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");a.push("){grad",r,"(src.pick(",s.join(),")",c);for(var l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(var l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}(p)}}a.push("return dst;};return gradient");for(var m=["diff","zero"],v=[f,h],o=1;o<=i;++o)m.push("grad"+o),v.push(n(o));m.push(a.join(""));var g=Function.apply(void 0,m),r=g.apply(void 0,v);return l[e]=r,r}function a(t,e,r){if(Array.isArray(r)){if(r.length!==e.dimension)throw new Error("ndarray-gradient: invalid boundary conditions")}else r="string"==typeof r?o(e.dimension,r):o(e.dimension,"clamp");if(t.dimension!==e.dimension+1)throw new Error("ndarray-gradient: output dimension must be +1 input dimension");if(t.shape[e.dimension]!==e.dimension)throw new Error("ndarray-gradient: output shape must match input shape");for(var n=0;n>",rrshift:">>>"};!function(){for(var t in l){var e=l[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var c={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in c){var e=c[t];r[t]=a({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=a({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var u={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in u){var e=u[t];r[t]=a({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=a({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=a({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=a({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var f=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=o({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=o({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=o({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=a({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=a({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=a({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=o({args:["array","array"],pre:s,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":109}],471:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":472,ndarray:476}],472:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":109}],473:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[l.mallocUint8,l.freeUint8];case"uint16":return[l.mallocUint16,l.freeUint16];case"uint32":return[l.mallocUint32,l.freeUint32];case"int8":return[l.mallocInt8,l.freeInt8];case"int16":return[l.mallocInt16,l.freeInt16];case"int32":return[l.mallocInt32,l.freeInt32];case"float32":return[l.mallocFloat,l.freeFloat];case"float64":return[l.mallocDouble,l.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r1){for(var f=[],h=1;h1){o.push("dptr=0;sptr=ptr");for(var h=t.length-1;h>=0;--h){var d=t[h];0!==d&&o.push(["for(i",d,"=0;i",d,"left){","dptr=0","sptr=cptr-s0");for(var h=1;hb){break __l}"].join(""));for(var h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");o.push("dptr=cptr;sptr=cptr-s0");for(var h=t.length-1;h>=0;--h){var d=t[h];0!==d&&o.push(["for(i",d,"=0;i",d,"=0;--h){var d=t[h];0!==d&&o.push(["for(i",d,"=0;i",d,"left)&&("+r("cptr-s0")+">scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));if(o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c){var p=new Function("malloc","free",o.join("\n"));return p(c[0],c[1])}var p=new Function(o.join("\n"));return p()}function o(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function o(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function s(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function l(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i){var o=t[i];0!==o&&_.push(["for(i",o,"=0;i",o,"1)for(var i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(var o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function f(){t.length>1&&T&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var s="__l"+ ++k;u(s,[n,i],!1,["comp=",o("ptr0"),"-",o("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",s,"}\n","if(comp<0){break ",s,"}"].join(""))}else _.push(["if(",o(a(n)),">",o(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?l([e,r],!1,s("ptr0",o("ptr1"))):_.push(s(a(e),o(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++k;u(i,[r],!0,[e,"=",o("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",o(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?l([e,r],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1","tmp")].join(""))}function v(e,r,n){t.length>1?(l([e,r,n],!1,["tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",o("ptr0"),"\n",s("ptr0",o("ptr1")),"\n",s("ptr1",o("ptr2")),"\n",s("ptr2","tmp")].join(""))}function g(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?l([e,r],!0,[s("ptr0",o("ptr1")),"\n",s("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(s(a(e),o(a(r))),s(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",c,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++k,":while(true){"].join("")),l([e],!0,["if(",o("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",k,"}"].join("")),_.push(n,"}")):_.push(["while(",o(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),T=n(e),k=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var A=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var E=[],S=1;S1?l(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",o("ptr1"),"\n","pivot2[pivot_ptr]=",o("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",o("ptr0"),"\n","y=",o("ptr2"),"\n","z=",o("ptr4"),"\n",s("ptr5","x"),"\n",s("ptr6","y"),"\n",s("ptr7","z")].join("")):_.push(["pivot1=",o(a("el2")),"\n","pivot2=",o(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",o(a("el1")),"\n","y=",o(a("el3")),"\n","z=",o(a("el5")),"\n",s(a("index1"),"x"),"\n",s(a("index3"),"y"),"\n",s(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),v("k","less","great"),_.push("break"),_.push("}else{"),g("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&T){var L=new Function("insertionSort","malloc","free",_.join("\n"));return L(r,T[0],T[1])}var L=new Function("insertionSort",_.join("\n"));return L(r)}function s(t,e){var r=["'use strict'"],n=["ndarraySortWrapper",t.join("d"),e].join(""),s=["array"];r.push(["function ",n,"(",s.join(","),"){"].join(""));for(var l=["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"],u=0;u0?l.push(["d",v,"=s",v,"-d",p,"*n",p].join("")):l.push(["d",v,"=s",v].join("")),p=v);var d=t.length-1-u;0!==d&&(m>0?l.push(["e",d,"=s",d,"-e",m,"*n",m,",f",d,"=",f[d],"-f",m,"*n",m].join("")):l.push(["e",d,"=s",d,",f",d,"=",f[d]].join("")),m=d)}r.push("var "+l.join(","));var g=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",c,"){","insertionSort(",g.join(","),")}else{","quickSort(",g.join(","),")}"].join("")),r.push("}return "+n);var y=new Function("insertionSort","quickSort",r.join("\n")),b=a(t,e);return y(b,o(t,e,b))}var l=t("typedarray-pool"),c=32;e.exports=s},{"typedarray-pool":549}],474:[function(t,e,r){"use strict";function n(t){var e=t.order,r=t.dtype,n=[e,r],o=n.join(":"),s=a[o];return s||(a[o]=s=i(e,r)),s(t),t}var i=t("./lib/compile_sort.js"),a={};e.exports=n},{"./lib/compile_sort.js":473}],475:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_33_arg4_)}",args:[{name:"_inline_33_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_33_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_34_arg2_(this_warped,_inline_34_arg0_),_inline_34_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_34_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_34_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_34_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_34_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_34_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_37_arg2_(this_warped,_inline_37_arg0_),_inline_37_arg3_(_inline_37_arg4_,this_warped[0])}",args:[{name:"_inline_37_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_37_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_37_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_37_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_37_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_40_arg2_(this_warped,_inline_40_arg0_),_inline_40_arg3_(_inline_40_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_40_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_40_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_40_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_43_arg2_(this_warped,_inline_43_arg0_),_inline_43_arg3_(_inline_43_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_43_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_43_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_43_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":112,"ndarray-linear-interpolate":469}],476:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+c.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+c.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",c.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+c.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var p=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),m=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+c.join(",")+"){var b=this.offset,d=0,"+p.join(",")+","+m.join(","));for(var v=0;v=0){d=i"+v+"|0;b+=c"+v+"*d;a"+v+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+c.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(var v=0;v=0){c=(c+this.stride["+v+"]*i"+v+")|0}else{a.push(this.shape["+v+"]);b.push(this.stride["+v+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");var o=new Function("CTOR_LIST","ORDER",a.join("\n"));return o(f[t],i)}function o(t){if(c(t))return"buffer";if(u)switch(Object.prototype.toString.call(t)){case"[object Float64Array]":return"float64";case"[object Float32Array]":return"float32";case"[object Int8Array]":return"int8";case"[object Int16Array]":return"int16";case"[object Int32Array]":return"int32";case"[object Uint8Array]":return"uint8";case"[object Uint16Array]":return"uint16";case"[object Uint32Array]":return"uint32";case"[object Uint8ClampedArray]":return"uint8_clamped"}return Array.isArray(t)?"array":"generic"}function s(t,e,r,n){if(void 0===t){var i=f.array[0];return i([])}"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var s=e.length;if(void 0===r){r=new Array(s);for(var l=s-1,c=1;l>=0;--l)r[l]=c,c*=e[l]}if(void 0===n){n=0;for(var l=0;lt==t>0?n===o?(r+=1,n=0):n+=1:0===n?(n=o,r-=1):n-=1,i.pack(n,r)}var i=t("double-bits"),a=Math.pow(2,-1074),o=-1>>>0;e.exports=n},{"double-bits":124}],478:[function(t,e,r){r.vertexNormals=function(t,e,r){for(var n=e.length,i=new Array(n),a=void 0===r?1e-6:r,o=0;oa)for(var x=i[c],_=1/Math.sqrt(v*y),b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(g[w]*m[M]-g[M]*m[w])}}for(var o=0;oa)for(var _=1/Math.sqrt(T),b=0;b<3;++b)x[b]*=_;else for(var b=0;b<3;++b)x[b]=0}return i},r.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;for(var c=0;c<3;++c)h[c]*=d;i[o]=h}return i}},{}],479:[function(t,e,r){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=n(t),l=1;lT&&(T=d[1]),A[r]=d}for(l=0,u=0,c=0,r=0;rk&&(k=m);return{center:[f,h],bounds:[M,_,T,w+1],radius:Math.sqrt(k)}}function o(t,e){var r=0,n=t.length,i=0 -;for(e||(e=4);!t[i]&&ir;)i-=e;return n=i,[r/e,n/e]}function s(t,e){return t*t+e*e}e.exports=n;var l=document.createElement("canvas"),c=l.getContext("2d");l.width=200,l.height=200,n.canvas=l},{}],481:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(f>0){var f=Math.sqrt(u+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,c),f=Math.sqrt(2*h-u+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}e.exports=n},{}],482:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=l([r]),this.center=l(e),this.rotation=l(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)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.rotation||[0,0,0,1],n=t.radius||1;e=[].slice.call(e,0,3),r=[].slice.call(r,0,4),a(r,r);var i=new o(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}e.exports=s;var l=t("filtered-vector"),c=t("gl-mat4/lookAt"),u=t("gl-mat4/fromQuat"),f=t("gl-mat4/invert"),h=t("./lib/quatFromFrame"),d=o.prototype;d.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},d.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;u(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 c=0,f=0;f<3;++f)c+=r[l+4*f]*i[f];r[12+l]=-c}},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},d.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},d.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l;u-=o*d,f-=s*d,h-=l*d;var p=n(u,f,h);u/=p,f/=p,h/=p;var m=a[2],v=a[6],g=a[10],y=m*o+v*s+g*l,b=m*u+v*f+g*h;m-=y*o+b*u,v-=y*s+b*f,g-=y*l+b*h;var x=n(m,v,g);m/=x,v/=x,g/=x;var _=u*e+o*r,w=f*e+s*r,M=h*e+l*r;this.center.move(t,_,w,M);var T=Math.exp(this.computedRadius[0]);T=Math.max(1e-4,T+i),this.radius.set(t,Math.log(T))},d.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],m=o[10],v=e*s+r*u,g=e*l+r*f,y=e*c+r*h,b=-(p*y-m*g),x=-(m*v-d*y),_=-(d*g-p*v),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var T=this.computedRotation,k=T[0],A=T[1],E=T[2],S=T[3],L=k*w+S*b+A*_-E*x,C=A*w+S*x+E*b-k*_,I=E*w+S*_+k*x-A*b,D=S*w-k*b-A*x-E*_;if(a){b=d,x=p,_=m;var P=Math.sin(a)/n(b,x,_);b*=P,x*=P,_*=P,w=Math.cos(e),L=L*w+D*b+C*_-I*x,C=C*w+D*x+I*b-L*_,I=I*w+D*_+L*x-C*b,D=D*w-L*b-C*x-I*_}var z=i(L,C,I,D);z>1e-6?(L/=z,C/=z,I/=z,D/=z):(L=C=I=0,D=1),this.rotation.set(t,L,C,I,D)},d.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;c(i,e,r,n);var o=this.computedRotation;h(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,l=0;l<3;++l)s+=Math.pow(r[l]-e[l],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},d.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},d.setMatrix=function(t,e){var r=this.computedRotation;h(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;f(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},d.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},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;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.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]}},d.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)}},{"./lib/quatFromFrame":481,"filtered-vector":133,"gl-mat4/fromQuat":182,"gl-mat4/invert":185,"gl-mat4/lookAt":186}],483:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":509}],484:[function(t,e,r){e.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}},{}],485:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}function o(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function s(t,e){for(var r=0;r>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:i(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455)return void a(t,this);this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127)))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=v.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&o(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,s,e)},writePackedSVarint:function(t,e){this.writeMessage(t,l,e)},writePackedBoolean:function(t,e){this.writeMessage(t,f,e)},writePackedFloat:function(t,e){this.writeMessage(t,c,e)},writePackedDouble:function(t,e){this.writeMessage(t,u,e)},writePackedFixed32:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,d,e)},writePackedFixed64:function(t,e){this.writeMessage(t,p,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,m,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":486}],488:[function(t,e,r){"use strict";function n(t){var e=t.length;if(e0;--i)n=l[i],r=s[i],s[i]=s[n],s[n]=r,l[i]=l[r],l[r]=n,c=(c+r)*i;return a.freeUint32(l),a.freeUint32(s),c}function i(t,e,r){switch(t){case 0:return r?r:[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}r=r||new Array(t);var n,i,a,o=1;for(r[0]=0,a=1;a0;--a)n=e/o|0,e=e-n*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}var a=t("typedarray-pool"),o=t("invert-permutation");r.rank=n,r.unrank=i},{"invert-permutation":299,"typedarray-pool":549}],490:[function(t,e,r){"use strict";function n(t,e){function r(t,e){var r=s[e][t[e]];r.splice(r.indexOf(t),1)}function n(t,n,a){for(var o,l,c,u=0;u<2;++u)if(s[u][n].length>0){o=s[u][n][0],c=u;break}l=o[1^c];for(var f=0;f<2;++f)for(var h=s[f][n],d=0;d0&&(o=p,l=m,c=f)}return a?l:(o&&r(o,c),l)}for(var a=0|e.length,o=t.length,s=[new Array(a),new Array(a)],l=0;l0;){var d=(s[0][l].length,function(t,a){var o=s[a][t][0],l=[t];r(o,a);for(var c=o[1^a];;){for(;c!==t;)l.push(c),c=n(l[l.length-2],c,!1);if(s[0][t].length+s[1][t].length===0)break;var u=l[l.length-1],f=t,h=l[1],d=n(u,f,!0);if(i(e[u],e[f],e[h],e[d])<0)break;l.push(t),c=n(u,f)}return l}(l,f));!function(t,e){return e[1]===e[e.length-1]}(h,d)?(h.length>0&&u.push(h),h=d):h.push.apply(h,d)}h.length>0&&u.push(h)}return u}e.exports=n;var i=t("compare-angle")},{"compare-angle":99}],491:[function(t,e,r){"use strict";function n(t,e){for(var r=i(t,e.length),n=new Array(e.length),a=new Array(e.length),o=[],s=0;s0;){var c=o.pop();n[c]=!1;for(var u=r[c],s=0;s0}function a(t){for(var e=t.length,r=0;r0;){var U=N.pop(),V=D[U];f(V,function(t,e){return t-e});var H,q=V.length,G=B[U];if(0===G){var A=g[U];H=[A]}for(var v=0;v=0)&&(B[Y]=1^G,N.push(Y),0===G)){var A=g[Y];a(A)||(A.reverse(),H.push(A))}}0===G&&d.push(H)}return d}e.exports=a;var o=t("edges-to-adjacency-list"),s=t("planar-dual"),l=t("point-in-big-polygon"),c=t("two-product"),u=t("robust-sum"),f=t("uniq"),h=t("./lib/trim-leaves")},{"./lib/trim-leaves":491,"edges-to-adjacency-list":127,"planar-dual":490,"point-in-big-polygon":494,"robust-sum":522,"two-product":547,uniq:551}],493:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],494:[function(t,e,r){function n(){return!0}function i(t){return function(e,r){var i=t[e];return!!i&&!!i.queryPoint(r,n)}}function a(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var o=i.key,s=f(r,o[0],o[1]);if(o[0][0]0))return 0;a=-1,i=i.right}else if(s>0)i=i.left;else{if(!(s<0))return 0;a=1,i=i.right}}return a}}function s(t){return 1}function l(t){return function(e){return t(e[0],e[1])?0:1}}function c(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}function u(t){for(var e=t.length,r=[],n=[],i=0;i=c?(x=1,y=c+2*h+p):(x=-h/c,y=h*x+p)):(x=0,d>=0?(_=0,y=p):-d>=f?(_=1,y=f+2*d+p):(_=-d/f,y=d*_+p));else if(_<0)_=0,h>=0?(x=0,y=p):-h>=c?(x=1,y=c+2*h+p):(x=-h/c,y=h*x+p);else{var w=1/b;x*=w,_*=w,y=x*(c*x+u*_+2*h)+_*(u*x+f*_+2*d)+p}else{var M,T,k,A;x<0?(M=u+h,T=f+d,T>M?(k=T-M,A=c-2*u+f,k>=A?(x=1,_=0,y=c+2*h+p):(x=k/A,_=1-x,y=x*(c*x+u*_+2*h)+_*(u*x+f*_+2*d)+p)):(x=0,T<=0?(_=1,y=f+2*d+p):d>=0?(_=0,y=p):(_=-d/f,y=d*_+p))):_<0?(M=u+d,T=c+h,T>M?(k=T-M,A=c-2*u+f,k>=A?(_=1,x=0,y=f+2*d+p):(_=k/A,x=1-_,y=x*(c*x+u*_+2*h)+_*(u*x+f*_+2*d)+p)):(_=0,T<=0?(x=1,y=c+2*h+p):h>=0?(x=0,y=p):(x=-h/c,y=h*x+p))):(k=f+d-u-h,k<=0?(x=0,_=1,y=f+2*d+p):(A=c-2*u+f,k>=A?(x=1,_=0,y=c+2*h+p):(x=k/A,_=1-x,y=x*(c*x+u*_+2*h)+_*(u*x+f*_+2*d)+p)))}for(var E=1-x-_,l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(P,"."),n+o(t.split("."),e).join(".")}function l(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(t-=65536,e+=F(t>>>10&1023|55296),t=56320|1023&t),e+=F(t)}).join("")}function u(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:M}function f(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function h(t,e,r){var n=0;for(t=r?R(t/E):t>>1,t+=R(t/e);t>O*k>>1;n+=M)t=R(t/O);return R(n+(O+1)*t/(t+A))}function d(t){var e,r,n,i,o,s,l,f,d,p,m=[],v=t.length,g=0,y=L,b=S;for(r=t.lastIndexOf(C),r<0&&(r=0),n=0;n=128&&a("not-basic"),m.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=v&&a("invalid-input"),f=u(t.charCodeAt(i++)),(f>=M||f>R((w-g)/s))&&a("overflow"),g+=f*s,d=l<=b?T:l>=b+k?k:l-b,!(fR(w/p)&&a("overflow"),s*=p;e=m.length+1,b=h(g-o,e,0==o),R(g/e)>w-y&&a("overflow"),y+=R(g/e),g%=e,m.splice(g++,0,y)}return c(m)}function p(t){var e,r,n,i,o,s,c,u,d,p,m,v,g,y,b,x=[];for(t=l(t),v=t.length,e=L,r=0,o=S,s=0;s=e&&mR((w-r)/g)&&a("overflow"),r+=(c-e)*g,e=c,s=0;sw&&a("overflow"),m==e){for(u=r,d=M;p=d<=o?T:d>=o+k?k:d-o,!(u= 0x80 (not a basic code point)","invalid-input":"Invalid input"},O=M-T,R=Math.floor,F=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:l,encode:c},decode:d,encode:p,toASCII:v,toUnicode:m},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return x});else if(g&&y)if(r.exports==g)y.exports=x;else for(_ in x)x.hasOwnProperty(_)&&(g[_]=x[_]);else i.punycode=x}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],498:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":236}],499:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;t=t.split(e);var s=1e3;a&&"number"==typeof a.maxKeys&&(s=a.maxKeys) -;var l=t.length;s>0&&l>s&&(l=s);for(var c=0;c=0?(u=p.substr(0,m),f=p.substr(m+1)):(u=p,f=""),h=decodeURIComponent(u),d=decodeURIComponent(f),n(o,h)?i(o[h])?o[h].push(d):o[h]=[o[h],d]:o[h]=d}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],500:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;nr;){if(o-r>600){var l=o-r+1,c=e-r+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-c*f/l+h)),Math.min(o,Math.floor(e+(l-c)*f/l+h)),s)}var d=t[e],p=r,m=o;for(i(t,r,e),s(t[o],d)>0&&i(t,r,o);p0;)m--}0===s(t[r],d)?i(t,r,m):(m++,i(t,m,o)),m<=e&&(r=m+1),e<=m&&(o=m-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function a(t,e){return te?1:0}e.exports=n},{}],503:[function(t,e,r){"use strict";function n(t,e){for(var r=t.length,n=new Array(r),a=0;a0){var c=t[r-1];if(0===i(s,c)&&o(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}var i=t("compare-cell"),a=t("compare-oriented-cell"),o=t("cell-orientation");e.exports=n},{"cell-orientation":85,"compare-cell":100,"compare-oriented-cell":101}],508:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?r.exports=i():"function"==typeof t&&t.amd?t(i):e.createREGL=i()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?": "+t:""}function i(t,r,i){t in r||e("unknown parameter ("+t+")"+n(i)+". possible values: "+Object.keys(r).join())}function a(t,r){Qt(t)||e("invalid parameter type"+n(r)+". must be a typed array")}function o(t,r,i){typeof t!==r&&e("invalid parameter type"+n(i)+". expected "+r+", got "+typeof t)}function s(t,r){t>=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")}function l(t,r,i){r.indexOf(t)<0&&e("invalid value"+n(i)+". must be one of: "+r)}function c(t){Object.keys(t).forEach(function(t){te.indexOf(t)<0&&e('invalid regl constructor argument "'+t+'". must be one of '+te)})}function u(t,e){for(t+="";t.length0&&e.push(new d("unknown",0,t))}}),e}function y(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}function b(t,e,n,i,a){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var o=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";A(n,"string",s+" shader source must be a string",a);var l=v(n,a),c=g(o);y(l,c),Object.keys(l).forEach(function(t){function e(t,e){n.push(t),i.push(e||"")}var r=l[t];if(r.hasErrors){var n=[""],i=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(u(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var i=n.message,a=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(a){var o=a[1];switch(i=a[2],o){case"assign":o="="}r=Math.max(t.line.indexOf(o,r),0)}else r=0;e(u("| ",6)),e(u("^^^",r+3)+"\n","font-weight:bold"),e(u("| ",6)),e(i+"\n","font-weight:bold")}),e(u("| ",6)+"\n")}else e(u(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=n.join("%c"),console.log.apply(console,i)):console.log(n.join(""))}}),r.raise("Error compiling "+s+" shader, "+l[0].name)}}function x(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=v(n,a),l=v(i,a),c='Error linking program with vertex shader, "'+l[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+c+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(c+"\n"+o),r.raise(c)}}function _(t){t._commandRef=p()}function w(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}_(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic}function M(t,r){var n=m();e(t+" in command "+(r||p())+("unknown"===n?"":" called from "+n))}function T(t,e,r){t||M(e,r||p())}function k(t,e,r,i){t in e||M("unknown parameter ("+t+")"+n(r)+". possible values: "+Object.keys(e).join(),i||p())}function A(t,e,r,i){typeof t!==e&&M("invalid parameter type"+n(r)+". expected "+e+", got "+typeof t,i||p())}function E(t){t()}function S(t,e,r){t.texture?l(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):l(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")}function L(t,e){return t===ce||t===le||t===ue?2:t===fe?4:he[t]*e}function C(t){return!(t&t-1||!t)}function I(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ee&&t.wrapT===ee||r(C(a)&&C(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==ne&&t.minFilter!==ae&&t.minFilter!==ie&&t.minFilter!==oe,"min filter requires mipmap"):(r(C(a)&&C(o),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),e.type===se&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===re&&t.magFilter===re,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var c=a>>i,u=o>>i;r(e.mipmask&1<0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(e.wrapS===ee&&e.wrapT===ee,"wrap mode not supported by cube map");for(var l=0;l>f,p=o>>f;r(c.mipmask&1<1&&e===r&&('"'===e||"'"===e))return['"'+z(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return O(t.substr(0,n.index)).concat(O(n[1])).concat(O(t.substr(n.index+n[0].length)));var i=t.split(".");if(1===i.length)return['"'+z(t)+'"'];for(var a=[],o=0;o0,"invalid pixel ratio"))):de.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){de("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=U(r||document.body,f,c);if(!d)return null;n=d.canvas,h=d.onDestroy}i=V(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:c,profile:u,onDone:f,onDestroy:h}:(h(),f("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function W(t,e){function r(e){de.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var n={},i=0;i65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function $(t){var e=K(t),r=Se[Q(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function tt(t){Se[Q(t.byteLength)>>2].push(t)}function et(t,e){var r=null;switch(t){case _e:r=new Int8Array($(e),0,e);break;case we:r=new Uint8Array($(e),0,e);break;case Me:r=new Int16Array($(2*e),0,e);break;case Te:r=new Uint16Array($(2*e),0,e);break;case ke:r=new Int32Array($(4*e),0,e);break;case Ae:r=new Uint32Array($(4*e),0,e);break;case Ee:r=new Float32Array($(4*e),0,e);break;default:return null}return r.length!==e?r.subarray(0,e):r}function rt(t){tt(t.buffer)}function nt(t,e,r){for(var n=0;n0){var l;if(Array.isArray(e[0])){s=ze(e);for(var c=1,u=1;u0)if("number"==typeof t[0]){var i=Le.allocType(p.dtype,t.length);ut(i,t),f(i,n),Le.freeType(i)}else if(Array.isArray(t[0])||Qt(t[0])){r=ze(t);var a=Pe(t,r,p.dtype);f(a,n),Le.freeType(a)}else de.raise("invalid buffer data")}else if(Qt(t))f(t,n);else if(Z(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,h=0;1===r.length?(s=r[0],l=1,c=o[0],h=0):2===r.length?(s=r[0],l=r[1],c=o[0],h=o[1]):de.raise("invalid shape");var d=Array.isArray(t.data)?p.dtype:ct(t.data),m=Le.allocType(d,s*l);ft(m,t.data,s,l,c,h,t.offset),f(m,n),Le.freeType(m)}else de.raise("invalid data for buffer subdata");return u}e.bufferCount++;var p=new n(a);return h[p.id]=p,o||u(i),u._reglType="buffer",u._buffer=p,u.subdata=d,r.profile&&(u.stats=p.stats),u.destroy=function(){l(p)},u}function u(){xe(h).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})}var f=0,h={};n.prototype.bind=function(){t.bindBuffer(this.type,this.buffer)},n.prototype.destroy=function(){l(this)};var d=[];return r.profile&&(e.getTotalBufferSize=function(){var t=0;return Object.keys(h).forEach(function(e){t+=h[e].stats.size}),t}),{create:c,createStream:i,destroyStream:a,clear:function(){xe(h).forEach(l),d.forEach(l)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:u,_initBuffer:s}}function dt(t,e,r,n){function i(t){this.id=f++,u[this.id]=this,this.buffer=t,this.primType=He,this.vertCount=0,this.type=0}function a(t){var e=d.pop();return e||(e=new i(r.create(null,Je,!0,!1)._buffer)),s(e,t,Ke,-1,-1,0,0),e}function o(t){d.push(t)}function s(n,i,a,o,s,l,c){if(n.buffer.bind(),i){var u=c;c||Qt(i)&&(!Z(i)||Qt(i.data))||(u=e.oes_element_index_uint?Ze:Xe),r._initBuffer(n.buffer,i,a,u,3)}else t.bufferData(Je,l,a),n.buffer.dtype=f||Ge,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var f=c;if(!c){switch(n.buffer.dtype){case Ge:case qe:f=Ge;break;case Xe:case Ye:f=Xe;break;case Ze:case We:f=Ze;break;default:de.raise("unsupported type for element array")}n.buffer.dtype=f}n.type=f,de(f!==Ze||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var h=s;h<0&&(h=n.buffer.byteLength,f===Xe?h>>=1:f===Ze&&(h>>=2)),n.vertCount=h;var d=o;if(o<0){d=He;var p=n.buffer.dimension;1===p&&(d=Ue),2===p&&(d=Ve),3===p&&(d=He)}n.primType=d}function l(t){n.elementsCount--,de(null!==t.buffer,"must not double destroy elements"),delete u[t.id],t.buffer.destroy(),t.buffer=null}function c(t,e){function a(t){if(t)if("number"==typeof t)o(t),c.primType=He,c.vertCount=0|t,c.type=Ge;else{var e=null,r=Qe,n=-1,i=-1,l=0,u=0;Array.isArray(t)||Qt(t)||Z(t)?e=t:(de.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,de(Array.isArray(e)||Qt(e)||Z(e),"invalid data for element buffer")),"usage"in t&&(de.parameter(t.usage,De,"invalid element buffer usage"),r=De[t.usage]),"primitive"in t&&(de.parameter(t.primitive,Be,"invalid element buffer primitive"),n=Be[t.primitive]),"count"in t&&(de("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(de.parameter(t.type,h,"invalid buffer type"),u=h[t.type]),"length"in t?l=0|t.length:(l=i,u===Xe||u===Ye?l*=2:u!==Ze&&u!==We||(l*=4))),s(c,e,r,n,i,l,u)}else o(),c.primType=He,c.vertCount=0,c.type=Ge;return a}var o=r.create(null,Je,!0),c=new i(o._buffer);return n.elementsCount++,a(t),a._reglType="elements",a._elements=c,a.subdata=function(t,e){return o.subdata(t,e),a},a.destroy=function(){l(c)},a}var u={},f=0,h={uint8:Ge,uint16:Xe};e.oes_element_index_uint&&(h.uint32=Ze),i.prototype.bind=function(){this.buffer.bind()};var d=[];return{create:c,createStream:a,destroyStream:o,getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){xe(u).forEach(l)}}}function pt(t){for(var e=Le.allocType(er,t.length),r=0;r>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function mt(t){return Array.isArray(t)||Qt(t)}function vt(t){return"[object "+t+"]"}function gt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function yt(t){return!!Array.isArray(t)&&!(0===t.length||!mt(t[0]))}function bt(t){return Object.prototype.toString.call(t)}function xt(t){return bt(t)===dn}function _t(t){return bt(t)===pn}function wt(t){return bt(t)===mn}function Mt(t){return bt(t)===vn}function Tt(t){if(!t)return!1;var e=bt(t);return gn.indexOf(e)>=0||(gt(t)||yt(t)||Z(t))}function kt(t){return 0|Kt[Object.prototype.toString.call(t)]}function At(t,e){var r=e.length;switch(t.type){case Or:case Rr:case Fr:case jr:var n=Le.allocType(t.type,r);n.set(e),t.data=n;break;case wr:t.data=pt(e);break;default:de.raise("unsupported texture type, must specify a typed array")}}function Et(t,e){return Le.allocType(t.type===wr?jr:t.type,e)}function St(t,e){t.type===wr?(t.data=pt(e),Le.freeType(e)):t.data=e}function Lt(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=o*s*l,u=Et(t,c),f=0,h=0;h=1;)s+=o*l*l,l/=2;return s}return o*r*n}function It(t,e,r,n,i,a,o){function s(){this.internalformat=or,this.format=or,this.type=Or,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function c(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(de.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(de.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(de.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(de.parameter(n.colorSpace,j,"invalid colorSpace"),t.colorSpace=j[n.colorSpace]),"type"in n){var i=n.type;de(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),de(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),de(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(i,N,"invalid texture type"),t.type=N[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(de(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],de(s>0&&s<=4,"invalid number of channels"),l=!0),de(a>=0&&a<=r.maxTextureSize,"invalid width"),de(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,de(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,de(a>=0&&a<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,de(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,de(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var c=!1;if("format"in n){var u=n.format;de(e.webgl_depth_texture||!("depth"===u||"depth stencil"===u),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),de.parameter(u,B,"invalid texture format");var f=t.internalformat=B[u];t.format=J[f],u in N&&("type"in n||(t.type=N[u])),u in U&&(t.compressed=!0),c=!0}!l&&c?t.channels=hn[t.format]:l&&!c?t.channels!==fn[t.format]&&(t.format=t.internalformat=fn[t.channels]):c&&l&&de(t.channels===hn[t.format],"number of channels inconsistent with specified format")}}function u(e){t.pixelStorei(an,e.flipY),t.pixelStorei(on,e.premultiplyAlpha),t.pixelStorei(sn,e.colorSpace),t.pixelStorei(nn,e.unpackAlignment)}function f(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function h(t,e){var n=null;if(Tt(e)?n=e:e&&(de.type(e,"object","invalid pixel data type"),c(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),Tt(e.data)&&(n=e.data)),de(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){de(!n,"can not specify copy and data field for the same texture");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,de(t.xOffset>=0&&t.xOffset=0&&t.yOffset0&&t.width<=a&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(Qt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==Or||(t.type=kt(n));else if(gt(n))t.channels=t.channels||4,At(t,n),t.alignment=1,t.needsFree=!0;else if(Z(n)){var s=n.data;Array.isArray(s)||t.type!==Or||(t.type=kt(s));var l,u,f,h,d,p,m=n.shape,v=n.stride;3===m.length?(f=m[2],p=v[2]):(de(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),f=1,p=1),l=m[0],u=m[1],h=v[0],d=v[1],t.alignment=1,t.width=l,t.height=u,t.channels=f,t.format=t.internalformat=fn[f],t.needsFree=!0,Lt(t,s,h,d,p,n.offset)}else if(xt(n)||_t(n))xt(n)?t.element=n:t.element=n.canvas,t.width=t.element.width,t.height=t.element.height,t.channels=4;else if(wt(n))t.element=n,t.width=n.naturalWidth,t.height=n.naturalHeight,t.channels=4;else if(Mt(n))t.element=n,t.width=n.videoWidth,t.height=n.videoHeight,t.channels=4;else if(yt(n)){var g=t.width||n[0].length,y=t.height||n.length,b=t.channels;b=mt(n[0][0])?b||n[0][0].length:b||1;for(var x=Ce.shape(n),_=1,w=0;w=0,"oes_texture_float extension not enabled"):t.type===wr&&de(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,c=e.type,f=e.width,h=e.height;u(e),a?t.texImage2D(r,i,l,l,c,a):e.compressed?t.compressedTexImage2D(r,i,s,f,h,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,f,h,0)):t.texImage2D(r,i,l,f,h,0,l,c,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,c=e.internalformat,f=e.format,h=e.type,d=e.width,p=e.height;u(e),s?t.texSubImage2D(r,o,i,a,f,h,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,c,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,f,h,l)}function m(){return K.pop()||new f}function v(t){t.needsFree&&Le.freeType(t.data),f.call(t),K.push(t)}function g(){s.call(this),this.genMipmaps=!1,this.mipmapHint=$r,this.mipmask=0,this.images=Array(16)}function y(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function b(t,e){var r=null;if(Tt(e))r=t.images[0]=m(),l(r,t),h(r,e),t.mipmask=1;else if(c(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,h(r,n[i]),t.mipmask|=1<=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;de.parameter(i,R),t.magFilter=R[i]}var a=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(de.parameter(s,O),a=o=O[s]):Array.isArray(s)&&(de.parameter(s[0],O),de.parameter(s[1],O),a=O[s[0]],o=O[s[1]])}else{if("wrapS"in e){var l=e.wrapS;de.parameter(l,O),a=O[l]}if("wrapT"in e){var c=e.wrapT;de.parameter(c,O),o=O[c]}}if(t.wrapS=a,t.wrapT=o,"anisotropic"in e){var u=e.anisotropic -;de("number"==typeof u&&u>=1&&u<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var f=!1;switch(typeof e.mipmap){case"string":de.parameter(e.mipmap,z,"invalid mipmap hint"),t.mipmapHint=z[e.mipmap],t.genMipmaps=!0,f=!0;break;case"boolean":f=t.genMipmaps=e.mipmap;break;case"object":de(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,f=!0;break;default:de.raise("invalid mipmap type")}!f||"min"in e||(t.minFilter=Wr)}}function k(r,n){t.texParameteri(n,Gr,r.minFilter),t.texParameteri(n,qr,r.magFilter),t.texParameteri(n,Nr,r.wrapS),t.texParameteri(n,Br,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,rn,r.anisotropic),r.genMipmaps&&(t.hint(Qr,r.mipmapHint),t.generateMipmap(n))}function A(e){s.call(this),this.mipmask=0,this.internalformat=or,this.id=$++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new M,o.profile&&(this.stats={size:0})}function E(e){t.activeTexture(cn),t.bindTexture(e.target,e.texture)}function S(){var e=rt[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(nr,null)}function L(e){var r=e.texture;de(r,"must not double destroy texture");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(cn+n),t.bindTexture(i,null),rt[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete tt[e.id],a.textureCount--}function C(e,n){function i(t,e){var n=u.texInfo;M.call(n);var a=_();return"number"==typeof t?"number"==typeof e?y(a,0|t,0|e):y(a,0|t,0|t):t?(de.type(t,"object","invalid arguments to regl.texture"),T(n,t),b(a,t)):y(a,1,1),n.genMipmaps&&(a.mipmask=(a.width<<1)-1),u.mipmask=a.mipmask,l(u,a),de.texture2D(n,a,r),u.internalformat=a.internalformat,i.width=a.width,i.height=a.height,E(u),x(a,nr),k(n,nr),S(),w(a),o.profile&&(u.stats.size=Ct(u.internalformat,u.type,a.width,a.height,n.genMipmaps,!1)),i.format=q[u.internalformat],i.type=G[u.type],i.mag=Y[n.magFilter],i.min=X[n.minFilter],i.wrapS=W[n.wrapS],i.wrapT=W[n.wrapT],i}function s(t,e,r,n){de(!!t,"must specify image data");var a=0|e,o=0|r,s=0|n,c=m();return l(c,u),c.width=0,c.height=0,h(c,t),c.width=c.width||(u.width>>s)-a,c.height=c.height||(u.height>>s)-o,de(u.type===c.type&&u.format===c.format&&u.internalformat===c.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+c.width<=u.width&&o+c.height<=u.height,"texture.subimage write out of bounds"),de(u.mipmask&1<>s;++s)t.texImage2D(nr,s,u.format,n>>s,a>>s,0,u.format,u.type,null);return S(),o.profile&&(u.stats.size=Ct(u.internalformat,u.type,n,a,!1,!1)),i}var u=new A(nr);return tt[u.id]=u,a.textureCount++,i(e,n),i.subimage=s,i.resize=c,i._reglType="texture2d",i._texture=u,o.profile&&(i.stats=u.stats),i.destroy=function(){u.decRef()},i}function I(e,n,i,s,u,f){function d(t,e,n,i,a,s){var u,f=C.texInfo;for(M.call(f),u=0;u<6;++u)I[u]=_();if("number"!=typeof t&&t)if("object"==typeof t)if(e)b(I[0],t),b(I[1],e),b(I[2],n),b(I[3],i),b(I[4],a),b(I[5],s);else if(T(f,t),c(C,t),"faces"in t){var h=t.faces;for(de(Array.isArray(h)&&6===h.length,"cube faces must be a length 6 array"),u=0;u<6;++u)de("object"==typeof h[u]&&!!h[u],"invalid input for cube map face"),l(I[u],C),b(I[u],h[u])}else for(u=0;u<6;++u)b(I[u],t);else de.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)y(I[u],p,p)}for(l(C,I[0]),f.genMipmaps?C.mipmask=(I[0].width<<1)-1:C.mipmask=I[0].mipmask,de.textureCube(C,f,I,r),C.internalformat=I[0].internalformat,d.width=I[0].width,d.height=I[0].height,E(C),u=0;u<6;++u)x(I[u],ar+u);for(k(f,ir),S(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,f.genMipmaps,!0)),d.format=q[C.internalformat],d.type=G[C.type],d.mag=Y[f.magFilter],d.min=X[f.minFilter],d.wrapS=W[f.wrapS],d.wrapT=W[f.wrapT],u=0;u<6;++u)w(I[u]);return d}function g(t,e,r,n,i){de(!!e,"must specify image data"),de("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var a=0|r,o=0|n,s=0|i,c=m();return l(c,C),c.width=0,c.height=0,h(c,e),c.width=c.width||(C.width>>s)-a,c.height=c.height||(C.height>>s)-o,de(C.type===c.type&&C.format===c.format&&C.internalformat===c.internalformat,"incompatible format for texture.subimage"),de(a>=0&&o>=0&&a+c.width<=C.width&&o+c.height<=C.height,"texture.subimage write out of bounds"),de(C.mipmask&1<>i;++i)t.texImage2D(ar+n,i,C.format,r>>i,r>>i,0,C.format,C.type,null);return S(),o.profile&&(C.stats.size=Ct(C.internalformat,C.type,d.width,d.height,!1,!0)),d}}var C=new A(ir);tt[C.id]=C,a.cubeCount++;var I=new Array(6);return d(e,n,i,s,u,f),d.subimage=g,d.resize=L,d._reglType="textureCube",d._texture=C,o.profile&&(d.stats=C.stats),d.destroy=function(){C.decRef()},d}function D(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(ar+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);k(e.texInfo,e.target)})}var z={"don't care":$r,"dont care":$r,nice:en,fast:tn},O={repeat:Ur,clamp:Vr,mirror:Hr},R={nearest:Yr,linear:Xr},F=$t({mipmap:Kr,"nearest mipmap nearest":Wr,"linear mipmap nearest":Zr,"nearest mipmap linear":Jr,"linear mipmap linear":Kr},R),j={none:0,browser:ln},N={uint8:Or,rgba4:pr,rgb565:vr,"rgb5 a1":mr},B={alpha:sr,luminance:cr,"luminance alpha":ur,rgb:lr,rgba:or,rgba4:fr,"rgb5 a1":hr,rgb565:dr},U={};e.ext_srgb&&(B.srgb=xr,B.srgba=_r),e.oes_texture_float&&(N.float32=N.float=jr),e.oes_texture_half_float&&(N.float16=N["half float"]=wr),e.webgl_depth_texture&&($t(B,{depth:yr,"depth stencil":br}),$t(N,{uint16:Rr,uint32:Fr,"depth stencil":gr})),e.webgl_compressed_texture_s3tc&&$t(U,{"rgb s3tc dxt1":Mr,"rgba s3tc dxt1":Tr,"rgba s3tc dxt3":kr,"rgba s3tc dxt5":Ar}),e.webgl_compressed_texture_atc&&$t(U,{"rgb atc":Er,"rgba atc explicit alpha":Sr,"rgba atc interpolated alpha":Lr}),e.webgl_compressed_texture_pvrtc&&$t(U,{"rgb pvrtc 4bppv1":Cr,"rgb pvrtc 2bppv1":Ir,"rgba pvrtc 4bppv1":Dr,"rgba pvrtc 2bppv1":Pr}),e.webgl_compressed_texture_etc1&&(U["rgb etc1"]=zr);var V=Array.prototype.slice.call(t.getParameter(rr));Object.keys(U).forEach(function(t){var e=U[t];V.indexOf(e)>=0&&(B[t]=e)});var H=Object.keys(B);r.textureFormats=H;var q=[];Object.keys(B).forEach(function(t){var e=B[t];q[e]=t});var G=[];Object.keys(N).forEach(function(t){var e=N[t];G[e]=t});var Y=[];Object.keys(R).forEach(function(t){var e=R[t];Y[e]=t});var X=[];Object.keys(F).forEach(function(t){var e=F[t];X[e]=t});var W=[];Object.keys(O).forEach(function(t){var e=O[t];W[e]=t});var J=H.reduce(function(t,e){var r=B[e];return r===cr||r===sr||r===cr||r===ur||r===yr||r===br?t[r]=r:r===hr||e.indexOf("rgba")>=0?t[r]=or:t[r]=lr,t},{}),K=[],Q=[],$=0,tt={},et=r.maxTextureUnits,rt=Array(et).map(function(){return null});return $t(A.prototype,{bind:function(){var e=this;e.bindCount+=1;var r=e.unit;if(r<0){for(var n=0;n0)continue;i.unit=-1}rt[n]=e,r=n;break}r>=et&&de.raise("insufficient number of texture units"),o.profile&&a.maxTextureUnits=En&&e=2,"invalid shape for framebuffer"),c=D[0],d=D[1]}else"radius"in I&&(c=d=I.radius),"width"in I&&(c=I.width),"height"in I&&(d=I.height);("color"in I||"colors"in I)&&(y=I.color||I.colors,Array.isArray(y)&&de(1===y.length||o,"multiple render targets not supported")),y||("colorCount"in I&&(A=0|I.colorCount,de(A>0,"invalid color buffer count")),"colorTexture"in I&&(b=!!I.colorTexture,x="rgba4"),"colorType"in I&&(k=I.colorType,b?(de(e.oes_texture_float||!("float"===k||"float32"===k),"you must enable OES_texture_float in order to use floating point framebuffer objects"),de(e.oes_texture_half_float||!("half float"===k||"float16"===k),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===k||"float16"===k?(de(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),x="rgba16f"):"float"!==k&&"float32"!==k||(de(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),x="rgba32f"),de.oneOf(k,T,"invalid color type")),"colorFormat"in I&&(x=I.colorFormat,w.indexOf(x)>=0?b=!0:M.indexOf(x)>=0?b=!1:b?de.oneOf(I.colorFormat,w,"invalid color format for texture"):de.oneOf(I.colorFormat,M,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(C=!(!I.depthTexture&&!I.depthStencilTexture),de(!C||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?p=I.depth:(E=I.depth,v=!1)),"stencil"in I&&("boolean"==typeof I.stencil?v=I.stencil:(S=I.stencil,p=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?p=v=I.depthStencil:(L=I.depthStencil,p=!1,v=!1))}else c=d=1;var P=null,z=null,O=null,R=null;if(Array.isArray(y))P=y.map(u);else if(y)P=[u(y)];else for(P=new Array(A),a=0;a=0||P[a].renderbuffer&&Bn.indexOf(P[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),P[a]&&P[a].texture){var j=On[P[a].texture._texture.format]*Rn[P[a].texture._texture.type];null===F?F=j:de(F===j,"all color attachments much have the same number of bits per pixel.")}return l(z,c,d),de(!z||z.texture&&z.texture._texture.format===Pn||z.renderbuffer&&z.renderbuffer._renderbuffer.format===Fn,"invalid depth attachment for framebuffer object"),l(O,c,d),de(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===jn,"invalid stencil attachment for framebuffer object"),l(R,c,d),de(!R||R.texture&&R.texture._texture.format===Nn||R.renderbuffer&&R.renderbuffer._renderbuffer.format===Nn,"invalid depth-stencil attachment for framebuffer object"),m(s),s.width=c,s.height=d,s.colorAttachments=P,s.depthAttachment=z,s.stencilAttachment=O,s.depthStencilAttachment=R,i.color=P.map(h),i.depth=h(z),i.stencil=h(O),i.depthStencil=h(R),i.width=s.width,i.height=s.height,g(s),i}function o(t,e){de(_.next!==s,"can not resize a framebuffer which is currently in use");var r=0|t,n=0|e||r;if(r===s.width&&n===s.height)return i;for(var a=s.colorAttachments,o=0;o=2,"invalid shape for framebuffer"),de(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&de(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(c=d.color||d.colors,Array.isArray(c)&&de(1===c.length||a,"multiple render targets not supported")),c||("colorCount"in d&&(h=0|d.colorCount,de(h>0,"invalid color buffer count")),"colorType"in d&&(de.oneOf(d.colorType,T,"invalid color type"),f=d.colorType),"colorFormat"in d&&(u=d.colorFormat,de.oneOf(d.colorFormat,w,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(c)if(Array.isArray(c))for(m=[],r=0;r0&&(s.depth=o[0].depth,s.stencil=o[0].stencil,s.depthStencil=o[0].depthStencil),o[r]?o[r](s):o[r]=y(s)}return $t(i,{width:l,height:l,color:m})}function a(t){var e,n=0|t;if(de(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===i.width)return i;var a=i.color;for(e=0;e1)for(var m=0;mt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return d.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);xe(u).forEach(e),u={},xe(f).forEach(e),f={},d.forEach(function(e){t.deleteProgram(e.program)}),d.length=0,h={},r.shaderCount=0},program:function(t,e,n){de.command(t>=0,"missing vertex shader",n),de.command(e>=0,"missing fragment shader",n);var i=h[e];i||(i=h[e]={});var a=i[t];return a||(a=new s(e,t),r.shaderCount++,l(a,n),i[t]=a,d.push(a)),a},restore:c,shader:o,frag:-1,vert:-1}}function Ft(t,e,r,n,i,a){function o(o){var s;null===e.next?(de(i.preserveDrawingBuffer,'you must create a webgl context with "preserveDrawingBuffer":true in order to read pixels from the drawing buffer'),s=Wn):(de(null!==e.next.colorAttachments[0].texture,"You cannot read from a renderbuffer"),s=e.next.colorAttachments[0].texture._texture.type,a.oes_texture_float?de(s===Wn||s===Jn,"Reading from a framebuffer is only allowed for the types 'uint8' and 'float'"):de(s===Wn,"Reading from a framebuffer is only allowed for the type 'uint8'"));var l=0,c=0,u=n.framebufferWidth,f=n.framebufferHeight,h=null;Qt(o)?h=o:o&&(de.type(o,"object","invalid arguments to regl.read()"),l=0|o.x,c=0|o.y,de(l>=0&&l=0&&c0&&u+l<=n.framebufferWidth,"invalid width for read pixels"),de(f>0&&f+c<=n.framebufferHeight,"invalid height for read pixels"),r();var d=u*f*4;return h||(s===Wn?h=new Uint8Array(d):s===Jn&&(h=h||new Float32Array(d))),de.isTypedArray(h,"data buffer for regl.read() must be a typedarray"),de(h.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(Zn,4),t.readPixels(l,c,u,f,Xn,s,h),h}function s(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}function l(t){return t&&"framebuffer"in t?s(t):o(t)}return l}function jt(t){return Array.prototype.slice.call(t)}function Nt(t){return jt(t).join("")}function Bt(){function t(t){for(var e=0;e0&&(r.push(t,"="),r.push.apply(r,jt(arguments)),r.push(";")),t}var r=[],n=[];return $t(t,{def:e,toString:function(){return Nt([n.length>0?"var "+n+";":"",Nt(r)])}})}function r(){function t(t,e){n(t,e,"=",r.def(t,e),";")}var r=e(),n=e(),i=r.toString,a=n.toString;return $t(function(){r.apply(r,jt(arguments))},{def:r.def,entry:r,exit:n,save:t,set:function(e,n,i){t(e,n),r(e,n,"=",i,";")},toString:function(){return i()+a()}})}function n(){var t=Nt(arguments),e=r(),n=r(),i=e.toString,a=n.toString;return $t(e,{then:function(){return e.apply(e,jt(arguments)),this},else:function(){return n.apply(n,jt(arguments)),this},toString:function(){var e=a();return e&&(e="else{"+e+"}"),Nt(["if(",t,"){",i(),"}",e])}})}function i(t,e){function n(){var t="a"+i.length;return i.push(t),t}var i=[];e=e||0;for(var a=0;a=1,n>=2,e)}if(r===ai){var i=t.data;return new Ht(i.thisDep,i.contextDep,i.propDep,e)}return new Ht(r===ii,r===ni,r===ri,e)}function Xt(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p){function m(t){return t.replace(".","_")}function v(t,e,r){var n=m(t);et.push(t),tt[n]=$[n]=!!r,rt[n]=e}function g(t,e,r){var n=m(t);et.push(t),Array.isArray(r)?($[n]=r.slice(),tt[n]=r.slice()):$[n]=tt[n]=r,nt[n]=e}function y(){var t=Bt(),r=t.link,n=t.global;t.id=ot++,t.batchId="0";var i=r(it),a=t.shared={props:"a0"};Object.keys(it).forEach(function(t){a[t]=n.def(i,".",t)}),de.optional(function(){t.CHECK=r(de),t.commandStr=de.guessCommand(),t.command=r(t.commandStr),t.assert=function(t,e,n){t("if(!(",e,"))",this.CHECK,".commandRaise(",r(n),",",this.command,");")},at.invalidBlendCombinations=Ua});var o=t.next={},s=t.current={};Object.keys(nt).forEach(function(t){Array.isArray($[t])&&(o[t]=n.def(a.next,".",t),s[t]=n.def(a.current,".",t))});var l=t.constants={};Object.keys(at).forEach(function(t){l[t]=n.def(JSON.stringify(at[t]))}),t.invoke=function(e,n){switch(n.type){case ei:var i=["this",a.context,a.props,t.batchId];return e.def(r(n.data),".call(",i.slice(0,Math.max(n.data.length+1,4)),")");case ri:return e.def(a.props,n.data);case ni:return e.def(a.context,n.data);case ii:return e.def("this",n.data);case ai:return n.data.append(t,e),n.data.ref}},t.attribCache={};var u={};return t.scopeAttrib=function(t){var n=e.id(t);if(n in u)return u[n];var i=c.scope[n];return i||(i=c.scope[n]=new W),u[n]=r(i)},t}function b(t){var e,r=t.static,n=t.dynamic;if(Pi in r){var i=!!r[Pi];e=Gt(function(t,e){return i}),e.enable=i}else if(Pi in n){var a=n[Pi];e=Yt(a,function(t,e){return t.invoke(e,a)})}return e}function x(t,e){var r=t.static,n=t.dynamic;if(zi in r){var i=r[zi];return i?(i=s.getFramebuffer(i),de.command(i,"invalid framebuffer object"),Gt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,".next",r);var a=n.context;return e.set(a,"."+Vi,r+".width"),e.set(a,"."+Hi,r+".height"),r})):Gt(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Vi,n+"."+Yi),e.set(n,"."+Hi,n+"."+Xi),"null"})}if(zi in n){var a=n[zi];return Yt(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,".getFramebuffer(",r,")");de.optional(function(){t.assert(e,"!"+r+"||"+o,"invalid framebuffer object")}),e.set(i,".next",o);var s=n.context;return e.set(s,"."+Vi,o+"?"+o+".width:"+s+"."+Yi),e.set(s,"."+Hi,o+"?"+o+".height:"+s+"."+Xi),o})}return null}function _(t,e,r){function n(t){if(t in i){var n=i[t];de.commandType(n,"object","invalid "+t,r.commandStr);var o,s,l=!0,c=0|n.x,u=0|n.y;return"width"in n?(o=0|n.width,de.command(o>=0,"invalid "+t,r.commandStr)):l=!1,"height"in n?(s=0|n.height,de.command(s>=0,"invalid "+t,r.commandStr)):l=!1,new Ht(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var r=t.shared.context,i=o;"width"in n||(i=e.def(r,".",Vi,"-",c));var a=s;return"height"in n||(a=e.def(r,".",Hi,"-",u)),[c,u,i,a]})}if(t in a){var f=a[t],h=Yt(f,function(e,r){var n=e.invoke(r,f);de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,a=r.def(n,".x|0"),o=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Vi,"-",a,")"),l=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",Hi,"-",o,")");return de.optional(function(){e.assert(r,s+">=0&&"+l+">=0","invalid "+t)}),[a,o,s,l]});return e&&(h.thisDep=h.thisDep||e.thisDep,h.contextDep=h.contextDep||e.contextDep,h.propDep=h.propDep||e.propDep),h}return e?new Ht(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Vi),e.def(r,".",Hi)]}):null}var i=t.static,a=t.dynamic,o=n(Di);if(o){var s=o;o=new Ht(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+qi,r[2]),e.set(n,"."+Gi,r[3]),r})}return{viewport:o,scissor_box:n(Ii)}}function w(t){function r(t){if(t in i){var r=e.id(i[t]);de.optional(function(){u.shader(qa[t],r,de.guessCommand())});var n=Gt(function(){return r});return n.id=r,n}if(t in a){var o=a[t];return Yt(o,function(e,r){var n=e.invoke(r,o),i=r.def(e.shared.strings,".id(",n,")");return de.optional(function(){r(e.shared.shader,".shader(",qa[t],",",i,",",e.command,");")}),i})}return null}var n,i=t.static,a=t.dynamic,o=r(Ri),s=r(Oi),l=null;return qt(o)&&qt(s)?(l=u.program(s.id,o.id),n=Gt(function(t,e){return t.link(l)})):n=new Ht(o&&o.thisDep||s&&s.thisDep,o&&o.contextDep||s&&s.contextDep,o&&o.propDep||s&&s.propDep,function(t,e){var r,n=t.shared.shader;r=o?o.append(t,e):e.def(n,".",Ri);var i;i=s?s.append(t,e):e.def(n,".",Oi);var a=n+".program("+i+","+r;return de.optional(function(){a+=","+t.command}),e.def(a+")")}),{frag:o,vert:s,progVar:n,program:l}}function M(t,e){function r(t,r){if(t in n){var a=0|n[t];return de.command(!r||a>=0,"invalid "+t,e.commandStr),Gt(function(t,e){return r&&(t.OFFSET=a),a})}if(t in i){var s=i[t];return Yt(s,function(e,n){var i=e.invoke(n,s);return r&&(e.OFFSET=i,de.optional(function(){e.assert(n,i+">=0","invalid "+t)})),i})}return r&&o?Gt(function(t,e){return t.OFFSET="0",0}):null}var n=t.static,i=t.dynamic,o=function(){if(Fi in n){var t=n[Fi];Ut(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),de.command(t,"invalid elements",e.commandStr));var r=Gt(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return r.value=t,r}if(Fi in i){var o=i[Fi];return Yt(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),l=e.def(n,"(",a,")"),c=t.cond(l).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return de.optional(function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")}),e.entry(c),e.exit(t.cond(l).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}(),s=r(Bi,!0);return{elements:o,primitive:function(){if(ji in n){var t=n[ji];return de.commandParameter(t,Be,"invalid primitve",e.commandStr),Gt(function(e,r){return Be[t]})}if(ji in i){var r=i[ji];return Yt(r,function(t,e){var n=t.constants.primTypes,i=t.invoke(e,r);return de.optional(function(){t.assert(e,i+" in "+n,"invalid primitive, must be one of "+Object.keys(Be))}),e.def(n,"[",i,"]")})}return o?qt(o)?Gt(o.value?function(t,e){return e.def(t.ELEMENTS,".primType")}:function(){return ka}):new Ht(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",ka)}):null}(),count:function(){if(Ni in n){var t=0|n[Ni];return de.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),Gt(function(){return t})}if(Ni in i){var r=i[Ni];return Yt(r,function(t,e){var n=t.invoke(e,r);return de.optional(function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")}),n})}if(o){if(qt(o)){if(o)return s?new Ht(s.thisDep,s.contextDep,s.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return de.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):Gt(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var a=Gt(function(){return-1});return de.optional(function(){a.MISSING=!0}),a}var l=new Ht(o.thisDep||s.thisDep,o.contextDep||s.contextDep,o.propDep||s.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return de.optional(function(){l.DYNAMIC=!0}),l}return null}(),instances:r(Ui,!1),offset:s}}function T(t,e){var r=t.static,i=t.dynamic,a={};return et.forEach(function(t){function o(e,n){if(t in r){var o=e(r[t]);a[s]=Gt(function(){return o})}else if(t in i){var l=i[t];a[s]=Yt(l,function(t,e){return n(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case vi:case si:case oi:case ki:case fi:case Ci:case xi:case wi:case Mi:case pi:return o(function(r){return de.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return de.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case hi:return o(function(r){return de.commandParameter(r,Va,"invalid "+t,e.commandStr),Va[r]},function(e,r,n){ -var i=e.constants.compareFuncs;return de.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Va))}),r.def(i,"[",n,"]")});case di:return o(function(t){return de.command(mt(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case ui:return o(function(t){de.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,a="dstAlpha"in t?t.dstAlpha:t.dst;return de.commandParameter(r,Ba,s+".srcRGB",e.commandStr),de.commandParameter(n,Ba,s+".srcAlpha",e.commandStr),de.commandParameter(i,Ba,s+".dstRGB",e.commandStr),de.commandParameter(a,Ba,s+".dstAlpha",e.commandStr),de.command(Ua.indexOf(r+", "+i)===-1,"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ba[r],Ba[i],Ba[n],Ba[a]]},function(e,r,n){function i(i,o){var s=r.def('"',i,o,'" in ',n,"?",n,".",i,o,":",n,".",i);return de.optional(function(){e.assert(r,s+" in "+a,"invalid "+t+"."+i+o+", must be one of "+Object.keys(Ba))}),s}var a=e.constants.blendFuncs;de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var o=i("src","RGB"),s=i("dst","RGB");de.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+o+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var l=r.def(a,"[",o,"]"),c=r.def(a,"[",i("src","Alpha"),"]");return[l,r.def(a,"[",s,"]"),c,r.def(a,"[",i("dst","Alpha"),"]")]});case ci:return o(function(r){return"string"==typeof r?(de.commandParameter(r,Z,"invalid "+t,e.commandStr),[Z[r],Z[r]]):"object"==typeof r?(de.commandParameter(r.rgb,Z,t+".rgb",e.commandStr),de.commandParameter(r.alpha,Z,t+".alpha",e.commandStr),[Z[r.rgb],Z[r.alpha]]):void de.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,a=r.def(),o=r.def(),s=e.cond("typeof ",n,'==="string"');return de.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(Z))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(a,"=",o,"=",i,"[",n,"];"),s.else(a,"=",i,"[",n,".rgb];",o,"=",i,"[",n,".alpha];"),r(s),[a,o]});case li:return o(function(t){return de.command(mt(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),J(4,function(e){return+t[e]})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),J(4,function(t){return e.def("+",r,"[",t,"]")})});case Ai:return o(function(t){return de.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return de.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Ei:return o(function(r){de.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,a="mask"in r?r.mask:-1;return de.commandParameter(n,Va,t+".cmp",e.commandStr),de.commandType(i,"number",t+".ref",e.commandStr),de.commandType(a,"number",t+".mask",e.commandStr),[Va[n],i,a]},function(t,e,r){var n=t.constants.compareFuncs;return de.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Pa),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case Si:case Li:return o(function(r){de.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",a=r.zpass||"keep";return de.commandParameter(n,Ha,t+".fail",e.commandStr),de.commandParameter(i,Ha,t+".zfail",e.commandStr),de.commandParameter(a,Ha,t+".zpass",e.commandStr),[t===Li?Ea:Aa,Ha[n],Ha[i],Ha[a]]},function(e,r,n){function i(i){return de.optional(function(){e.assert(r,'!("'+i+'" in '+n+")||("+n+"."+i+" in "+a+")","invalid "+t+"."+i+", must be one of "+Object.keys(Ha))}),r.def('"',i,'" in ',n,"?",a,"[",n,".",i,"]:",Pa)}var a=e.constants.stencilOps;return de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Li?Ea:Aa,i("fail"),i("zfail"),i("zpass")]});case _i:return o(function(t){de.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return de.commandType(r,"number",s+".factor",e.commandStr),de.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return de.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case gi:return o(function(t){var r=0;return"front"===t?r=Aa:"back"===t&&(r=Ea),de.command(!!r,s,e.commandStr),r},function(t,e,r){return de.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Aa,":",Ea)});case bi:return o(function(t){return de.command("number"==typeof t&&t>=n.lineWidthDims[0]&&t<=n.lineWidthDims[1],"invalid line width, must positive number between "+n.lineWidthDims[0]+" and "+n.lineWidthDims[1],e.commandStr),t},function(t,e,r){return de.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+n.lineWidthDims[0]+"&&"+r+"<="+n.lineWidthDims[1],"invalid line width")}),r});case yi:return o(function(t){return de.commandParameter(t,Ga,s,e.commandStr),Ga[t]},function(t,e,r){return de.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+Sa+":"+La)});case mi:return o(function(t){return de.command(mt(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return de.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),J(4,function(t){return"!!"+r+"["+t+"]"})});case Ti:return o(function(t){de.command("object"==typeof t&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return de.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return de.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),a}function k(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,a=r[t];if("number"==typeof a||"boolean"==typeof a)n=Gt(function(){return a});else if("function"==typeof a){var o=a._reglType;"texture2d"===o||"textureCube"===o?n=Gt(function(t){return t.link(a)}):"framebuffer"===o||"framebufferCube"===o?(de.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=Gt(function(t){return t.link(a.color[0])})):de.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else mt(a)?n=Gt(function(e){return e.global.def("[",J(a.length,function(r){return de.command("number"==typeof a[r]||"boolean"==typeof a[r],"invalid uniform "+t,e.commandStr),a[r]}),"]")}):de.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=a,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=Yt(e,function(t,r){return t.invoke(r,e)})}),i}function A(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var a=n[t],s=e.id(t),l=new W;if(Ut(a))l.state=$n,l.buffer=i.getBuffer(i.create(a,Zi,!1,!0)),l.type=0;else{var c=i.getBuffer(a);if(c)l.state=$n,l.buffer=c,l.type=0;else if(de.command("object"==typeof a&&a,"invalid data for attribute "+t,r.commandStr),a.constant){var u=a.constant;l.buffer="null",l.state=ti,"number"==typeof u?l.x=u:(de.command(mt(u)&&u.length>0&&u.length<=4,"invalid constant for attribute "+t,r.commandStr),Kn.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',r.commandStr);var h=0|a.stride;de.command(h>=0&&h<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',r.commandStr);var d=0|a.size;de.command(!("size"in a)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',r.commandStr);var p=!!a.normalized,m=0;"type"in a&&(de.commandParameter(a.type,Ie,"invalid type for attribute "+t,r.commandStr),m=Ie[a.type]);var v=0|a.divisor;"divisor"in a&&(de.command(0===v||K,'cannot specify divisor for attribute "'+t+'", instancing not supported',r.commandStr),de.command(v>=0,'invalid divisor for attribute "'+t+'"',r.commandStr)),de.optional(function(){var e=r.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(a).forEach(function(r){de.command(n.indexOf(r)>=0,'unknown parameter "'+r+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",e)})}),l.buffer=c,l.state=$n,l.size=d,l.normalized=p,l.type=m||c.dtype,l.offset=f,l.stride=h,l.divisor=v}}o[t]=Gt(function(t,e){var r=t.attribCache;if(s in r)return r[s];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[s]=n,n})}),Object.keys(a).forEach(function(t){function e(e,n){function i(t){n(c[t],"=",a,".",t,"|0;")}var a=e.invoke(n,r),o=e.shared,s=o.isBufferArgs,l=o.buffer;de.optional(function(){e.assert(n,a+"&&(typeof "+a+'==="object"||typeof '+a+'==="function")&&('+s+"("+a+")||"+l+".getBuffer("+a+")||"+l+".getBuffer("+a+".buffer)||"+s+"("+a+'.buffer)||("constant" in '+a+"&&(typeof "+a+'.constant==="number"||'+o.isArrayLike+"("+a+".constant))))",'invalid dynamic attribute "'+t+'"')});var c={isStream:n.def(!1)},u=new W;u.state=$n,Object.keys(u).forEach(function(t){c[t]=n.def(""+u[t])});var f=c.buffer,h=c.type;return n("if(",s,"(",a,")){",c.isStream,"=true;",f,"=",l,".createStream(",Zi,",",a,");",h,"=",f,".dtype;","}else{",f,"=",l,".getBuffer(",a,");","if(",f,"){",h,"=",f,".dtype;",'}else if("constant" in ',a,"){",c.state,"=",ti,";","if(typeof "+a+'.constant === "number"){',c[Kn[0]],"=",a,".constant;",Kn.slice(1).map(function(t){return c[t]}).join("="),"=0;","}else{",Kn.map(function(t,e){return c[t]+"="+a+".constant.length>="+e+"?"+a+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",a,".buffer)){",f,"=",l,".createStream(",Zi,",",a,".buffer);","}else{",f,"=",l,".getBuffer(",a,".buffer);","}",h,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",f,".dtype;",c.normalized,"=!!",a,".normalized;"),i("size"),i("offset"),i("stride"),i("divisor"),n("}}"),n.exit("if(",c.isStream,"){",l,".destroyStream(",f,");","}"),c}var r=a[t];o[t]=Yt(r,e)}),o}function E(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=Gt(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=Yt(e,function(t,r){return t.invoke(r,e)})}),n}function S(t,e,r,n,i){function a(t){var e=c[t];e&&(f[t]=e)}var o=t.static,s=t.dynamic;de.optional(function(){function t(t){Object.keys(t).forEach(function(t){de.command(e.indexOf(t)>=0,'unknown parameter "'+t+'"',i.commandStr)})}var e=[zi,Oi,Ri,Fi,ji,Bi,Ni,Ui,Pi].concat(et);t(o),t(s)});var l=x(t,i),c=_(t,l,i),u=M(t,i),f=T(t,i),h=w(t,i);a(Di),a(m(Ii));var d=Object.keys(f).length>0,p={framebuffer:l,draw:u,shader:h,state:f,dirty:d};return p.profile=b(t,i),p.uniforms=k(r,i),p.attributes=A(e,i),p.context=E(n,i),p}function L(t,e,r){var n=t.shared,i=n.context,a=t.scope();Object.keys(r).forEach(function(n){e.save(i,"."+n);var o=r[n];a(i,".",n,"=",o.append(t,e),";")}),e(a)}function C(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;Q&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,c=t.constants,u=c.drawBuffer,f=c.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",ja,",",l,".framebuffer);"),Q&&e(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",ja,",null);"),Q&&e(i,".drawBuffersWEBGL(",f,");"),e("}",s,".cur=",l,";"),n||e("}")}function I(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");et.forEach(function(e){var n=m(e);if(!(n in r.state)){var u,f;if(n in o){u=o[n],f=a[n];var h=J($[n].length,function(t){return c.def(u,"[",t,"]")});c(t.cond(h.map(function(t,e){return t+"!=="+f+"["+e+"]"}).join("||")).then(i,".",nt[n],"(",h,");",h.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";"))}else{u=c.def(l,".",n);var d=t.cond(u,"!==",s,".",n);c(d),n in rt?d(t.cond(u).then(i,".enable(",rt[n],");").else(i,".disable(",rt[n],");"),s,".",n,"=",u,";"):d(i,".",nt[n],"(",u,");",s,".",n,"=",u,";")}}}),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function D(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;Vt(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(rt[i]){var u=rt[i];qt(l)?c?e(s,".enable(",u,");"):e(s,".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(mt(c)){var f=a[i];e(s,".",nt[i],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",nt[i],"(",c,");",o,".",i,"=",c,";")}})}function P(t,e){K&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function z(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){c=e.def(),t(c,"=",a(),";"),"string"==typeof i?t(p,".count+=",i,";"):t(p,".count++;"),d&&(n?(u=e.def(),t(u,"=",v,".getNumPendingQueries();")):t(v,".beginQuery(",p,");"))}function s(t){t(p,".cpuTime+=",a(),"-",c,";"),d&&(n?t(v,".pushScopeStats(",u,",",v,".getNumPendingQueries(),",p,");"):t(v,".endQuery();"))}function l(t){var r=e.def(m,".profile");e(m,".profile=",t,";"),e.exit(m,".profile=",r,";")}var c,u,f,h=t.shared,p=t.stats,m=h.current,v=h.timer,g=r.profile;if(g){if(qt(g))return void(g.enable?(o(e),s(e.exit),l("true")):l("false"));f=g.append(t,e),l(f)}else f=e.def(m,".profile");var y=t.block();o(y),e("if(",f,"){",y,"}");var b=t.block();s(b),e.exit("if(",f,"){",b,"}")}function O(t,e,r,n,i){function a(t){switch(t){case ca:case da:case ga:return 2;case ua:case pa:case ya:return 3;case fa:case ma:case ba:return 4;default:return 1}}function o(r,n,i){function a(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",p.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",Zi,",",h,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",p.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),K){var o=i.divisor;e("if(",u,".divisor!==",o,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,o],");",u,".divisor=",o,";}")}}function o(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",Kn.map(function(t,e){return u+"."+t+"!=="+d[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",d,");",Kn.map(function(t,e){return u+"."+t+"="+d[e]+";"}).join(""),"}")}var l=s.gl,c=e.def(r,".location"),u=e.def(s.attributes,"[",c,"]"),f=i.state,h=i.buffer,d=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];f===$n?a():f===ti?o():(e("if(",f,"===",$n,"){"),a(),e("}else{"),o(),e("}"))}var s=t.shared;n.forEach(function(n){var s,l=n.name,c=r.attributes[l];if(c){if(!i(c))return;s=c.append(t,e)}else{if(!i(Ya))return;var u=t.scopeAttrib(l);de.optional(function(){t.assert(e,u+".state","missing attribute "+l)}),s={},Object.keys(new W).forEach(function(t){s[t]=e.def(u,".",t)})}o(t.link(n),a(n.info.type),s)})}function R(t,r,n,i,a){for(var o,s=t.shared,l=s.gl,c=0;c1?J(_,function(t){return u+"["+t+"]"}):u);r(");")}}function F(t,e,r,n){function i(i){var a=u[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(c,".",i)}function a(){function t(){r(v,".drawElementsInstancedANGLE(",[h,p,g,d+"<<(("+g+"-"+Qn+")>>1)",m],");")}function e(){r(v,".drawArraysInstancedANGLE(",[h,d,p,m],");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[h,p,g,d+"<<(("+g+"-"+Qn+")>>1)"]+");")}function e(){r(l+".drawArrays("+[h,d,p]+");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,f=function(){var i,a=u.elements,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(c,".",Fi),i&&o("if("+i+")"+l+".bindBuffer("+Ji+","+i+".buffer.buffer);"),i}(),h=i(ji),d=i(Bi),p=function(){var i,a=u.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),de.optional(function(){a.MISSING&&t.assert(e,"false","missing vertex count"),a.DYNAMIC&&t.assert(o,i+">=0","missing vertex count")})):(i=o.def(c,".",Ni),de.optional(function(){t.assert(o,i+">=0","missing vertex count")})),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,v;K&&(m=i(Ui),v=t.instancing);var g=f+".type",y=u.elements&&qt(u.elements);K&&("number"!=typeof m||m>=0)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function j(t,e,r,n,i){var a=y(),o=a.proc("body",i);return de.optional(function(){a.commandStr=e.commandStr,a.command=a.link(e.commandStr)}),K&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function N(t,e,r,n){P(t,e),O(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),F(t,e,e,r)}function B(t,e){var r=t.proc("draw",1);P(t,r),L(t,r,e.context),C(t,r,e.framebuffer),I(t,r,e),D(t,r,e.state),z(t,r,e,!1,!0);var n=e.shader.progVar.append(t,r);if(r(t.shared.gl,".useProgram(",n,".program);"),e.shader.program)N(t,r,e,e.shader.program);else{var i=t.global.def("{}"),a=r.def(n,".id"),o=r.def(i,"[",a,"]");r(t.cond(o).then(o,".call(this,a0);").else(o,"=",i,"[",a,"]=",t.link(function(r){return j(N,t,e,r,1)}),"(",n,");",o,".call(this,a0);"))}Object.keys(e.state).length>0&&r(t.shared.current,".dirty=true;")}function U(t,e,r,n){function i(){return!0}t.batchId="a1",P(t,e),O(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),F(t,e,e,r)}function V(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}P(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();if(e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&L(t,u,r.context),r.needsFramebuffer&&C(t,u,r.framebuffer),D(t,u,r.state,i),r.profile&&i(r.profile)&&z(t,u,r,!1,!0),n)O(t,c,r,n.attributes,a),O(t,u,r,n.attributes,i),R(t,c,r,n.uniforms,a),R(t,u,r,n.uniforms,i),F(t,c,u,r);else{var f=t.global.def("{}"),h=r.shader.progVar.append(t,u),d=u.def(h,".id"),p=u.def(f,"[",d,"]");u(t.shared.gl,".useProgram(",h,".program);","if(!",p,"){",p,"=",f,"[",d,"]=",t.link(function(e){return j(U,t,r,e,2)}),"(",h,");}",p,".call(this,a0[",s,"],",s,");")}}function H(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",P(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(L(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||C(t,n,o)):C(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),I(t,n,e),D(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||z(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)V(t,n,e,null);else{var c=l.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)V(t,n,e,e.shader.program);else{var u=t.global.def("{}"),f=n.def(c,".id"),h=n.def(u,"[",f,"]");n(t.cond(h).then(h,".call(this,a0,a1);").else(h,"=",u,"[",f,"]=",t.link(function(r){return j(V,t,e,r,2)}),"(",c,");",h,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}function q(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;L(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),Vt(Object.keys(r.state)).forEach(function(e){var n=r.state[e],o=n.append(t,i);mt(o)?o.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,o)}),z(t,i,r,!0,!0),[Fi,Bi,Ni,Ui,ji].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new W).forEach(function(t){i.set(a,"."+t,n[t])})}),n(Oi),n(Ri),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}function G(t){if("object"==typeof t&&!mt(t)){for(var e=Object.keys(t),r=0;r=0;--t){var r=q[t];r&&r(S,null,0)}g.flush(),T&&T.update()}function r(){!J&&q.length>0&&(J=ge.next(e))}function n(){J&&(ge.cancel(e),J=null)}function i(t){t.preventDefault(),b=!0,n(),G.forEach(function(t){t()})}function a(t){g.getError(),b=!1,x.restore(),O.restore(),D.restore(),R.restore(),F.restore(),j.restore(),T&&T.restore(),N.procs.refresh(),r(),Y.forEach(function(t){t()})}function o(){q.length=0,n(),H&&(H.removeEventListener(eo,i),H.removeEventListener(ro,a)),O.clear(),j.clear(),F.clear(),R.clear(),P.clear(),D.clear(),T&&T.clear(),Z.forEach(function(t){t()})}function s(t){function e(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];ve.isDynamic(i)?r[n]=ve.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}function r(t){for(;d.length0)return f.call(this,r(0|t),0|t)}else{if(!Array.isArray(t))return u.call(this,t);if(t.length)return f.call(this,t,t.length)}}de(!!t,"invalid args to regl({...})"),de.type(t,"object","invalid args to regl({...})");var i=e(t.context||{}),a=e(t.uniforms||{}),o=e(t.attributes||{}),s=e(function(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}var r=$t({},t);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),r}(t)),l={gpuTime:0,cpuTime:0,count:0},c=N.compile(s,o,a,i,l),u=c.draw,f=c.batch,h=c.scope,d=[];return $t(n,{stats:l})}function l(t,e){var r=0;N.procs.poll();var n=e.color;n&&(g.clearColor(+n[0]||0,+n[1]||0,+n[2]||0,+n[3]||0),r|=Ka),"depth"in e&&(g.clearDepth(+e.depth),r|=Qa),"stencil"in e&&(g.clearStencil(0|e.stencil),r|=$a),de(!!r,"called regl.clear with no buffer specified"),g.clear(r)}function c(t){if(de("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;e<6;++e)K($t({framebuffer:t.framebuffer.faces[e]},t),l);else K(t,l);else l(null,t)}function u(t){function e(){function e(){var t=Zt(q,e);q[t]=q[q.length-1],q.length-=1,q.length<=0&&n()}var r=Zt(q,t);de(r>=0,"cannot cancel a frame twice"),q[r]=e}return de.type(t,"function","regl.frame() callback must be a function"),q.push(t),r(),{cancel:e}}function f(){var t=V.viewport,e=V.scissor_box;t[0]=t[1]=e[0]=e[1]=0,S.viewportWidth=S.framebufferWidth=S.drawingBufferWidth=t[2]=e[2]=g.drawingBufferWidth,S.viewportHeight=S.framebufferHeight=S.drawingBufferHeight=t[3]=e[3]=g.drawingBufferHeight}function h(){S.tick+=1,S.time=p(),f(),N.procs.poll()}function d(){f(),N.procs.refresh(),T&&T.update()}function p(){return(ye()-k)/1e3 -}function m(t,e){de.type(e,"function","listener callback must be a function");var r;switch(t){case"frame":return u(e);case"lost":r=G;break;case"restore":r=Y;break;case"destroy":r=Z;break;default:de.raise("invalid event, must be one of frame,lost,restore,destroy")}return r.push(e),{cancel:function(){for(var t=0;t=0},read:U,destroy:o,_gl:g,_refresh:d,poll:function(){h(),T&&T.update()},now:p,stats:w});return v.onDone(null,Q),Q}var Kt={"[object Int8Array]":5120,"[object Int16Array]":5122,"[object Int32Array]":5124,"[object Uint8Array]":5121,"[object Uint8ClampedArray]":5121,"[object Uint16Array]":5123,"[object Uint32Array]":5125,"[object Float32Array]":5126,"[object Float64Array]":5121,"[object ArrayBuffer]":5121},Qt=function(t){return Object.prototype.toString.call(t)in Kt},$t=function(t,e){for(var r=Object.keys(e),n=0;n=2,"invalid renderbuffer shape"),a=0|d[0],o=0|d[1]}else"radius"in h&&(a=o=0|h.radius),"width"in h&&(a=0|h.width),"height"in h&&(o=0|h.height);"format"in h&&(de.parameter(h.format,c,"invalid renderbuffer format"),l=c[h.format])}else"number"==typeof e?(a=0|e,o="number"==typeof n?0|n:a):e?de.raise("invalid arguments to renderbuffer constructor"):a=o=1;if(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),a!==f.width||o!==f.height||l!==f.format)return s.width=f.width=a,s.height=f.height=o,f.format=l,t.bindRenderbuffer(xn,f.renderbuffer),t.renderbufferStorage(xn,l,a,o),i.profile&&(f.stats.size=Dt(f.format,f.width,f.height)),s.format=u[f.format],s}function l(e,n){var a=0|e,o=0|n||a;return a===f.width&&o===f.height?s:(de(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),s.width=f.width=a,s.height=f.height=o,t.bindRenderbuffer(xn,f.renderbuffer),t.renderbufferStorage(xn,f.format,a,o),i.profile&&(f.stats.size=Dt(f.format,f.width,f.height)),s)}var f=new a(t.createRenderbuffer());return h[f.id]=f,n.renderbufferCount++,s(e,o),s.resize=l,s._reglType="renderbuffer",s._renderbuffer=f,i.profile&&(s.stats=f.stats),s.destroy=function(){f.decRef()},s}function l(){xe(h).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(xn,e.renderbuffer),t.renderbufferStorage(xn,e.format,e.width,e.height)}),t.bindRenderbuffer(xn,null)}var c={rgba4:_n,rgb565:36194,"rgb5 a1":32855,depth:33189,stencil:36168,"depth stencil":34041};e.ext_srgb&&(c.srgba=35907),e.ext_color_buffer_half_float&&(c.rgba16f=34842,c.rgb16f=34843),e.webgl_color_buffer_float&&(c.rgba32f=34836);var u=[];Object.keys(c).forEach(function(t){var e=c[t];u[e]=t});var f=0,h={};return a.prototype.decRef=function(){--this.refCount<=0&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(h).forEach(function(e){t+=h[e].stats.size}),t}),{create:s,clear:function(){xe(h).forEach(o)},restore:l}},Tn=36160,kn=36161,An=3553,En=34069,Sn=36064,Ln=36096,Cn=36128,In=33306,Dn=36053,Pn=6402,zn=[6408],On=[];On[6408]=4;var Rn=[];Rn[5121]=1,Rn[5126]=4,Rn[36193]=2;var Fn=33189,jn=36168,Nn=34041,Bn=[32854,32855,36194,35907,34842,34843,34836],Un={};Un[Dn]="complete",Un[36054]="incomplete attachment",Un[36057]="incomplete dimensions",Un[36055]="incomplete, missing attachment",Un[36061]="unsupported";var Vn=5126,Hn=35632,qn=35633,Gn=35718,Yn=35721,Xn=6408,Wn=5121,Zn=3333,Jn=5126,Kn="xyzw".split(""),Qn=5121,$n=1,ti=2,ei=0,ri=1,ni=2,ii=3,ai=4,oi="dither",si="blend.enable",li="blend.color",ci="blend.equation",ui="blend.func",fi="depth.enable",hi="depth.func",di="depth.range",pi="depth.mask",mi="colorMask",vi="cull.enable",gi="cull.face",yi="frontFace",bi="lineWidth",xi="polygonOffset.enable",_i="polygonOffset.offset",wi="sample.alpha",Mi="sample.enable",Ti="sample.coverage",ki="stencil.enable",Ai="stencil.mask",Ei="stencil.func",Si="stencil.opFront",Li="stencil.opBack",Ci="scissor.enable",Ii="scissor.box",Di="viewport",Pi="profile",zi="framebuffer",Oi="vert",Ri="frag",Fi="elements",ji="primitive",Ni="count",Bi="offset",Ui="instances",Vi=zi+"Width",Hi=zi+"Height",qi=Di+"Width",Gi=Di+"Height",Yi="drawingBufferWidth",Xi="drawingBufferHeight",Wi=[ui,ci,Ei,Si,Li,Ti,Di,Ii,_i],Zi=34962,Ji=34963,Ki=3553,Qi=34067,$i=2884,ta=3042,ea=3024,ra=2960,na=2929,ia=3089,aa=32823,oa=32926,sa=32928,la=5126,ca=35664,ua=35665,fa=35666,ha=5124,da=35667,pa=35668,ma=35669,va=35670,ga=35671,ya=35672,ba=35673,xa=35674,_a=35675,wa=35676,Ma=35678,Ta=35680,ka=4,Aa=1028,Ea=1029,Sa=2304,La=2305,Ca=32775,Ia=32776,Da=519,Pa=7680,za=0,Oa=1,Ra=32774,Fa=513,ja=36160,Na=36064,Ba={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ua=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Va={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Ha={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},qa={frag:35632,vert:35633},Ga={cw:Sa,ccw:La},Ya=new Ht(!1,!1,!1,function(){}),Xa=34918,Wa=34919,Za=35007,Ja=function(t,e){function r(){return h.pop()||f.createQueryEXT()}function n(t){h.push(t)}function i(t){var e=r();f.beginQueryEXT(Za,e),d.push(e),c(d.length-1,d.length,t)}function a(){f.endQueryEXT(Za)}function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}function s(){return p.pop()||new o}function l(t){p.push(t)}function c(t,e,r){var n=s();n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,m.push(n)}function u(){var t,e,r=d.length;if(0!==r){g.length=Math.max(g.length,r+1),v.length=Math.max(v.length,r+1),v[0]=0,g[0]=0;var i=0;for(t=0,e=0;ea.length&&e>0&&(1&e&&(a+=t),e>>=1);)t+=t;return a.substr(0,r)}var i,a="";e.exports=n},{}],510:[function(e,r,n){!function(e,i){"function"==typeof t&&t.amd?t(i):"object"==typeof n?r.exports=i():e.resolveUrl=i()}(this,function(){function t(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r,o=t[i];r=a+o;var s=r-a,l=o-s;l&&(t[--n]=r,r=l)}for(var c=0,i=n;i>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return o(e,t)}function s(t){return t&!0?"-":""}function l(t){if(2===t.length)return[["diff(",o(t[0][0],t[1][1]),",",o(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var a=0;a0&&r.push(","),a===n?r.push("+b[",i,"]"):r.push("+A[",i,"][",a,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?o[t]:o)}function i(){return[0]}function a(t,e){return[[e[0]],[t[0][0]]]}var o=t("robust-determinant"),s=6,l=[i,a];!function(){for(;l.length>1;return["sum(",o(t.slice(0,e)),",",o(t.slice(e)),")"].join("")}function s(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:m(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],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,p=o*l,m=o*s,g=i*c,y=i*l,b=a*s,x=u*(d-p)+f*(m-g)+h*(y-b),_=(Math.abs(d)+Math.abs(p))*Math.abs(u)+(Math.abs(m)+Math.abs(g))*Math.abs(f)+(Math.abs(y)+Math.abs(b))*Math.abs(h),w=7.771561172376103e-16*_;return x>w||-x>w?x:v(t,e,r,n)}];!function(){for(;g.length<=p;)g.push(l(g.length));for(var t=[],r=["slow"],n=0;n<=p;++n)t.push("a"+n),r.push("o"+n);for(var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"],n=2;n<=p;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&s>0||o<0&&s<0)return!1;var l=a(r,t,e),c=a(i,t,e);return!(l>0&&c>0||l<0&&c<0)&&(0!==o||0!==s||0!==l||0!==c||n(t,e,r,i))}e.exports=i;var a=t("robust-orientation")[3]},{"robust-orientation":517}],521:[function(t,e,r){"use strict";function n(t,e){var r=t+e,n=r-t,i=r-n,a=e-n,o=t-i,s=o+a;return s?[s,r]:[r]}function i(t,e){var r=0|t.length,i=0|e.length;if(1===r&&1===i)return n(t[0],-e[0]);var a,o,s=r+i,l=new Array(s),c=0,u=0,f=0,h=Math.abs,d=t[u],p=h(d),m=-e[f],v=h(m);p=i?(a=d,(u+=1)=i?(a=d,(u+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(f=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(f,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],524:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],525:[function(t,e,r){"use strict";function n(t){return a(i(t))}e.exports=n;var i=t("boundary-cells"),a=t("reduce-simplicial-complex")},{"boundary-cells":70,"reduce-simplicial-complex":507}],526:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=0,n=0;n>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--n){n0&&l.push(","),l.push("[");for(var n=0;n0&&l.push(","),l.push("B(C,E,c[",i[0],"],c[",i[1],"])")}l.push("]")}l.push(");")}}(i[s]),l.push("break;");l.push("}}")}return l.push("}return R;};return getContour",t,"d"),new Function("pool",l.join(""))(a)}function i(t){var e=s[t];return e||(e=s[t]=n(t)),e}e.exports=i;var a=t("typedarray-pool"),o=t("marching-simplex-table"),s={}},{"marching-simplex-table":453,"typedarray-pool":549}],528:[function(t,e,r){"use strict";"use restrict";function n(t){for(var e=0,r=Math.max,n=0,i=t.length;n>1,s=o(t[a],e);s<=0?(0===s&&(i=a),r=a+1):s>0&&(n=a-1)}return i}function f(t,e){for(var r=new Array(t.length),n=0,i=r.length;n=t.length||0!==o(t[m],a))break}return r}function h(t,e){if(!e)return f(c(p(t,0)),t,0);for(var r=new Array(e),n=0;n>>u&1&&c.push(i[u]);e.push(c)}return l(e)}function p(t,e){if(e<0)return[];for(var r=[],n=(1<>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),o=t;if(n0;){var r=l(t);if(r>=0){if(e0){var t=T[0];return a(0,A-1),A-=1,c(0),t}return-1}function h(t,e){var r=T[t];return y[r]===e?t:(y[r]=-(1/0),u(t),f(),y[r]=e,A+=1,u(A-1))}function d(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var p=e.length,m=t.length,v=new Array(p),g=new Array(p),y=new Array(p),b=new Array(p),x=0;x>1;x>=0;--x)c(x);for(;;){var E=f();if(E<0||y[E]>r)break;!function(t){if(!b[t]){b[t]=!0;var e=v[t],r=g[t];v[r]>=0&&(v[r]=e),g[e]>=0&&(g[e]=r),k[e]>=0&&h(k[e],i(e)),k[r]>=0&&h(k[r],i(r))}}(E)}for(var S=[],x=0;x=0&&r>=0&&e!==r){var n=k[e],i=k[r];n!==i&&L.push([n,i])}}),o.unique(o.normalize(L)),{positions:S,edges:L}}e.exports=i;var a=t("robust-orientation"),o=t("simplicial-complex")},{"robust-orientation":517,"simplicial-complex":530}],533:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var i=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?i-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],i=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=a(r,i,s),c=a(r,i,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=a(s,o,i),c=a(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return i[0]-s[0]}e.exports=i;var a=t("robust-orientation")},{"robust-orientation":517}],534:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{var l=a(t.right,e);if(l)return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l=a(t.right,e);if(l)return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}function l(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?h(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var l=this.horizontal[e];if(l.length>0){var u=c.ge(l,t[1],i);if(u=l.length)return n;d=l[u]}}if(d.start)if(o){var p=f(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":533,"binary-search-bounds":67,"functional-red-black-tree":135,"robust-orientation":517}],535:[function(t,e,r){"use strict";function n(t,e){var r=c(l(t,e),[e[e.length-1]]);return r[r.length-1]}function i(t,e,r,n){var i=n-e,a=-e/i;a<0?a=0:a>1&&(a=1);for(var o=1-a,s=t.length,l=new Array(s),c=0;c0||o>0&&u<0){var f=i(s,u,l,o);r.push(f),a.push(f.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}}function o(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r}function s(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}var l=t("robust-dot-product"),c=t("robust-sum");e.exports=a,e.exports.positive=o,e.exports.negative=s},{"robust-dot-product":514,"robust-sum":522}],536:[function(e,r,n){!function(e){function r(){var t=arguments[0],e=r.cache;return e[t]&&e.hasOwnProperty(t)||(e[t]=r.parse(t)),r.format.call(null,e[t],arguments)}function i(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function a(t,e){return Array(e+1).join(t)}var o={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};r.format=function(t,e){var n,s,l,c,u,f,h,d=1,p=t.length,m="",v=[],g=!0,y="";for(s=0;s=0),c[8]){case"b":n=n.toString(2);break;case"c":n=String.fromCharCode(n);break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,c[6]?parseInt(c[6]):0);break;case"e":n=c[7]?n.toExponential(c[7]):n.toExponential();break;case"f":n=c[7]?parseFloat(n).toFixed(c[7]):parseFloat(n);break;case"g":n=c[7]?parseFloat(n).toPrecision(c[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=(n=String(n))&&c[7]?n.substring(0,c[7]):n;break;case"u":n>>>=0;break;case"x":n=n.toString(16);break;case"X":n=n.toString(16).toUpperCase()}o.json.test(c[8])?v[v.length]=n:(!o.number.test(c[8])||g&&!c[3]?y="":(y=g?"+":"-",n=n.toString().replace(o.sign,"")),f=c[4]?"0"===c[4]?"0":c[4].charAt(1):" ",h=c[6]-(y+n).length,u=c[6]&&h>0?a(f,h):"",v[v.length]=c[5]?y+n+u:"0"===f?y+u+n:u+y+n)}return v.join("")},r.cache={},r.parse=function(t){for(var e=t,r=[],n=[],i=0;e;){if(null!==(r=o.text.exec(e)))n[n.length]=r[0];else if(null!==(r=o.modulo.exec(e)))n[n.length]="%";else{if(null===(r=o.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){i|=1;var a=[],s=r[2],l=[];if(null===(l=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a[a.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=o.key_access.exec(s)))a[a.length]=l[1];else{if(null===(l=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a[a.length]=l[1]}r[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var s=function(t,e,n){return n=(e||[]).slice(0),n.splice(0,0,t),r.apply(null,n)};void 0!==n?(n.sprintf=r,n.vsprintf=s):(e.sprintf=r,e.vsprintf=s,"function"==typeof t&&t.amd&&t(function(){return{sprintf:r,vsprintf:s}}))}("undefined"==typeof window?this:window)},{}],537:[function(t,e,r){"use strict";function n(t){for(var e=t.length,r=new Array(e),n=new Array(e),i=new Array(e),a=new Array(e),o=new Array(e),s=new Array(e),l=0;l0;){e=h[h.length-1];var d=t[e];if(a[e]=0&&s[e].push(o[m])}a[e]=p}else{if(n[e]===r[e]){for(var v=[],g=[],y=0,p=l.length-1;p>=0;--p){var b=l[p];if(i[b]=!1,v.push(b),g.push(s[b]),y+=s[b].length,o[b]=u.length,b===e){l.length=p;break}}u.push(v);for(var x=new Array(y),p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return d(d({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function c(t){return t/360+.5}function u(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function f(t){return 360*(t-.5)}function h(t){var e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function d(t,e){for(var r in e)t[r]=e[r];return t}function p(t){return t.x}function m(t){return t.y}var v=t("kdbush");e.exports=n,i.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(o);e&&console.timeEnd(r);for(var i=this.options.maxZoom;i>=this.options.minZoom;i--){var a=+Date.now();this.trees[i+1]=v(n,p,m,this.options.nodeSize,Float32Array),n=this._cluster(n,i),e&&console.log("z%d: %d clusters in %dms",i,n.length,+Date.now()-a)}return this.trees[this.options.minZoom]=v(n,p,m,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(c(t[0]),u(t[3]),c(t[2]),u(t[1])),i=[],a=0;a c)|0 },"),"generic"===e&&n.push("getters:[0],");for(var a=[],l=[],c=0;c>>7){");for(var c=0;c<1<<(1<128&&c%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;n.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),v=new Array(r),g=new Array(r),y=0,b=0;bb)&&!(c&1<<_)!=!(c&1<0&&(k="+"+v[x]+"*c");var A=p[x].length/y*.5,E=.5+g[x]/y*.5;T.push("d"+x+"-"+E+"-"+A+"*("+p[x].join("+")+k+")/("+m[x].join("+")+")")}h.push("a.push([",T.join(),"]);","break;")}n.push("}},"),f.length>0&&h.push("}}");for(var S=[],c=0;c<1<=0?1.2:1))}function i(t,e,r,n,i,o,s){for(var l=0;l.5?l/(2-a-o):l/(a+o),a){case t:n=(e-r)/l+(e1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;if(t=k(t,360),e=k(e,100),r=k(r,100),0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}function s(t,e,r){t=k(t,255),e=k(e,255),r=k(r,255);var n,i,a=V(t,e,r),o=U(t,e,r),s=a,l=a-o;if(i=0===a?0:l/a,a==o)n=0;else{switch(a){case t:n=(e-r)/l+(e>1)+720)%360;--r;)i.h=(i.h+a)%360,o.push(e(i));return o}function M(t,r){r=r||6;for(var n=e(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/r;r--;)s.push(e({h:i,s:a,v:o})),o=(o+l)%1;return s}function T(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function k(t,e){S(t)&&(t="100%");var r=L(t);return t=U(e,V(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),N.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function A(t){return U(1,V(0,t))}function E(t){return parseInt(t,16)}function S(t){return"string"==typeof t&&t.indexOf(".")!=-1&&1===parseFloat(t)}function L(t){return"string"==typeof t&&t.indexOf("%")!=-1}function C(t){return 1==t.length?"0"+t:""+t}function I(t){return t<=1&&(t=100*t+"%"),t}function D(t){return Math.round(255*parseFloat(t)).toString(16)}function P(t){return E(t)/255}function z(t){t=t.replace(R,"").replace(F,"").toLowerCase();var e=!1;if(q[t])t=q[t],e=!0;else if("transparent"==t)return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Y.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Y.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Y.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Y.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Y.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Y.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Y.hex8.exec(t))?{a:P(r[1]),r:E(r[2]),g:E(r[3]),b:E(r[4]),format:e?"name":"hex8"}:(r=Y.hex6.exec(t))?{r:E(r[1]),g:E(r[2]),b:E(r[3]),format:e?"name":"hex"}:!!(r=Y.hex3.exec(t))&&{r:E(r[1]+""+r[1]),g:E(r[2]+""+r[2]),b:E(r[3]+""+r[3]),format:e?"name":"hex"}}function O(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}var R=/^\s+/,F=/\s+$/,j=0,N=Math,B=N.round,U=N.min,V=N.max,H=N.random;e.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,i,a,o=this.toRgb();return t=o.r/255,e=o.g/255,r=o.b/255,n=t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4),i=e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4),.2126*n+.7152*i+.0722*a},setAlpha:function(t){return this._a=T(t),this._roundA=B(100*this._a)/100,this},toHsv:function(){var t=s(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=s(this._r,this._g,this._b),e=B(360*t.h),r=B(100*t.s),n=B(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=a(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=a(this._r,this._g,this._b),e=B(360*t.h),r=B(100*t.s),n=B(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+n+"%)":"hsla("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(t){return c(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(){return u(this._r,this._g,this._b,this._a)},toHex8String:function(){return"#"+this.toHex8()},toRgb:function(){return{r:B(this._r),g:B(this._g),b:B(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+B(this._r)+", "+B(this._g)+", "+B(this._b)+")":"rgba("+B(this._r)+", "+B(this._g)+", "+B(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:B(100*k(this._r,255))+"%",g:B(100*k(this._g,255))+"%",b:B(100*k(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+B(100*k(this._r,255))+"%, "+B(100*k(this._g,255))+"%, "+B(100*k(this._b,255))+"%)":"rgba("+B(100*k(this._r,255))+"%, "+B(100*k(this._g,255))+"%, "+B(100*k(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(G[c(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var r="#"+u(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(t){n=e(t).toHex8String()}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},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&&"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)),"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 e(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(p,arguments)},brighten:function(){return this._applyModification(m,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(d,arguments)},spin:function(){return this._applyModification(g,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(w,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(M,arguments)},splitcomplement:function(){return this._applyCombination(_,arguments)},triad:function(){return this._applyCombination(b,arguments)},tetrad:function(){return this._applyCombination(x,arguments)}},e.fromRatio=function(t,r){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:I(t[i]));t=n}return e(t,r)},e.equals=function(t,r){return!(!t||!r)&&e(t).toRgbString()==e(r).toRgbString()},e.random=function(){return e.fromRatio({r:H(),g:H(),b:H()})},e.mix=function(t,r,n){n=0===n?0:n||50 -;var i,a=e(t).toRgb(),o=e(r).toRgb(),s=n/100,l=2*s-1,c=o.a-a.a;i=l*c==-1?l:(l+c)/(1+l*c),i=(i+1)/2;var u=1-i;return e({r:o.r*i+a.r*u,g:o.g*i+a.g*u,b:o.b*i+a.b*u,a:o.a*s+a.a*(1-s)})},e.readability=function(t,r){var n=e(t),i=e(r);return(Math.max(n.getLuminance(),i.getLuminance())+.05)/(Math.min(n.getLuminance(),i.getLuminance())+.05)},e.isReadable=function(t,r,n){var i,a,o=e.readability(t,r);switch(a=!1,i=O(n),i.level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},e.mostReadable=function(t,r,n){var i,a,o,s,l=null,c=0;n=n||{},a=n.includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=e(r[u]));return e.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,e.mostReadable(t,["#fff","#000"],n))};var q=e.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"},G=e.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(q),Y=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();void 0!==r&&r.exports?r.exports=e:"function"==typeof t&&t.amd?t(function(){return e}):window.tinycolor=e}()},{}],543:[function(t,e,r){"use strict";function n(t,e){var r=o(getComputedStyle(t).getPropertyValue(e));return r[0]*a(r[1],t)}function i(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}function a(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return i(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return s;case"cm":return s/2.54;case"mm":return s/25.4;case"pt":return s/72;case"pc":return s/6}return 1}var o=t("parse-unit");e.exports=a;var s=96},{"parse-unit":484}],544:[function(e,r,n){!function(e,i){"object"==typeof n&&void 0!==r?i(n):"function"==typeof t&&t.amd?t(["exports"],i):i(e.topojson=e.topojson||{})}(this,function(t){"use strict";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:"Feature",properties:a,geometry:o}:null==i?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=f[t<0?~t:t],n=0,i=r.length;n1)n=i(t,e,r);else for(a=0,n=new Array(o=t.arcs.length);a1)for(var i,a,l=1,c=o(n[0]);lc&&(a=n[0],n[0]=n[l],n[l]=a,c=i);return n})}}var s=function(t){return t},l=function(t){if(null==(e=t.transform))return s;var e,r,n,i=e.scale[0],a=e.scale[1],o=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+o,t[1]=(n+=t[1])*a+l,t}},c=function(t){function e(t){s[0]=t[0],s[1]=t[1],o(s),s[0]f&&(f=s[0]),s[1]h&&(h=s[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,o=l(t),s=new Array(2),c=1/0,u=c,f=-c,h=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=s[0]),s[1]h&&(h=s[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,f,h]}return n},u=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},f=function(t,r){return"GeometryCollection"===r.type?{type:"FeatureCollection",features:r.geometries.map(function(r){return e(t,r)})}:e(t,r)},h=function(t,e){function r(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}function n(t,e){for(var r in t){var n=t[r];delete e[n.start],delete n.start,delete n.end,n.forEach(function(t){i[t<0?~t:t]=1}),s.push(n)}}var i={},a={},o={},s=[],l=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++l],e[l]=r,e[n]=i)}),e.forEach(function(t){var e,n,i=r(t),s=i[0],l=i[1];if(e=o[s])if(delete o[e.end],e.push(t),e.end=l,n=a[l]){delete a[n.start];var c=n===e?e:e.concat(n);a[c.start=e.start]=o[c.end=n.end]=c}else a[e.start]=o[e.end]=e;else if(e=a[l])if(delete a[e.start],e.unshift(t),e.start=s,n=o[s]){delete o[n.end];var u=n===e?e:n.concat(e);a[u.start=n.start]=o[u.end=e.end]=u}else a[e.start]=o[e.end]=e;else e=[t],a[e.start=s]=o[e.end=l]=e}),n(o,a),n(a,o),e.forEach(function(t){i[t<0?~t:t]||s.push([t])}),s},d=function(t){return r(t,n.apply(this,arguments))},p=function(t){return r(t,o.apply(this,arguments))},m=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=c(t),o=a[0],s=(a[2]-o)/(e-1)||1,l=a[1],u=(a[3]-l)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,c=t.length,f=t[0],h=f[0]=Math.round((f[0]-o)/s),d=f[1]=Math.round((f[1]-l)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(var s=0;s<3;++s)i[s]-=o/a*t[s];return h(i,i),i}function o(t,e,r,n,i,a,o,s){this.center=l(r),this.up=l(n),this.right=l(i),this.radius=l([a]),this.angle=l([o,s]),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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}function s(t){t=t||{};var e=t.center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),h(r,r),i=[].slice.call(i,0,3),h(i,i),"eye"in t){var u=t.eye,p=[u[0]-e[0],u[1]-e[1],u[2]-e[2]];f(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):h(i,i),s=n(p[0],p[1],p[2]);var m=d(r,p)/s,v=d(i,p)/s;c=Math.acos(m),l=Math.acos(v)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)}e.exports=s;var l=t("filtered-vector"),c=t("gl-mat4/invert"),u=t("gl-mat4/rotate"),f=t("gl-vec3/cross"),h=t("gl-vec3/normalize"),d=t("gl-vec3/dot"),p=o.prototype;p.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},p.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])]},p.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,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];for(var s=Math.sqrt(i),l=0,o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;for(var c=Math.sqrt(l),o=0;o<3;++o)r[o]/=c;var u=this.computedToward;f(u,e,r),h(u,u);for(var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],v=Math.cos(p),g=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=v*y,w=g*y,M=b,T=-v*b,k=-g*b,A=y,E=this.computedEye,S=this.computedMatrix,o=0;o<3;++o){var L=_*r[o]+w*u[o]+M*e[o];S[4*o+1]=T*r[o]+k*u[o]+A*e[o],S[4*o+2]=L,S[4*o+3]=0}var C=S[1],I=S[5],D=S[9],P=S[2],z=S[6],O=S[10],R=I*O-D*z,F=D*P-C*O,j=C*z-I*P,N=n(R,F,j);R/=N,F/=N,j/=N,S[0]=R,S[4]=F,S[8]=j;for(var o=0;o<3;++o)E[o]=x[o]+S[2+4*o]*d;for(var o=0;o<3;++o){for(var l=0,B=0;B<3;++B)l+=S[o+4*B]*E[B];S[12+o]=-l}S[15]=1},p.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 m=[0,0,0];p.rotate=function(t,e,r,n){if(this.angle.move(t,e,r),n){this.recalcMatrix(t);var i=this.computedMatrix;m[0]=i[2],m[1]=i[6],m[2]=i[10];for(var a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];u(i,i,n,m);for(var l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},p.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l;u-=o*d,f-=s*d,h-=l*d;var p=n(u,f,h);u/=p,f/=p,h/=p;var m=u*e+o*r,v=f*e+s*r,g=h*e+l*r;this.center.move(t,m,v,g);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),this.radius.set(t,Math.log(y))},p.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},p.setMatrix=function(t,e,r,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var l=e[o],u=e[o+4],f=e[o+8];if(a){var h=Math.abs(l),d=Math.abs(u),p=Math.abs(f),m=Math.max(h,d,p);h===m?(l=l<0?-1:1,u=f=0):p===m?(f=f<0?-1:1,l=u=0):(u=u<0?-1:1,l=f=0)}else{var v=n(l,u,f);l/=v,u/=v,f/=v}var g=e[s],y=e[s+4],b=e[s+8],x=g*l+y*u+b*f;g-=l*x,y-=u*x,b-=f*x;var _=n(g,y,b);g/=_,y/=_,b/=_;var w=u*b-f*y,M=f*g-l*b,T=l*y-u*g,k=n(w,M,T);w/=k,M/=k,T/=k,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,l,u,f),this.right.jump(t,g,y,b);var A,E;if(2===o){var S=e[1],L=e[5],C=e[9],I=S*g+L*y+C*b,D=S*w+L*M+C*T;A=R<0?-Math.PI/2:Math.PI/2,E=Math.atan2(D,I)}else{var P=e[2],z=e[6],O=e[10],R=P*l+z*u+O*f,F=P*g+z*y+O*b,j=P*w+z*M+O*T;A=Math.asin(i(R)),E=Math.atan2(j,F)}this.angle.jump(t,E,A),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;c(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,X=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*X,G-B*X,Y-U*X)},p.lastT=function(){return Math.max(this.center.lastT(),this.up.lastT(),this.right.lastT(),this.radius.lastT(),this.angle.lastT())},p.idle=function(t){this.center.idle(t),this.up.idle(t),this.right.idle(t),this.radius.idle(t),this.angle.idle(t)},p.flush=function(t){this.center.flush(t),this.up.flush(t),this.right.flush(t),this.radius.flush(t),this.angle.flush(t)},p.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},p.lookAt=function(t,e,r,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter,a=a||this.computedUp;var o=a[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(u,f,h);if(!(d<1e-6)){u/=d,f/=d,h/=d;var p=this.computedRight,m=p[0],v=p[1],g=p[2],y=o*m+s*v+l*g;m-=y*o,v-=y*s,g-=y*l;var b=n(m,v,g);if(!(b<.01&&(m=s*h-l*f,v=l*u-o*h,g=o*f-s*u,(b=n(m,v,g))<1e-6))){m/=b,v/=b,g/=b,this.up.set(t,o,s,l),this.right.set(t,m,v,g),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*g-l*v,_=l*m-o*g,w=o*v-s*m,M=n(x,_,w);x/=M,_/=M,w/=M;var T=o*u+s*f+l*h,k=m*u+v*f+g*h,A=x*u+_*f+w*h,E=Math.asin(i(T)),S=Math.atan2(A,k),L=this.angle._state,C=L[L.length-1],I=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-S),P=Math.abs(C-S),z=Math.abs(C-2*Math.PI-S);D0?r.pop():new ArrayBuffer(t)}function s(t){return new Uint8Array(o(t),0,t)}function l(t){return new Uint16Array(o(2*t),0,t)}function c(t){return new Uint32Array(o(4*t),0,t)}function u(t){return new Int8Array(o(t),0,t)}function f(t){return new Int16Array(o(2*t),0,t)}function h(t){return new Int32Array(o(4*t),0,t)}function d(t){return new Float32Array(o(4*t),0,t)}function p(t){return new Float64Array(o(8*t),0,t)}function m(t){return x?new Uint8ClampedArray(o(t),0,t):s(t)}function v(t){return new DataView(o(t),0,t)}function g(t){t=y.nextPow2(t);var e=y.log2(t),r=M[e];return r.length>0?r.pop():new n(t)}var y=t("bit-twiddle"),b=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:b([32,0]),UINT16:b([32,0]),UINT32:b([32,0]),INT8:b([32,0]),INT16:b([32,0]),INT32:b([32,0]),FLOAT:b([32,0]),DOUBLE:b([32,0]),DATA:b([32,0]),UINT8C:b([32,0]),BUFFER:b([32,0])});var x="undefined"!=typeof Uint8ClampedArray,_=e.__TYPEDARRAY_POOL;_.UINT8C||(_.UINT8C=b([32,0])),_.BUFFER||(_.BUFFER=b([32,0]));var w=_.DATA,M=_.BUFFER;r.free=function(t){if(n.isBuffer(t))M[y.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|y.log2(e);w[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=a,r.freeArrayBuffer=i,r.freeBuffer=function(t){M[y.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return o(t);switch(e){case"uint8":return s(t);case"uint16":return l(t);case"uint32":return c(t);case"int8":return u(t);case"int16":return f(t);case"int32":return h(t);case"float":case"float32":return d(t);case"double":case"float64":return p(t);case"uint8_clamped":return m(t);case"buffer":return g(t);case"data":case"dataview":return v(t);default:return null}return null},r.mallocArrayBuffer=o,r.mallocUint8=s,r.mallocUint16=l,r.mallocUint32=c,r.mallocInt8=u,r.mallocInt16=f,r.mallocInt32=h,r.mallocFloat32=r.mallocFloat=d,r.mallocFloat64=r.mallocDouble=p,r.mallocUint8Clamped=m,r.mallocDataView=v,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)_.UINT8[t].length=0,_.UINT16[t].length=0,_.UINT32[t].length=0,_.INT8[t].length=0,_.INT16[t].length=0,_.INT32[t].length=0,_.FLOAT[t].length=0,_.DOUBLE[t].length=0,_.UINT8C[t].length=0,w[t].length=0,M[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":68,buffer:78,dup:125}],550:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],553:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&c.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}function a(t){return c.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)}function o(t,e){return i(t,!1,!0).resolve(e)}function s(t,e){return t?i(t,!1,!0).resolveObject(e):e}var l=t("punycode"),c=t("./util");r.parse=i,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=n;var u=/^([a-z0-9.+-]+:)/i,f=/:[0-9]*$/,h=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,d=["<",">",'"',"`"," ","\r","\n","\t"],p=["{","}","|","\\","^","`"].concat(d),m=["'"].concat(p),v=["%","/","?",";","#"].concat(m),g=["/","?","#"],y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},x={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=t("querystring");n.prototype.parse=function(t,e,r){if(!c.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n127?I+="x":I+=C[D];if(!I.match(/^[+a-z0-9A-Z_-]{0,63}$/)){var z=S.slice(0,M),O=S.slice(M+1),R=C.match(/^([+a-z0-9A-Z_-]{0,63})(.*)$/);R&&(z.push(R[1]),O.unshift(R[2])),O.length&&(o="/"+O.join(".")+o),this.hostname=z.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),E||(this.hostname=l.toASCII(this.hostname));var F=this.port?":"+this.port:"",j=this.hostname||"";this.host=j+F,this.href+=this.host,E&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!y[d])for(var M=0,L=m.length;M0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return r.search=t.search,r.query=t.query,c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=M.slice(-1)[0],E=(r.host||t.host||M.length>1)&&("."===A||".."===A)||""===A,S=0,L=M.length;L>=0;L--)A=M[L],"."===A?M.splice(L,1):".."===A?(M.splice(L,1),S++):S&&(M.splice(L,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),E&&"/"!==M.join("/").substr(-1)&&M.push("");var C=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(T){r.hostname=r.host=C?"":M.length?M.shift():"";var k=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return _=_||r.host&&M.length,_&&!C&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":554,punycode:497,querystring:501}],554:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],555:[function(t,e,r){e.exports=function(t){ -return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],556:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(e)?n.showHidden=e:e&&r._extend(n,e),_(n.showHidden)&&(n.showHidden=!1),_(n.depth)&&(n.depth=2),_(n.colors)&&(n.colors=!1),_(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),l(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function l(t,e,n){if(t.customInspect&&e&&A(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return b(i)||(i=l(t,i,n)),i}var a=c(t,e);if(a)return a;var o=Object.keys(e),m=s(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),k(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return u(e);if(0===o.length){if(A(e)){var v=e.name?": "+e.name:"";return t.stylize("[Function"+v+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(T(e))return t.stylize(Date.prototype.toString.call(e),"date");if(k(e))return u(e)}var g="",y=!1,x=["{","}"];if(p(e)&&(y=!0,x=["[","]"]),A(e)){g=" [Function"+(e.name?": "+e.name:"")+"]"}if(w(e)&&(g=" "+RegExp.prototype.toString.call(e)),T(e)&&(g=" "+Date.prototype.toUTCString.call(e)),k(e)&&(g=" "+u(e)),0===o.length&&(!y||0==e.length))return x[0]+g+x[1];if(n<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var _;return _=y?f(t,e,n,m,o):o.map(function(r){return h(t,e,n,m,r,y)}),t.seen.pop(),d(_,g,x)}function c(t,e){if(_(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return y(e)?t.stylize(""+e,"number"):m(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var a=[],o=0,s=e.length;o-1&&(s=a?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),_(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function d(t,e,r){var n=0;return t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function p(t){return Array.isArray(t)}function m(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function x(t){return"symbol"==typeof t}function _(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===S(t)}function M(t){return"object"==typeof t&&null!==t}function T(t){return M(t)&&"[object Date]"===S(t)}function k(t){return M(t)&&("[object Error]"===S(t)||t instanceof Error)}function A(t){return"function"==typeof t}function E(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t}function S(t){return Object.prototype.toString.call(t)}function L(t){return t<10?"0"+t.toString(10):t.toString(10)}function C(){var t=new Date,e=[L(t.getHours()),L(t.getMinutes()),L(t.getSeconds())].join(":");return[t.getDate(),z[t.getMonth()],e].join(" ")}function I(t,e){return Object.prototype.hasOwnProperty.call(t,e)}r.format=function(t){if(!b(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)a+=t.readSVarint(),o+=t.readSVarint(),1===n&&(e&&s.push(e),e=[]),e.push(new l(a,o));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&s.push(e),s},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-(1/0),l=1/0,c=-(1/0);t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}var o=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":559}],561:[function(t,e,r){"use strict";function n(t,e){return"object"==typeof e&&null!==e||(e={}),i(t,e.canvas||a,e.context||o,e)}e.exports=n;var i=t("./lib/vtext"),a=null,o=null;"undefined"!=typeof document&&(a=document.createElement("canvas"),a.width=8192,a.height=1024,o=a.getContext("2d"))},{"./lib/vtext":562}],562:[function(t,e,r){"use strict";function n(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;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}function l(t){for(var e=[],r=0,n=0,i=t.length,a=0;a=0?l[r]:e)}function e(t){var e=n(t);return e?c in e:s.indexOf(t)>=0}function r(t,e){var r,i=n(t);return i?i[c]=e:(r=s.indexOf(t),r>=0?l[r]=e:(r=s.length,l[r]=e,s[r]=t)),this}function o(t){var e,r,i=n(t);return i?c in i&&delete i[c]:!((e=s.indexOf(t))<0)&&(r=s.length-1,s[e]=void 0,l[e]=l[r],s[e]=s[r],s.length=r,l.length=r,!0)}this instanceof x||a();var s=[],l=[],c=b++;return Object.create(x.prototype,{get___:{value:i(t)},has___:{value:i(e)},set___:{value:i(r)},delete___:{value:i(o)}})};x.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 s?function(){function r(){function e(t,e){return u?c.has(t)?c.get(t):u.get___(t,e):c.get(t,e)}function r(t){return c.has(t)||!!u&&u.has___(t)}function n(t){var e=!!c.delete(t);return u?u.delete___(t)||e:e}this instanceof x||a();var l,c=new s,u=void 0,f=!1;return l=o?function(t,e){return c.set(t,e),c.has(t)||(u||(u=new x),u.set(t,e)),this}:function(t,e){if(f)try{c.set(t,e)}catch(r){u||(u=new x),u.set___(t,e)}else c.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(e)},has___:{value:i(r)},set___:{value:i(l)},delete___:{value:i(n)},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");f=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],567:[function(t,e,r){function n(){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:i(e,t)}}var i=t("./hidden-store.js");e.exports=n},{"./hidden-store.js":568}],568:[function(t,e,r){function n(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}e.exports=n},{}],569:[function(t,e,r){function n(){var t=i();return{get:function(e,r){var n=t(e);return n.hasOwnProperty("value")?n.value:r},set:function(e,r){t(e).value=r},has:function(e){return"value"in t(e)},delete:function(e){return delete t(e).value}}}var i=t("./create-store.js");e.exports=n},{"./create-store.js":567}],570:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":147}],571:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){v[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];v[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c=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=n||{}}var o=p[i.year-p[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1,o=p[a.year-p[0]];var l,c=o>>9&4095,u=o>>5&15,f=31&o,h=new Date(c,u-1,f),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-h)/864e5);var v,g=d[a.year-d[0]];for(v=0;v<13;v++){var y=g&1<<12-v?30:29;if(l>13;return!b||v=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");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=d[o.year-d[0]],f=u>>13;c=f?o.month>f?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var h=0;h>9&4095,g=m>>5&15,y=31&m,b=new Date(v,g-1,y+l);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}var o=t("../main"),s=t("object-assign"),l=o.instance();n.prototype=new o.baseCalendar,s(n.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(u);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(f);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00\u6708","\u4e8c\u6708","\u4e09\u6708","\u56db\u6708","\u4e94\u6708","\u516d\u6708","\u4e03\u6708","\u516b\u6708","\u4e5d\u6708","\u5341\u6708","\u5341\u4e00\u6708","\u5341\u4e8c\u6708"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},monthNamesShort:function(t){if("string"==typeof t){var e=t.match(h);return e?e[0]:""}var r=this._validateYear(t),n=t.month(),i=this.toChineseMonth(r,n),a=["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"][i-1];return this.isIntercalaryMonth(r,n)&&(a="\u95f0"+a),a},parseMonth:function(t,e){t=this._validateYear(t);var r,n=parseInt(e);if(isNaN(n))"\u95f0"===e[0]&&(r=!0,e=e.substring(1)),"\u6708"===e[e.length-1]&&(e=e.substring(0,e.length-1)),n=1+["\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d","\u4e03","\u516b","\u4e5d","\u5341","\u5341\u4e00","\u5341\u4e8c"].indexOf(e);else{var i=e[e.length-1];r="i"===i||"I"===i}return this.toMonthIndex(t,n,r)},dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:1,isRTL:!1}},_validateYear:function(t,e){if(t.year&&(t=t.year()),"number"!=typeof t||t<1888||t>2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t),n=r?12:11;if(e<0||e>n)throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(t=t.year(),e=t.month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,i=this._validateYear(t,o.local.invalidyear),a=p[i-p[0]],s=a>>9&4095,c=a>>5&15,u=31&a;n=l.newDate(s,c,u),n.add(4-(n.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-n.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=d[t-d[0]];if(e>(r>>13?12:11))throw o.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,o.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var i=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),c=a(t,s,r,i);return l.toJD(c.year,c.month,c.day)},fromJD:function(t){var e=l.fromJD(t),r=i(e.year(),e.month(),e.day()),n=this.toMonthIndex(r.year,r.month,r.isIntercalary);return this.newDate(r.year,n,r.day)},fromString:function(t){var e=t.match(c),r=this._validateYear(+e[1]),n=+e[2],i=!!e[3],a=this.toMonthIndex(r,n,i),o=+e[4];return this.newDate(r,a,o)},add:function(t,e,r){var i=t.year(),a=t.month(),o=this.isIntercalaryMonth(i,a),s=this.toChineseMonth(i,a),l=Object.getPrototypeOf(n.prototype).add.call(this,t,e,r);if("y"===r){var c=l.year(),u=l.month(),f=this.isIntercalaryMonth(c,s),h=o&&f?this.toMonthIndex(c,s,!0):this.toMonthIndex(c,s,!1);h!==u&&l.month(h)}return l}});var c=/^\s*(-?\d\d\d\d|\d\d)[-\/](\d?\d)([iI]?)[-\/](\d?\d)/m,u=/^\d?\d[iI]?/m,f=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?\u6708/m,h=/^\u95f0?\u5341?[\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]?/m;o.calendars.chinese=n -;var d=[1887,5780,5802,19157,2742,50359,1198,2646,46378,7466,3412,30122,5482,67949,2396,5294,43597,6732,6954,36181,2772,4954,18781,2396,54427,5274,6730,47781,5800,6868,21210,4790,59703,2350,5270,46667,3402,3496,38325,1388,4782,18735,2350,52374,6804,7498,44457,2906,1388,29294,4700,63789,6442,6804,56138,5802,2772,38235,1210,4698,22827,5418,63125,3476,5802,43701,2484,5302,27223,2646,70954,7466,3412,54698,5482,2412,38062,5294,2636,32038,6954,60245,2772,4826,43357,2394,5274,39501,6730,72357,5800,5844,53978,4790,2358,38039,5270,87627,3402,3496,54708,5484,4782,43311,2350,3222,27978,7498,68965,2904,5484,45677,4700,6444,39573,6804,6986,19285,2772,62811,1210,4698,47403,5418,5780,38570,5546,76469,2420,5302,51799,2646,5414,36501,3412,5546,18869,2412,54446,5276,6732,48422,6822,2900,28010,4826,92509,2394,5274,55883,6730,6820,47956,5812,2778,18779,2358,62615,5270,5450,46757,3492,5556,27318,4718,67887,2350,3222,52554,7498,3428,38252,5468,4700,31022,6444,64149,6804,6986,43861,2772,5338,35421,2650,70955,5418,5780,54954,5546,2740,38074,5302,2646,29991,3366,61011,3412,5546,43445,2412,5294,35406,6732,72998,6820,6996,52586,2778,2396,38045,5274,6698,23333,6820,64338,5812,2746,43355,2358,5270,39499,5450,79525,3492,5548],p=[1887,966732,967231,967733,968265,968766,969297,969798,970298,970829,971330,971830,972362,972863,973395,973896,974397,974928,975428,975929,976461,976962,977462,977994,978494,979026,979526,980026,980558,981059,981559,982091,982593,983124,983624,984124,984656,985157,985656,986189,986690,987191,987722,988222,988753,989254,989754,990286,990788,991288,991819,992319,992851,993352,993851,994383,994885,995385,995917,996418,996918,997450,997949,998481,998982,999483,1000014,1000515,1001016,1001548,1002047,1002578,1003080,1003580,1004111,1004613,1005113,1005645,1006146,1006645,1007177,1007678,1008209,1008710,1009211,1009743,1010243,1010743,1011275,1011775,1012306,1012807,1013308,1013840,1014341,1014841,1015373,1015874,1016404,1016905,1017405,1017937,1018438,1018939,1019471,1019972,1020471,1021002,1021503,1022035,1022535,1023036,1023568,1024069,1024568,1025100,1025601,1026102,1026633,1027133,1027666,1028167,1028666,1029198,1029699,1030199,1030730,1031231,1031763,1032264,1032764,1033296,1033797,1034297,1034828,1035329,1035830,1036362,1036861,1037393,1037894,1038394,1038925,1039427,1039927,1040459,1040959,1041491,1041992,1042492,1043023,1043524,1044024,1044556,1045057,1045558,1046090,1046590,1047121,1047622,1048122,1048654,1049154,1049655,1050187,1050689,1051219,1051720,1052220,1052751,1053252,1053752,1054284,1054786,1055285,1055817,1056317,1056849,1057349,1057850,1058382,1058883,1059383,1059915,1060415,1060947,1061447,1061947,1062479,1062981,1063480,1064012,1064514,1065014,1065545,1066045,1066577,1067078,1067578,1068110,1068611,1069112,1069642,1070142,1070674,1071175,1071675,1072207,1072709,1073209,1073740,1074241,1074741,1075273,1075773,1076305,1076807,1077308,1077839,1078340,1078840,1079372,1079871,1080403,1080904]},{"../main":588,"object-assign":479}],575:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Coptic",jdEpoch:1825029.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:"Coptic",epochs:["BAM","AM"],monthNames:["Thout","Paopi","Hathor","Koiak","Tobi","Meshir","Paremhat","Paremoude","Pashons","Paoni","Epip","Mesori","Pi Kogi Enavot"],monthNamesShort:["Tho","Pao","Hath","Koi","Tob","Mesh","Pat","Pad","Pash","Pao","Epi","Meso","PiK"],dayNames:["Tkyriaka","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"],dayNamesShort:["Tky","Pes","Psh","Pef","Pti","Pso","Psa"],dayNamesMin:["Tk","Pes","Psh","Pef","Pt","Pso","Psa"],digits:null,dateFormat:"dd/mm/yyyy",firstDay:0,isRTL:!1}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.coptic=n},{"../main":588,"object-assign":479}],576:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Discworld",jdEpoch:1721425.5,daysPerMonth:[16,32,32,32,32,32,32,32,32,32,32,32,32],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Discworld",epochs:["BUC","UC"],monthNames:["Ick","Offle","February","March","April","May","June","Grune","August","Spune","Sektober","Ember","December"],monthNamesShort:["Ick","Off","Feb","Mar","Apr","May","Jun","Gru","Aug","Spu","Sek","Emb","Dec"],dayNames:["Sunday","Octeday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Oct","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Oc","Mo","Tu","We","Th","Fr","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:2,isRTL:!1}},leapYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),!1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),13},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),400},weekOfYear:function(t,e,r){var n=this.newDate(t,e,r);return n.add(-n.dayOfWeek(),"d"),Math.floor((n.dayOfYear()-1)/8)+1},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]},daysInWeek:function(){return 8},dayOfWeek:function(t,e,r){return(this._validate(t,e,r,i.local.invalidDate).day()+1)%8},weekDay:function(t,e,r){var n=this.dayOfWeek(t,e,r);return n>=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:o[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var o={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":588,"object-assign":479}],577:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.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,i.local.invalidYear),t=e.year()+(e.year()<0?1:0);return t%4==3||t%4==-1},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),t<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":588,"object-assign":479}],578:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main"),o=t("object-assign");n.prototype=new a.baseCalendar,o(n.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,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.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,a.local.invalidYear).year(),this.toJD(t===-1?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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+r+1;if(e<7){for(var s=7;s<=this.monthsInYear(t);s++)o+=this.daysInMonth(t,s);for(var s=1;s=this.toJD(e===-1?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)}}),a.calendars.hebrew=n},{"../main":588,"object-assign":479}],579:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":588,"object-assign":479}],580:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.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,i.local.invalidYear),t=e.year()<0?e.year()+1:e.year();return t%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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5),r=e+1524,n=Math.floor((r-122.1)/365.25),i=Math.floor(365.25*n),a=Math.floor((r-i)/30.6001),o=a-Math.floor(a<14?1:13),s=n-Math.floor(o>2?4716:4715),l=r-i-Math.floor(30.6001*a);return s<=0&&s--,this.newDate(s,o,l)}}),i.calendars.julian=n},{"../main":588,"object-assign":479}],581:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main"),s=t("object-assign");n.prototype=new o.baseCalendar,s(n.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,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.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("."),t.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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate),i=n.toJD(),a=this._toHaab(i),s=this._toTzolkin(i);return{haabMonthName:this.local.haabMonths[a[0]-1],haabMonth:a[0],haabDay:a[1],tzolkinDayName:this.local.tzolkinMonths[s[0]-1],tzolkinDay:s[0],tzolkinTrecena:s[1]}},_toHaab:function(t){t-=this.jdEpoch;var e=i(t+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":588,"object-assign":479}],582:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth),t=n.year();t<0&&t++;for(var a=n.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)}}),i.calendars.nanakshahi=n},{"../main":588,"object-assign":479}],583:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.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,i.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,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance(),r=e.fromJD(t),n=r.year(),a=r.dayOfYear(),o=n+56;this._createMissingCalendarData(o);for(var s=9,l=this.NEPALI_CALENDAR_DATA[o][0],c=this.NEPALI_CALENDAR_DATA[o][s]-l+1;a>c;)s++,s>12&&(s=1,o++),c+=this.NEPALI_CALENDAR_DATA[o][s];var u=this.NEPALI_CALENDAR_DATA[o][s]-(c-a);return this.newDate(o,s,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,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/2820)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=t-this.toJD(475,1,1),r=Math.floor(e/1029983),n=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":588,"object-assign":479}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.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,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.taiwan=n},{"../main":588,"object-assign":479}],586:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();n.prototype=new i.baseCalendar,a(n.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,i.local.invalidYear),t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear),t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.thai=n},{"../main":588,"object-assign":479}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar,a(n.prototype,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth),n=r.toJD()-24e5+.5,a=0,s=0;sn)return o[a]-o[a-1];a++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),a=12*(n.year()-1)+n.month()-15292;return n.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,c=e-o[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(t=null!=t.year?t.year:t,n=t>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;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]},{"../main":588,"object-assign":479}],588:[function(t,e,r){function n(){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 i(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.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(),n.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]}}}),l(i.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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,c.local.invalidDate||c.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),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":479}],589:[function(t,e,r){var n=t("object-assign"),i=t("./main");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,r=r||{};for(var n=r.dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;v+n1}),u=function(t,e,r,n){var i=""+e;if(c(t,n))for(;i.length1},b=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(M).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,M);return M+=s[0].length,parseInt(s[0],10)},x=this,_=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=m;for(var A=this.daysInMonth(h,d);p>A;A=this.daysInMonth(h,d))d++,p-=A}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,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}t=t.toLowerCase();for(var e=(t.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)}})},{"./main":588,"object-assign":479}],590:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":109}],591:[function(t,e,r){"use strict";function n(t,e){var r=[];return e=+e||0,i(t.hi(t.shape[0]-1),r,e),r}e.exports=n;var i=t("./lib/zc-core")},{"./lib/zc-core":590}],592:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{},l=l||{};var u=c("visible",!l.itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;a(t,e,r,c);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},v=0;v<2;v++){var g=d[v],y=i.coerceRef(t,e,m,g,"","paper");if(i.coercePosition(e,m,c,y,g,.5),h){var b="a"+g,x=i.coerceRef(t,e,m,b,"pixel");"pixel"!==x&&x!==y&&(x=e[b]="pixel");var _="pixel"===x?p[v]:.4;i.coercePosition(e,m,c,x,b,_)}c(g+"anchor"),c(g+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":735,"../../plots/cartesian/axes":779,"./attributes":594,"./common_defaults":597}],593:[function(t,e,r){"use strict";e.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}]},{}],594:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},arrowcolor:{valType:"color",editType:"arraydraw"},arrowhead:{valType:"integer",min:0,max:n.length,dflt:1,editType:"arraydraw"},arrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":784,"../../plots/font_attributes":803,"./arrow_paths":593}],595:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i=a.getFromId(t,e.xref),o=a.getFromId(t,e.yref),s=3*e.arrowsize*e.arrowwidth||0;i&&i.autorange&&(r=s+e.xshift,n=s-e.xshift,e.axref===e.xref?(a.expand(i,[i.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(i,[i.r2c(e.ax)],{ppadplus:e._xpadplus,ppadminus:e._xpadminus})):a.expand(i,[i.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r),ppadminus:Math.max(e._xpadminus,n)})),o&&o.autorange&&(r=s-e.yshift,n=s+e.yshift,e.ayref===e.yref?(a.expand(o,[o.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(o,[o.r2c(e.ay)],{ppadplus:e._ypadplus,ppadminus:e._ypadminus})):a.expand(o,[o.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r),ppadminus:Math.max(e._ypadminus,n)}))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=!0,s[t.yref]=!0});if(a.list(t).filter(function(t){return t.autorange&&s[t._id]}).length)return i.syncOrAsync([o,n],t)}}},{"../../lib":735,"../../plots/cartesian/axes":779,"./draw":600}],596:[function(t,e,r){"use strict";function n(t,e){var r=a(t,e);return r.on.length>0||r.explicitOff.length>0}function i(t,e){var r,n=a(t,e),i=n.on,o=n.off.concat(n.explicitOff),l={};if(i.length||o.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var o=j.selectAll("a");if(1===o.size()&&o.text()===j.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":o.attr("xlink:href"),"xlink:xlink:show":o.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(z.node())}var l=C.select(".annotation-text-math-group"),u=!l.empty(),d=h.bBox((u?l:j).node()),y=d.width,L=d.height,D=e.width||y,F=e.height||L,N=Math.round(D+2*P),B=Math.round(F+2*P);e._w=D,e._h=F;for(var U=!1,V=["x","y"],H=0;H1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;q=Q._offset+Q.r2p(e[Z]),X=.5}else"x"===Z?(Y=e[Z],q=_.l+_.w*Y):(Y=1-e[Z],q=_.t+_.h*Y),X=e.showarrow?.5:Y;if(e.showarrow){at.head=q;var st=e["a"+Z];W=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=W):(at.tail=q+st,G=W+st),at.text=at.tail+W;var lt=x["x"===Z?"width":"height"];if("paper"===J&&(at.head=c.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else W=rt*r(X,nt),G=W,at.text=q+W;at.text+=it,W+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=W}if(U)return void C.remove();var ft=0,ht=0;if("left"!==e.align&&(ft=(D-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(F-L)*("middle"===e.valign?.5:1)),u)l.select("svg").attr({x:P+ft-1,y:P+ht}).call(h.setClipUrl,O?M:null);else{var dt=P+ht-d.top,pt=P+ft-d.left;j.call(p.positionText,pt,dt).call(h.setClipUrl,O?M:null)}R.select("rect").call(h.setRect,P,P,D,F),z.call(h.setRect,I/2,I/2,N-I,B-I),C.call(h.setTranslate,Math.round(T.x.text-N/2),Math.round(T.y.text-B/2)),E.attr({transform:"rotate("+k+","+T.x.text+","+T.y.text+")"});var mt=function(r,o){A.selectAll(".annotation-arrow-g").remove();var l=T.x.head,u=T.y.head,d=T.x.tail+r,p=T.y.tail+o,m=T.x.text+r,y=T.y.text+o,x=c.rotationXYMatrix(k,m,y),M=c.apply2DTransform(x),S=c.apply2DTransform2(x),L=+z.attr("width"),I=+z.attr("height"),D=m-.5*L,P=D+L,O=y-.5*I,R=O+I,F=[[D,O,D,R],[D,R,P,R],[P,R,P,O],[P,O,D,O]].map(S);if(!F.reduce(function(t,e){return t^!!c.segmentsIntersect(l,u,l+1e6,u+1e6,e[0],e[1],e[2],e[3])},!1)){F.forEach(function(t){var e=c.segmentsIntersect(d,p,l,u,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var j=e.arrowwidth,N=e.arrowcolor,B=A.append("g").style({opacity:f.opacity(N)}).classed("annotation-arrow-g",!0),U=B.append("path").attr("d","M"+d+","+p+"L"+l+","+u).style("stroke-width",j+"px").call(f.stroke,f.rgb(N));if(g(U,"end",e),w.annotationPosition&&U.node().parentNode&&!n){var V=l,H=u;if(e.standoff){var q=Math.sqrt(Math.pow(l-d,2)+Math.pow(u-p,2));V+=e.standoff*(d-l)/q,H+=e.standoff*(p-u)/q}var G,Y,X,W=B.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-V)+","+(p-H),transform:"translate("+V+","+H+")"}).style("stroke-width",j+6+"px").call(f.stroke,"rgba(0,0,0,0)").call(f.fill,"rgba(0,0,0,0)");v.init({element:W.node(),gd:t,prepFn:function(){var t=h.getTranslate(C);Y=t.x,X=t.y,G={},i&&i.autorange&&(G[i._name+".autorange"]=!0),a&&a.autorange&&(G[a._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(Y,X),o=n[0]+t,s=n[1]+r;C.call(h.setTranslate,o,s),G[b+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,G[b+".y"]=a?a.p2r(a.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(G[b+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(G[b+".ay"]=a.p2r(a.r2p(e.ay)+r)),B.attr("transform","translate("+t+","+r+")"),E.attr({transform:"rotate("+k+","+o+","+s+")"})},doneFn:function(e){if(e){s.relayout(t,G);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}};if(e.showarrow&&mt(0,0),S){var vt,gt;v.init({element:C.node(),gd:t,prepFn:function(){gt=E.attr("transform"),vt={}},moveFn:function(t,r){var o="pointer";if(e.showarrow)e.axref===e.xref?vt[b+".ax"]=i.p2r(i.r2p(e.ax)+t):vt[b+".ax"]=e.ax+t,e.ayref===e.yref?vt[b+".ay"]=a.p2r(a.r2p(e.ay)+r):vt[b+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)vt[b+".x"]=e.x+t/i._m;else{var s=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-s/2;vt[b+".x"]=v.align(l+t/_.w,s,0,1,e.xanchor)}if(a)vt[b+".y"]=e.y+r/a._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;vt[b+".y"]=v.align(u-r/_.h,c,0,1,e.yanchor)}i&&a||(o=v.getCursor(i?.5:vt[b+".x"],a?.5:vt[b+".y"],e.xanchor,e.yanchor))}E.attr({transform:"translate("+t+","+r+")"+gt}),m(C,o)},doneFn:function(e){if(m(C),e){s.relayout(t,vt);var r=document.querySelector(".js-notes-box-panel");r&&r.redraw(r.selectedObj)}}})}}var y,b,x=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,b=n+".annotations["+r+"]"):(y="annotation",b="annotations["+r+"]"),x._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+x._uid+"_ann"+r;if(!e._input||e.visible===!1)return void o.selectAll("#"+M).remove();var T={x:{},y:{}},k=+e.textangle||0,A=x._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),E=A.append("g").classed("annotation-text-g",!0),S=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||S,C=E.append("g").style("pointer-events",L?"all":null).call(m,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:o.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();d.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:t})}).on("mouseout",function(){d.loneUnhover(x._hoverlayer.node())});var I=e.borderwidth,D=e.borderpad,P=I+D,z=C.append("rect").attr("class","bg").style("stroke-width",I+"px").call(f.stroke,e.bordercolor).call(f.fill,e.bgcolor),O=e.width||e.height,R=x._topclips.selectAll("#"+M).data(O?[0]:[]);R.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),R.exit().remove();var F=e.font,j=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?j.call(p.makeEditable,{delegate:C,gd:t}).call(l).on("edit",function(r){e.text=r,this.call(l);var n={};n[b+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),a&&a.autorange&&(n[a._name+".autorange"]=!0),s.relayout(t,n)}):j.call(l)}var o=t("d3"),s=t("../../plotly"),l=t("../../plots/plots"),c=t("../../lib"),u=t("../../plots/cartesian/axes"),f=t("../color"),h=t("../drawing"),d=t("../fx"),p=t("../../lib/svg_text_utils"),m=t("../../lib/setcursor"),v=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:n,drawOne:i,drawRaw:a}},{"../../lib":735,"../../lib/setcursor":753,"../../lib/svg_text_utils":757,"../../plotly":774,"../../plots/cartesian/axes":779,"../../plots/plots":838,"../color":611,"../dragelement":632,"../drawing":635,"../fx":652,"./draw_arrow_head":601,d3:121}],601:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color"),a=t("./arrow_paths");e.exports=function(t,e,r){function o(){t.style("stroke-dasharray","0px,100px")}function s(e,a){d.path&&(d.noRotate&&(a=0),n.select(h.parentNode).append("path").attr({class:t.attr("class"),d:d.path,transform:"translate("+e.x+","+e.y+")"+(a?"rotate("+180*a/Math.PI+")":"")+"scale("+p+")"}).style({fill:i.rgb(r.arrowcolor),"stroke-width":0}))}var l,c,u,f,h=t.node(),d=a[r.arrowhead||0],p=(r.arrowwidth||1)*r.arrowsize,m=e.indexOf("start")>=0,v=e.indexOf("end")>=0,g=d.backoff*p+r.standoff;if("line"===h.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var y=l.x-c.x,b=l.y-c.y;if(u=Math.atan2(b,y),f=u+Math.PI,g){if(g*g>y*y+b*b)return void o();var x=g*Math.cos(u),_=g*Math.sin(u);m&&(l.x-=x,l.y-=_,t.attr({x1:l.x,y1:l.y})),v&&(c.x+=x,c.y+=_,t.attr({x2:c.x,y2:c.y}))}}else if("path"===h.nodeName){var w=h.getTotalLength(),M="";if(w1){c=!0;break}}c?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))}}},{"../../plots/gl3d/project":827,"../annotations/draw":600}],607:[function(t,e,r){"use strict";e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),convert:t("./convert"),draw:t("./draw")}},{"./attributes":603,"./convert":604,"./defaults":605,"./draw":606}],608:[function(t,e,r){"use strict";e.exports=t("world-calendars/dist/main"),t("world-calendars/dist/plus"),t("world-calendars/dist/calendars/chinese"),t("world-calendars/dist/calendars/coptic"),t("world-calendars/dist/calendars/discworld"),t("world-calendars/dist/calendars/ethiopian"),t("world-calendars/dist/calendars/hebrew"),t("world-calendars/dist/calendars/islamic"),t("world-calendars/dist/calendars/julian"),t("world-calendars/dist/calendars/mayan"),t("world-calendars/dist/calendars/nanakshahi"),t("world-calendars/dist/calendars/nepali"),t("world-calendars/dist/calendars/persian"),t("world-calendars/dist/calendars/taiwan"),t("world-calendars/dist/calendars/thai"),t("world-calendars/dist/calendars/ummalqura")},{"world-calendars/dist/calendars/chinese":574,"world-calendars/dist/calendars/coptic":575,"world-calendars/dist/calendars/discworld":576,"world-calendars/dist/calendars/ethiopian":577,"world-calendars/dist/calendars/hebrew":578,"world-calendars/dist/calendars/islamic":579,"world-calendars/dist/calendars/julian":580,"world-calendars/dist/calendars/mayan":581,"world-calendars/dist/calendars/nanakshahi":582,"world-calendars/dist/calendars/nepali":583,"world-calendars/dist/calendars/persian":584,"world-calendars/dist/calendars/taiwan":585,"world-calendars/dist/calendars/thai":586,"world-calendars/dist/calendars/ummalqura":587,"world-calendars/dist/main":588,"world-calendars/dist/plus":589}],609:[function(t,e,r){"use strict";function n(t,e,r){for(var n,a,o,s,l,c=Math.floor((e+.05)/f)+u,h=i(r).fromJD(c),d=0;(d=t.indexOf("%",d))!==-1;)n=t.charAt(d+1),"0"===n||"-"===n||"_"===n?(o=3,a=t.charAt(d+2),"_"===n&&(n="-")):(a=n,n="0",o=2),s=b[a],s?(l=s===y?y:h.formatDate(s[n]),t=t.substr(0,d)+l+t.substr(d+o),d+=l.length):d+=o;return t}function i(t){var e=x[t];return e?e:e=x[t]=s.instance(t)}function a(t){return l.extendFlat({},h,{description:t})}function o(t){return"Sets the calendar system to use with `"+t+"` date data."}var s=t("./calendars"),l=t("../../lib"),c=t("../../constants/numerical"),u=c.EPOCHJD,f=c.ONEDAY,h={valType:"enumerated",values:Object.keys(s.calendars),editType:"calc",dflt:"gregorian"},d=function(t,e,r,n){var i={};return i[r]=h,l.coerce(t,e,i,r,n)},p=function(t,e,r,n){for(var i=0;i=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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);return 1!==n.getAlpha()&&(n=i(o.combine(t,c))),(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;es&&(a[1]-=(ut-s)/2):r.node()&&!r.classed("js-placeholder")&&(ut=d.bBox(r.node()).height),ut){if(ut+=5,"top"===M.titleside)rt.domain[1]-=ut/S.h,a[1]*=-1;else{rt.domain[0]+=ut/S.h;var c=v.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),rt.setScale()}}lt.selectAll(".cbfills,.cblines,.cbaxis").attr("transform","translate(0,"+Math.round(S.h*(1-rt.domain[1]))+")");var f=lt.select(".cbfills").selectAll("rect.cbfill").data(P);f.enter().append("rect").classed("cbfill",!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?I[0]:(P[e]+P[e-1])/2,e===P.length-1?I[1]:(P[e]+P[e+1])/2].map(rt.c2p).map(Math.round);e!==P.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=O(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:J,width:Math.max(H,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var h=lt.select(".cblines").selectAll("path.cbline").data(M.line.color&&M.line.width?D:[]);return h.enter().append("path").classed("cbline",!0),h.exit().remove(),h.each(function(t){n.select(this).attr("d","M"+J+","+(Math.round(rt.c2p(t))+M.line.width/2%1)+"h"+H).call(d.lineGroupStyle,M.line.width,z(t),M.line.dash)}),rt._axislayer.selectAll("g."+rt._id+"tick,path").remove(),rt._pos=J+H+(M.outlinewidth||0)/2-("outside"===M.ticks?1:0),rt.side="right",u.syncOrAsync([function(){return l.doTicks(t,rt,!0)},function(){if(["top","bottom"].indexOf(M.titleside)===-1){var e=rt.titlefont.size,r=rt._offset+rt._length/2,i=S.l+(rt.position||0)*S.w+("right"===rt.side?10+e*(rt.showticklabels?1:.5):-10-e*(rt.showticklabels?.5:0));k("h"+rt._id+"title",{avoid:{selection:n.select(t).selectAll("g."+rt._id+"tick"),side:M.titleside,offsetLeft:S.l,offsetTop:S.t,maxShift:E.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])}function k(e,r){var n,i=w();n=s.traceIs(i,"markerColorscale")?"marker.colorbar.title":"colorbar.title";var a={propContainer:rt,propName:n,traceIndex:i.index,dfltName:"colorscale",containerGroup:lt.select(".cbtitle")},o="h"===e.charAt(0)?e.substr(1):"h"+e;lt.selectAll("."+o+",."+o+"-math-group").remove(),m.draw(t,e,f(a,r||{}))}function A(){var r=H+M.outlinewidth/2+d.bBox(rt._axislayer.node()).width;if(B=ct.select("text"),B.node()&&!B.classed("js-placeholder")){var n,i=ct.select(".h"+rt._id+"title-math-group").node();n=i&&["top","bottom"].indexOf(M.titleside)!==-1?d.bBox(i).width:d.bBox(ct.node()).right-J-S.l,r=Math.max(r,n)}var a=2*M.xpad+r+M.borderwidth+M.outlinewidth/2,s=$-tt;lt.select(".cbbg").attr({x:J-M.xpad-(M.borderwidth+M.outlinewidth)/2,y:tt-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,M.bgcolor).call(p.stroke,M.bordercolor).style({"stroke-width":M.borderwidth}),lt.selectAll(".cboutline").attr({x:J,y:tt+M.ypad+("top"===M.titleside?ut:0),width:Math.max(H,2),height:Math.max(s-2*M.ypad-ut,2)}).call(p.stroke,M.outlinecolor).style({fill:"None","stroke-width":M.outlinewidth});var l=({center:.5,right:1}[M.xanchor]||0)*a;lt.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:M.x,y:M.y,l:a*({right:1,center:.5}[M.xanchor]||0),r:a*({left:1,center:.5}[M.xanchor]||0),t:s*({bottom:1,middle:.5}[M.yanchor]||0),b:s*({top:1,middle:.5}[M.yanchor]||0)})}var E=t._fullLayout,S=E._size;if("function"!=typeof M.fillcolor&&"function"!=typeof M.line.color)return void E._infolayer.selectAll("g."+e).remove();var L,C,I=n.extent(("function"==typeof M.fillcolor?M.fillcolor:M.line.color).domain()),D=[],P=[],z="function"==typeof M.line.color?M.line.color:function(){return M.line.color},O="function"==typeof M.fillcolor?M.fillcolor:function(){return M.fillcolor},R=M.levels.end+M.levels.size/100,F=M.levels.size,j=1.001*I[0]-.001*I[1],N=1.001*I[1]-.001*I[0];for(C=0;C<1e5&&(L=M.levels.start+C*F,!(F>0?L>=R:L<=R));C++)L>j&&L0?L>=R:L<=R));C++)L>I[0]&&L1){var st=Math.pow(10,Math.floor(Math.log(ot)/Math.LN10));it*=st*u.roundUp(ot/st,[2,5,10]),(Math.abs(M.levels.start)/M.levels.size+1e-6)%1<2e-6&&(rt.tick0=0)}rt.dtick=it}rt.domain=[Q+Z,Q+Y-Z],rt.setScale();var lt=E._infolayer.selectAll("g."+e).data([0]);lt.enter().append("g").classed(e,!0).each(function(){var t=n.select(this);t.append("rect").classed("cbbg",!0),t.append("g").classed("cbfills",!0),t.append("g").classed("cblines",!0),t.append("g").classed("cbaxis",!0).classed("crisp",!0),t.append("g").classed("cbtitleunshift",!0).append("g").classed("cbtitle",!0),t.append("rect").classed("cboutline",!0),t.select(".cbtitle").datum(0)}),lt.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var ct=lt.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");rt._axislayer=lt.select(".cbaxis");var ut=0;if(["top","bottom"].indexOf(M.titleside)!==-1){var ft,ht=S.l+(M.x+X)*S.w,dt=rt.titlefont.size;ft="top"===M.titleside?(1-(Q+Y-Z))*S.h+S.t+3+.75*dt:(1-(Q+Z))*S.h+S.t-3-.25*dt,k(rt._id+"title",{attributes:{x:ht,y:ft,"text-anchor":"start"}})}var pt=u.syncOrAsync([o.previousPromises,T,o.previousPromises,A],t);if(pt&&pt.then&&(t._promises||[]).push(pt),t._context.edits.colorbarPosition){var mt,vt,gt;c.init({element:lt.node(),gd:t,prepFn:function(){mt=lt.attr("transform"),h(lt)},moveFn:function(t,e){lt.attr("transform",mt+" translate("+t+","+e+")"),vt=c.align(K+t/S.w,q,0,1,M.xanchor),gt=c.align(Q-e/S.h,Y,0,1,M.yanchor);var r=c.getCursor(vt,gt,M.xanchor,M.yanchor);h(lt,r)},doneFn:function(e){h(lt),e&&void 0!==vt&&void 0!==gt&&a.restyle(t,{"colorbar.x":vt,"colorbar.y":gt},w().index)}})}return pt}function w(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":735,"./flip_scale":622,"./scales":629}],618:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:r===!1?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":724,"./attributes":616,"./scales.js":629}],619:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":629}],620:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,v=p[h+"min"],g=p[h+"max"],y=p.colorscale;c(f+h+"auto",!(n(v)&&n(g)&&v=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],623:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":619,"./is_valid_scale_array":627,"./scales":629}],624:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],631:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.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]}},{"../../lib":735}],632:[function(t,e,r){"use strict";function n(){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 i(t){t._dragging=!1,t._replotPending&&l.plot(t)}function a(t){return o(t.changedTouches?t.changedTouches[0]:t,document.body)}var o=t("mouse-event-offset"),s=t("has-hover"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/cartesian/constants"),f=t("../../constants/interactions"),h=e.exports={};h.align=t("./align"),h.getCursor=t("./cursor");var d=t("./unhover");h.unhover=d.wrapped,h.unhoverRaw=d.raw,h.init=function(t){function e(e){if(!e.buttons||2!==e.buttons){y._dragged=!1,y._dragging=!0;var i=a(e);return l=i[0],d=i[1],g=e.target,p=(new Date).getTime(),p-y._mouseDownTimex&&(b=Math.max(b-1,1)),t.doneFn&&t.doneFn(y._dragged,b,e),!y._dragged){var n;try{n=new MouseEvent("click",e)}catch(t){var l=a(e);n=document.createEvent("MouseEvents"),n.initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,l[0],l[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}g.dispatchEvent(n)}return i(y),y._dragged=!1,c.pauseEvent(e)}var l,d,p,m,v,g,y=t.gd,b=1,x=f.DBLCLICKDELAY,_=t.element;y._mouseDownTime||(y._mouseDownTime=0),_.style.pointerEvents="all",_.onmousedown=e,_.ontouchstart=e},h.coverSlip=n},{"../../constants/interactions":713,"../../lib":735,"../../plotly":774,"../../plots/cartesian/constants":784,"./align":630,"./cursor":631,"./unhover":633,"has-hover":294,"mouse-event-offset":461}],633:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){t=a(t),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&&n.triggerHandler(t,"plotly_beforehover",e)===!1||(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}))}},{"../../lib/events":723,"../../lib/get_graph_div":730,"../../lib/throttle":758,"../fx/constants":647}],634:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],635:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){if(c.traceIs(r,"symbols")){var l=y(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===a.size?3:g.isBubble(r)?l(t.ms):(a.size||6)/2,t.mrc=e;var n=b.symbolNumber(t.mx||a.symbol)||0,i=n%100;return t.om=n%200>=100,b.symbolFuncs[i](e)+(n>=200?w:"")}).style("opacity",function(t){return(t.mo+1||a.opacity+1)-1})}var f,h,d,p=!1;if(t.so?(d=o.outlierwidth,h=o.outliercolor,f=a.outliercolor):(d=(t.mlw+1||o.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,h="mlc"in t?t.mlcc=i(t.mlc):Array.isArray(o.color)?u.defaultLine:o.color,Array.isArray(a.color)&&(f=u.defaultLine,p=!0),f="mc"in t?t.mcc=n(t.mc):a.color||"rgba(0,0,0,0)"),t.om)e.call(u.stroke,f).style({"stroke-width":(d||1)+"px",fill:"none"});else{e.style("stroke-width",d+"px");var m=a.gradient,v=t.mgt;if(v?p=!0:v=m&&m.type,v&&"none"!==v){var x=t.mgc;x?p=!0:x=m.color;var _="g"+s._fullLayout._uid+"-"+r.uid;p&&(_+="-"+t.i),e.call(b.gradient,s,_,v,f,x)}else e.call(u.fill,f);d&&e.call(u.stroke,h)}}function i(t,e,r,n){var i=t[0]-e[0],a=t[1]-e[1],s=r[0]-e[0],l=r[1]-e[1],c=Math.pow(i*i+a*a,A/2),u=Math.pow(s*s+l*l,A/2),f=(u*u*i-c*c*s)*n,h=(u*u*a-c*c*l)*n,d=3*u*(c+u),p=3*c*(c+u);return[[o.round(e[0]+(d&&f/d),2),o.round(e[1]+(d&&h/d),2)],[o.round(e[0]-(p&&f/p),2),o.round(e[1]-(p&&h/p),2)]]}function a(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var o=t("d3"),s=t("fast-isnumeric"),l=t("tinycolor2"),c=t("../../registry"),u=t("../color"),f=t("../colorscale"),h=t("../../lib"),d=t("../../lib/svg_text_utils"),p=t("../../constants/xmlns_namespaces"),m=t("../../constants/alignment"),v=m.LINE_SPACING,g=t("../../traces/scatter/subtypes"),y=t("../../traces/scatter/make_bubble_size_func"),b=e.exports={};b.font=function(t,e,r,n){h.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(u.fill,n)},b.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},b.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},b.setRect=function(t,e,r,n,i){t.call(b.setPosition,e,r).call(b.setSize,n,i)},b.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(s(i)&&s(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},b.translatePoints=function(t,e,r){t.each(function(t){var n=o.select(this);b.translatePoint(t,n,e,r)})},b.hideOutsideRangePoint=function(t,e,r,n){e.attr("display",r.isPtWithinRange(t)&&n.isPtWithinRange(t)?null:"none")},b.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(t){b.hideOutsideRangePoint(t,o.select(this),r,n)})}},b.crispRound=function(t,e,r){return e&&s(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},b.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),b.dashLine(e,s,o)},b.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,s=n||i.dash||"";o.select(this).call(u.stroke,r||i.color).call(b.dashLine,s,a)})},b.dashLine=function(t,e,r){r=+r||0,e=b.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},b.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},b.singleFillStyle=function(t){var e=o.select(t.node()),r=e.data(),n=(((r[0]||[])[0]||{}).trace||{}).fillcolor;n&&t.call(u.fill,n)},b.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=o.select(this);try{r.call(u.fill,e[0].trace.fillcolor)}catch(e){h.error(e,t),r.remove()}})} -;var x=t("./symbol_defs");b.symbolNames=[],b.symbolFuncs=[],b.symbolNeedLines={},b.symbolNoDot={},b.symbolList=[],Object.keys(x).forEach(function(t){var e=x[t];b.symbolList=b.symbolList.concat([e.n,t,e.n+100,t+"-open"]),b.symbolNames[e.n]=t,b.symbolFuncs[e.n]=e.f,e.needLine&&(b.symbolNeedLines[e.n]=!0),e.noDot?b.symbolNoDot[e.n]=!0:b.symbolList=b.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var _=b.symbolNames.length,w="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";b.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),t=b.symbolNames.indexOf(t),t>=0&&(t+=e)}return t%100>=_||t>=400?0:Math.floor(Math.max(t,0))};var M={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0};b.gradient=function(t,e,r,n,i,a){var s=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],h.identity);s.exit().remove(),s.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=o.select(this);"horizontal"===n?t.attr(M):"vertical"===n&&t.attr(T),t.attr("id",r);var e=l(i),s=l(a);t.append("stop").attr({offset:"0%","stop-color":u.tinyRGB(s),"stop-opacity":s.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":u.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},b.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},b.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;n(t,e,r,i,a,s,s.line,o)},b.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=b.tryColorscale(n,""),a=b.tryColorscale(n,"line");t.each(function(t){b.singlePointStyle(t,o.select(this),e,i,a,r)})}},b.tryColorscale=function(t,e){var r=e?h.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?f.makeColorScaleFunc(f.extractScale(n,r.cmin,r.cmax)):h.identity};var k={start:1,end:-1,middle:0,bottom:1,top:-1};b.textPointStyle=function(t,e,r){t.each(function(t){var n=o.select(this),i=h.extractOption(t,e,"tx","text");if(!i)return void n.remove();var a=t.tp||e.textposition,l=a.indexOf("top")!==-1?"top":a.indexOf("bottom")!==-1?"bottom":"middle",c=a.indexOf("left")!==-1?"end":a.indexOf("right")!==-1?"start":"middle",u=t.ts||e.textfont.size,f=t.mrc?t.mrc/.8+1:0;u=s(u)&&u>0?u:0,n.call(b.font,t.tf||e.textfont.family,u,t.tc||e.textfont.color).attr("text-anchor",c).text(i).call(d.convertToTspans,r);var p=o.select(this.parentNode),m=(d.lineCount(n)-1)*v+1,g=k[c]*f,y=.75*u+k[l]*f+(k[l]-1)*m*u/2;p.attr("transform","translate("+g+","+y+")")})};var A=.5;b.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],a=[];for(r=1;r=1e4&&(b.savedBBoxes={},L=0),r&&(b.savedBBoxes[r]=g),L++,h.extendFlat({},g)},b.setClipUrl=function(t,e){if(!e)return void t.attr("clip-path",null);var r="#"+e,n=o.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")},b.getTranslate=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\btranslate\((-?\d*\.?\d*)[^-\d]*(-?\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||0,y:+n[1]||0}},b.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+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},b.getScale=function(t){var e=t.attr?"attr":"getAttribute",r=t[e]("transform")||"",n=r.replace(/.*\bscale\((\d*\.?\d*)[^\d]*(\d*\.?\d*)[^\d].*/,function(t,e,r){return[e,r].join(" ")}).split(" ");return{x:+n[0]||1,y:+n[1]||1}},b.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+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},b.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n+=i,n=n.trim(),this.setAttribute("transform",n)}),i};b.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=o.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),s=parseFloat(i.attr("y")||0),l=(n.attr("transform")||"").match(/translate\([^)]*\)\s*$/);t=1===e&&1===r?[]:["translate("+a+","+s+")","scale("+e+","+r+")","translate("+-a+","+-s+")"],l&&t.push(l),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":708,"../../constants/xmlns_namespaces":716,"../../lib":735,"../../lib/svg_text_utils":757,"../../registry":853,"../../traces/scatter/make_bubble_size_func":1061,"../../traces/scatter/subtypes":1066,"../color":611,"../colorscale":625,"./symbol_defs":636,d3:121,"fast-isnumeric":131,tinycolor2:542}],636:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(t*-.309,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(e*-.309,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:121}],637:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],638:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=a.visible&&["linear","log"].indexOf(r.type)!==-1,c=[];if(l){for(var u=s(a),f=0;f0;t.each(function(t){var h,d=t[0].trace,p=d.error_x||{},m=d.error_y||{};d.ids&&(h=function(t){return t.id});var v=s.hasMarkers(d)&&d.marker.maxdisplayed>0;m.visible||p.visible||(t=[]);var g=i.select(this).selectAll("g.errorbar").data(t,h);if(g.exit().remove(),t.length){p.visible||g.selectAll("path.xerror").remove(),m.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var y=g.enter().append("g").classed("errorbar",!0);f&&y.style("opacity",0).transition().duration(r.duration).style("opacity",1),o.setClipUrl(g,e.layerClipId),g.each(function(t){var e=i.select(this),o=n(t,c,u);if(!v||t.vis){var s;if(m.visible&&a(o.x)&&a(o.yh)&&a(o.ys)){var h=m.width;s="M"+(o.x-h)+","+o.yh+"h"+2*h+"m-"+h+",0V"+o.ys,o.noYS||(s+="m-"+h+",0h"+2*h);var d=e.select("path.yerror");l=!d.size(),l?d=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):f&&(d=d.transition().duration(r.duration).ease(r.easing)),d.attr("d",s)}if(p.visible&&a(o.y)&&a(o.xh)&&a(o.xs)){var g=(p.copy_ystyle?m:p).width;s="M"+o.xh+","+(o.y-g)+"v"+2*g+"m0,-"+g+"H"+o.xs,o.noXS||(s+="m0,-"+g+"v"+2*g);var y=e.select("path.xerror");l=!y.size(),l?y=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):f&&(y=y.transition().duration(r.duration).ease(r.easing)),y.attr("d",s)}}})}})}},{"../../traces/scatter/subtypes":1066,"../drawing":635,d3:121,"fast-isnumeric":131}],643:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.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)})}},{"../color":611,d3:121}],644:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":803}],645:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||i.identity,Array.isArray(t)&&(e[0][r]=n(t))}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){for(var e=t.calcdata,r=t._fullLayout,o=0;o=0&&r.indexQ.width||J<0||J>Q.height)return b.unhoverRaw(t,e)}if(z="xval"in e?w.flat(h,e.xval):w.p2c(E,Z),O="yval"in e?w.flat(h,e.yval):w.p2c(S,J),!f(z[0])||!f(O[0]))return d.warn("Fx.hover failed",e,t),b.unhoverRaw(t,e)}var $=1/0;for(F=0;FY&&(X.splice(0,Y),$=X[0].distance)}if(0===X.length)return b.unhoverRaw(t,e);X.sort(function(t,e){return t.distance-e.distance});var it=t._hoverdata,at=[];for(R=0;R1,ct=y.combine(m.plot_bgcolor||y.background,m.paper_bgcolor),ut={hovermode:P,rotateLabels:lt,bgColor:ct,container:m._hoverlayer,outerContainer:m._paperdiv,commonLabelOpts:m.hoverlabel},ft=i(X,ut,t);if(a(X,lt?"xa":"ya"),o(ft,lt),e.target&&e.target.tagName){var ht=_.getComponentMethod("annotations","hasClickToShow")(t,at);v(u.select(e.target),ht?"pointer":"")}e.target&&!n&&c(t,e,it)&&(it&&t.emit("plotly_unhover",{event:e,points:it}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:E,yaxes:S,xvals:z,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,l=e.container,c=e.outerContainer,f=e.commonLabelOpts||{},h=e.fontFamily||M.HOVERFONT,d=e.fontSize||M.HOVERFONTSIZE,p=t[0],v=p.xa,b=p.ya,x="y"===a?"yLabel":"xLabel",_=p[x],w=(String(_)||"").split(" ")[0],k=c.node().getBoundingClientRect(),A=k.top,E=k.width,S=k.height,I=p.distance<=M.MAXDIST&&("x"===a||"y"===a);for(n=0;n-1&&n.length>p&&(n=p>3?n.substr(0,p-3)+"...":n.substr(0,p))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):I&&t[a+"Label"]===_?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var v=e.select("text.nums").call(g.font,t.fontFamily||h,t.fontSize||d,t.fontColor||f).text(i).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,r),b=e.select("text.name"),x=0;n&&n!==i?(b.call(g.font,t.fontFamily||h,t.fontSize||d,c).text(n).attr("data-notex",1).call(m.positionText,0,0).call(m.convertToTspans,r),x=b.node().getBoundingClientRect().width+2*C):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:c,stroke:f});var w,M,k=v.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,P=t.ya._offset+(t.y0+t.y1)/2,z=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),R=k.width+L+C+x;t.ty0=A-k.top,t.bx=k.width+2*C,t.by=k.height+2*C,t.anchor="start",t.txwidth=k.width,t.tx2width=x,t.offset=0,o?(t.pos=D,w=P+O/2+R<=S,M=P-O/2-R>=0,"top"!==t.idealAlign&&w||!M?w?(P+=O/2,t.anchor="start"):t.anchor="middle":(P-=O/2,t.anchor="end")):(t.pos=P,w=D+z/2+R<=E,M=D-z/2-R>=0,"left"!==t.idealAlign&&w||!M?w?(D+=z/2,t.anchor="start"):t.anchor="middle":(D-=z/2,t.anchor="end")),v.attr("text-anchor",t.anchor),x&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+P+")"+(o?"rotate("+T+")":""))}),z}function a(t,e){function r(t){var e=t[0],r=t[t.length-1];if(i=e.pmin-e.pos-e.dp+e.size,a=r.pos+r.dp+r.size-e.pmax,i>.01){for(s=t.length-1;s>=0;s--)t[s].dp+=i;n=!1}if(!(a<.01)){if(i<-.01){for(s=t.length-1;s>=0;s--)t[s].dp-=a;n=!1}if(n){var c=0;for(o=0;oe.pmax&&c++;for(o=t.length-1;o>=0&&!(c<=0);o--)l=t[o],l.pos>e.pmax-1&&(l.del=!0,c--);for(o=0;o=0;s--)t[s].dp-=a;for(o=t.length-1;o>=0&&!(c<=0);o--)l=t[o],l.pos+l.dp+l.size>e.pmax&&(l.del=!0,c--)}}}for(var n,i,a,o,s,l,c,u=0,f=t.map(function(t,r){var n=t[e];return[{i:r,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===n._id.charAt(0)?A:1)/2,pmin:n._offset,pmax:n._offset+n._length}]}).sort(function(t,e){return t[0].posref-e[0].posref});!n&&u<=t.length;){for(u++,n=!0,o=0;o.01&&p.pmin===m.pmin&&p.pmax===m.pmax){for(s=d.length-1;s>=0;s--)d[s].dp+=i;for(h.push.apply(h,d),f.splice(o+1,1),c=0,s=h.length-1;s>=0;s--)c+=h[s].dp;for(a=c/h.length,s=h.length-1;s>=0;s--)h[s].dp-=a;n=!1}else o++}f.forEach(r)}for(o=f.length-1;o>=0;o--){var v=f[o];for(s=v.length-1;s>=0;s--){var g=v[s],y=t[g.i];y.offset=g.dp,y.del=g.del}}}function o(t,e){t.each(function(t){var r=u.select(this);if(t.del)return void r.remove();var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(L+C),s=o+a*(t.txwidth+C),l=0,c=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(c*=-S,l=t.offset*E),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*L+l)+","+(L+c)+"v"+(t.by/2-L)+"h"+n*t.bx+"v-"+t.by+"H"+(n*L+l)+"V"+(c-L)+"Z"),i.call(m.positionText,o+l,c+t.ty0-t.by/2+C),t.tx2width&&(r.select("text.name").call(m.positionText,s+a*C+l,c+t.ty0-t.by/2+C),r.select("rect").call(g.setRect,s+(a-1)*t.tx2width/2+l,c-t.by/2-1,t.tx2width,t.by+2))})}function s(t,e){function r(e,r,n){var i=s(r,n);i&&(t[e]=i)}var n=t.index,i=t.trace||{},a=t.cd[0],o=t.cd[n]||{},s=Array.isArray(n)?function(t,e){return d.castOption(a,n,t)||d.extractOption({},i,"",e)}:function(t,e){return d.extractOption(o,i,t,e)};if(r("hoverinfo","hi","hoverinfo"),r("color","hbg","hoverlabel.bgcolor"),r("borderColor","hbc","hoverlabel.bordercolor"),r("fontFamily","htf","hoverlabel.font.family"),r("fontSize","hts","hoverlabel.font.size"),r("fontColor","htc","hoverlabel.font.color"),r("nameLength","hnl","hoverlabel.namelength"),t.posref="y"===e?(t.x0+t.x1)/2:(t.y0+t.y1)/2,t.x0=d.constrain(t.x0,0,t.xa._length),t.x1=d.constrain(t.x1,0,t.xa._length),t.y0=d.constrain(t.y0,0,t.ya._length),t.y1=d.constrain(t.y1,0,t.ya._length),void 0!==t.xLabelVal&&(t.xLabel="xLabel"in t?t.xLabel:x.hoverLabelText(t.xa,t.xLabelVal),t.xVal=t.xa.c2d(t.xLabelVal)),void 0!==t.yLabelVal&&(t.yLabel="yLabel"in t?t.yLabel:x.hoverLabelText(t.ya,t.yLabelVal),t.yVal=t.ya.c2d(t.yLabelVal)),void 0!==t.zLabelVal&&void 0===t.zLabel&&(t.zLabel=String(t.zLabelVal)),!(isNaN(t.xerr)||"log"===t.xa.type&&t.xerr<=0)){var l=x.tickText(t.xa,t.xa.c2l(t.xerr),"hover").text;void 0!==t.xerrneg?t.xLabel+=" +"+l+" / -"+x.tickText(t.xa,t.xa.c2l(t.xerrneg),"hover").text:t.xLabel+=" \xb1 "+l,"x"===e&&(t.distance+=1)}if(!(isNaN(t.yerr)||"log"===t.ya.type&&t.yerr<=0)){var c=x.tickText(t.ya,t.ya.c2l(t.yerr),"hover").text;void 0!==t.yerrneg?t.yLabel+=" +"+c+" / -"+x.tickText(t.ya,t.ya.c2l(t.yerrneg),"hover").text:t.yLabel+=" \xb1 "+c,"y"===e&&(t.distance+=1)}var u=t.hoverinfo||t.trace.hoverinfo;return"all"!==u&&(u=u.split("+"),u.indexOf("x")===-1&&(t.xLabel=void 0),u.indexOf("y")===-1&&(t.yLabel=void 0),u.indexOf("z")===-1&&(t.zLabel=void 0),u.indexOf("text")===-1&&(t.text=void 0),u.indexOf("name")===-1&&(t.name=void 0)),t}function l(t,e){var r=e.hovermode,n=e.container,i=t[0],a=i.xa,o=i.ya,s=a.showspikes,l=o.showspikes;if(n.selectAll(".spikeline").remove(),"closest"===r&&(s||l)){var c=e.fullLayout,u=a._offset+(i.x0+i.x1)/2,f=o._offset+(i.y0+i.y1)/2,d=y.combine(c.plot_bgcolor,c.paper_bgcolor),p=h.readability(i.color,d)<1.5?y.contrast(d):i.color;if(l){var m=o.spikemode,v=o.spikethickness,b=o.spikecolor||p,x=o._boundingBox,_=(x.left+x.right)/2=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var u=t("d3"),f=t("fast-isnumeric"),h=t("tinycolor2"),d=t("../../lib"),p=t("../../lib/events"),m=t("../../lib/svg_text_utils"),v=t("../../lib/override_cursor"),g=t("../drawing"),y=t("../color"),b=t("../dragelement"),x=t("../../plots/cartesian/axes"),_=t("../../registry"),w=t("./helpers"),M=t("./constants"),T=M.YANGLE,k=Math.PI*T/180,A=1/Math.sin(k),E=Math.cos(k),S=Math.sin(k),L=M.HOVERARROWSIZE,C=M.HOVERTEXTPAD;r.hover=function(t,e,r,i){t=d.getGraphDiv(t),d.throttle(t._fullLayout._uid+M.HOVERID,M.HOVERMINTIME,function(){n(t,e,r,i)})},r.loneHover=function(t,e){var r={color:t.color||y.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=u.select(e.container),a=e.outerContainer?u.select(e.outerContainer):n,s={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||y.background,container:n,outerContainer:a},l=i([r],s,e.gd);return o(l,s.rotateLabels),l.node()}},{"../../lib":735,"../../lib/events":723,"../../lib/override_cursor":745,"../../lib/svg_text_utils":757,"../../plots/cartesian/axes":779,"../../registry":853,"../color":611,"../dragelement":632,"../drawing":635,"./constants":647,"./helpers":649,d3:121,"fast-isnumeric":131,tinycolor2:542}],651:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){i=i||{},r("hoverlabel.bgcolor",i.bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":735}],652:[function(t,e,r){"use strict";function n(t){var e=s.isD3Selection(t)?t:o.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()}function i(t,e,r){return s.castOption(t,e,"hoverlabel."+r)}function a(t,e,r){function n(r){return s.coerceHoverinfo({hoverinfo:r},{_module:t._module},e)}return s.castOption(t,r,"hoverinfo",n)}var o=t("d3"),s=t("../../lib"),l=t("../dragelement"),c=t("./helpers"),u=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:u},attributes:t("./attributes"),layoutAttributes:u,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),getDistanceFunction:c.getDistanceFunction,getClosest:c.getClosest,inbox:c.inbox,quadrature:c.quadrature,appendArrayPointValue:c.appendArrayPointValue,castHoverOption:i,castHoverinfo:a,hover:t("./hover").hover,unhover:l.unhover,loneHover:t("./hover").loneHover,loneUnhover:n,click:t("./click")}},{"../../lib":735,"../dragelement":632,"./attributes":644,"./calc":645,"./click":646,"./constants":647,"./defaults":648,"./helpers":649,"./hover":650,"./layout_attributes":653,"./layout_defaults":654,"./layout_global_defaults":655,d3:121}],653:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":803,"./constants":647}],654:[function(t,e,r){"use strict";function n(t){for(var e=!0,r=0;r=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],662:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":803,"../color/attributes":610}],663:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],664:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,f,h,d=t.legend||{},p=e.legend={},m=0,v="normal",g=0;g1)!==!1){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(c=0,f="left",u=1.1,h="bottom"):(c=0,f="left",u=-.1,h="top")}l("traceorder",v),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",f),l("y",u),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":735,"../../plots/layout_attributes":829,"../../registry":853,"./attributes":662,"./helpers":668}],665:[function(t,e,r){"use strict";function n(t,e){function r(r){g.convertToTspans(r,e,function(){a(t,e)})}var n=t.data()[0][0],i=e._fullLayout,o=n.trace,s=d.traceIs(o,"pie"),l=o.index,c=s?n.label:o.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(m.font,i.legend.font).text(c),e._context.edits.legendText&&!s?h.call(g.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o,s=n.trace._fullInput||{},c={};if(["ohlc","candlestick"].indexOf(s.type)!==-1)a=n.trace.transforms,o=a[a.length-1].direction,c[o+".name"]=t;else if(d.hasTransform(s,"groupby")){var h=d.getTransformIndices(s,"groupby"),p=h[h.length-1],m=f.keyedContainer(s,"transforms["+p+"].styles","target","value.name");""===i?m.remove(n.trace._group):m.set(n.trace._group,t),c=m.constructUpdate()}else c.name=t;return u.restyle(e,c,l)}):h.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(v.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){r=(new Date).getTime(),r-e._legendMouseDownTimeA&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){y(t,e,n)},A):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,y(t,e,n))}})}function a(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend,l=s.font.size*_;if(o){var c=m.bBox(o);n=c.height,i=c.width,m.setTranslate(a,0,n/4)}else{var u=t.select(".legendtext"),f=g.lineCount(u),h=u.node();n=l*f,i=h?m.bBox(h).width:0;var d=l*(.3+(1-f)/2);g.positionText(u,40,d)}n=Math.max(n,16)+3,r.height=n,r.width=i}function o(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=T.isGrouped(i),s=0;if(i.width=0,i.height=0,T.isVertical(i))o&&e.each(function(t,e){m.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;m.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),s=40;else if(o){for(var l=[i.width],u=e.data(),f=0,h=u.length;fn.width-(n.margin.r+n.margin.l)&&(b=0,v+=g,i.height=i.height+g,g=0),m.setTranslate(this,a+b,5+a+e.height/2+v),i.width+=o+r,i.height=Math.max(i.height,e.height),b+=o+r,g=Math.max(e.height,g)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];c.select(this).select(".legendtoggle").call(m.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+s,r.height)})}function s(t){var e=t._fullLayout,r=e.legend,n="left";k.isRightAnchor(r)?n="right":k.isCenterAnchor(r)&&(n="center");var i="top";k.isBottomAnchor(r)?i="bottom":k.isMiddleAnchor(r)&&(i="middle"),h.autoMargin(t,"legend",{x:r.x,y:r.y,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:r.height*({top:1,middle:.5}[i]||0),t:r.height*({bottom:1,middle:.5}[i]||0)})}function l(t){var e=t._fullLayout,r=e.legend,n="left";k.isRightAnchor(r)?n="right":k.isCenterAnchor(r)&&(n="center"),h.autoMargin(t,"legend",{x:r.x,y:.5,l:r.width*({right:1,center:.5}[n]||0),r:r.width*({left:1,center:.5}[n]||0),b:0,t:0})}var c=t("d3"),u=t("../../plotly"),f=t("../../lib"),h=t("../../plots/plots"),d=t("../../registry"),p=t("../dragelement"),m=t("../drawing"),v=t("../color"),g=t("../../lib/svg_text_utils"),y=t("./handle_click"),b=t("./constants"),x=t("../../constants/interactions"),_=t("../../constants/alignment").LINE_SPACING,w=t("./get_legend_data"),M=t("./style"),T=t("./helpers"),k=t("./anchor_utils"),A=x.DBLCLICKDELAY;e.exports=function(t){function e(t,e){L.attr("data-scroll",e).call(m.setTranslate,0,e),C.call(m.setRect,N,t,b.scrollBarWidth,b.scrollBarHeight),E.select("rect").attr({y:g.borderwidth-e})}var r=t._fullLayout,a="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var g=r.legend,x=r.showlegend&&w(t.calcdata,g),_=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+a).remove(),void h.autoMargin(t,"legend");var T=r._infolayer.selectAll("g.legend").data([0]);T.enter().append("g").attr({class:"legend","pointer-events":"all"});var E=r._topdefs.selectAll("#"+a).data([0]);E.enter().append("clipPath").attr("id",a).append("rect");var S=T.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(v.stroke,g.bordercolor),S.call(v.fill,g.bgcolor),S.style("stroke-width",g.borderwidth+"px");var L=T.selectAll("g.scrollbox").data([0]);L.enter().append("g").attr("class","scrollbox");var C=T.selectAll("rect.scrollbar").data([0]);C.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(v.fill,"#808BA4");var I=L.selectAll("g.groups").data(x);I.enter().append("g").attr("class","groups"),I.exit().remove();var D=I.selectAll("g.traces").data(f.identity);D.enter().append("g").attr("class","traces"),D.exit().remove(),D.call(M,t).style("opacity",function(t){var e=t[0].trace;return d.traceIs(e,"pie")?_.indexOf(t[0].label)!==-1?.5:1:"legendonly"===e.visible?.5:1}).each(function(){c.select(this).call(n,t).call(i,t)});var P=0!==T.enter().size();P&&(o(t,I,D),s(t));var z=r.width,O=r.height;o(t,I,D),g.height>O?l(t):s(t);var R=r._size,F=R.l+R.w*g.x,j=R.t+R.h*(1-g.y);k.isRightAnchor(g)?F-=g.width:k.isCenterAnchor(g)&&(F-=g.width/2),k.isBottomAnchor(g)?j-=g.height:k.isMiddleAnchor(g)&&(j-=g.height/2);var N=g.width,B=R.w;N>B?(F=R.l,N=B):(F+N>z&&(F=z-N),F<0&&(F=0),N=Math.min(z-F,g.width));var U=g.height,V=R.h;U>V?(j=R.t,U=V):(j+U>O&&(j=O-U),j<0&&(j=0),U=Math.min(O-j,g.height)),m.setTranslate(T,F,j);var H,q,G=U-b.scrollBarHeight-2*b.scrollBarMargin,Y=g.height-U;if(g.height<=U||t._context.staticPlot)S.attr({width:N-g.borderwidth,height:U-g.borderwidth,x:g.borderwidth/2,y:g.borderwidth/2}),m.setTranslate(L,0,0),E.select("rect").attr({width:N-2*g.borderwidth,height:U-2*g.borderwidth,x:g.borderwidth,y:g.borderwidth}),L.call(m.setClipUrl,a);else{H=b.scrollBarMargin,q=L.attr("data-scroll")||0,S.attr({width:N-2*g.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-g.borderwidth,x:g.borderwidth/2,y:g.borderwidth/2}),E.select("rect").attr({width:N-2*g.borderwidth+b.scrollBarWidth+b.scrollBarMargin,height:U-2*g.borderwidth,x:g.borderwidth,y:g.borderwidth-q}),L.call(m.setClipUrl,a),P&&e(H,q),T.on("wheel",null),T.on("wheel",function(){q=f.constrain(L.attr("data-scroll")-c.event.deltaY/G*Y,-Y,0),H=b.scrollBarMargin-q/Y*G,e(H,q),0!==q&&q!==-Y&&c.event.preventDefault()}),C.on(".drag",null),L.on(".drag",null);var X=c.behavior.drag().on("drag",function(){H=f.constrain(c.event.y-b.scrollBarHeight/2,b.scrollBarMargin,b.scrollBarMargin+G),q=-(H-b.scrollBarMargin)/G*Y,e(H,q)});C.call(X),L.call(X)}if(t._context.edits.legendPosition){var W,Z,J,K;T.classed("cursor-move",!0),p.init({element:T.node(),gd:t,prepFn:function(){var t=m.getTranslate(T);J=t.x,K=t.y},moveFn:function(t,e){var r=J+t,n=K+e;m.setTranslate(T,r,n),W=p.align(r,0,R.l,R.l+R.w,g.xanchor),Z=p.align(n,0,R.t+R.h,R.t,g.yanchor)},doneFn:function(e,n,i){if(e&&void 0!==W&&void 0!==Z)u.relayout(t,{"legend.x":W,"legend.y":Z});else{var a=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return i.clientX>=t.left&&i.clientX<=t.right&&i.clientY>=t.top&&i.clientY<=t.bottom});a.size()>0&&(1===n?T._clickTimeout=setTimeout(function(){y(a,t,n)},A):2===n&&(T._clickTimeout&&clearTimeout(T._clickTimeout),y(a,t,n)))}}})}}}},{"../../constants/alignment":708,"../../constants/interactions":713,"../../lib":735,"../../lib/svg_text_utils":757,"../../plotly":774,"../../plots/plots":838,"../../registry":853,"../color":611,"../dragelement":632,"../drawing":635,"./anchor_utils":661,"./constants":663,"./get_legend_data":666,"./handle_click":667,"./helpers":668,"./style":670,d3:121}],666:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))l.indexOf(t)===-1?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var a,o,s={},l=[],c=!1,u={},f=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],f=u.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var m={},v={};h&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),v.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(v.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(f,v)}var g=n.select(this).select("g.legendpoints"),y=g.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),h&&(s[0].mrc=3);var b=g.selectAll("g.pointtext").data(d?s:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,c,e)}function f(t){var e=t[0].trace,r=e.marker||{},a=r.line||{},o=n.select(this).select("g.legendpoints").selectAll("path.legendbar").data(i.traceIs(e,"bar")?[t]:[]);o.enter().append("path").classed("legendbar",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),o.exit().remove(),o.each(function(t){var e=n.select(this),i=t[0],o=(i.mlw+1||a.width+1)-1;e.style("stroke-width",o+"px").call(s.fill,i.mc||r.color),o&&e.call(s.stroke,i.mlc||a.color)})}function h(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendbox").data(i.traceIs(e,"box-violin")&&e.visible?[t]:[]) -;r.enter().append("path").classed("legendbox",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.each(function(){var t=e.line.width,r=n.select(this);r.style("stroke-width",t+"px").call(s.fill,e.fillcolor),t&&r.call(s.stroke,e.line.color)})}function d(t){var e=t[0].trace,r=n.select(this).select("g.legendpoints").selectAll("path.legendpie").data(i.traceIs(e,"pie")&&e.visible?[t]:[]);r.enter().append("path").classed("legendpie",!0).attr("d","M6,6H-6V-6H6Z").attr("transform","translate(20,0)"),r.exit().remove(),r.size()&&r.call(c,t[0],e)}t.each(function(t){var e=n.select(this),r=e.selectAll("g.layers").data([0]);r.enter().append("g").classed("layers",!0),r.style("opacity",t[0].trace.opacity),r.selectAll("g.legendfill").data([t]).enter().append("g").classed("legendfill",!0),r.selectAll("g.legendlines").data([t]).enter().append("g").classed("legendlines",!0);var i=r.selectAll("g.legendsymbols").data([t]);i.enter().append("g").classed("legendsymbols",!0),i.selectAll("g.legendpoints").data([t]).enter().append("g").classed("legendpoints",!0)}).each(f).each(h).each(d).each(r).each(u)}},{"../../lib":735,"../../registry":853,"../../traces/pie/style_one":1031,"../../traces/scatter/subtypes":1066,"../color":611,"../drawing":635,d3:121}],671:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=d.list(t,null,!0),u="on";if("zoom"===a){var h,p="in"===o?.5:2,m=(1+p)/2,v=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),o(g,r);u&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var y=i(s),b=[];return((c||p)&&!y||m)&&(b=["zoom2d","pan2d"]),(v||f)&&(b=["pan2d"]),a(l)&&(b.push("select2d"),b.push("lasso2d")),b.length&&n(b),!c&&!p||y||m||n(["zoomIn2d","zoomOut2d","autoScale2d","resetScale2d"]),c&&d?n(["toggleHover"]):p?n(["hoverClosestGl2d"]):c?n(["toggleSpikelines","hoverClosestCartesian","hoverCompareCartesian"]):d?n(["hoverClosestPie"]):v?n(["resetViewMapbox","toggleHover"]):f&&(n(["zoomInGeo","zoomOutGeo","resetGeo"]),n(["hoverClosestGeo"])),o(g,r)}function i(t){for(var e=l.list({_fullLayout:t},null,!0),r=!0,n=0;n0)){var p=i(e,r,l);f("x",p[0]),f("y",p[1]),a.noneOrAll(t,e,["x","y"]),f("xanchor"),f("yanchor"),a.coerceFont(f,"font",r.font);var m=f("bgcolor");f("activecolor",o.contrast(m,c.lightAmount,c.darkAmount)),f("bordercolor"),f("borderwidth")}}},{"../../lib":735,"../color":611,"./attributes":675,"./button_attributes":676,"./constants":677}],679:[function(t,e,r){"use strict";function n(t){for(var e=g.list(t,"x",!0),r=[],n=0;np&&(p=h)));return p>=d?[d,p]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sY&&n>X&&!t.shiftKey?p.getCursor(i/r,1-a/n):"move";m(e,o),G=o.split("-")[0]}function a(e){N=f.getFromId(t,r.xref),B=f.getFromId(t,r.yref),U=g.getDataToPixel(t,N),V=g.getDataToPixel(t,B,!0),H=g.getPixelToData(t,N),q=g.getPixelToData(t,B,!0);var a="shapes["+n+"]";"path"===r.type?(F=r.path,j=a+".path"):(v=U(r.x0),y=V(r.y0),b=U(r.x1),x=V(r.y1),_=a+".x0",w=a+".y0",M=a+".x1",T=a+".y1"),vX&&(d[L]=r[P]=q(c),d[C]=r[z]=q(u)),h-f>Y&&(d[I]=r[O]=H(f),d[D]=r[R]=H(h))}e.attr("d",o(t,r))}var d,v,y,b,x,_,w,M,T,k,A,E,S,L,C,I,D,P,z,O,R,F,j,N,B,U,V,H,q,G,Y=10,X=10,W={element:e.node(),gd:t,prepFn:a,doneFn:s},Z=W.element.getBoundingClientRect();p.init(W),e.node().onmousemove=i}function o(t,e){var r,n,i,a,o=e.type,l=f.getFromId(t,e.xref),c=f.getFromId(t,e.yref),u=t._fullLayout._size;if(l?(r=g.shapePositionToRange(l),n=function(t){return l._offset+l.r2p(r(t,!0))}):n=function(t){return u.l+u.w*t},c?(i=g.shapePositionToRange(c),a=function(t){return c._offset+c.r2p(i(t,!0))}):a=function(t){return u.t+u.h*(1-t)},"path"===o)return l&&"date"===l.type&&(n=g.decodeDate(n)),c&&"date"===c.type&&(a=g.decodeDate(a)),s(e.path,n,a);var h=n(e.x0),d=n(e.x1),p=a(e.y0),m=a(e.y1);if("line"===o)return"M"+h+","+p+"L"+d+","+m;if("rect"===o)return"M"+h+","+p+"H"+d+"V"+m+"H"+h+"Z";var v=(h+d)/2,y=(p+m)/2,b=Math.abs(v-h),x=Math.abs(y-p),_="A"+b+","+x,w=v+b+","+y;return"M"+w+_+" 0 1,1 "+v+","+(y-x)+_+" 0 0,1 "+w+"Z"}function s(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i],l=t.substr(1).replace(v.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),n++,n>s&&(t="X"),t});return n>s&&(l=l.replace(/[\s,]*X.*/,""),u.log("Ignoring extra params in segment "+t)),i+l})}function l(t,e,r){return t.replace(v.segmentRE,function(t){var n=0,i=t.charAt(0),a=v.paramIsX[i],o=v.paramIsY[i],s=v.numParams[i];return i+t.substr(1).replace(v.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var c=t("../../plotly"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../color"),d=t("../drawing"),p=t("../dragelement"),m=t("../../lib/setcursor"),v=t("./constants"),g=t("./helpers");e.exports={draw:n,drawOne:i}},{"../../lib":735,"../../lib/setcursor":753,"../../plotly":774,"../../plots/cartesian/axes":779,"../color":611,"../dragelement":632,"../drawing":635,"./constants":690,"./helpers":693}],693:[function(t,e,r){"use strict";r.rangeToShapePosition=function(t){return"log"===t.type?t.r2d:function(t){return t}},r.shapePositionToRange=function(t){return"log"===t.type?t.d2r:function(t){return t}},r.decodeDate=function(t){return function(e){return e.replace&&(e=e.replace("_"," ")),t(e)}},r.encodeDate=function(t){return function(e){return t(e).replace(" ","_")}},r.getDataToPixel=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.shapePositionToRange(e);i=function(t){return e._offset+e.r2p(o(t,!0))},"date"===e.type&&(i=r.decodeDate(i))}else i=n?function(t){return a.t+a.h*(1-t)}:function(t){return a.l+a.w*t};return i},r.getPixelToData=function(t,e,n){var i,a=t._fullLayout._size;if(e){var o=r.rangeToShapePosition(e);i=function(t){return o(e.p2r(t-e._offset))}}else i=n?function(t){return 1-(t-a.t)/a.h}:function(t){return(t-a.l)/a.w};return i}},{}],694:[function(t,e,r){"use strict";var n=t("./draw");e.exports={moduleType:"component",name:"shapes",layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),calcAutorange:t("./calc_autorange"),draw:n.draw,drawOne:n.drawOne}},{"./attributes":688,"./calc_autorange":689,"./defaults":691,"./draw":692}],695:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("./helpers");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,a,r,i)}if(s=s||{},l=l||{},!c("visible",!l.itemIsNotPlainObject))return e;c("layer"),c("opacity"),c("fillcolor"),c("line.color"),c("line.width"),c("line.dash");for(var u=t.path?"path":"rect",f=c("type",u),h=["x","y"],d=0;d<2;d++){var p=h[d],m={_fullLayout:r},v=i.coerceRef(t,e,m,p,"","paper");if("path"!==f){var g,y,b;"paper"!==v?(g=i.getFromId(m,v),b=o.rangeToShapePosition(g),y=o.shapePositionToRange(g)):y=b=n.identity;var x=p+"0",_=p+"1",w=t[x],M=t[_];t[x]=y(t[x],!0),t[_]=y(t[_],!0),i.coercePosition(e,m,c,v,x,.25),i.coercePosition(e,m,c,v,_,.75),e[x]=b(e[x]),e[_]=b(e[_]),t[x]=w,t[_]=M}}return"path"===f?c("path"):n.noneOrAll(t,e,["x0","x1","y0","y1"]),e}},{"../../lib":735,"../../plots/cartesian/axes":779,"./attributes":688,"./helpers":693}],696:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/pad_attributes"),a=t("../../lib/extend").extendDeepAll,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/animation_attributes"),l=t("./constants"),c={_isLinkedToArray:"step",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}};e.exports=o({_isLinkedToArray:"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,{},{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:l.gripBgActiveColor},bgcolor:{valType:"color",dflt:l.railBgColor},bordercolor:{valType:"color",dflt:l.railBorderColor},borderwidth:{valType:"number",min:0,dflt:l.railBorderWidth},ticklen:{valType:"number",min:0,dflt:l.tickLength},tickcolor:{valType:"color",dflt:l.tickColor},tickwidth:{valType:"number",min:0,dflt:1},minorticklen:{valType:"number",min:0,dflt:l.minorTickLength}},"arraydraw","from-root")},{"../../lib/extend":724,"../../plot_api/edit_types":763,"../../plots/animation_attributes":775,"../../plots/font_attributes":803,"../../plots/pad_attributes":837,"./constants":697}],697:[function(t,e,r){"use strict";e.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}},{}],698:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),a.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen"))}function i(t,e){function r(t,e){return a.coerce(n,i,u,t,e)}for(var n,i,o=t.steps||[],s=e.steps=[],l=0;l=r.steps.length&&(r.active=0),e.call(s,r).call(x,r).call(u,r).call(p,r).call(b,t,r).call(l,t,r),k.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(v,r,r.active/(r.steps.length-1),!1),e.call(s,r)}function s(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-S.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=S.currentValueInset,i="left"}a.enter().append("text").classed(S.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(k.font,e.currentvalue.font).text(o).call(A.convertToTspans,e.gd);var s=A.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*L;return A.positionText(a,n,l),a}}function l(t,e,r){var n=t.selectAll("rect."+S.gripRectClass).data([0]);n.enter().append("rect").classed(S.gripRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:S.gripWidth,height:S.gripHeight,rx:S.gripRadius,ry:S.gripRadius}).call(T.stroke,r.bordercolor).call(T.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function c(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(S.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(k.font,r.font).text(e.step.label).call(A.convertToTspans,r.gd),n}function u(t,e){var r=t.selectAll("g."+S.labelsClass).data([0]);r.enter().append("g").classed(S.labelsClass,!0);var n=r.selectAll("g."+S.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(S.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=w.select(this);r.call(c,t,e),k.setTranslate(r,g(e,t.fraction),S.tickOffset+e.ticklen+e.font.size*L+S.labelOffset+e.currentValueTotalHeight)})}function f(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&h(t,e,r,a,!0,i)}function h(t,e,r,n,i,a){var o=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(v,r,r.active/(r.steps.length-1),a),e.call(s,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:i,previousActive:o}),l&&l.method&&i&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=i,e._nextMethod.doTransition=a):(e._nextMethod={step:l,doCallback:i,doTransition:a},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&M.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function d(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=w.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+S.gripRectClass);w.event.stopPropagation(),w.event.preventDefault(),o.call(T.fill,t.activebgcolor);var s=y(t,w.mouse(i)[0]);f(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=y(t,w.mouse(i)[0]);f(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(T.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function p(t,e){var r=t.selectAll("rect."+S.tickRectClass).data(e.steps);r.enter().append("rect").classed(S.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=w.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(T.fill,e.tickcolor),k.setTranslate(i,g(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?S.tickOffset:S.minorTickOffset)+e.currentValueTotalHeight)})}function m(t){t.labelSteps=[];for(var e=t.steps.length,r=0;r0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*S.gripWidth)+","+e.currentValueTotalHeight+")")}}function g(t,e){return t.inputAreaStart+S.stepInset+(t.inputAreaLength-2*S.stepInset)*Math.min(1,Math.max(0,e))}function y(t,e){return Math.min(1,Math.max(0,(e-S.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*S.stepInset-2*t.inputAreaStart)))}function b(t,e,r){var n=t.selectAll("rect."+S.railTouchRectClass).data([0]);n.enter().append("rect").classed(S.railTouchRectClass,!0).call(d,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,S.tickOffset+r.ticklen+r.labelHeight)}).call(T.fill,r.bgcolor).attr("opacity",0),k.setTranslate(n,0,r.currentValueTotalHeight)}function x(t,e){var r=t.selectAll("rect."+S.railRectClass).data([0]);r.enter().append("rect").classed(S.railRectClass,!0);var n=e.inputAreaLength-2*S.railInset;r.attr({width:n,height:S.railWidth,rx:S.railRadius,ry:S.railRadius,"shape-rendering":"crispEdges"}).call(T.stroke,e.bordercolor).call(T.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),k.setTranslate(r,S.railInset,.5*(e.inputAreaWidth-S.railWidth)+e.currentValueTotalHeight)}function _(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n0?[0]:[]);if(s.enter().append("g").classed(S.containerClassName,!0).style("cursor","ew-resize"),s.exit().remove(),s.exit().size()&&_(t),0!==r.length){var l=s.selectAll("g."+S.groupClassName).data(r,i);l.enter().append("g").classed(S.groupClassName,!0),l.exit().each(function(e){w.select(this).remove(),e._commandObserver.remove(),delete e._commandObserver,M.autoMargin(t,S.autoMarginIdRoot+e._index)});for(var c=0;c0||h<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[x.side];e.attr("transform","translate("+m+")")}}}var m,v=r.propContainer,g=r.propName,y=r.traceIndex,b=r.dfltName,x=r.avoid||{},_=r.attributes,w=r.transform,M=r.containerGroup,T=t._fullLayout,k=v.titlefont.family,A=v.titlefont.size,E=v.titlefont.color,S=1,L=!1,C=v.title.trim();"title"===g?m="titleText":g.indexOf("axis")!==-1?m="axisTitleText":g.indexOf(!0)&&(m="colorbarTitleText");var I=t._context.edits[m];""===C&&(S=0),C.match(/Click to enter .+ title/)&&(S=.2,L=!0,I||(C=""));var D=C||I;M||(M=T._infolayer.selectAll(".g-"+e).data([0]),M.enter().append("g").classed("g-"+e,!0));var P=M.selectAll("text").data(D?[0]:[]);if(P.enter().append("text"),P.text(C).attr("class",e),P.exit().remove(),D){P.call(h);var z="Click to enter "+b+" title";I&&(C?P.on(".opacity",null):function(){S=0,L=!0,C=z,P.text(C).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})}(),P.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==y?a.restyle(t,g,e,y):a.relayout(t,g,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(h)}).on("input",function(t){this.text(t||" ").call(u.positionText,_.x,_.y)})),P.classed("js-placeholder",L)}}},{"../../constants/interactions":713,"../../lib":735,"../../lib/svg_text_utils":757,"../../plotly":774,"../../plots/plots":838,"../color":611,"../drawing":635,d3:121,"fast-isnumeric":131}],702:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes"),l={_isLinkedToArray:"button",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",dflt:""},execute:{valType:"boolean",dflt:!0}};e.exports=o({_isLinkedToArray:"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:l,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,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":724,"../../plot_api/edit_types":763,"../../plots/font_attributes":803,"../../plots/pad_attributes":837,"../color/attributes":610}],703:[function(t,e,r){"use strict";e.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:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],704:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return a.coerce(t,e,s,r,n)}n("visible",i(t,e).length>0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),a.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),a.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}function i(t,e){function r(t,e){return a.coerce(n,i,u,t,e)}for(var n,i,o=t.buttons||[],s=e.buttons=[],l=0;l0?[0]:[]);if(a.enter().append("g").classed(L.containerClassName,!0).style("cursor","pointer"),a.exit().remove(),a.exit().size()&&_(t),0!==r.length){var u=a.selectAll("g."+L.headerGroupClassName).data(r,i);u.enter().append("g").classed(L.headerGroupClassName,!0);var f=a.selectAll("g."+L.dropdownButtonGroupClassName).data([0]);f.enter().append("g").classed(L.dropdownButtonGroupClassName,!0).style("pointer-events","all");for(var h=0;hM,A=n.barLength+2*n.barPad,E=n.barWidth+2*n.barPad,S=p,L=v+g;L+E>c&&(L=c-E);var C=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);C.exit().on(".drag",null).remove(),C.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=C.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:L,width:A,height:E}),this._hbarXMin=S+A/2,this._hbarTranslateMax=M-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var I=g>T,D=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,z=p+m,O=v;z+D>l&&(z=l-D);var R=this.container.selectAll("rect.scrollbar-vertical").data(I?[0]:[]);R.exit().on(".drag",null).remove(),R.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),I?(this.vbar=R.attr({rx:n.barRadius,ry:n.barRadius,x:z,y:O,width:D,height:P}),this._vbarYMin=O+P/2,this._vbarTranslateMax=T-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,j=u-.5,N=I?f+D+.5:f+.5,B=h-.5,U=k?d+E+.5:d+.5,V=s._topdefs.selectAll("#"+F).data(k||I?[0]:[]);if(V.exit().remove(),V.enter().append("clipPath").attr("id",F).append("rect"),k||I?(this._clipRect=V.select("rect").attr({x:Math.floor(j),y:Math.floor(B),width:Math.ceil(N)-Math.floor(j),height:Math.ceil(U)-Math.floor(B)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:v,width:m,height:g})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||I){var H=i.behavior.drag().on("dragstart",function(){i.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 q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),I&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":735,"../color":611,"../drawing":635,d3:121}],708:[function(t,e,r){"use strict";e.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},LINE_SPACING:1.3,MID_SHIFT:.35}},{}],709:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],710:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,i={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},a={},o=Object.keys(i),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],716:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],717:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.31.2",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":602,"./components/annotations3d":607,"./components/fx":652,"./components/images":660,"./components/legend":669,"./components/rangeselector":681,"./components/rangeslider":687,"./components/shapes":694,"./components/sliders":700,"./components/updatemenus":706,"./fonts/mathjax_config":718,"./lib/queue":748,"./plot_api/plot_schema":768,"./plot_api/register":769,"./plot_api/set_plot_config":770,"./plot_api/to_image":772,"./plot_api/validate":773,"./plotly":774,"./snapshot":858,"./snapshot/download":855,"./traces/scatter":1056,d3:121,"es6-promise":128}],718:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],719:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM;e.exports=function(t){return"string"==typeof t&&(t=t.replace(/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g,"")),n(t)?Number(t):i}},{"../constants/numerical":714,"fast-isnumeric":131}],720:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),n.values.indexOf(t)===-1?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):e.set(+t)}},string:{coerceFunction:function(t,e,r,n){if("string"!=typeof t){var i="number"==typeof t;n.strict!==!0&&i?e.set(String(t)):e.set(r)}else n.noBlank&&!t?e.set(r):e.set(t)}},color:{coerceFunction:function(t,e,r){i(t).isValid()?e.set(t):e.set(r)}},colorscale:{coerceFunction:function(t,e,r){e.set(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){if("string"==typeof t&&l(r).test(t))return void e.set(t);e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"!=typeof t)return void e.set(r);if((n.extras||[]).indexOf(t)!==-1)return void e.set(t);for(var i=t.split("+"),a=0;a0&&(o=o.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+o}return n}function l(t){return t.formatDate("yyyy")}function c(t){return t.formatDate("M yyyy")}function u(t){return t.formatDate("M d")}function f(t){return t.formatDate("M d, yyyy")}var h=t("d3"),d=t("fast-isnumeric"),p=t("./loggers").error,m=t("./mod"),v=t("../constants/numerical"),g=v.BADNUM,y=v.ONEDAY,b=v.ONEHOUR,x=v.ONEMIN,_=v.ONESEC,w=v.EPOCHJD,M=t("../registry"),T=h.time.format.utc,k=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?M.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:M.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?M.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var A,E;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return t=Number(t)-t.getTimezoneOffset()*x,t>=A&&t<=E?t:g;if("string"!=typeof t&&"number"!=typeof t)return g;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m:/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m);if(!s)return g;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),d=Number(s[11]||0);if(i){if(2===l.length)return g;l=Number(l);var p;try{var m=M.getComponentMethod("calendars","getCal")(e);if(o){var v="i"===c.charAt(c.length-1);c=parseInt(c,10),p=m.newDate(l,m.toMonthIndex(l,c,v),u)}else p=m.newDate(l,Number(c),u)}catch(t){return g}return p?(p.toJD()-w)*y+f*b+h*x+d*_:g}l=2===l.length?(Number(l)+2e3-k)%100+k:Number(l),c-=1;var T=new Date(Date.UTC(2e3,c,u,f,h));return T.setUTCFullYear(l),T.getUTCMonth()!==c?g:T.getUTCDate()!==u?g:T.getTime()+d*_},A=r.MIN_MS=r.dateTime2ms("-9999"),E=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==g};var S=90*y,L=3*b,C=5*x;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=A&&t<=E))return g;e||(e=0);var i,o,s,l,c,u,f=Math.floor(10*m(t+.05,1)),h=Math.round(t-f/10);if(n(r)){var d=Math.floor(h/y)+w,p=Math.floor(m(t,y));try{i=M.getComponentMethod("calendars","getCal")(r).fromJD(d).formatDate("yyyy-mm-dd")}catch(t){i=T("G%Y-%m-%d")(new Date(h))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=A+y&&t<=E-y))return g;var e=Math.floor(10*m(t+.05,1)),r=new Date(Math.round(t-e/10));return a(h.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return p("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return p("unrecognized date",t),e;return t};var I=/%\d?f/g,D=[59,59.9,59.99,59.999,59.9999],P=T("%Y"),z=T("%b %Y"),O=T("%b %-d"),R=T("%b %-d, %Y");r.formatDate=function(t,e,r,i){var a,h;if(i=n(i)&&i,e)return o(e,t,i);if(i)try{var d=Math.floor((t+.05)/y)+w,p=M.getComponentMethod("calendars","getCal")(i).fromJD(d);"y"===r?h=l(p):"m"===r?h=c(p):"d"===r?(a=l(p),h=u(p)):(a=f(p),h=s(t,r))}catch(t){return"Invalid"}else{var m=new Date(Math.floor(t+.05));"y"===r?h=P(m):"m"===r?h=z(m):"d"===r?(a=P(m),h=O(m)):(a=R(m),h=s(t,r))}return h+(a?"\n"+a:"")};var F=3*y;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=m(t,y);if(t=Math.round(t-i),r)try{var a=Math.round(t/y)+w,o=M.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-w)*y+i}catch(e){p("invalid ms "+t+" in calendar "+r)}var l=new Date(t+F);return l.setUTCMonth(l.getUTCMonth()+e)+i-F},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,c=n(e)&&M.getComponentMethod("calendars","getCal")(e),u=0;u0&&(i.push(a),a=[])}return a.length>0&&i.push(a),i},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function i(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}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,f=a-e,h=l-o,d=c-s,p=u*u+f*f,m=h*h+d*d,v=Math.min(i(u,f,p,o-t,s-e),i(u,f,p,l-t,c-e),i(h,d,m,t-o,e-s),i(h,d,m,r-o,a-s));return Math.sqrt(v)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),f=t.getPointAtLength(a(r,e)),h=(4*f.x+i.x+c.x)/6,d=(4*f.y+i.y+c.y)/6,p={x:h,y:d,theta:u};return o[r]=p,p},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,f=t.getTotalLength(),h=f,d=n(u);d;){if((u+=d+r)>h)return;d=n(u)}for(d=n(h);d;){if(h-=d+r,u>h)return;d=n(h)}return{min:u,max:h,len:h-u,total:f,isClosed:0===u&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){n=n||{};for(var i,a,o,s=n.pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":741}],730:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],731:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(s(t))return f;var e=l(t);return e.length?e:f}function a(t){return s(t)?t:h}function o(t,e,r){var o,s,u,d,p,m=t.color,v=Array.isArray(m),g=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?c.makeColorScaleFunc(c.extractScale(t.colorscale,t.cmin,t.cmax)):i,s=v?function(t,e){return void 0===t[e]?f:l(o(t[e]))}:i,u=g?function(t,e){return void 0===t[e]?h:a(t[e])}:a,v||g)for(var b=0;b",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}function a(t){return t.replace(/\<.*\>/g,"")}function o(t){for(var e=c.entityToUnicode,r=0;(r=t.indexOf("&",r))>=0;){var n=t.indexOf(";",r);if(no?s:i(t)?Number(t):s):s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||u!==1/0&&u>=Math.pow(2,r)?t(e,r,n):l},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.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,c=new Array(l),u=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]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n1?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};var b=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(/%{([^\s%{}]*)}/g,function(t,n){return b.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})}},{"../constants/numerical":714,"./clean_number":719,"./coerce":720,"./dates":721,"./ensure_array":722,"./extend":724,"./filter_unique":725,"./filter_visible":726,"./geometry2d":729,"./get_graph_div":730,"./identity":734,"./is_array":736,"./is_plain_object":737,"./keyed_container":738,"./loggers":739,"./matrix":740,"./mod":741,"./nested_property":742,"./noop":743,"./notifier":744,"./push_unique":747,"./regex":749,"./relative_attr":750,"./relink_private":751,"./search":752,"./stats":755,"./throttle":758,"./to_log_range":759,d3:121,"fast-isnumeric":131}],736:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],737:[function(t,e,r){"use strict";e.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)===Object.prototype}},{}],738:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,d(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}function u(t){return void 0===t||null===t||"object"==typeof t&&(d(t)?!t.length:!Object.keys(t).length)}function f(t,e,r){return{set:function(){throw"bad container"},get:function(){},astr:e,parts:r,obj:t}}var h=t("fast-isnumeric"),d=t("./is_array"),p=t("./is_plain_object"),m=t("../plot_api/container_array_match");e.exports=function(t,e){if(h(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,l=e.split(".");s/g),s=0;so||n===i||nl)&&(!e||!u(t))}function r(t,e){var r=t[0],c=t[1];if(r===i||ro||c===i||cl)return!1;var u,f,h,d,p,m=n.length,v=n[0][0],g=n[0][1],y=0;for(u=1;uMath.max(f,v)||c>Math.max(h,g)))if(cu||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":714,"./matrix":740}],747:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ra.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--)},o.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},o.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},o.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)return void t.framework.undo();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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(u=p>=0?r?n:i:r?o:a,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&l.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":131}],756:[function(t,e,r){"use strict";function n(t){var e=i(t);return e.length?e:[0,0,0,1]}var i=t("color-rgba");e.exports=n},{"color-rgba":94}],757:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t){return t.replace(v,"\\lt ").replace(g,"\\gt ")}function a(t,e,r){var n="math-output-"+h.randstr([],64),a=f.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(i(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,a.node()],function(){var e=f.select("body").select("#MathJax_SVG_glyphs");if(a.select(".MathJax_SVG").empty()||!a.select("svg").node())h.log("There was an error in the tex syntax.",t),r();else{var n=a.select("svg").node().getBoundingClientRect();r(a.select(".MathJax_SVG"),e,n)}a.remove()})}function o(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function s(t,e){if(!t)return"";for(var r=0;r1)for(var i=1;i.",e);var r=c.pop();t!==r.type&&h.log("Start tag <"+r.type+"> doesnt match end tag <"+t+">. Pretending it did match.",e),a=c[c.length-1].node}(T);else{var O=M[4],R={type:T},F=o(O,L);if(F?(F=F.replace(P,"$1 fill:"),z&&(F+=";"+z)):z&&(F=z),F&&(R.style=F),"a"===T){s=!0;var j=o(O,C);if(j){var N=document.createElement("a");N.href=j,w.indexOf(N.protocol)!==-1&&(R.href=encodeURI(j),R.target=o(O,I)||"_blank",R.popup=o(O,D))}}n(R)}}return s}function u(t,e,r){var n,i,a,o=r.horizontalAlign,s=r.verticalAlign||"top",l=t.node().getBoundingClientRect(),c=e.node().getBoundingClientRect();return i="bottom"===s?function(){return l.bottom-n.height}:"middle"===s?function(){return l.top+(l.height-n.height)/2}:function(){return l.top},a="right"===o?function(){return l.right-n.width}:"center"===o?function(){return l.left+(l.width-n.width)/2}:function(){return l.left},function(){return n=this.node().getBoundingClientRect(),this.style({top:i()-c.top+"px",left:a()-c.left+"px","z-index":1e3}),this}}var f=t("d3"),h=t("../lib"),d=t("../constants/xmlns_namespaces"),p=t("../constants/string_mappings"),m=t("../constants/alignment").LINE_SPACING;r.convertToTspans=function(t,e,i){function o(){u.empty()||(h=t.attr("class")+"-math",u.select("svg."+h).remove()),t.text("").style("white-space","pre"),c(t.node(),s)&&t.style("pointer-events","all"),r.positionText(t),i&&i.call(t)}var s=t.text(),l=!t.attr("data-notex")&&"undefined"!=typeof MathJax&&s.match(/([^$]*)([$]+[^$]*[$]+)([^$]*)/),u=f.select(t.node().parentNode);if(!u.empty()){var h=t.attr("class")?t.attr("class").split(" ")[0]:"text";return h+="-math",u.selectAll("svg."+h).remove(),u.selectAll("g."+h+"-group").remove(),t.style("display",null).attr({"data-unformatted":s,"data-math":"N"}),l?(e&&e._promises||[]).push(new Promise(function(e){t.style("display","none");var r=parseInt(t.node().style.fontSize,10),c={fontSize:r};a(l[2],c,function(a,l,c){u.selectAll("svg."+h).remove(),u.selectAll("g."+h+"-group").remove();var f=a&&a.select("svg");if(!f||!f.node())return o(),void e();var d=u.append("g").classed(h+"-group",!0).attr({"pointer-events":"none","data-unformatted":s,"data-math":"Y"});d.node().appendChild(f.node()),l&&l.node()&&f.node().insertBefore(l.node().cloneNode(!0),f.node().firstChild),f.attr({class:h,height:c.height,preserveAspectRatio:"xMinYMin meet"}).style({overflow:"visible","pointer-events":"none"});var p=t.node().style.fill||"black";f.select("g").attr({fill:p,stroke:p});var m=n(f,"width"),v=n(f,"height"),g=+t.attr("x")-m*{start:0,middle:.5,end:1}[t.attr("text-anchor")||"start"],y=r||n(t,"height"),b=-y/4;"y"===h[0]?(d.attr({transform:"rotate("+[-90,+t.attr("x"),+t.attr("y")]+") translate("+[-m/2,b-v/2]+")"}),f.attr({x:+t.attr("x"),y:+t.attr("y")})):"l"===h[0]?f.attr({x:t.attr("x"),y:b-v/2}):"a"===h[0]?f.attr({x:0,y:b}):f.attr({x:g,y:+t.attr("y")+b-v/2}),i&&i.call(t,d),e(d)})})):o(),t}};var v=/(<|<|<)/g,g=/(>|>|>)/g,y={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},b={sub:"0.3em",sup:"-0.6em"},x={sub:"-0.21em",sup:"0.42em"},_="\u200b",w=["http:","https:","mailto:","",void 0,":"],M=new RegExp("]*)?/?>","g"),T=Object.keys(p.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:p.entityToUnicode[t]}}),k=/(\r\n?|\n)/g,A=/(<[^<>]*>)/,E=/<(\/?)([^ >]*)(\s+(.*))?>/i,S=//i,L=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,C=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,I=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,D=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,P=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(M," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=f.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){i(),t.style({opacity:0});var e,r=l.attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}function i(){var r=f.select(a),i=r.select(".svg-container"),o=i.append("div"),l=t.node().style,c=parseFloat(l.fontSize||12);o.classed("plugin-editable editable",!0).style({position:"absolute","font-family":l.fontFamily||"Arial","font-size":c,color:e.fill||l.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-c/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(u(t,i,e)).on("blur",function(){a._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=f.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&f.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;f.select(this).transition().duration(0).remove(),f.select(document).on("mouseup",null),s.edit.call(t,n)}).on("focus",function(){var t=this;a._editing=!0,f.select(document).on("mouseup",function(){if(f.event.target===t)return!1;document.activeElement===o.node()&&o.node().blur()})}).on("keyup",function(){27===f.event.which?(a._editing=!1,t.style({opacity:1}),f.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),s.cancel.call(t,this.textContent)):(s.input.call(t,this.textContent),f.select(this).call(u(t,i,e)))}).on("keydown",function(){13===f.event.which&&this.blur()}).call(n)}var a=e.gd,o=e.delegate,s=f.dispatch("edit","input","cancel"),l=o||t;if(t.style({"pointer-events":o?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():l.on("click",r),f.rebind(t,s,"on")}},{"../constants/alignment":708,"../constants/string_mappings":715,"../constants/xmlns_namespaces":716,"../lib":735,d3:121}],758:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e)return void a();o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],759:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.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}},{"fast-isnumeric":131}],760:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){ -return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":805,"topojson-client":544}],761:[function(t,e,r){"use strict";function n(t,e){for(var r=new Float32Array(e),n=0;n0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axes"),d=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;t||(t={}),t.xaxis1&&(t.xaxis||(t.xaxis=t.xaxis1),delete t.xaxis1),t.yaxis1&&(t.yaxis||(t.yaxis=t.yaxis1),delete t.yaxis1);var i=h.list({_fullLayout:t});for(e=0;e3?(v.x=1.02,v.xanchor="left"):v.x<-2&&(v.x=-.02,v.xanchor="right"),v.y>3?(v.y=1.02,v.yanchor="bottom"):v.y<-2&&(v.y=-.02,v.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),t.scene1&&(t.scene||(t.scene=t.scene1),delete t.scene1);var g=f.getSubplotIds(t,"gl3d");for(e=0;e1&&o.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 o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(v,g),d(t),!0)}var b,x,_,w,M,T,k,A=Object.keys(r).map(Number).sort(s),E=e.get(),S=E||[],L=n(g,f).get(),C=[],I=-1,D=S.length;for(b=0;bS.length-(k?0:1))o.warn("index out of range",f,_);else if(void 0!==T)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(T)?C.push(_):k?("add"===T&&(T={}),S.splice(_,0,T),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,T),I===-1&&(I=_);else for(x=0;x=0;b--)S.splice(C[b],1),L&&L.splice(C[b],1);if(S.length?E||e.set(S):e.set(null),m)return!1;if(h(v,g),p!==a){var P;if(I===-1)P=A;else{for(D=Math.max(S.length,D),P=[],b=0;b=I);b++)P.push(_);for(b=I;b=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 c(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]),l(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&l(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function u(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&&lY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];X?(Z<=0&&J<=0&&r(z+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(z+".range[0]",Math.log(Z)/Math.LN10),r(z+".range[1]",Math.log(J)/Math.LN10)):(r(z+".range[0]",Math.pow(10,Z)),r(z+".range[1]",Math.pow(10,J)))}else r(z+".autorange",!0);k.getComponentMethod("annotations","convertCoords")(t,B,L,r),k.getComponentMethod("images","convertCoords")(t,B,L,r)}else r(z+".autorange",!0),r(z+".range",null);w.nestedProperty(c,z+"._inputRange").set(null)}else if(D.match(N.AX_NAME_PATTERN)){var K=w.nestedProperty(c,T).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),k.getComponentMethod("annotations","convertCoords")(t,K,Q,r),k.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=O.containerArrayMatch(T);if($){a=$.array,o=$.index;var tt=$.property,et=w.nestedProperty(l,a),rt=(et||[])[o]||{},nt=rt,it=V||{editType:"calc"},at=it.editType.indexOf("calcIfAutorange")!==-1;""===o?(at?y.calc=!0:j.update(y,it),at=!1):""===tt&&(nt=L,O.isAddVal(L)?x[T]=null:O.isRemoveVal(L)?(x[T]=rt,nt=rt):w.warn("unrecognized full object value",e)),at&&(n(nt,"x")||n(nt,"y"))?y.calc=!0:j.update(y,it),h[a]||(h[a]={});var ot=h[a][o];ot||(ot=h[a][o]={}),ot[tt]=L,delete e[T]}else"reverse"===D?(F.range?F.range.reverse():(r(z+".autorange",!0),F.range=[1,0]),B.autorange?y.calc=!0:y.plot=!0):((!c._has("gl2d")||"dragmode"!==T||"lasso"!==L&&"select"!==L||"lasso"===U||"select"===U)&&V?j.update(y,V):y.calc=!0,S.set(L))}}for(a in h){O.applyContainerArrayChanges(t,w.nestedProperty(l,a),h[a],y)||(y.plot=!0)}var st=c._axisConstraintGroups;for(g in M)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=w.getGraphDiv(t),!w.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]),r=E.supplyAnimationDefaults(r);var s=r.transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(){t.emit("plotly_animated"),window.cancelAnimationFrame(o._animationRaf),o._animationRaf=null}function f(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,E.transition(t,e.frame.data,e.frame.layout,R.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 u()}function h(){t.emit("plotly_animating"),o._lastFrameAt=-(1/0),o._timeToNext=0,o._runningTransitions=0,o._currentFrame=null;var e=function(){o._animationRaf=window.requestAnimationFrame(e),Date.now()-o._lastFrameAt>o._timeToNext&&f()};e()}function d(t){return Array.isArray(s)?v>=s.length?t.transitionOpts=s[v]:t.transitionOpts=s[0]:t.transitionOpts=s,v++,t}var p,m,v=0,g=[],y=void 0===e||null===e,b=Array.isArray(e);if(y||b||!w.isPlainObject(e)){if(y||["string","number"].indexOf(typeof e)!==-1)for(p=0;p0&&MM)&&T.push(m);g=T}}g.length>0?function(e){if(0!==e.length){for(var s=0;s=0;i--)if(w.isPlainObject(e[i])){var h=(c[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&c[h]&&(n++,w.warn('addFrames: overwriting frame "'+c[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&w.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:E.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if(a=f[i].frame,"number"==typeof a.name&&w.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=E.modifyFrames,l=E.modifyFrames,c=[t,o],u=[t,a];return T&&T.add(t,s,c,l,u),E.modifyFrames(t,a)},_.purge=function(t){t=w.getGraphDiv(t);var e=t._fullLayout||{},r=t._fullData||[];return E.cleanPlot([],{},r,e),E.purge(t),M.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":611,"../components/drawing":635,"../components/errorbars":641,"../constants/xmlns_namespaces":716,"../lib":735,"../lib/events":723,"../lib/queue":748,"../lib/svg_text_utils":757,"../plotly":774,"../plots/cartesian/axis_ids":782,"../plots/cartesian/constants":784,"../plots/cartesian/constraints":786,"../plots/cartesian/graph_interact":788,"../plots/plots":838,"../plots/polar":841,"../registry":853,"./edit_types":763,"./helpers":764,"./manage_arrays":765,"./plot_schema":768,"./subroutines":771,d3:121,"fast-isnumeric":131,"has-hover":294}],767:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:!1,globalTransforms:[]}},{}],768:[function(t,e,r){"use strict";function n(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t.items.length)return!1;t=t.items[i]}}return t}function a(t){return t===Math.round(t)&&t>=0}function o(t){var e,r;"area"===t?(e={attributes:w},r={}):(e=v.modules[t]._module,r=e.basePlotModule);var n={};n.type=null,A(n,y),A(n,e.attributes),r.attributes&&A(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:u(n)};if(e.layoutAttributes){var a={};A(a,e.layoutAttributes),i.layoutAttributes=u(a)}return i}function s(){var t,e,r={};A(r,b);for(t in v.subplotsRegistry)if(e=v.subplotsRegistry[t],e.layoutAttributes)if("cartesian"===e.name)p(r,e,"xaxis"),p(r,e,"yaxis");else{var n="subplot"===e.attr?e.name:e.attr;p(r,e,n)}r=d(r);for(t in v.componentsRegistry){e=v.componentsRegistry[t];var i=e.schema;if(i&&(i.subplots||i.layout)){var a=i.subplots;if(a&&a.xaxis&&!a.yaxis)for(var o in a.xaxis)delete r.yaxis[o]}else e.layoutAttributes&&m(r,e.layoutAttributes,e.name)}return{layoutAttributes:u(r)}}function l(t){var e=v.transformsRegistry[t],r=A({},e.attributes);return Object.keys(v.componentsRegistry).forEach(function(e){var n=v.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){m(r,n.schema.transforms[t][e],e)})}),{attributes:u(r)}}function c(){var t={frames:g.extendDeepAll({},x)};return u(t),t.frames}function u(t){return f(t),h(t),t}function f(t){function e(t){return{valType:"string",editType:"none"}}function n(t,n,i){r.isValObject(t)?"data_array"===t.valType?(t.role="data",i[n+"src"]=e(n)):t.arrayOk===!0&&(i[n+"src"]=e(n)):g.isPlainObject(t)&&(t.role="object")}r.crawl(t,n)}function h(t){function e(t,e,r){if(t){var n=t[S];n&&(delete t[S],r[e]={items:{}},r[e].items[n]=t,r[e].role="object")}}r.crawl(t,e)}function d(t){return k(t,{radialaxis:M.radialaxis,angularaxis:M.angularaxis}),k(t,M.layout),t}function p(t,e,r){var n=g.nestedProperty(t,r),i=A({},e.layoutAttributes);i[E]=!0,n.set(i)}function m(t,e,r){var n=g.nestedProperty(t,r);n.set(A(n.get()||{},e))}var v=t("../registry"),g=t("../lib"),y=t("../plots/attributes"),b=t("../plots/layout_attributes"),x=t("../plots/frame_attributes"),_=t("../plots/animation_attributes"),w=t("../plots/polar/area_attributes"),M=t("../plots/polar/axis_attributes"),T=t("./edit_types"),k=g.extendFlat,A=g.extendDeepAll,E="_isSubplotObj",S="_isLinkedToArray",L=[E,S,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=E,r.IS_LINKED_TO_ARRAY=S,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=L,r.get=function(){var t={};v.allTypes.concat("area").forEach(function(e){t[e]=o(e)});var e={};return Object.keys(v.transformsRegistry).forEach(function(t){e[t]=l(t)}),{defs:{valObjects:g.valObjectMeta,metaKeys:L.concat(["description","role","editType","impliedEdits"]),editType:{traces:T.traces,layout:T.layout},impliedEdits:{}},traces:t,layout:s(),transforms:e,frames:c(),animation:u(_)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(L.indexOf(n)===-1){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||g.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,o,s){if(a=a.slice(0,s).concat([r]),e&&("data_array"===e.valType||e.arrayOk===!0)&&!("colorbar"===a[s-1]&&("ticktext"===r||"tickvals"===r))){var l=n(a),c=g.nestedProperty(t,l).get();Array.isArray(c)&&i.push(l)}}function n(t){return t.join(".")}var i=[],a=[];if(r.crawl(y,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var o=t.transforms,s=0;s=t.transforms.length)return!1;r=(v.transformsRegistry[t.transforms[l].type]||{}).attributes,n=r&&r[e[2]],s=3}else if("area"===t.type)n=w[o];else{var c=t._module;if(c||(c=(v.modules[t.type||y.type.dflt]||{})._module),!c)return!1;if(r=c.attributes,!(n=r&&r[o])){var u=c.basePlotModule;u&&u.attributes&&(n=u.attributes[o])}n||(n=y[o])}return i(n,e,s)},r.getLayoutValObject=function(t,e){return i(n(t,e[0]),e,1)}},{"../lib":735,"../plots/animation_attributes":775,"../plots/attributes":777,"../plots/frame_attributes":804,"../plots/layout_attributes":829,"../plots/polar/area_attributes":839,"../plots/polar/axis_attributes":840,"../registry":853,"./edit_types":763}],769:[function(t,e,r){"use strict";function n(t){o.register(t,t.name,t.categories,t.meta),o.subplotsRegistry[t.basePlotModule.name]||o.registerSubplot(t.basePlotModule)}function i(t){if("string"!=typeof t.name)throw new Error("Transform module *name* must be a string.");var e="Transform module "+t.name,r="function"==typeof t.transform,n="function"==typeof t.calcTransform;if(!r&&!n)throw new Error(e+" is missing a *transform* or *calcTransform* method.");r&&n&&s.log([e+" has both a *transform* and *calcTransform* methods.","Please note that all *transform* methods are executed","before all *calcTransform* methods."].join(" ")),s.isPlainObject(t.attributes)||s.log(e+" registered without an *attributes* object."),"function"!=typeof t.supplyDefaults&&s.log(e+" registered without a *supplyDefaults* method."),o.registerTransform(t)}function a(t){if("string"!=typeof t.name)throw new Error("Component module *name* must be a string.");o.registerComponent(t)}var o=t("../registry"),s=t("../lib");e.exports=function(t){if(!t)throw new Error("No argument passed to Plotly.register.");t&&!Array.isArray(t)&&(t=[t]);for(var e=0;e=t[1]||i[1]<=t[0])&&(a[0]e[0]))return!0}return!1}function i(t,e,r){return t._anchorAxis===e&&(t.mirror||t.side===r)||"all"===t.mirror||"allticks"===t.mirror||t.mirrors&&t.mirrors[e._id+r]}function a(t,e,r){var n=[],i=e._anchorAxis;if(i){var a=i._mainAxis;if(n.indexOf(a)===-1){n.push(a);for(var o=0;o1&&l.push(o("object","layout"))),h.supplyDefaults(c);for(var u=c._fullData,v=r.length,g=0;g.3*f||a(n)||a(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=U.tickIncrement(t,"M6","reverse")+1.5*z:a.exactMonths>.8?t=U.tickIncrement(t,"M1","reverse")+15.5*z:t-=z/2;var s=U.tickIncrement(t,r);if(s<=n)return s}return t}function s(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=k.simpleMap(t.range,t.r2l),s=1.0001*o[0]-1e-4*o[1],l=1.0001*o[1]-1e-4*o[0],c=Math.min(s,l),f=Math.max(s,l),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;rc&&e10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=z&&i<=10||e>=15*z)t._tickround="d";else if(e>=R&&i<=16||e>=O)t._tickround="M";else if(e>=F&&i<=19||e>=R)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(M(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);M(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(m(t.exponentformat)&&!v(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function u(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function f(t,e,r,n){var i=t._tickround,a=r&&t.hoverformat||U.getTickFormat(t);n&&(i=M(i)?4:{y:"m",m:"d",d:"M",M:"S",S:4}[i]);var o,s=k.formatDate(e.x,a,i,t.calendar),l=s.indexOf("\n");l!==-1&&(o=s.substr(l+1),s=s.substr(0,l)),n&&("00:00:00"===s||"00:00"===s?(s=o,o=""):8===s.length&&(s=s.replace(/:00$/,""))),o&&(r?"d"===i?s+=", "+o:s=o+(s?", "+s:""):t._inCalcTicks&&o===t._prevDateHead||(s+="
"+o,t._prevDateHead=o)),e.text=s}function h(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=g(Math.pow(10,o),t,i,n);else if(M(a)||"D"===a.charAt(0)&&k.mod(o+.01,1)<.1){var l=Math.round(o);["e","E","power"].indexOf(t.exponentformat)!==-1||m(t.exponentformat)&&v(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+j+-l+"",e.fontSize*=1.25):(e.text=g(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,k.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var c=String(e.text).charAt(0);"0"!==c&&"1"!==c||("y"===t._id.charAt(0)?e.dx-=e.fontSize/4:(e.dy+=e.fontSize/2,e.dx+=(t.range[1]>t.range[0]?1:-1)*e.fontSize*(o<0?.5:.25)))}}function d(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}function p(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=g(e.x,t,i,n)}function m(t){return"SI"===t||"B"===t}function v(t){return t>14||t<-15}function g(t,e,r,n){var i=t<0,a=e._tickround,o=r||e.exponentformat||"B",s=e._tickexponent,l=U.getTickFormat(e),u=e.separatethousands;if(n){var f={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:M(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};c(f),a=(Number(f._tickround)||0)+4,s=f._tickexponent,e.hoverformat&&(l=e.hoverformat)}if(l)return w.format(l)(t).replace(/-/g,j);var h=Math.pow(10,-a)/2;if("none"===o&&(s=0),(t=Math.abs(t))"+g+"":"B"===o&&9===s?t+="B":m(o)&&(t+=K[s/3+5])}return i?j+t:t}function y(t,e){var r,n,i=[];for(r=0;r1)for(n=1;n2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},U.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);if(n===i){var m=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,v)]:[m,v]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),k.simpleMap(r,t.l2r||Number)},U.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=U.getAutoRange(t),t._r=t.range.slice(),t._rl=k.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},U.saveRangeInitial=function(t,e){for(var r=U.list(t,"",!0),n=!1,i=0;i=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:y&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:y&&0===u?0:f})}}}if((t.autorange||!!k.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,m,v=e.length,g=r.padded?.05*t._length:0,y=r.tozero&&("linear"===t.type||"-"===t.type);g&&"domain"===t.constrain&&t._inputDomain&&(g*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var b=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),x=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),_=n(r.vpadplus||r.vpad),w=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=v-1;a>5;a--)i(a)}},U.autoBin=function(t,e,r,n,i){var s=k.aggNums(Math.min,null,t),l=k.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:s-.5,end:l+.5,size:1,_count:l-s+1};var c;if(r)c=(l-s)/r;else{var u=k.distinctVals(t),f=Math.pow(10,Math.floor(Math.log(u.minDiff)/Math.LN10)),h=f*k.roundUp(u.minDiff/f,[.9,1.9,4.9,9.9],!0);c=Math.max(h,2*k.stdev(t)/Math.pow(t.length,n?.25:.4)),M(c)||(c=1)}var d;d="log"===e.type?{type:"linear",range:[s,l]}:{type:e.type,range:k.simpleMap([s,l],e.c2r,0,i),calendar:i},U.setConvert(d),U.autoTicks(d,c);var p,m,v=U.tickIncrement(U.tickFirst(d),d.dtick,"reverse",i);if("number"==typeof d.dtick)v=a(v,t,d,s,l),m=1+Math.floor((l-v)/d.dtick),p=v+m*d.dtick;else for("M"===d.dtick.charAt(0)&&(v=o(v,t,d.dtick,s,i)),p=v,m=0;p<=l;)p=U.tickIncrement(p,d.dtick,!1,i),m++;return{start:e.c2r(v,0,i),end:e.c2r(p,0,i),size:d.dtick,_count:m}},U.calcTicks=function(t){var e=k.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=k.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),U.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),c(t),"array"===t.tickmode)return s(t);t._tmin=U.tickFirst(t);var i=e[1]=o:f<=o)&&!(a.length>u||f===l);f=U.tickIncrement(f,t.dtick,i,t.calendar))l=f,a.push(f);t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dD?(e/=D,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*l(e,r,G)):n>P?(e/=P,t.dtick="M"+l(e,1,Y)):n>z?(t.dtick=l(e,z,W),t.tick0=k.dateTick0(t.calendar,!0)):n>O?t.dtick=l(e,O,Y):n>R?t.dtick=l(e,R,X):n>F?t.dtick=l(e,F,X):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,r,G))}else if("log"===t.type){t.tick0=0;var i=k.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var a=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/a,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+l(e,r,G)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=l(e,r,G));if(0===t.dtick&&(t.dtick=1),!M(t.dtick)&&"string"!=typeof t.dtick){var o=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(o)}},U.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(M(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return k.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?J:Z,l=t+.01*i,c=k.roundUp(k.mod(l,1),s,r);return Math.floor(l)+Math.log(w.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},U.tickFirst=function(t){var e=t.r2l||Number,r=k.simpleMap(t.range,e),n=r[1]0)switch(t.type){case"date":case"linear":for(n=0;n=n(t))}(t.dtick,t.tickformatstops[n].dtickrange,e)){i=t.tickformatstops[n];break}break;case"log":for(n=0;n=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}(t.dtick,t.tickformatstops[n].dtickrange)){i=t.tickformatstops[n];break}}return i?i.value:t.tickformat},U.subplotMatch=/^x([0-9]*)y([0-9]*)$/,U.getSubplots=function(t,e){var r,n,i,a=[],o=t._fullData||t.data||[];for(r=0;r1&&e2*i}function a(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,i=0,a=0;a2*n}var o=t("fast-isnumeric"),s=t("../../lib"),l=t("../../constants/numerical").BADNUM;e.exports=function(t,e){return i(t,e)?"date":a(t)?"category":n(t)?"linear":"-"}},{"../../constants/numerical":714,"../../lib":735,"fast-isnumeric":131}],781:[function(t,e,r){"use strict";var n=t("tinycolor2").mix,i=t("../../registry"),a=t("../../lib"),o=t("../../components/color/attributes").lightFraction,s=t("./layout_attributes"),l=t("./tick_value_defaults"),c=t("./tick_mark_defaults"),u=t("./tick_label_defaults"),f=t("./category_order_defaults"),h=t("./set_convert"),d=t("./ordered_categories");e.exports=function(t,e,r,p,m){function v(r,n){return a.coerce2(t,e,s,r,n)}var g=p.letter,y=p.font||{},b="Click to enter "+(p.title||g.toUpperCase()+" axis")+" title",x=r("visible",!p.cheateronly),_=e.type;if("date"===_){i.getComponentMethod("calendars","handleDefaults")(t,e,"calendar",p.calendar)}if(h(e,m),r("autorange",!e.isValidRange(t.range))&&r("rangemode"),r("range"),e.cleanRange(),f(t,e,r),e._initialCategories="category"===_?d(g,e.categoryorder,e.categoryarray,p.data):[],!x)return e;var w=r("color"),M=w===t.color?w:y.color;r("title",b),a.coerceFont(r,"titlefont",{family:y.family,size:Math.round(1.2*y.size),color:M}),l(t,e,r,_),u(t,e,r,_,p),c(t,e,r,p);var T=v("linecolor",w),k=v("linewidth"),A=r("showline",!!T||!!k);A||(delete e.linecolor,delete e.linewidth),(A||e.ticks)&&r("mirror");var E=v("gridcolor",n(w,p.bgColor,o).toRgbString()),S=v("gridwidth");r("showgrid",p.showGrid||!!E||!!S)||(delete e.gridcolor,delete e.gridwidth);var L=v("zerolinecolor",w),C=v("zerolinewidth");return r("zeroline",p.showGrid||!!L||!!C)||(delete e.zerolinecolor,delete e.zerolinewidth),e}},{"../../components/color/attributes":610,"../../lib":735,"../../registry":853,"./category_order_defaults":783,"./layout_attributes":790,"./ordered_categories":792,"./set_convert":796,"./tick_label_defaults":797,"./tick_mark_defaults":798,"./tick_value_defaults":799,tinycolor2:542}],782:[function(t,e,r){"use strict";function n(t,e,r){function n(t,r){for(var n=Object.keys(t),i=/^[xyz]axis[0-9]*/,a=[],o=0;o0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"), -a||"array"!==o||(e.categoryorder="trace")}}},{}],784:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":735}],785:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a,s,l,c=n[o(e)].type,u=[];for(a=0;ao*g)||_)for(r=0;rI&&PL&&(L=P);var R=(L-S)/(2*C);f/=R,S=l.l2r(S),L=l.l2r(L),l.range=l._input.range=k=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}function c(t,e){return t?"nsew"===t?"pan"===e?"move":"crosshair":t.toLowerCase()+"-resize":"pointer"}function u(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","translate("+r+", "+n+")").attr("d",i+"Z")}function f(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:A.background,stroke:A.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function h(t){t.selectAll(".select-outline").remove()}function d(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"),i||(t.transition().style("fill",a>.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}function p(t){x.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function m(t){return["lasso","select"].indexOf(t)!==-1}function v(t,e){return"M"+(t.l-.5)+","+(e-j-.5)+"h-3v"+(2*j+1)+"h3ZM"+(t.r+.5)+","+(e-j-.5)+"h3v"+(2*j+1)+"h-3Z"}function g(t,e){return"M"+(e-j-.5)+","+(t.t-.5)+"v-3h"+(2*j+1)+"v3ZM"+(e-j-.5)+","+(t.b+.5)+"v3h"+(2*j+1)+"v-3Z"}function y(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,j)/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 b(t,e,r){var n,i,a,o,s,l,c=!1,u={},f={};for(n=0;nj||s>j?(Tt="xy",o/at>s/ot?(s=o*ot/at,bt>a?xt.t=bt-s:xt.b=bt+s):(o=s*at/ot,yt>i?xt.l=yt-o:xt.r=yt+o),At.attr("d",y(xt))):n():!lt||szoom back out","long"),N=!1)}function X(e,r){var n=1===(U+V).length;if(e)Q();else if(2!==r||n){if(1===r&&n){var i=U?rt[0]:et[0],o="s"===U||"w"===V?0:1,s=i._name+".range["+o+"]",l=a(i,o),c="left",u="middle";if(i.fixedrange)return;U?(u="n"===U?"top":"bottom","right"===i.side&&(c="right")):"e"===V&&(c="right"),t._context.showAxisRangeEntryBoxes&&x.select(vt).call(k.makeEditable,{gd:t,immediate:!0,background:dt.paper_bgcolor,text:String(l),fill:i.tickfont?i.tickfont.color:"#444",horizontalAlign:c,verticalAlign:u}).on("edit",function(e){var r=i.d2r(e);void 0!==r&&w.relayout(t,s,r)})}}else K()}function W(e){function r(t,e,r){function n(e){return t.l2r(a+(e-a)*r)}if(!t.fixedrange){var i=T.simpleMap(t.range,t.r2l),a=i[0]+(i[1]-i[0])*e;t.range=i.map(n)}}if(t._context.scrollZoom||dt._enablescrollzoom){if(t._transitioningWithDuration)return T.pauseEvent(e);var n=t.querySelector(".plotly");if(H(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Lt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),!isFinite(i))return void T.log("Did not find wheel motion attributes: ",e);var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=It.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(V||ut){for(V||(l=.5),a=0;a rect").call(E.setTranslate,s,l).call(E.setScale,a,o);var w=m.plot.selectAll(".scatterlayer .points, .boxlayer .points");m.plot.call(E.setTranslate,x,_).call(E.setScale,1/a,1/o),w.selectAll(".point").call(E.setPointGroupScale,a,o).call(E.hideOutsideRangePoints,m),w.selectAll(".textpoint").call(E.setTextPointsScale,a,o).call(E.hideOutsideRangePoints,m)}}}var tt,et,rt,nt,it,at,ot,st,lt,ct,ut,ft,ht,dt=t._fullLayout,pt=t._fullLayout._zoomlayer,mt=U+V==="nsew";H();var vt=n(e,U+V+"drag",ct,r,A,S,B);if(!lt&&!st&&!m(dt.dragmode))return vt.onmousedown=null,vt.style.pointerEvents=mt?"all":"none",vt;var gt={element:vt,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;mt?e.shiftKey&&(i="pan"===i?"zoom":"pan"):i="pan",gt.minDrag="lasso"===i?1:void 0,"zoom"===i?(gt.moveFn=G,gt.doneFn=Y,gt.minDrag=1,q(e,r,n)):"pan"===i?(gt.moveFn=Z,gt.doneFn=X,h(pt)):m(i)&&(gt.xaxes=et,gt.yaxes=rt,z(e,r,n,gt,i))}};L.init(gt);var yt,bt,xt,_t,wt,Mt,Tt,kt,At,Et={},St=[0,0,at,ot],Lt=null,Ct=R.REDRAWDELAY,It=e.mainplot?dt._plots[e.mainplot]:e;return U.length*V.length!=1&&(void 0!==vt.onwheel?vt.onwheel=W:void 0!==vt.onmousewheel&&(vt.onmousewheel=W)),vt}},{"../../components/color":611,"../../components/dragelement":632,"../../components/drawing":635,"../../constants/alignment":708,"../../lib":735,"../../lib/setcursor":753,"../../lib/svg_text_utils":757,"../../plotly":774,"../../registry":853,"../plots":838,"./axes":779,"./axis_ids":782,"./constants":784,"./scale_zoom":794,"./select":795,d3:121,tinycolor2:542}],788:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../components/fx"),a=t("../../components/dragelement"),o=t("./constants"),s=t("./dragbox");e.exports=function(t){var e=t._fullLayout;if((e._has("cartesian")||e._has("gl2d"))&&!t._context.staticPlot){Object.keys(e._plots||{}).sort(function(t,r){if((e._plots[t].mainplot&&!0)===(e._plots[r].mainplot&&!0)){var n=t.split("y"),i=r.split("y");return n[0]===i[0]?Number(n[1]||1)-Number(i[1]||1):Number(n[0]||1)-Number(i[0]||1)}return e._plots[t].mainplot?1:-1}).forEach(function(r){var l=e._plots[r],c=l.xaxis,u=l.yaxis,f=(c._linepositions[r]||[])[3],h=(u._linepositions[r]||[])[3],d=o.DRAGGERSIZE;if(n(f)&&"top"===c.side&&(f-=d),n(h)&&"right"!==u.side&&(h-=d),!l.mainplot){var p=s(t,l,0,0,c._length,u._length,"ns","ew");p.onmousemove=function(e){t._fullLayout._rehover=function(){t._fullLayout._hoversubplot===r&&i.hover(t,e,r)},i.hover(t,e,r),t._fullLayout._lasthover=p,t._fullLayout._hoversubplot=r},p.onmouseout=function(e){t._dragging||(t._fullLayout._hoversubplot=null,a.unhover(t,e))},p.onclick=function(e){i.click(t,e,r)},t._context.showAxisDragHandles&&(s(t,l,-d,-d,d,d,"n","w"),s(t,l,c._length,-d,d,d,"n","e"),s(t,l,-d,u._length,d,d,"s","w"),s(t,l,c._length,u._length,d,d,"s","e"))}t._context.showAxisDragHandles&&(n(f)&&("free"===c.anchor&&(f-=e._size.h*(1-u.domain[1])),s(t,l,.1*c._length,f,.8*c._length,d,"","ew"),s(t,l,0,f,.1*c._length,d,"","w"),s(t,l,.9*c._length,f,.1*c._length,d,"","e")),n(h)&&("free"===u.anchor&&(h-=e._size.w*c.domain[0]),s(t,l,h,.1*u._length,d,.8*u._length,"ns",""),s(t,l,h,.9*u._length,d,.1*u._length,"s",""),s(t,l,h,0,d,.1*u._length,"n","")))});var r=e._hoverlayer.node();r.onmousemove=function(r){r.target=e._lasthover,i.hover(t,r,e._hoversubplot)},r.onclick=function(r){r.target=e._lasthover,i.click(t,r)},r.onmousedown=function(t){e._lasthover.onmousedown(t)}}}},{"../../components/dragelement":632,"../../components/fx":652,"./constants":784,"./dragbox":787,"fast-isnumeric":131}],789:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._fullLayout,o=a._modules;e.plot&&e.plot.selectAll("g:not(.scatterlayer)").selectAll("g.trace").remove();for(var s=0;su[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":735,"fast-isnumeric":131}],794:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.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)]}},{"../../constants/alignment":708}],795:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e){if(Array.isArray(t))for(var r=e.cd[0].trace,n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function v(e,r,n){return l(e,r,n||t.calendar)}function g(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,["linear","-"].indexOf(t.type)!==-1?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=v,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return v(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=g,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return g(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),!i||2!==i.length)return void o.nestedProperty(t,e).set(n);for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-h?i[r]=-h:i[r]>h&&(i[r]=h),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",s=t.calendar;t.cleanRange(a);var l=t.r2l(t[a][0],s),c=t.r2l(t[a][1],s);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(l-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-l),t._b=-t._m*l),!isFinite(t._m)||!isFinite(t._b))throw o.notifier("Something went wrong with axis scaling","long"),e._replotting=!1,new Error("axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.range[0]&&r<=t.range[1]}:function(e){var r=e.y;return r>=t.range[0]&&r<=t.range[1]},t._min=[],t._max=[],t._separators=e.separators,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":714,"../../lib":735,"./axis_ids":782,"./constants":784,d3:121,"fast-isnumeric":131}],797:[function(t,e,r){"use strict";function n(t){var e=["showexponent","showtickprefix","showticksuffix"],r=e.filter(function(e){return void 0!==t[e]}),n=function(e){return t[e]===t[r[0]]};if(r.every(n)||1===r.length)return t[r[0]]}function i(t,e){function r(t,e){return a.coerce(s,l,o.tickformatstops,t,e)}var n=t.tickformatstops,i=e.tickformatstops=[];if(Array.isArray(n))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),h=u.substr(1);h=n(h)?Number(h):0,(h<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{var m=r("tickvals");void 0===m?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":714,"../../lib":735,"fast-isnumeric":131}],800:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(e,r){function n(e,r,n){for(i=0;i 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.select(".scatterlayer").selectAll(".points");n.selectAll(".point").call(o.setPointGroupScale,1,1).call(o.hideOutsideRangePoints,t),n.selectAll(".textpoint").call(o.setTextPointsScale,1,1).call(o.hideOutsideRangePoints,t)}function h(e,r){var n,i,a,s=y[e.xaxis._id],l=y[e.yaxis._id],c=[];if(s){n=t._fullLayout[s.axisName],i=n._r,a=s.to,c[0]=(i[0]*(1-r)+r*a[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var f=i[1]-i[0],h=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],c[2]=e.xaxis._length*(1-r+r*h/f)}else c[0]=0,c[2]=e.xaxis._length;if(l){n=t._fullLayout[l.axisName],i=n._r,a=l.to,c[1]=(i[1]*(1-r)+r*a[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var d=i[1]-i[0],p=a[1]-a[0];n.range[0]=i[0]*(1-r)+r*a[0],n.range[1]=i[1]*(1-r)+r*a[1],c[3]=e.yaxis._length*(1-r+r*p/d)}else c[1]=0,c[3]=e.yaxis._length;u(e.xaxis,e.yaxis);var m=e.xaxis,g=e.yaxis,b=!!s,x=!!l,_=b?m._length/c[2]:1,w=x?g._length/c[3]:1,M=b?c[0]:0,T=x?c[1]:0,k=b?c[0]/c[2]*m._length:0,A=x?c[1]/c[3]*g._length:0,E=m._offset-k,S=g._offset-A;v._defs.select("#"+e.clipId+"> rect").call(o.setTranslate,M,T).call(o.setScale,1/_,1/w),e.plot.call(o.setTranslate,E,S).call(o.setScale,_,w).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/_,1/w),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/_,1/w)}function d(){for(var e={},r=0;rr.duration?(d(),T=window.cancelAnimationFrame(m)):T=window.requestAnimationFrame(m)}var v=t._fullLayout,g=[],y=function(t){var e,r,n,i,a={};for(e in t)if(r=e.split("."),r[0].match(l)){var o=e.charAt(0),s=r[0];if(n=v[s],i={},Array.isArray(t[e])?i.to=t[e].slice(0):Array.isArray(t[e].range)&&(i.to=t[e].range.slice(0)),!i.to)continue;i.axisName=s,i.length=n._length,g.push(o),a[o]=i}return a}(e),b=Object.keys(y),x=function(t,e,r){var n,i,a,o=t._plots,s=[];for(n in o){var l=o[n];if(s.indexOf(l)===-1){var c=l.xaxis._id,u=l.yaxis._id,f=l.xaxis.range,h=l.yaxis.range;l.xaxis._r=l.xaxis.range.slice(),l.yaxis._r=l.yaxis.range.slice(),i=r[c]?r[c].to:f,a=r[u]?r[u].to:h,f[0]===i[0]&&f[1]===i[1]&&h[0]===a[0]&&h[1]===a[1]||e.indexOf(c)===-1&&e.indexOf(u)===-1||s.push(l)}}return s}(v,b,y);if(!x.length)return function(){function e(e,r,n){for(var i=0;i0?".":"")+i;c.isPlainObject(a)?s(a,e,o,n+1):e(o,i,a)}})}var l=t("../plotly"),c=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var l=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(l)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(l){n(t,l,o.cache),o.check=function(){if(s){var e=n(t,l,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:l.type,prop:l.prop,traces:l.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fi*Math.PI/180}return!1},n.getPath=function(){return s.geo.path().projection(n)},n.getBounds=function(t){return n.getPath().bounds(t)},n.fitExtent=function(t,e){var r=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=n.clipExtent&&n.clipExtent();n.scale(150).translate([0,0]),a&&n.clipExtent(null);var o=n.getBounds(e),s=Math.min(r/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(r-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&n.clipExtent(a),n.scale(150*s).translate([l,c])},n.precision(y.precision),i&&n.clipAngle(i-y.clipPad),n}function a(t,e){var r=e[t],n=r.dtick,i=y.scopeDefaults[e.scope],a=i.lonaxisRange,o=i.lataxisRange,l="lonaxis"===t?[n]:[0,n];return s.geo.graticule().extent([[a[0],o[0]],[a[1],o[1]]]).step(l)}function o(t,e){var r=y.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../components/color"),f=t("../../components/drawing"),h=t("../../components/fx"),d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),v=t("../cartesian/select"),g=t("./zoom"),y=t("./constants"),b=t("../../lib/topojson_utils"),x=t("topojson-client").feature;t("./projections")(s);var _=n.prototype;e.exports=function(t){return new n(t)},_.plot=function(t,e,r){var n=this,i=e[this.id],a=b.getTopojsonName(i);null===n.topojson||a!==n.topojsonName?(n.topojsonName=a,void 0===PlotlyGeoAssets.topojson[n.topojsonName]?r.push(n.fetchTopojson().then(function(r){PlotlyGeoAssets.topojson[n.topojsonName]=r,n.topojson=r,n.update(t,e)})):(n.topojson=PlotlyGeoAssets.topojson[n.topojsonName],n.update(t,e))):n.update(t,e)},_.fetchTopojson=function(){var t=b.getTopojsonPath(this.topojsonURL,this.topojsonName);return new Promise(function(e,r){s.json(t,function(n,i){if(n)return r(404===n.status?new Error(["plotly.js could not find topojson file at",t,".","Make sure the *topojsonURL* plot config option","is set properly."].join(" ")):new Error(["unexpected error while fetching topojson file at",t].join(" ")));e(i)})})},_.update=function(t,e){var r=e[this.id];if(!this.updateProjection(e,r)){this.hasChoropleth=!1;for(var n=0;n0&&M<0&&(M+=360);var T,k=(w+M)/2;if(!u){var A=f?l.projRotate:[k,0,0];T=r("projection.rotation.lon",A[0]),r("projection.rotation.lat",A[1]),r("projection.rotation.roll",A[2]),n=r("showcoastlines",!f),n&&(r("coastlinecolor"),r("coastlinewidth")),n=r("showocean"),n&&r("oceancolor")}var E,S;if(u?(E=-96.6,S=38.7):(E=f?k:T,S=(_[0]+_[1])/2),r("center.lon",E),r("center.lat",S),h){r("projection.parallels",l.projParallels||[0,60])}r("projection.scale"),n=r("showland"),n&&r("landcolor"),n=r("showlakes"),n&&r("lakecolor"),n=r("showrivers"),n&&(r("rivercolor"),r("riverwidth")),n=r("showcountries",f&&"usa"!==o),n&&(r("countrycolor"),r("countrywidth")),("usa"===o||"north america"===o&&50===i)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),f||(n=r("showframe",!0))&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":845,"../constants":805,"./layout_attributes":810}],810:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("../../../plot_api/edit_types").overrideAll,o={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=a({domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:o,lataxis:o},"plot","from-root")},{"../../../components/color/attributes":610,"../../../plot_api/edit_types":763,"../constants":805}],811:[function(t,e,r){"use strict";function n(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!E.hasOwnProperty(e.type))return null;var i=E[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(h-c)*(n-u)/(d-u)+c&&(i=!i)}return i}function o(t){return t?t/Math.sin(t):1}function s(t){return t>1?I:t<-1?-I:Math.asin(t)}function l(t){return t>1?0:t<-1?C:Math.acos(t)}function c(t,e){var r=(2+I)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>S;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(C*(4+C))*t*(1+Math.cos(e)),2*Math.sqrt(C/(4+C))*Math.sin(e)]}function u(t,e){function r(r,n){var i=R(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?R:e===1/0?h:(r.invert=function(r,n){var i=R.invert(r/t,n);return i[0]*=e,i},r)}function f(){var t=2,e=O(u),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}function h(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function d(t,e){return[3*t/(2*C)*Math.sqrt(C*C/3-e*e),e]}function p(t,e){return[t,1.25*Math.log(Math.tan(C/4+.4*e))]}function m(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>S&&--i>0);return e/2}}function v(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function g(t,e){var r,n=Math.min(18,36*Math.abs(e)/C),i=Math.floor(n),a=n-i,o=(r=j[i])[0],s=r[1],l=(r=j[++i])[0],c=r[1],u=(r=j[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?I:-I)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function y(t,e){return[t*Math.cos(e),e]}function b(t,e){var r=Math.cos(e),n=o(l(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function x(t,e){var r=b(t,e);return[(r[0]+t/I)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&_.hasOwnProperty(t.type)?_[t.type]:r)(t,n)};var _={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},w=[],M=[],T={point:function(t,e){w.push([t,e])},result:function(){var t=w.length?w.length<2?{type:"Point",coordinates:w[0]}:{type:"MultiPoint",coordinates:w}:null;return w=[],t}},k={lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){w.length&&(M.push(w),w=[])},result:function(){var t=M.length?M.length<2?{type:"LineString",coordinates:M[0]}:{type:"MultiLineString",coordinates:M}:null;return M=[],t}},A={polygonStart:n,lineStart:n,point:function(t,e){w.push([t,e])},lineEnd:function(){var t=w.length;if(t){do{w.push(w[0].slice())}while(++t<4);M.push(w),w=[]}},polygonEnd:n,result:function(){if(!M.length)return null;var t=[],e=[];return M.forEach(function(r){i(r)?t.push([r]):e.push(r)}),e.forEach(function(e){var r=e[0];t.some(function(t){if(a(t[0],r))return t.push(e),!0})||t.push([e])}),M=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},E={Point:T,MultiPoint:T,LineString:k,MultiLineString:k,Polygon:A,MultiPolygon:A,Sphere:A},S=1e-6,L=S*S,C=Math.PI,I=C/2,D=(Math.sqrt(C),C/180),P=180/C,z=t.geo.projection,O=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=l[+(r<0)],a=0,o=i.length-1;ai[a][2][0];++a);var s=e(t-i[a][1][0],r);return s[0]+=e(i[a][1][0],n*r>n*i[a][0][1]?i[a][0][1]:r)[0],s}function n(){s=l.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})})}function i(){for(var e=1e-6,r=[],n=0,i=l[0].length;n=0;--n){var o=l[1][n],s=180*o[0][0]/C,c=180*o[0][1]/C,u=180*o[1][1]/C,f=180*o[2][0]/C,h=180*o[2][1]/C;r.push(a([[f-e,h-e],[f-e,u+e],[s+e,u+e],[s+e,c-e]],30))}return{type:"Polygon",coordinates:[t.merge(r)]}}function a(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++aS&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return z(v)}).raw=v;var j=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];j.forEach(function(t){t[1]*=1.0144}),g.invert=function(t,e){var r=e/I,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{i=Math.min(18,Math.abs(n)/5),a=Math.floor(i),d=i-a,o=j[a][1],s=j[a+1][1],l=j[Math.min(19,a+2)][1],n-=(p=(e>=0?I:-I)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*P}while(Math.abs(p)>L&&--m>0);break}}while(--a>=0);var v=j[a][0],g=j[a+1][0],y=j[Math.min(19,a+2)][0];return[t/(g+d*(y-v)/2+d*d*(y-2*g+v)/2),n*D]},(t.geo.robinson=function(){return z(g)}).raw=g,y.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return z(y)}).raw=y,b.invert=function(t,e){if(!(t*t+4*e*e>C*C+S)){var r=t,n=e,i=25;do{var a,o=Math.sin(r),s=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,m=s*s,v=1-p*c*c,g=v?l(f*c)*Math.sqrt(a=1/v):a=0,y=2*g*f*s-t,b=g*u-e,x=a*(p*m+g*f*c*d),_=a*(.5*o*h-2*g*u*s),w=.25*a*(h*s-g*u*p*o),M=a*(d*c+g*m*f),T=_*w-M*x;if(!T)break;var k=(b*_-y*M)/T,A=(y*w-b*x)/T;r-=k,n-=A}while((Math.abs(k)>S||Math.abs(A)>S)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return z(b)}).raw=b,x.invert=function(t,e){var r=t,n=e,i=25;do{var a,o=Math.cos(n),s=Math.sin(n),c=Math.sin(2*n),u=s*s,f=o*o,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,v=1-f*d*d,g=v?l(o*d)*Math.sqrt(a=1/v):a=0,y=.5*(2*g*o*p+r/I)-t,b=.5*(g*s+n)-e,x=.5*a*(f*m+g*o*d*u)+.5/I,_=a*(h*c/4-g*s*p),w=.125*a*(c*p-g*s*f*h),M=.5*a*(u*d+g*m*o)+.5,T=_*w-M*x,k=(b*_-y*M)/T,A=(y*w-b*x)/T;r-=k,n-=A}while((Math.abs(k)>S||Math.abs(A)>S)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return z(x)}).raw=x}e.exports=n},{}],812:[function(t,e,r){"use strict";function n(t,e){var r=t.projection;return(e._isScoped?o:e._isClipped?l:s)(t,r)}function i(t,e){return w.behavior.zoom().translate(e.translate()).scale(e.scale())}function a(t,e,r){function n(t,e){var r=M.nestedProperty(s,t);r.get()!==e&&(r.set(e),M.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function o(t,e){function r(){w.select(this).style(A)}function n(){e.scale(w.event.scale).translate(w.event.translate),t.render()}function o(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}function s(){w.select(this).style(E),a(t,e,o)}var l=i(t,e);return l.on("zoomstart",r).on("zoom",n).on("zoomend",s),l}function s(t,e){function r(t){return e.invert(t)}function n(t){var n=e(r(t));return Math.abs(n[0]-t[0])>b||Math.abs(n[1]-t[1])>b}function o(){w.select(this).style(A),u=w.mouse(this),f=e.rotate(),h=e.translate(),d=f,p=r(u)}function s(){if(m=w.mouse(this),n(u))return y.scale(e.scale()),void y.translate(e.translate());e.scale(w.event.scale),e.translate([h[0],w.event.translate[1]]),p?r(m)&&(g=r(m),v=[d[0]+(g[0]-p[0]),f[1],f[2]],e.rotate(v),d=v):(u=m,p=r(u)),t.render()}function l(){w.select(this).style(E),a(t,e,c)}function c(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var u,f,h,d,p,m,v,g,y=i(t,e),b=2;return y.on("zoomstart",o).on("zoom",s).on("zoomend",l),y}function l(t,e){function r(t){y++||t({type:"zoomstart"})}function n(t){t({type:"zoom"})}function o(t){--y||t({type:"zoomend"})}function s(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var l,p={r:e.rotate(),k:e.scale()},m=i(t,e),v=_(m,"zoomstart","zoom","zoomend"),y=0,b=m.on;return m.on("zoomstart",function(){w.select(this).style(A);var t=w.mouse(this),i=e.rotate(),a=i,o=e.translate(),s=u(i);l=c(e,t),b.call(m,"zoom",function(){var r=w.mouse(this);if(e.scale(p.k=w.event.scale),l){if(c(e,r)){e.rotate(i).translate(o);var u=c(e,r),m=h(l,u),y=g(f(s,m)),b=p.r=d(y,l,a);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=a),e.rotate(b),a=b}}else t=r,l=c(e,t);n(v.of(this,arguments))}),r(v.of(this,arguments))}).on("zoomend",function(){w.select(this).style(E),b.call(m,"zoom",null),o(v.of(this,arguments)),a(t,e,s)}).on("zoom.redraw",function(){t.render()}),w.rebind(m,v,"on")}function c(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&y(r)}function u(t){var e=.5*t[0]*T,r=.5*t[1]*T,n=.5*t[2]*T,i=Math.sin(e),a=Math.cos(e),o=Math.sin(r),s=Math.cos(r),l=Math.sin(n),c=Math.cos(n);return[a*s*c+i*o*l,i*s*c-a*o*l,a*o*c+i*s*l,a*s*l-i*o*c]}function f(t,e){var r=t[0],n=t[1],i=t[2],a=t[3],o=e[0],s=e[1],l=e[2],c=e[3];return[r*o-n*s-i*l-a*c,r*s+n*o+i*c-a*l,r*l-n*c+i*o+a*s,r*c+n*l-i*s+a*o]}function h(t,e){if(t&&e){var r=x(t,e),n=Math.sqrt(b(r,r)),i=.5*Math.acos(Math.max(-1,Math.min(1,b(t,e)))),a=Math.sin(i)/n;return n&&[Math.cos(i),r[2]*a,-r[1]*a,r[0]*a]}}function d(t,e,r){var n=v(e,2,t[0]);n=v(n,1,t[1]),n=v(n,0,t[2]-r[2]);var i,a,o=e[0],s=e[1],l=e[2],c=n[0],u=n[1],f=n[2],h=Math.atan2(s,o)*k,d=Math.sqrt(o*o+s*s);Math.abs(u)>d?(a=(u>0?90:-90)-h,i=0):(a=Math.asin(u/d)*k-h,i=Math.sqrt(d*d-u*u));var m=180-a-2*h,g=(Math.atan2(f,c)-Math.atan2(l,i))*k,y=(Math.atan2(f,c)-Math.atan2(l,-i))*k;return p(r[0],r[1],a,g)<=p(r[0],r[1],m,y)?[a,g,r[2]]:[m,y,r[2]]}function p(t,e,r,n){var i=m(r-t),a=m(n-e);return Math.sqrt(i*i+a*a)}function m(t){return(t%360+540)%360-180}function v(t,e,r){var n=r*T,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function g(t){return[Math.atan2(2*(t[0]*t[1]+t[2]*t[3]),1-2*(t[1]*t[1]+t[2]*t[2]))*k,Math.asin(Math.max(-1,Math.min(1,2*(t[0]*t[2]-t[3]*t[1]))))*k,Math.atan2(2*(t[0]*t[3]+t[1]*t[2]),1-2*(t[2]*t[2]+t[3]*t[3]))*k]}function y(t){var e=t[0]*T,r=t[1]*T,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function b(t,e){for(var r=0,n=0,i=t.length;nMath.abs(c)?(f.boxEnd[1]=f.boxStart[1]+Math.abs(s)*w*(c>=0?1:-1),f.boxEnd[1]h[3]&&(f.boxEnd[1]=h[3],f.boxEnd[0]=f.boxStart[0]+(h[3]-f.boxStart[1])/Math.abs(w))):(f.boxEnd[0]=f.boxStart[0]+Math.abs(c)/w*(s>=0?1:-1),f.boxEnd[0]h[2]&&(f.boxEnd[0]=h[2],f.boxEnd[1]=f.boxStart[1]+(h[2]-f.boxStart[0])*Math.abs(w)))}}else f.boxEnabled?(s=f.boxStart[0]!==f.boxEnd[0],c=f.boxStart[1]!==f.boxEnd[1],s||c?(s&&(o(0,f.boxStart[0],f.boxEnd[0]),t.xaxis.autorange=!1),c&&(o(1,f.boxStart[1],f.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),f.boxEnabled=!1,f.boxInited=!1):f.boxInited&&(f.boxInited=!1);break;case"pan":f.boxEnabled=!1,f.boxInited=!1,n?(f.panning||(f.dragStart[0]=i,f.dragStart[1]=a),Math.abs(f.dragStart[0]-i)h[p+2]&&(h[p]=-1,h[p+2]=1),d=this[_[p]],d._length=o.viewBox[p+2]-o.viewBox[p],l.doAutoRange(d),d.setScale();b(s),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*n*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p}e.exports=n;var i=t("right-now"),a=t("3d-view"),o=t("mouse-change"),s=t("mouse-wheel"),l=t("mouse-event-offset")},{"3d-view":38,"mouse-change":460,"mouse-event-offset":461,"mouse-wheel":463,"right-now":511}],818:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../plots"),s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=o.getSubplotIds(e,"gl3d"),i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:a,paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":611,"../../../lib":735,"../../../registry":853,"../../subplot_defaults":845,"./axis_defaults":821,"./layout_attributes":824}],824:[function(t,e,r){"use strict";function n(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"}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{}),editType:"camera"},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},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:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":735,"../../../lib/extend":724,"./axis_attributes":820}],825:[function(t,e,r){"use strict";function n(){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]}function i(t){var e=new n;return e.merge(t),e}var a=t("../../../lib/str2rgbarray"),o=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[o[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=a(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=i},{"../../../lib/str2rgbarray":756}],826:[function(t,e,r){"use strict";function n(t){for(var e=new Array(3),r=0;r<3;++r){for(var n=t[r],i=new Array(n.length),a=0;ah[1][o]?d[o]=1:h[1][o]===h[0][o]?d[o]=1:d[o]=1/(h[1][o]-h[0][o]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var k=m[1][a]-m[0][a];m[0][a]-=k/32,m[1][a]+=k/32}}else{var E=l.range;m[0][a]=l.r2l(E[0]),m[1][a]=l.r2l(E[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var S=[1,1,1];for(a=0;a<3;++a){l=u[A[a]],c=l.type;var L=g[c];S[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,S)/Math.min.apply(null,S)<=4?S:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=S;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=u.aspectratio;C=[I.x,I.y,I.z]}u.aspectratio.x=f.aspectratio.x=C[0],u.aspectratio.y=f.aspectratio.y=C[1],u.aspectratio.z=f.aspectratio.z=C[2],this.glplot.aspect=C;var D=u.domain||null,P=e._size||null;if(D&&P){var z=this.container.style;z.position="absolute",z.left=P.l+D.x[0]*P.w+"px",z.top=P.t+(1-D.y[1])*P.h+"px",z.width=P.w*(D.x[1]-D.x[0])+"px",z.height=P.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},k.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},k.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),c(this.glplot.camera)},k.setCamera=function(t){this.glplot.camera.lookAt.apply(this,l(t))},k.saveCamera=function(t){var e=this.getCamera(),r=m.nestedProperty(t,this.id+".camera"),n=r.get(),i=!1;if(void 0===n)i=!0;else for(var a=0;a<3;a++)for(var o=0;o<3;o++)if(!function(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]]}(e,n,a,o)){i=!0;break}return i&&r.set(e),i},k.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},k.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(u),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}function a(t){var e={},r={};switch(t.type){case"circle":s.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":s.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":s.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=l(n.textposition,n.iconsize);s.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),s.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}function o(t){var e,r=t.sourcetype,n=t.source,i={type:r},a="string"==typeof n;return"geojson"===r?e="data":"vector"===r&&(e=a?"url":"tiles"),i[e]=n,i}var s=t("../../lib"),l=t("./convert_text_opts"),c=n.prototype;c.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},c.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},c.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},c.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=o(t);e.addSource(this.idSource,r)}},c.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);var r={visibility:"visible"};this.mapbox.setOptions(this.idLayer,"setLayoutProperty",r)}},c.updateStyle=function(t){var e=a(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},c.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":735,"./convert_text_opts":831}],834:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition,s=t("../../plot_api/edit_types").overrideAll,l=a({});l.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=s({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:l,textposition:n.extendFlat({},o,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":611,"../../lib":735,"../../plot_api/edit_types":763,"../../traces/scatter/attributes":1045,"../font_attributes":803}],835:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),i(t,e),e._input=t}function i(t,e){function r(t,e){return a.coerce(n,i,s.layers,t,e)}for(var n,i,o=t.layers||[],l=e.layers=[],c=0;c=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"),c=r.select(".js-sourcelinks");t._context.showSources&&t._context.showSources(t),t._context.showLink&&n(t,o),s.text(o.text()&&c.text()?" - ":"")}},v.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=l.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=v.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},v.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],l=t.data||[];if(t._transitionData||v.createTransitionData(t),r._initialAutoSizeIsDone){var c=r.width,f=r.height;v.supplyLayoutGlobalDefaults(a,n),a.width||(n.width=c),a.height||(n.height=f)}else{v.supplyLayoutGlobalDefaults(a,n);var h=!a.width||!a.height,d=n.autosize,p=t._context&&t._context.autosizable;h&&(d||p)?v.plotAutoSize(t,a,n):h&&v.sanitizeMargins(t),!d&&h&&(a.width=n.width,a.height=n.height)}n._initialAutoSizeIsDone=!0,n._dataLength=l.length,n._globalTransforms=(t._context||{}).globalTransforms,v.supplyDataDefaults(l,s,a,n),n._has=v._hasPlotType.bind(n);var m=n._modules;for(e=0;e0){var u=o(t._boundingBoxMargins),f=u.left+u.right,h=u.bottom+u.top,p=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(p*(m.width-f)),i=Math.round(p*(m.height-h))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var y=v.layoutAttributes.width.min,b=v.layoutAttributes.height.min;n1,_=!e.height&&Math.abs(r.height-i)>1;(_||x)&&(x&&(r.width=n),_&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),v.sanitizeMargins(r)},v.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a;u.Axes.supplyLayoutDefaults(t,e,r);var o=e._basePlotModules;for(i=0;i.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||v.doAutoMargin(t)}},v.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),a=Math.max(e.margin.r||0,0),o=Math.max(e.margin.t||0,0),s=Math.max(e.margin.b||0,0),l=e._pushmargin;if(e.margin.autoexpand!==!1){l.base={l:{val:0,size:i},r:{val:1,size:a},t:{val:1,size:o},b:{val:0,size:s}};for(var f=Object.keys(l),h=0;hv){var T=(g*w+(M-e.width)*v)/(w-v),k=(M*(1-v)+(g-e.width)*(1-w))/(w-v);T>=0&&k>=0&&T+k>i+a&&(i=T,a=k)}}if(c(b)&&l[_].t){var A=l[_].t.val,E=l[_].t.size;if(A>y){var S=(b*A+(E-e.height)*y)/(A-y),L=(E*(1-y)+(b-e.height)*(1-A))/(A-y);S>=0&&L>=0&&S+L>s+o&&(s=S,o=L)}}}}if(r.l=Math.round(i),r.r=Math.round(a),r.t=Math.round(o),r.b=Math.round(s),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return u.plot(t)},v.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(d.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&["_","["].indexOf(e.charAt(0))===-1){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!d.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):d.isJSDate(t)?d.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&v.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},v.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){x=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return u.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var o,s,l=0,c=0,h=t._fullLayout._basePlotModules,p=!1;if(r)for(s=0;s=0,L=S?h.angularAxis.domain:n.extent(T),C=Math.abs(T[1]-T[0]);A&&!k&&(C=0);var I=L.slice();E&&k&&(I[1]+=C);var D=h.angularAxis.ticksCount||4;D>8&&(D=D/(D/8)+D%8),h.angularAxis.ticksStep&&(D=(I[1]-I[0])/D);var P=h.angularAxis.ticksStep||(I[1]-I[0])/(D*(h.minorTicks+1));M&&(P=Math.max(Math.round(P),1)),I[2]||(I[2]=P);var z=n.range.apply(this,I);if(z=z.map(function(t,e){return parseFloat(t.toPrecision(12))}),l=n.scale.linear().domain(I.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),f.layout.angularAxis.domain=l.domain(),f.layout.angularAxis.endPadding=E?C:0,void 0===(e=n.select(this).select("svg.chart-root"))||e.empty()){var O=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),R=this.appendChild(this.ownerDocument.importNode(O.documentElement,!0));e=n.select(R)}e.select(".guides-group").style({"pointer-events":"none"}),e.select(".angular.axis-group").style({"pointer-events":"none"}),e.select(".radial.axis-group").style({"pointer-events":"none"});var F,j=e.select(".chart-group"),N={fill:"none",stroke:h.tickColor},B={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){F=e.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var U=p.map(function(t,e){var r=s.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});s.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:a({},s.Legend.defaultConfig().legendConfig,{container:F,elements:U,reverseOrder:h.legend.reverseOrder})})();var V=F.node().getBBox();x=Math.min(h.width-V.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),w=[h.margin.left+x,h.margin.top+x],i.range([0,x]),f.layout.radialAxis.domain=i.domain(),F.attr("transform","translate("+[w[0]+x,w[1]-x]+")")}else F=e.select(".legend-group").style({display:"none"});e.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),j.attr("transform","translate("+w+")").style({cursor:"crosshair"});var H=[(h.width-(h.margin.left+h.margin.right+2*x+(V?V.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(H[0]=Math.max(0,H[0]),H[1]=Math.max(0,H[1]),e.select(".outer-group").attr("transform","translate("+H+")"),h.title){var q=e.select("g.title-group text").style(B).text(h.title),G=q.node().getBBox();q.attr({x:w[0]-G.width/2,y:w[1]-x-20})}var Y=e.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var X=Y.selectAll("circle.grid-circle").data(i.ticks(5));X.enter().append("circle").attr({class:"grid-circle"}).style(N),X.attr("r",i),X.exit().remove()}Y.select("circle.outside-circle").attr({r:x}).style(N);var W=e.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var Z=n.svg.axis().scale(i).ticks(5).tickSize(5);Y.call(Z).attr({transform:"rotate("+h.radialAxis.orientation+")"}),Y.selectAll(".domain").style(N),Y.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(B).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,B["font-size"]]+")":"translate("+[0,B["font-size"]]+")"}}),Y.selectAll("g>line").style({stroke:"black"})}var J=e.select(".angular.axis-group").selectAll("g.angular-tick").data(z),K=J.enter().append("g").classed("angular-tick",!0);J.attr({transform:function(t,e){return"rotate("+c(t,e)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),J.exit().remove(),K.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(N),K.selectAll(".minor").style({stroke:h.minorTickColor}),J.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),K.append("text").classed("axis-text",!0).style(B);var Q=J.select("text.axis-text").attr({x:x+h.labelOffset,dy:o+"em",transform:function(t,e){var r=c(t,e),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":M?M[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(B);h.angularAxis.rewriteTicks&&Q.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var $=n.max(j.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));F.attr({transform:"translate("+[x+$,h.margin.top]+")"});var tt=e.select("g.geometry-group").selectAll("g").size()>0,et=e.select("g.geometry-group").selectAll("g.geometry").data(p);if(et.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),et.exit().remove(),p[0]||tt){var rt=[];p.forEach(function(t,e){var r={};r.radialScale=i,r.angularScale=l,r.container=et.filter(function(t,r){return r==e}),r.geometry=t.geometry,r.orientation=h.orientation,r.direction=h.direction,r.index=e,rt.push({data:t,geometryConfig:r})});var nt=n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(rt),it=[];nt.forEach(function(t,e){"unstacked"===t.key?it=it.concat(t.values.map(function(t,e){return[t]})):it.push(t.values)}),it.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return a(s[r].defaultConfig(),t)});s[r]().config(n)()})}var at,ot,st=e.select(".guides-group"),lt=e.select(".tooltips-group"),ct=s.tooltipPanel().config({container:lt,fontSize:8})(),ut=s.tooltipPanel().config({container:lt,fontSize:8})(),ft=s.tooltipPanel().config({container:lt,hasTick:!0})();if(!k){var ht=st.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});j.on("mousemove.angular-guide",function(t,e){var r=s.util.getMousePos(W).angle;ht.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;at=l.invert(n);var i=s.util.convertToCartesian(x+12,r+180);ct.text(s.util.round(at)).move([i[0]+w[0],i[1]+w[1]])}).on("mouseout.angular-guide",function(t,e){st.select("line").style({opacity:0})})}var dt=st.select("circle").style({stroke:"grey",fill:"none"});j.on("mousemove.radial-guide",function(t,e){var r=s.util.getMousePos(W).radius;dt.attr({r:r}).style({opacity:.5}),ot=i.invert(s.util.getMousePos(W).radius);var n=s.util.convertToCartesian(r,h.radialAxis.orientation);ut.text(s.util.round(ot)).move([n[0]+w[0],n[1]+w[1]])}).on("mouseout.radial-guide",function(t,e){dt.style({opacity:0}),ft.hide(),ct.hide(),ut.hide()}),e.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(t,r){var i=n.select(this),a=this.style.fill,o="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),o=n.hsl(a).darker().toString(),i.style({fill:o,opacity:1});var c={t:s.util.round(t[0]),r:s.util.round(t[1])};k&&(c.t=M[t[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),h=e.node().getBoundingClientRect(),d=[f.left+f.width/2-H[0]-h.left,f.top+f.height/2-H[1]-h.top];ft.config({color:o}).text(u),ft.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),o=n.hsl(a).darker().toString(),i.style({stroke:o,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&&ft.show()}).on("mouseout.tooltip",function(t,e){ft.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})}),d}var e,r,i,l,c={data:[],layout:{}},u={},f={},h=n.dispatch("hover"),d={};return d.render=function(e){return t(e),this},d.config=function(t){if(!arguments.length)return c;var e=s.util.cloneJson(t);return e.data.forEach(function(t,e){c.data[e]||(c.data[e]={}),a(c.data[e],s.Axis.defaultConfig().data[0]),a(c.data[e],t)}),a(c.layout,s.Axis.defaultConfig().layout),a(c.layout,e.layout),this},d.getLiveConfig=function(){return f},d.getinputConfig=function(){return u},d.radialScale=function(t){return i},d.angularScale=function(t){return l},d.svg=function(){return e},n.rebind(d,h,"on"),d},s.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},s.util={},s.DATAEXTENT="dataExtent",s.AREA="AreaChart",s.LINE="LinePlot",s.DOT="DotPlot",s.BAR="BarChart",s.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},s.util._extend=function(t,e){for(var r in t)e[r]=t[r]},s.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},s.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},s.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},s.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},s.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=s.util.ensureArray(t[e],r)}),t},s.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},s.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},s.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},s.util.arrayLast=function(t){return t[t.length-1]},s.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return r===-2},s.util.flattenArray=function(t){for(var e=[];!s.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},s.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},s.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},s.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},s.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},s.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var s=n.select(this.parentNode).selectAll("path.line").data([0]);s.enter().insert("path"),s.attr({class:"line",d:h(o),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return v.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return v.stroke(r,i,a)},"stroke-width":function(t,e){return v["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return v["stroke-dasharray"](r,i,a)},opacity:function(t,e){return v.opacity(r,i,a)},display:function(t,e){return v.display(r,i,a)}})}};var d=t.angularScale.range(),p=Math.abs(d[1]-d[0])/l[0].length*Math.PI/180,m=n.svg.arc().startAngle(function(t){return-p/2}).endAngle(function(t){return p/2}).innerRadius(function(e){return t.radialScale(u+(e[2]||0))}).outerRadius(function(e){return t.radialScale(u+(e[2]||0))+t.radialScale(e[1])});f.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:m,transform:function(e,r){return"rotate("+(t.orientation+c(e[0])+90)+")"}})};var v={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return i[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},g=n.select(this).selectAll("g.layer").data(l);g.enter().append("g").attr({class:"layer"});var y=g.selectAll("path.mark").data(function(t,e){return t});y.enter().append("path").attr({class:"mark"}),y.style(v).each(f[t.geometryType]),y.exit().remove(),g.exit().remove()})}var e=[s.PolyChart.defaultConfig()],r=n.dispatch("hover"),i={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),a(e[r],s.PolyChart.defaultConfig()),a(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},s.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},s.BarChart=function(){return s.PolyChart()},s.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},s.AreaChart=function(){return s.PolyChart()},s.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},s.DotPlot=function(){return s.PolyChart()},s.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},s.LinePlot=function(){return s.PolyChart()},s.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},s.Legend=function(){function t(){var r=e.legendConfig,i=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var i=a({},r.elements[e]);return i.name=t,i.color=[].concat(r.elements[e].color)[n],i})}),o=n.merge(i);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,h=s.classed("legend-group",!0),d=h.selectAll("svg").data([0]),p=d.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});p.append("g").classed("legend-axis",!0),p.append("g").classed("legend-marks",!0);var m=n.range(o.length),v=n.scale[u?"linear":"ordinal"]().domain(m).range(l),g=n.scale[u?"linear":"ordinal"]().domain(m)[u?"range":"rangePoints"]([0,f]),y=function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":n.svg.symbolTypes.indexOf(t)!=-1?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()};if(u){var b=d.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);b.enter().append("stop"),b.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),d.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var x=d.select(".legend-marks").selectAll("path.legend-mark").data(o);x.enter().append("path").classed("legend-mark",!0),x.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){var r=t.symbol;return y(r,c)},fill:function(t,e){return v(e)}}),x.exit().remove()}var _=n.svg.axis().scale(g).orient("right"),w=d.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(_);return w.selectAll(".domain").style({fill:"none",stroke:"none"}),w.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),w.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=s.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(a(e,t),this):e},n.rebind(t,r,"on"),t},s.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{ -symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},s.tooltipPanel=function(){var t,e,r,i={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},o="tooltip-"+s.tooltipPanel.uid++,l=function(){t=i.container.selectAll("g."+o).data([0]);var n=t.enter().append("g").classed(o,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:i.padding+10,dy:.3*+i.fontSize}),l};return l.text=function(a){var o=n.hsl(i.color).l,s=o>=.5?"#aaa":"white",c=o>=.5?"black":"white",u=a||"";e.style({fill:c,"font-size":i.fontSize+"px"}).text(u);var f=i.padding,h=e.node().getBBox(),d={fill:i.color,stroke:s,"stroke-width":"2px"},p=h.width+2*f+10,m=h.height+2*f;return r.attr({d:"M"+[[10,-m/2],[10,-m/4],[i.hasTick?0:10,0],[10,m/4],[10,m/2],[p,m/2],[p,-m/2]].join("L")+"Z"}).style(d),t.attr({transform:"translate("+[10,-m/2+2*f]+")"}),t.style({display:"block"}),l},l.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),l},l.hide=function(){if(t)return t.style({display:"none"}),l},l.show=function(){if(t)return t.style({display:"block"}),l},l.config=function(t){return a(i,t),l},l},s.tooltipPanel.uid=1,s.adapter={},s.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=a({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",n.dotVisible===!0?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var i=s.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=i.indexOf(t.geometry);n!=-1&&(r.data[e].groupId=n)})}if(t.layout){var o=a({},t.layout);if([[o,["plot_bgcolor"],["backgroundColor"]],[o,["showlegend"],["showLegend"]],[o,["radialaxis"],["radialAxis"]],[o,["angularaxis"],["angularAxis"]],[o.angularaxis,["showline"],["gridLinesVisible"]],[o.angularaxis,["showticklabels"],["labelsVisible"]],[o.angularaxis,["nticks"],["ticksCount"]],[o.angularaxis,["tickorientation"],["tickOrientation"]],[o.angularaxis,["ticksuffix"],["ticksSuffix"]],[o.angularaxis,["range"],["domain"]],[o.angularaxis,["endpadding"],["endPadding"]],[o.radialaxis,["showline"],["gridLinesVisible"]],[o.radialaxis,["tickorientation"],["tickOrientation"]],[o.radialaxis,["ticksuffix"],["ticksSuffix"]],[o.radialaxis,["range"],["domain"]],[o.angularAxis,["showline"],["gridLinesVisible"]],[o.angularAxis,["showticklabels"],["labelsVisible"]],[o.angularAxis,["nticks"],["ticksCount"]],[o.angularAxis,["tickorientation"],["tickOrientation"]],[o.angularAxis,["ticksuffix"],["ticksSuffix"]],[o.angularAxis,["range"],["domain"]],[o.angularAxis,["endpadding"],["endPadding"]],[o.radialAxis,["showline"],["gridLinesVisible"]],[o.radialAxis,["tickorientation"],["tickOrientation"]],[o.radialAxis,["ticksuffix"],["ticksSuffix"]],[o.radialAxis,["range"],["domain"]],[o.font,["outlinecolor"],["outlineColor"]],[o.legend,["traceorder"],["reverseOrder"]],[o,["labeloffset"],["labelOffset"]],[o,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){s.util.translator.apply(null,t.concat(e))}),e?(void 0!==o.tickLength&&(o.angularaxis.ticklen=o.tickLength,delete o.tickLength),o.tickColor&&(o.angularaxis.tickcolor=o.tickColor,delete o.tickColor)):(o.angularAxis&&void 0!==o.angularAxis.ticklen&&(o.tickLength=o.angularAxis.ticklen),o.angularAxis&&void 0!==o.angularAxis.tickcolor&&(o.tickColor=o.angularAxis.tickcolor)),o.legend&&"boolean"!=typeof o.legend.reverseOrder&&(o.legend.reverseOrder="normal"!=o.legend.reverseOrder),o.legend&&"boolean"==typeof o.legend.traceorder&&(o.legend.traceorder=o.legend.traceorder?"reversed":"normal",delete o.legend.reverseOrder),o.margin&&void 0!==o.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(o.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),o.margin=u}e&&(delete o.needsEndSpacing,delete o.minorTickColor,delete o.minorTicks,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksCount,delete o.angularaxis.ticksStep,delete o.angularaxis.rewriteTicks,delete o.angularaxis.nticks,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksCount,delete o.radialaxis.ticksStep,delete o.radialaxis.rewriteTicks,delete o.radialaxis.nticks),r.layout=o}return r},t}},{"../../constants/alignment":708,"../../lib":735,d3:121}],843:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(f=i),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":611,"../../lib":735,"./micropolar":842,"./undo_manager":844,d3:121}],844:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return n!==-1},hasRedo:function(){return n=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":611,"../../subplot_defaults":845,"./axis_defaults":849,"./layout_attributes":851}],851:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes"),a=t("../../../plot_api/edit_types").overrideAll;e.exports=a({domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i},"plot","from-root")},{"../../../components/color/attributes":610,"../../../plot_api/edit_types":763,"./axis_attributes":848}],852:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=t("../../components/color"),u=t("../../components/drawing"),f=t("../cartesian/set_convert"),h=t("../../lib/extend").extendFlat,d=t("../plots"),p=t("../cartesian/axes"),m=t("../../components/dragelement"),v=t("../../components/fx"),g=t("../../components/titles"),y=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var x=n.prototype;x.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},x.plot=function(t,e){var r=this,n=e[r.id],i=e._size;r._hasClipOnAxisFalse=!1;for(var a=0;a_*b?(a=b,i=a*_):(i=y,a=i/_),o=v*i/y,s=g*a/b,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=x,l.xaxis={type:"linear",range:[w+2*T-x,x-w-2*M],domain:[p-o/2,p+o/2],_id:"x"},f(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[w,x-M-T],domain:[m-s/2,m+s/2],_id:"y"},f(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var k=l.yaxis.domain[0],A=l.aaxis=h({},t.aaxis,{visible:!0,range:[w,x-M-T],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[k,k+s*_],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});f(A,l.graphDiv._fullLayout),A.setScale();var E=l.baxis=h({},t.baxis,{visible:!0,range:[x-w-T,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});f(E,l.graphDiv._fullLayout),E.setScale(),A._counteraxis=E;var S=l.caxis=h({},t.caxis,{visible:!0,range:[x-w-M,T],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[k,k+s*_],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});f(S,l.graphDiv._fullLayout),S.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var I="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),l.clipDefRelative.select("path").attr("transform",null);var D="translate("+r+","+(n+a)+")";l.layers.baxis.attr("transform",D),l.layers.bgrid.attr("transform",D);var P="translate("+(r+i/2)+","+n+")rotate(30)";l.layers.aaxis.attr("transform",P),l.layers.agrid.attr("transform",P);var z="translate("+(r+i/2)+","+n+")rotate(-30)";l.layers.caxis.attr("transform",z),l.layers.cgrid.attr("transform",z),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(c.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",E.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(c.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",S.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(c.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),u.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},x.drawAxes=function(t){var e=this,r=e.graphDiv,n=e.id.substr(7)+"title",i=e.aaxis,a=e.baxis,o=e.caxis;if(p.doTicks(r,i,!0),p.doTicks(r,a,!0),p.doTicks(r,o,!0),t){var s=Math.max(i.showticklabels?i.tickfont.size/2:0,(o.showticklabels?.75*o.tickfont.size:0)+("outside"===o.ticks?.87*o.ticklen:0));g.draw(r,"a"+n,{propContainer:i,propName:e.id+".aaxis.title",dfltName:"Component A",attributes:{x:e.x0+e.w/2,y:e.y0-i.titlefont.size/3-s,"text-anchor":"middle"}});var l=(a.showticklabels?a.tickfont.size:0)+("outside"===a.ticks?a.ticklen:0)+3;g.draw(r,"b"+n,{propContainer:a,propName:e.id+".baxis.title",dfltName:"Component B",attributes:{x:e.x0-l,y:e.y0+e.h+.83*a.titlefont.size+l,"text-anchor":"middle"}}),g.draw(r,"c"+n,{propContainer:o,propName:e.id+".caxis.title",dfltName:"Component C",attributes:{x:e.x0+e.w+l,y:e.y0+e.h+.83*o.titlefont.size+l,"text-anchor":"middle"}})}};var w=b.MINZOOM/2+.87,M="m-0.87,.5h"+w+"v3h-"+(w+5.2)+"l"+(w/2+2.6)+",-"+(.87*w+4.5)+"l2.6,1.5l-"+w/2+","+.87*w+"Z",T="m0.87,.5h-"+w+"v3h"+(w+5.2)+"l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-2.6,1.5l"+w/2+","+.87*w+"Z",k="m0,1l"+w/2+","+.87*w+"l2.6,-1.5l-"+(w/2+2.6)+",-"+(.87*w+4.5)+"l-"+(w/2+2.6)+","+(.87*w+4.5)+"l2.6,1.5l"+w/2+",-"+.87*w+"Z",A=!0;x.initInteractions=function(){function t(t,e,r){var n=F.getBoundingClientRect();w=e-n.left,E=r-n.top,S={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=S,L=R.aaxis.range[1]-S.a,I=o(R.graphDiv._fullLayout[R.id].bgcolor).getLuminance(),D="M0,"+R.h+"L"+R.w/2+", 0L"+R.w+","+R.h+"Z",P=!1,z=N.append("path").attr("class","zoombox").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:I>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",D),O=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+R.x0+", "+R.y0+")").style({fill:c.background,stroke:c.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),g()}function e(t,e){return 1-e/R.h}function r(t,e){return 1-(t+(R.h-e)/Math.sqrt(3))/R.w}function n(t,e){return(t-(R.h-e)/Math.sqrt(3))/R.w}function a(t,i){var a=w+t,o=E+i,s=Math.max(0,Math.min(1,e(w,E),e(a,o))),l=Math.max(0,Math.min(1,r(w,E),r(a,o))),c=Math.max(0,Math.min(1,n(w,E),n(a,o))),u=(s/2+c)*R.w,f=(1-s/2-l)*R.w,h=(u+f)/2,d=f-u,p=(1-s)*R.h,m=p-d/_;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),O.transition().style("opacity",1).duration(200),P=!0)}function f(t,e){if(C===S)return 2===e&&x(),i(j);i(j);var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r),A&&j.data&&j._context.showTips&&(l.notifier("Double-click to
zoom back out","long"),A=!1)}function h(){S={a:R.aaxis.range[0],b:R.baxis.range[1],c:R.caxis.range[1]},C=S}function d(t,e){var r=t/R.xaxis._m,n=e/R.yaxis._m;C={a:S.a-n,b:S.b+(r+n)/2,c:S.c-(r-n)/2};var i=[C.a,C.b,C.c].sort(),a={a:i.indexOf(C.a),b:i.indexOf(C.b),c:i.indexOf(C.c)};i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),C={a:i[a.a],b:i[a.b],c:i[a.c]},e=(S.a-C.a)*R.yaxis._m,t=(S.c-C.c-S.b+C.b)*R.xaxis._m);var o="translate("+(R.x0+t)+","+(R.y0+e)+")";R.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",o);var s="translate("+-t+","+-e+")";if(R.clipDefRelative.select("path").attr("transform",s),R.aaxis.range=[C.a,R.sum-C.b-C.c],R.baxis.range=[R.sum-C.a-C.c,C.b],R.caxis.range=[R.sum-C.a-C.b,C.c],R.drawAxes(!1),R.plotContainer.selectAll(".crisp").classed("crisp",!1),R._hasClipOnAxisFalse){var l=R.plotContainer.select(".scatterlayer").selectAll(".points");l.selectAll(".point").call(u.hideOutsideRangePoints,R),l.selectAll(".textpoint").call(u.hideOutsideRangePoints,R)}}function p(t,e){if(t){var r={};r[R.id+".aaxis.min"]=C.a,r[R.id+".baxis.min"]=C.b,r[R.id+".caxis.min"]=C.c,s.relayout(j,r)}else 2===e&&x()}function g(){N.selectAll(".select-outline").remove()}function x(){var t={};t[R.id+".aaxis.min"]=0,t[R.id+".baxis.min"]=0,t[R.id+".caxis.min"]=0,j.emit("plotly_doubleclick",null),s.relayout(j,t)}var w,E,S,L,C,I,D,P,z,O,R=this,F=R.layers.plotbg.select("path").node(),j=R.graphDiv,N=j._fullLayout._zoomlayer,B={element:F,gd:j,plotinfo:{xaxis:R.xaxis,yaxis:R.yaxis},doubleclick:x,subplot:R.id,prepFn:function(e,r,n){B.xaxes=[R.xaxis],B.yaxes=[R.yaxis];var i=j._fullLayout.dragmode;e.shiftKey&&(i="pan"===i?"zoom":"pan"),B.minDrag="lasso"===i?1:void 0,"zoom"===i?(B.moveFn=a,B.doneFn=f,t(e,r,n)):"pan"===i?(B.moveFn=d,B.doneFn=p,h(),g()):"select"!==i&&"lasso"!==i||y(e,r,n,B,i)}};F.onmousemove=function(t){v.hover(j,t,R.id),j._fullLayout._lasthover=F,j._fullLayout._hoversubplot=R.id},F.onmouseout=function(t){j._dragging||m.unhover(j,t)},F.onclick=function(t){v.click(j,t,R.id)},m.init(B)}},{"../../components/color":611,"../../components/dragelement":632,"../../components/drawing":635,"../../components/fx":652,"../../components/titles":701,"../../lib":735,"../../lib/extend":724,"../../plotly":774,"../cartesian/axes":779,"../cartesian/constants":784,"../cartesian/select":795,"../cartesian/set_convert":796,"../plots":838,d3:121,tinycolor2:542}],853:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=t("../plots/plots"),s=a.extendFlat,l=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,c=t.layout,u=l([],a),f=l({},c,n(e.tileClass)),h=t._context||{};if(e.width&&(f.width=e.width),e.height&&(f.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){f.annotations=[];var d=Object.keys(f);for(r=0;r")!==-1?"":e.html(t).text()});return e.remove(),r}function i(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}var a=t("d3"),o=t("../lib"),s=t("../components/drawing"),l=t("../components/color"),c=t("../constants/xmlns_namespaces"),u=new RegExp('("TOBESTRIPPED)|(TOBESTRIPPED")',"g");e.exports=function(t,e,r){var f,h=t._fullLayout,d=h._paper,p=h._toppaper,m=h.width,v=h.height;d.insert("rect",":first-child").call(s.setRect,0,0,m,v).call(l.fill,h.paper_bgcolor);var g=h._basePlotModules||[];for(f=0;f0&&k>0,N=M<=R&&k<=F,B=M<=F&&k<=R,U="h"===g?R>=M*(F/k):F>=k*(R/M);j&&(N||B||U)?b="inside":(b="outside",x.remove(),x=null)}else b="inside";if(!x&&(x=m(e,y,"outside"===b?S:E),_=T.bBox(x.node()),M=_.width,k=_.height,M<=0||k<=0))return void x.remove();var V,H;"outside"===b?(H="both"===v.constraintext||"outside"===v.constraintext,V=a(o,h,d,p,_,g,H)):(H="both"===v.constraintext||"inside"===v.constraintext,V=i(o,h,d,p,_,g,H)),x.attr("transform",V)}}}function i(t,e,r,n,i,a,s){var l,c,u,f,h,d=i.width,p=i.height,m=(i.left+i.right)/2,v=(i.top+i.bottom)/2,g=Math.abs(e-t),y=Math.abs(n-r);g>2*D&&y>2*D?(h=D,g-=2*h,y-=2*h):h=0;var b,x;return d<=g&&p<=y?(b=!1,x=1):d<=y&&p<=g?(b=!0,x=1):dr?(u=(t+e)/2,f=n-h-c/2):(u=(t+e)/2,f=n+h+c/2),o(m,v,u,f,x,b)}function a(t,e,r,n,i,a,s){var l,c="h"===a?Math.abs(n-r):Math.abs(e-t);c>2*D&&(l=D);var u=1;s&&(u="h"===a?Math.min(1,c/i.height):Math.min(1,c/i.width));var f,h,d,p,m=(i.left+i.right)/2,v=(i.top+i.bottom)/2;return f=u*i.width,h=u*i.height,"h"===a?er?(d=(t+e)/2,p=n+l+h/2):(d=(t+e)/2,p=n-l-h/2),o(m,v,d,p,u,!1)}function o(t,e,r,n,i,a){var o,s;return i<1?o="scale("+i+") ":(i=1,o=""),s=a?"rotate("+a+" "+t+" "+e+") ":"","translate("+(r-i*t)+" "+(n-i*e)+")"+o+s}function s(t,e){var r=d(t.text,e);return p(E,r)}function l(t,e){var r=d(t.textposition,e);return m(S,r)}function c(t,e,r){return h(L,t.textfont,e,r)}function u(t,e,r){return h(C,t.insidetextfont,e,r)}function f(t,e,r){return h(I,t.outsidetextfont,e,r)}function h(t,e,r,n){e=e||{};var i=d(e.family,r),a=d(e.size,r),o=d(e.color,r);return{family:p(t.family,i,n.family),size:v(t.size,a,n.size),color:g(t.color,o,n.color)}}function d(t,e){var r;return Array.isArray(t)?ei))return e}return void 0!==r?r:t.dflt}function g(t,e,r){return x(e).isValid()?e:void 0!==r?r:t.dflt}var y=t("d3"),b=t("fast-isnumeric"),x=t("tinycolor2"),_=t("../../lib"),w=t("../../lib/svg_text_utils"),M=t("../../components/color"),T=t("../../components/drawing"),k=t("../../components/errorbars"),A=t("./attributes"),E=A.text,S=A.textposition,L=A.textfont,C=A.insidetextfont,I=A.outsidetextfont,D=3;e.exports=function(t,e,r){var i=e.xaxis,a=e.yaxis,o=t._fullLayout,s=e.plot.select(".barlayer").selectAll("g.trace.bars").data(r);s.enter().append("g").attr("class","trace bars"),s.append("g").attr("class","points").each(function(e){var r=e[0].node3=y.select(this),s=e[0].t,l=e[0].trace,c=s.poffset,u=Array.isArray(c);r.selectAll("g.point").data(_.identity).enter().append("g").classed("point",!0).each(function(r,s){function f(t){return 0===o.bargap&&0===o.bargroupgap?y.round(Math.round(t)-k,2):t}function h(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var d,p,m,v,g=r.p+(u?c[s]:c),x=g+r.w,_=r.b,w=_+r.s;if("h"===l.orientation?(m=a.c2p(g,!0),v=a.c2p(x,!0),d=i.c2p(_,!0),p=i.c2p(w,!0),r.ct=[p,(m+v)/2]):(d=i.c2p(g,!0),p=i.c2p(x,!0),m=a.c2p(_,!0),v=a.c2p(w,!0),r.ct=[(d+p)/2,v]),!(b(d)&&b(p)&&b(m)&&b(v)&&d!==p&&m!==v))return void y.select(this).remove();var T=(r.mlw+1||l.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,k=y.round(T/2%1,2);if(!t._context.staticPlot){var A=M.opacity(r.mc||l.marker.color),E=A<1||T>.01?f:h;d=E(d,p),p=E(p,d),m=E(m,v),v=E(v,m)}var S=y.select(this);S.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+d+","+m+"V"+v+"H"+p+"V"+m+"Z"),n(t,S,e,s,d,p,m,v)})}),s.call(k.plot,e)}},{"../../components/color":611,"../../components/drawing":635,"../../components/errorbars":641,"../../lib":735,"../../lib/svg_text_utils":757,"./attributes":863,d3:121,"fast-isnumeric":131,tinycolor2:542}],871:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i=t.cd,a=t.xaxis,o=t.yaxis,s=[],l=i[0].node3;if(e===!1)for(r=0;rc+s||!y(l))&&(f=!0,h(u,t))}for(var i=r.traces,a=g(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),c="stack"===t._fullLayout.barmode?o:l,u=[l,c],f=!1,d=0;d1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),e.selectAll("g.points").each(function(t){var e=t[0].trace,r=e.marker,o=r.line,s=a.tryColorscale(r,""),l=a.tryColorscale(r,"line");n.select(this).selectAll("path").each(function(t){var e,a,c=(t.mlw+1||o.width+1)-1,u=n.select(this);e="mc"in t?t.mcc=s(t.mc):Array.isArray(r.color)?i.defaultLine:r.color,u.style("stroke-width",c+"px").call(i.fill,e),c&&(a="mlc"in t?t.mlcc=l(t.mlc):Array.isArray(o.color)?i.defaultLine:o.color,u.call(i.stroke,a))})}),e.call(o.style)}},{"../../components/color":611,"../../components/drawing":635,"../../components/errorbars":641,d3:121}],875:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width")}},{"../../components/color":611,"../../components/colorscale/defaults":620,"../../components/colorscale/has_colorscale":624}],876:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":610,"../../lib/extend":724,"../scatter/attributes":1045}],877:[function(t,e,r){"use strict";function n(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var a;a=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||c(t.name)&&["linear","log"].indexOf(r.type)!==-1||u.isDateTime(t.name)&&"date"===r.type)?t.name:i;var o=r.d2c(a,0,t[e+"calendar"]);return n.map(function(){return o})}function i(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&I0){var P=L[r].sort(s),z=P.map(l),O=z.length,R={pos:T[r],pts:P};R.min=z[0],R.max=z[O-1],R.mean=u.mean(z,O),R.sd=u.stdev(z,O,R.mean),R.q1=u.interp(z,.25),R.med=u.interp(z,.5),R.q3=u.interp(z,.75),R.lf=Math.min(R.q1,z[Math.min(u.findBin(2.5*R.q1-1.5*R.q3,z,!0)+1,O-1)]),R.uf=Math.max(R.q3,z[Math.max(u.findBin(2.5*R.q3-1.5*R.q1,z),0)]),R.lo=4*R.q1-3*R.q3,R.uo=4*R.q3-3*R.q1,b.push(R)}return f.expand(h,_,{padded:!0}),b.length>0?(b[0].t={num:v[x],dPos:k,posLetter:m,valLetter:d},v[x]++,b):[{t:{empty:!0}}]}},{"../../lib":735,"../../plots/cartesian/axes":779,"fast-isnumeric":131}],878:[function(t,e,r){"use strict";function n(t,e,r,n){function s(r,n){return o.coerce(t,e,c,r,n)}i(t,e,s,n),e.visible!==!1&&(s("line.color",(t.marker||{}).color||r),s("line.width"),s("fillcolor",l.addOpacity(e.line.color,.5)),s("whiskerwidth"),s("boxmean"),a(t,e,s,{prefix:"box"}))}function i(t,e,r,n){var i,a=r("y"),o=r("x");if(a&&a.length)i="v",o||r("x0");else{if(!o||!o.length)return void(e.visible=!1);i="h",r("y0")}s.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function a(t,e,r,n){var i=n.prefix,a=o.coerce2(t,e,c,"marker.outliercolor"),s=r("marker.line.outliercolor"),l=r(i+"points",a||s?"suspectedoutliers":void 0);l?(r("jitter","all"===l?.3:0),r("pointpos","all"===l?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===l&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("text")):delete e.marker,r("hoveron")}var o=t("../../lib"),s=t("../../registry"),l=t("../../components/color"),c=t("./attributes");e.exports={supplyDefaults:n,handleSampleDefaults:i,handlePointsDefaults:a}},{"../../components/color":611,"../../lib":735,"../../registry":853,"./attributes":876}],879:[function(t,e,r){"use strict";function n(t,e,r,n){var o,s=t.cd,l=s[0].trace,c=l.hoveron,u=[];return c.indexOf("boxes")!==-1&&(u=u.concat(i(t,e,r,n))),c.indexOf("points")!==-1&&(o=a(t,e,r)),"closest"===n?o?[o]:u:o?(u.push(o),u):u}function i(t,e,r,n){var i,a,u,f,h,d,p,m,v,g=t.cd,y=t.xa,b=t.ya,x=g[0].trace,_=g[0].t,w="violin"===x.type,M=[],T="closest"!==n||w?_.bdPos:2.5*_.bdPos,k=function(t){return t.pos+_.bPos-d};w&&"both"!==x.side?("positive"===x.side&&(v=function(t){var e=k(t);return l.inbox(e,e+T)}),"negative"===x.side&&(v=function(t){var e=k(t);return l.inbox(e-T,e)})):v=function(t){var e=k(t);return l.inbox(e-T,e+T)};var A;A=w?function(t){return l.inbox(t.span[0]-h,t.span[1]-h)}:function(t){return l.inbox(t.min-h,t.max-h)},"h"===x.orientation?(h=e,d=r,p=A,m=v,i="y",u=b,a="x",f=y):(h=r,d=e,p=v,m=A,i="x",u=y,a="y",f=b);var E=l.getDistanceFunction(n,p,m);if(l.getClosest(g,E,t),t.index===!1)return[];var S=g[t.index],L=x.line.color,C=(x.marker||{}).color;c.opacity(L)&&x.line.width?t.color=L:c.opacity(C)&&x.boxpoints?t.color=C:t.color=x.fillcolor,t[i+"0"]=u.c2p(S.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(S.pos+_.bPos+_.bdPos,!0),o.tickText(u,u.c2l(S.pos),"hover").text,t[i+"LabelVal"]=S.pos;var I={},D=["med","min","q1","q3","max"],P=["median","min","q1","q3","max"];(x.boxmean||(x.meanline||{}).visible)&&(D.push("mean"),P.push("sd"===x.boxmean?"mean \xb1 \u03c3":"mean")),(x.boxpoints||x.points)&&(D.push("lf","uf"),P.push("lower fence","upper fence"));for(var z=0;z1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?h:1),m=d?2*r.dPos*(-.5+(r.num+.5)/h)*(1-n.boxgap):0,v=p*u.whiskerwidth;if(u.visible!==!0||r.empty)return void c.select(this).remove();var g,y;"h"===u.orientation?(g=a,y=i):(g=i,y=a),r.bPos=m,r.bdPos=p,r.wdPos=v,o(f,{pos:g,val:y},u,r),u.boxpoints&&s(f,{x:i,y:a},u,r),u.boxmean&&l(f,{pos:g,val:y},u,r)})}function o(t,e,r,n){var i,a,o=e.pos,s=e.val,l=n.bPos,f=n.wdPos||0,h=n.bPosPxOffset||0,d=r.whiskerwidth||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.box").data(u.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","box").each(function(t){ -var e=t.pos,n=o.c2p(e+l,!0)+h,p=o.c2p(e+l-i,!0)+h,m=o.c2p(e+l+a,!0)+h,v=o.c2p(e+l-f,!0)+h,g=o.c2p(e+l+f,!0)+h,y=s.c2p(t.q1,!0),b=s.c2p(t.q3,!0),x=u.constrain(s.c2p(t.med,!0),Math.min(y,b)+1,Math.max(y,b)-1),_=s.c2p(r.boxpoints===!1?t.min:t.lf,!0),w=s.c2p(r.boxpoints===!1?t.max:t.uf,!0);"h"===r.orientation?c.select(this).attr("d","M"+x+","+p+"V"+m+"M"+y+","+p+"V"+m+"H"+b+"V"+p+"ZM"+y+","+n+"H"+_+"M"+b+","+n+"H"+w+(0===d?"":"M"+_+","+v+"V"+g+"M"+w+","+v+"V"+g)):c.select(this).attr("d","M"+p+","+x+"H"+m+"M"+p+","+y+"H"+m+"V"+b+"H"+p+"ZM"+n+","+y+"V"+_+"M"+n+","+b+"V"+w+(0===d?"":"M"+v+","+_+"H"+g+"M"+v+","+w+"H"+g))})}function s(t,e,r,a){var o=e.x,s=e.y,l=a.bdPos,c=a.bPos,h=r.boxpoints||r.points;n(),t.selectAll("g.points").data(function(t){return t.forEach(function(t){t.t=a,t.trace=r}),t}).enter().append("g").attr("class","points").selectAll("path").data(function(t){var e,n,a="all"===h?t.pts:t.pts.filter(function(e){return e.vt.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),s=1e-9*o,f=o*p,m=[],v=0;if(r.jitter){if(0===o)for(v=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(f.translatePoints,o,s)}function l(t,e,r,n){var i,a,o=e.pos,s=e.val,l=n.bPos,f=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(u.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+l,!0)+f,n=o.c2p(t.pos+l-i,!0)+f,u=o.c2p(t.pos+l+a,!0)+f,h=s.c2p(t.mean,!0),d=s.c2p(t.mean-t.sd,!0),p=s.c2p(t.mean+t.sd,!0);"h"===r.orientation?c.select(this).attr("d","M"+h+","+n+"V"+u+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+h+","+n+"L"+p+","+e+"Z":"")):c.select(this).attr("d","M"+n+","+h+"H"+u+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+h+"L"+e+","+p+"Z":""))})}var c=t("d3"),u=t("../../lib"),f=t("../../components/drawing"),h=2e9,d=5,p=.01;e.exports={plot:a,plotBoxAndWhiskers:o,plotPoints:s,plotBoxMean:l}},{"../../components/drawing":635,"../../lib":735,d3:121}],884:[function(t,e,r){"use strict";var n=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,i,a=t.cd,o=t.xaxis,s=t.yaxis,l=a[0].trace,c=a[0].node3,u=[];if(l.visible!==!0)return[];if(e===!1)for(r=0;r=10)return null;for(var r=1/0,i=-(1/0),a=t.length,o=0;o0?Math.floor:Math.ceil,D=L>0?Math.ceil:Math.floor,P=L>0?Math.min:Math.max,z=L>0?Math.max:Math.min,O=I(E+C),R=D(S-C);u=A(E);var F=[[u]];for(i=O;i*L=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],899:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,f,h,d,p,v,g=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(z-2,i))),s=i-o,b.length=z,b.crossLength=P,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(h=t.dxydi([],n-1,o,0,s),g.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),d=t.dxydi([],n-1,o,1,s),g.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),g.push(f[0]),y.push(f[1]),l=f;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(P-2,n))),u=n-c,b.length=P,b.crossLength=z,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),g.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),v=t.dxydj([],c,i-1,u,1),g.push(f[0]-v[0]/3),y.push(f[1]-v[1]/3)),g.push(f[0]),y.push(f[1]),l=f;return b.axisLetter=r,b.axis=M,b.crossAxis=S,b.value=e,b.constvar=a,b.index=m,b.x=g,b.y=y,b.smoothing=S.smoothing,b}function s(e){var n,i,o,s,l,c=[],u=[],f={};if(f.length=w.length,f.crossLength=E.length,"b"===r)for(o=Math.max(0,Math.min(z-2,e)),l=Math.min(1,Math.max(0,e-o)),f.xy=function(r){return t.evalxy([],r,e)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||T.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(b=w[u],x=w[y],l=0;lw[w.length-1]||k.push(i(o(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(f=5e-15,h=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+f)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+f))].sort(function(t,e){return t-e}),d=h[0],p=h[1],m=d;m<=p;m++)v=M.tick0+M.dtick*m,T.push(i(o(v),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||k.push(i(o(g),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":724,"../../plots/cartesian/axes":779}],900:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],916:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],c=r[0].trace,u=e.xaxis,f=e.yaxis,h=c.aaxis,d=c.baxis,p=t._fullLayout,m=e.plot.selectAll(".carpetlayer"),v=p._clips,g=n(m,"g","carpet"+c.uid).classed("trace",!0),y=n(g,"g","minorlayer"),b=n(g,"g","majorlayer"),x=n(g,"g","boundarylayer"),_=n(g,"g","labellayer");g.style("opacity",c.opacity),o(u,f,b,h,"a",h._gridlines),o(u,f,b,d,"b",d._gridlines),o(u,f,y,h,"a",h._minorgridlines),o(u,f,y,d,"b",d._minorgridlines),o(u,f,x,h,"a-boundary",h._boundarylines),o(u,f,x,d,"b-boundary",d._boundarylines),l(t,_,c,i,u,f,s(t,u,f,c,i,_,h._labels,"a-label"),s(t,u,f,c,i,_,d._labels,"b-label")),a(c,i,v,u,f)}function a(t,e,r,i,a){var o,s,l,c,u=r.select("#"+t._clipPathId);u.size()||(u=r.append("clipPath").classed("carpetclip",!0));var f=n(u,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(f.font,i.font).text(i.text).call(m.convertToTspans,t),h=f.bBox(this);l.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*h.height+")"),c=Math.max(c,h.width+i.axis.labelpadding)}),l.exit().remove(),c}function l(t,e,r,n,i,a,o,s){var l,u,f,h;l=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],f=r.ab2xy(l,u,!0),h=r.dxyda_rough(l,u),c(t,e,r,n,f,h,r.aaxis,i,a,o,"a-title"),l=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),f=r.ab2xy(l,u,!0),h=r.dxydb_rough(l,u),c(t,e,r,n,f,h,r.baxis,i,a,s,"b-title")}function c(t,e,r,n,i,a,o,s,l,c,h){var d=[];o.title&&d.push(o.title);var v=e.selectAll("text."+h).data(d);v.enter().append("text").classed(h,!0),v.each(function(){var e=p(r,s,l,i,a);["start","both"].indexOf(o.showticklabels)===-1&&(c=0),c+=o.titlefont.size+o.titleoffset,u.select(this).text(o.title||"").call(m.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+c+")").classed("user-select-none",!0).attr("text-anchor","middle").call(f.font,o.titlefont)}),v.exit().remove()}var u=t("d3"),f=t("../../components/drawing"),h=t("./map_1d_array"),d=t("./makepath"),p=t("./orient_text"),m=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||ev},f.c2p=function(t){return t},h.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,f.smoothing,h.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t.xctrl,t.yctrl],f.smoothing,h.smoothing),t.dxydj=l([t.xctrl,t.yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,d,p,m=0,v=0,g=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):(f=Math.max(0,Math.min(c-2,Math.floor(o))),h=o-f),ir[u-1]?(d=u-2,p=1,v=(i-r[u-1])/(r[u-1]-r[u-2])):(d=Math.max(0,Math.min(u-2,Math.floor(s))),p=s-d),m&&(t.dxydi(g,f,d,h,p),l[0]+=g[0]*m,l[1]+=g[1]*m),v&&(t.dxydj(g,f,d,h,p),l[0]+=g[0]*v,l[1]+=g[1]*v)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=g*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":752,"./compute_control_points":903,"./constants":904,"./create_i_derivative_evaluator":905,"./create_j_derivative_evaluator":906,"./create_spline_evaluator":907}],918:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){var i,a,o,s=[],l=[],c=t[0].length,u=t.length,f=0;for(i=0;i0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&a0&&i1e-5);return n.log("Smoother converged to",M,"after",T,"iterations"),t}},{"../../lib":735}],919:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":960,"./has_columns":909}],920:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},editType:"calc"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":612,"../../components/colorscale/attributes":616,"../../lib/extend":724,"../../plots/attributes":777,"../scattergeo/attributes":1083}],921:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata");e.exports=function(t,e){for(var r=e.locations.length,s=new Array(r),l=0;ll&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),i(t,e,o,s,{prefix:"",cLetter:"z"})}},{"../../components/colorscale/defaults":620,"../../lib":735,"./attributes":920}],923:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],924:[function(t,e,r){"use strict";function n(t,e,r,n){var s=r.hi||e.hoverinfo,l="all"===s?a.hoverinfo.flags:s.split("+"),c=l.indexOf("name")!==-1,u=l.indexOf("location")!==-1,f=l.indexOf("z")!==-1,h=l.indexOf("text")!==-1,d=!c&&u,p=[];d?t.nameOverride=r.loc:(c&&(t.nameOverride=e.name),u&&p.push(r.loc)),f&&p.push(function(t){return i.tickText(n,n.c2l(t),"hover").text}(r.z)),h&&o(r,e,p),t.extraText=p.join("
")}var i=t("../../plots/cartesian/axes"),a=t("./attributes"),o=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var i,a,o,s,l=t.cd,c=l[0].trace,u=t.subplot;for(a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,o=t.geometry,s=o.coordinates,l=t.id,c=[];switch(r="RUS"===l||"FJI"===l?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var o=f.tester(n);o.pts.pop(),c.push(o)}:function(t){c.push(f.tester(t))},o.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,f=e._input.contours;if(c>u&&(s.start=f.start=u,u=s.end=f.end=c,c=s.start),!(s.size>0)){var h;h=c===u?1:n(c,u,e.ncontours).dtick,f.size=s.size=h}}return r}},{"../../lib":735,"../../plots/cartesian/axes":779,"../heatmap/calc":957}],930:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),!r.showscale)return void n.autoMargin(t,s);var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,f=c.size||1,h=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:u.color,width:c.showlines!==!1?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}},{"../../components/colorbar/draw":614,"../../plots/plots":838,"./end_plus":934,"./make_color_map":938}],931:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],932:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a,o=n.coerce2(t,e,i,"contours.start"),s=n.coerce2(t,e,i,"contours.end"),l=o===!1||s===!1,c=r("contours.size");!(a=l?e.autocontour=!0:r("autocontour",!1))&&c||r("ncontours")}},{"../../lib":735,"./attributes":928}],933:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}if(!a(t,e,u,c))return void(e.visible=!1);u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)}},{"../../lib":735,"../heatmap/has_columns":963,"../heatmap/xyz_defaults":972,"./attributes":928,"./contours_defaults":932,"./style_defaults":942}],934:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],935:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20?(m=c.CHOOSESADDLE[m][(v[0]||v[1])<0?0:1],t.crossings[p]=c.SADDLEREMAINDER[m]):delete t.crossings[p],!(v=c.NEWDELTA[m])){l.log("Found bad marching index:",m,e,t.level);break}g.push(s(t,e,v)),e[0]+=v[0],e[1]+=v[1],n(g[g.length-1],g[g.length-2],a,u)&&g.pop(),p=e.join(",");var _=v[0]&&(e[0]<0||e[0]>x-2)||v[1]&&(e[1]<0||e[1]>b-2);if(p===d&&v.join(",")===y||r&&_)break;m=t.crossings[p]}1e4===h&&l.log("Infinite loop in contour?");var w,M,T,k,A,E,S,L,C,I,D,P=n(g[0],g[g.length-1],a,u),z=0,O=.2*t.smoothing,R=[],F=0;for(h=1;h=F;h--)if((w=R[h])=F&&w+R[M]L&&C--,t.edgepaths[C]=D.concat(g,I));break}B||(t.edgepaths[L]=g.concat(I))}for(L=0;L20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:c.BOTTOMSTART.indexOf(t)!==-1?i=1:c.LEFTSTART.indexOf(t)!==-1?n=1:c.TOPSTART.indexOf(t)!==-1?i=-1:n=-1,[n,i]}function s(t,e,r){var n=e[0]+Math.max(r[0],0),i=e[1]+Math.max(r[1],0),a=t.z[i][n],o=t.xaxis,s=t.yaxis;if(r[1]){var l=(t.level-a)/(t.z[i][n+1]-a);return[o.c2p((1-l)*t.x[n]+l*t.x[n+1],!0),s.c2p(t.y[i],!0),n+l,i]}var c=(t.level-a)/(t.z[i+1][n]-a);return[o.c2p(t.x[n],!0),s.c2p((1-c)*t.y[i]+c*t.y[i+1],!0),n,i+c]}var l=t("../../lib"),c=t("./constants");e.exports=function(t,e,r){var n,i,o,s,c;for(e=e||.01,r=r||.01,o=0;ot?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r){return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208}return 15===r?0:r}var i=t("./constants");e.exports=function(t){var e,r,a,o,s,l,c,u,f,h=t[0].z,d=h.length,p=h[0].length,m=2===d||2===p;for(r=0;r1e3){d.warn("Too many contours, clipping at 1000",t);break}return i}function a(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}function o(t,e,r,n){var i=t.selectAll("g.contourfill").data([0]);i.enter().append("g").classed("contourfill",!0);var a=i.selectAll("path").data("fill"===n.coloring?e:[]);a.enter().append("path"),a.exit().remove(),a.each(function(t){var e=s(t,r);e?h.select(this).attr("d",e).style("stroke","none"):h.select(this).remove()})}function s(t,e){function r(t){return Math.abs(t[0]-e[2][0])<.01}for(var n,i,a,o,s,l,c=Math.min(t.z[0][0],t.z[0][1]),u=t.edgepaths.length||c<=t.level?"":"M"+e.join("L")+"Z",f=0,h=t.edgepaths.map(function(t,e){return e}),m=!0;h.length;){for(l=p.smoothopen(t.edgepaths[f],t.smoothing),u+=m?l:l.replace(/^M/,"L"),h.splice(h.indexOf(f),1),n=t.edgepaths[f][t.edgepaths[f].length-1],o=-1,a=0;a<4;a++){if(!n){d.log("Missing end?",f,t);break}for(!function(t){return Math.abs(t[1]-e[0][1])<.01}(n)||r(n)?function(t){return Math.abs(t[0]-e[0][0])<.01}(n)?i=e[0]:function(t){return Math.abs(t[1]-e[2][1])<.01}(n)?i=e[3]:r(n)&&(i=e[2]):i=e[1],s=0;s=0&&(i=v,o=s):Math.abs(n[1]-i[1])<.01?Math.abs(n[1]-v[1])<.01&&(v[0]-n[0])*(i[0]-v[0])>=0&&(i=v,o=s):d.log("endpt to newendpt is not vert. or horz.",n,i,v)}if(n=i,o>=0)break;u+="L"+i}if(o===t.edgepaths.length){d.log("unclosed perimeter path");break}f=o,m=h.indexOf(f)===-1,m&&(f=h[0],u+="Z")}for(f=0;fn.center?n.right-o:o-n.left)/(c+Math.abs(Math.sin(l)*a)),h=(s>n.middle?n.bottom-s:s-n.top)/(Math.abs(u)+Math.cos(l)*a);if(f<1||h<1)return 1/0;var p=M.EDGECOST*(1/(f-1)+1/(h-1));p+=M.ANGLECOST*l*l;for(var m=o-c,v=s-u,g=o+c,y=s+u,b=0;b2*M.MAXCOST)break;p&&(o/=2),a=l-o/2,s=a+1.5*o}if(h<=M.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=i*u,h=a*c,d=i*c,p=-a*u,m=[[o-f-h,s-d-p],[o+f-h,s+d-p],[o+f+h,s+d+p],[o-f+h,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var a=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(a.exit().remove(),a.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;h.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(m.convertToTspans,r)}),i){for(var o="",s=0;sE){r("a scale is not linear");break}}if(s.length&&"fast"===k){var S=(s[s.length-1]-s[0])/(s.length-1),L=Math.abs(S/100);for(x=0;xL){r("b scale is not linear");break}}}var C=d(b),I="scaled"===e.xtype?"":n,D=v(e,I,i,o,C,w),P="scaled"===e.ytype?"":s,z=v(e,P,g,y,b.length,M),O={a:D,b:z,z:b};return"levels"===e.contours.type&&c(e,b,"","z"),[O]}var a=t("../../lib"),o=t("../../plots/cartesian/axes"),s=t("../../lib").extendFlat,l=t("../../registry"),c=t("../../components/colorscale/calc"),u=t("../heatmap/has_columns"),f=t("../heatmap/convert_column_xyz"),h=t("../heatmap/clean_2d_array"),d=t("../heatmap/max_row_length"),p=t("../heatmap/interp2d"),m=t("../heatmap/find_empties"),v=t("../heatmap/make_bound_array"),g=t("./defaults"),y=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=y(t,e);if(r&&r.visible&&"legendonly"!==r.visible){if(!e.a||!e.b){var a=t.data[r.index],l=t.data[e.index];l.a||(l.a=a.a),l.b||(l.b=a.b),g(l,e,e._defaultColor,t._fullLayout)}var c=i(t,e),u=e.contours;if(e.autocontour===!0){var f=n(e.zmin,e.zmax,e.ncontours);u.size=f.dtick,u.start=o.tickFirst(f),f.range.reverse(),u.end=o.tickFirst(f),u.start===e.zmin&&(u.start+=u.size),u.end===e.zmax&&(u.end-=u.size),u.start>u.end&&(u.start=u.end=(u.start+u.end)/2),e._input.contours=s({},u)}else{var h=u.start,d=u.end,p=e._input.contours;if(h>d&&(u.start=p.start=d,d=u.end=p.end=h,h=u.start),!(u.size>0)){var m;m=h===d?1:n(h,d,e.ncontours).dtick,p.size=u.size=m}}return c}}},{"../../components/colorscale/calc":617,"../../lib":735,"../../plots/cartesian/axes":779,"../../registry":853,"../carpet/lookup_carpetid":911,"../heatmap/clean_2d_array":958,"../heatmap/convert_column_xyz":960,"../heatmap/find_empties":962,"../heatmap/has_columns":963,"../heatmap/interp2d":966,"../heatmap/make_bound_array":967,"../heatmap/max_row_length":968,"./defaults":950}],945:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-(1/0),f=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],946:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],947:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return o.INEQUALITY_OPS.indexOf(t)!==-1?n=r(i?e[0]:e):o.INTERVAL_OPS.indexOf(t)!==-1?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:o.SET_OPS.indexOf(t)!==-1&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":946,"fast-isnumeric":131}],948:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;["=","<","<=",">",">="].indexOf(e.operation)===-1?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":947,"fast-isnumeric":131}],949:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":735}],952:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":789,"../contour/colorbar":930,"../contour/style":941,"./attributes":943,"./calc":944,"./defaults":950,"./plot":955}],953:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function f(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,x=_):Math.abs(g[1]-y[1])=0&&(y=L,x=_):a.log("endpt to newendpt is not vert. or horz.",g,y,L)}if(x>=0)break;M+=m(g,y),g=y}if(x===e.edgepaths.length){a.log("unclosed perimeter path");break}v=x,k=T.indexOf(v)===-1,k&&(v=T[0],M+=m(g,y)+"Z",g=null)}for(v=0;v=0;F--)z=s.clipsegments[F],O=h([],z.x,_.c2p),R=h([],z.y,A.c2p),O.reverse(),R.reverse(),N.push(d(O,R,z.bicubic));var B="M"+N.join("L")+"Z";c(j,s.clipsegments,_,A,C,m.coloring),u(a,j,_,A,L,I,n,o,s,m.coloring,B),i(j,L,t,r[0],m,e,o),p.setClipUrl(j,o._clipPathId)}}function i(t,e,r,n,i,o,s){var l=t.selectAll("g.contourlines").data([0]);l.enter().append("g").classed("contourlines",!0);var c=i.showlines!==!1,u=i.showlabels,h=c&&u,d=y.createLines(l,c||u,e),v=y.createLineClip(l,h,r._fullLayout._defs,n.trace.uid),g=t.selectAll("g.contourlabels").data(u?[0]:[]);if(g.exit().remove(),g.enter().append("g").classed("contourlabels",!0),u){var x=o.xaxis,_=o.yaxis,w=x._length,M=_._length,T=[[[0,0],[w,0],[w,M],[0,M]]],k=[];m.clearLocationCache();var A=y.labelFormatter(i,n.t.cb,r._fullLayout),E=p.tester.append("text").attr("data-notex",1).call(p.font,i.labelfont),S={left:0,right:w,center:w/2,top:0,bottom:M,middle:M/2},L=Math.sqrt(w*w+M*M),C=b.LABELDISTANCE*L/Math.max(1,e.length/b.LABELINCREASE);d.each(function(t){var e=y.calcTextOpts(t.level,A,E,r);f.select(this).selectAll("path").each(function(r){var n=this,i=m.getVisibleSegment(n,S,e.height/2);if(i&&(a(n,r,t,i,s,e.height),!(i.len<(e.width+e.height)*b.LABELMIN)))for(var o=Math.min(Math.ceil(i.len/C),b.LABELMAX),l=0;lb&&(n.max=b),n.len=n.max-n.min}}function o(t,e,r){var n=t.getPointAtLength(e),i=t.getPointAtLength(r),a=i.x-n.x,o=i.y-n.y,s=Math.sqrt(a*a+o*o);return[a/s,o/s]}function s(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);return[t[0]/e,t[1]/e]}function l(t,e){var r=Math.abs(t[0]*e[0]+t[1]*e[1]);return Math.sqrt(1-r*r)/r}function c(t,e,r,n,i,a){var o,s,l,c,u=t.selectAll("g.contourbg").data([0]);u.enter().append("g").classed("contourbg",!0);var f=u.selectAll("path").data("fill"!==a||i?[]:[0]);f.enter().append("path"),f.exit().remove();var p=[];for(c=0;cI){r("x scale is not linear");break}}if(y.length&&"fast"===L){var D=(y[y.length-1]-y[0])/(y.length-1),P=Math.abs(D/100);for(w=0;wP){r("y scale is not linear");break}}}var z=u(_),O="scaled"===e.xtype?"":m,R=p(e,O,v,g,z,T),F="scaled"===e.ytype?"":y,j=p(e,F,b,x,_.length,k);S||(a.expand(T,R),a.expand(k,j));var N={x:R,y:j,z:_,text:e.text};if(E&&(N.xRanges=M.xRanges,N.yRanges=M.yRanges,N.pts=M.pts),s(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,v,g,z,T),N.yfill=p(B,F,b,x,_.length,k)}return[N]}},{"../../components/colorscale/calc":617,"../../lib":735,"../../plots/cartesian/axes":779,"../../registry":853,"../histogram2d/calc":989,"./clean_2d_array":958,"./convert_column_xyz":960,"./find_empties":962,"./has_columns":963,"./interp2d":966,"./make_bound_array":967,"./max_row_length":968}],958:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){var r,i,a,o,s,l;if(e){for(r=0,s=0;s=0;o--)a=h[o],r=a[0],i=a[1],(s=((f[[r-1,i]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":968}],963:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],964:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=x[0].length||d<0||d>x.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-b[0],r-b[b.length-1])>o)return;if(c){var E;for(k=[2*y[0]-y[1]],E=1;Em&&(g=Math.max(g,Math.abs(t[i][a]-p)/(v-m))))}return g}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":735}],967:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)b=p.c2p(k[M]),M--;for(b0;)w=m.c2p(A[M]),M--;if(w<_&&(x=_,_=w,w=x,D=!0),E&&(k=r[0].xfill,A=r[0].yfill),"fast"!==S){var P="best"===S?0:.5;y=Math.max(-P*p._length,y),b=Math.min((1+P)*p._length,b),_=Math.max(-P*m._length,_),w=Math.min((1+P)*m._length,w)}var z=Math.round(b-y),O=Math.round(w-_),R=z<=0||O<=0,F=e.plot.select(".imagelayer").selectAll("g.hm."+g).data(R?[]:[0]);if(F.enter().append("g").classed("hm",!0).classed(g,!0),F.exit().remove(),!R){var j,N;"fast"===S?(j=C,N=L):(j=z,N=O);var B=document.createElement("canvas");B.width=j,B.height=N;var U,V,H=B.getContext("2d"),q=s.makeColorScaleFunc(s.extractScale(h.colorscale,h.zmin,h.zmax),{noNumericCheck:!0,returnArray:!0});"fast"===S?(U=I?function(t){return C-1-t}:o.identity,V=D?function(t){return L-1-t}:o.identity):(U=function(t){return o.constrain(Math.round(p.c2p(k[t])-y),0,z)},V=function(t){return o.constrain(Math.round(m.c2p(A[t])-_),0,O)});var G,Y,X,W,Z,J,K,Q=V(0),$=[Q,Q],tt=I?0:1,et=D?0:1,rt=0,nt=0,it=0,at=0;if(S){var ot,st=0;try{ot=new Uint8Array(z*O*4)}catch(t){ot=new Array(z*O*4)}if("best"===S){var lt,ct,ut,ft=new Array(k.length),ht=new Array(A.length),dt=new Array(z);for(M=0;M0&&a0&&s0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]d?t>u?t>1.1*l?l:t>1.1*c?c:u:t>f?f:t>h?h:d:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r,n,i,a){if(n&&t>u){var s=o(e,i,a),c=o(r,i,a),f=t===l?0:1;return s[f]!==c[f]}return Math.floor(r/t)-Math.floor(e/t)>.1}function o(t,e,r){var n=e.c2d(t,l,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var s=t("../../constants/numerical"),l=s.ONEAVGYEAR,c=s.ONEAVGMONTH,u=s.ONEDAY,f=s.ONEHOUR,h=s.ONEMIN,d=s.ONESEC,p=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,s,c=-1.1*e,f=-.1*e,h=t-f,d=r[0],m=r[1],v=Math.min(n(d+f,d+h,i,a),n(m+f,m+h,i,a)),g=Math.min(n(d+c,d+f,i,a),n(m+c,m+f,i,a));if(v>g&&gu){var y=o===l?1:6,b=o===l?"M12":"M1";return function(e,r){var n=i.c2d(e,l,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cd.size/1.9?d.size:d.size/Math.ceil(d.size/b);var k=d.start+(d.size-b)/2;x=k-b*Math.ceil((k-x)/b)}for(l=0;l=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}var c=t("fast-isnumeric"),u=t("../../lib"),f=t("../../plots/cartesian/axes"),h=t("../bar/arrays_to_calcdata"),d=t("./bin_functions"),p=t("./norm_functions"),m=t("./average"),v=t("./clean_bins"),g=t("../../constants/numerical").ONEAVGMONTH,y=t("./bin_label_vals");e.exports=function(t,e){if(e.visible===!0){var r,i=[],a=[],o=f.getFromId(t,"h"===e.orientation?e.yaxis||"y":e.xaxis||"x"),s="h"===e.orientation?"y":"x",g={x:"y",y:"x"}[s],b=e[s+"calendar"],x=e.cumulative;v(e,o,s);var _,w,M,T=n(t,e,o,s),k=T[0],A=T[1],E="string"==typeof k.size,S=[],L=E?S:k,C=[],I=[],D=[],P=0,z=e.histnorm,O=e.histfunc,R=z.indexOf("density")!==-1;x.enabled&&R&&(z=z.replace(/ ?density$/,""),R=!1);var F,j="max"===O||"min"===O,N=j?null:0,B=d.count,U=p[z],V=!1,H=function(t){return o.r2c(t,0,b)};for(Array.isArray(e[g])&&"count"!==O&&(F=e[g],V="avg"===O,B=d[O]),r=H(k.start),w=H(k.end)+(r-f.tickIncrement(r,k.size,!1,b))/1e6;r=0&&M=Q;r--)if(a[r]){$=r;break}for(r=Q;r<=$;r++)if(c(i[r])&&c(a[r])){var tt={p:i[r],s:a[r],b:0};x.enabled||(tt.pts=D[r],G?tt.p0=tt.p1=D[r].length?A[D[r][0]]:i[r]:(tt.p0=Z(S[r]),tt.p1=Z(S[r+1],!0))),K.push(tt)}return 1===K.length&&(K[0].width1=f.tickIncrement(K[0].p,k.size,!1,b)-K[0].p),h(K,e),K}}},{"../../constants/numerical":714,"../../lib":735,"../../plots/cartesian/axes":779,"../bar/arrays_to_calcdata":862,"./average":977,"./bin_functions":979,"./bin_label_vals":980,"./clean_bins":982,"./norm_functions":987,"fast-isnumeric":131}],982:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===a?o:1,h=c.size;if(n(h))c.size=h>0?Number(h):f;else if("string"!=typeof h)c.size=f;else{var d=h.charAt(0),p=h.substr(1);p=n(p)?Number(p):0,(p<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=f)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":714,"../../lib":735,"fast-isnumeric":131}],983:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return i.coerce(t,e,c,r,n)}var h=f("x"),d=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var p=f("orientation",d&&!h?"h":"v"),m=e["v"===p?"x":"y"];if(!m||!m.length)return void(e.visible=!1);n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u),e["h"===p?"x":"y"]&&f("histfunc"),o(t,e,f,"h"===p?["y"]:["x"]),s(t,e,f,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"})}},{"../../components/color":611,"../../components/errorbars/defaults":640,"../../lib":735,"../../registry":853,"../bar/style_defaults":875,"./attributes":976,"./bin_defaults":978}],984:[function(t,e,r){"use strict";e.exports=function(t,e){return t.x=e.xVal,t.y=e.yVal,t.xaxis=e.xa,t.yaxis=e.ya,e.pts&&(t.pointNumbers=e.pts,t.binNumber=t.pointNumber,delete t.pointNumber),t}},{}],985:[function(t,e,r){"use strict";var n=t("../bar/hover"),i=t("../../plots/cartesian/axes").hoverLabelText;e.exports=function(t,e,r,a){var o=n(t,e,r,a);if(o){t=o[0];var s=t.cd[t.index],l=t.cd[0].trace;if(!l.cumulative.enabled){var c="h"===l.orientation?"y":"x";t[c+"Label"]=i(t[c+"a"],s.p0,s.p1),t.pts=s.pts}return o}}},{"../../plots/cartesian/axes":779,"../bar/hover":866}],986:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.layoutAttributes=t("../bar/layout_attributes"),n.supplyDefaults=t("./defaults"),n.supplyLayoutDefaults=t("../bar/layout_defaults"),n.calc=t("./calc"),n.setPositions=t("../bar/set_positions"),n.plot=t("../bar/plot"),n.style=t("../bar/style"),n.colorbar=t("../scatter/colorbar"),n.hoverPoints=t("./hover"),n.selectPoints=t("../bar/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="histogram",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","bar","histogram","oriented","errorBarsOK","showLegend"],n.meta={},e.exports=n},{"../../plots/cartesian":789,"../bar/layout_attributes":868,"../bar/layout_defaults":869,"../bar/plot":870,"../bar/select":871,"../bar/set_positions":872,"../bar/style":874,"../scatter/colorbar":1048,"./attributes":976,"./calc":981,"./defaults":983,"./event_data":984,"./hover":985}],987:[function(t,e,r){"use strict";e.exports={percent:function(t,e){for(var r=t.length,n=100/e,i=0;ik&&v.splice(k,v.length-k),y.length>k&&y.splice(k,y.length-k),n(e,"x",v,m,_,M,b),n(e,"y",y,g,w,T,x);var A=[],E=[],S=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,I=[],D=[],P=L?I:e.xbins,z=C?D:e.ybins,O=0,R=[],F=[],j=e.histnorm,N=e.histfunc,B=j.indexOf("density")!==-1,U="max"===N||"min"===N,V=U?null:0,H=c.count,q=u[j],G=!1,Y=[],X=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==N&&(G="avg"===N,H=c[N]);var Z=e.xbins,J=_(Z.start),K=_(Z.end)+(J-l.tickIncrement(J,Z.size,!1,b))/1e6;for(r=J;r=0&&d=0&&p0)s=f(t.alphahull,l);else{var c=["x","y","z"].indexOf(t.delaunayaxis);s=u(l.map(function(t){return[t[(c+1)%3],t[(c+2)%3]]}))}var p={positions:l,cells:s,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:d(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=i(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0], -p.vertexColors=a(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=a(t.facecolor)):(this.color=t.color,p.meshColor=d(t.color)),this.mesh.update(p)},p.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=s},{"../../lib/str2rgbarray":756,"alpha-shape":44,"convex-hull":102,"delaunay-triangulate":123,"gl-mesh3d":209,tinycolor2:542}],1001:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),f=c(["i","j","k"]);if(!u)return void(e.visible=!1);f&&f.forEach(function(t){for(var e=0;eo?a=!0:e1)){var f=s.simpleMap(u.x,e.d2c,0,r.xcalendar),h=s.distinctVals(f).minDiff;a=Math.min(a,h)}}for(a===1/0&&(a=1),c=0;c");w.push(o,o,o,o,o,o,null)}(C,p[C],m[C],v[C],g[C]));e.x=x,e.y=_,e.text=w}},{"../../lib":735,"../../plots/cartesian/axes":779,"../../plots/cartesian/axis_ids":782,"./helpers":1006,"fast-isnumeric":131}],1010:[function(t,e,r){"use strict";var n=t("../../components/colorscale/color_attributes"),i=t("../../components/colorbar/attributes"),a=t("../../components/colorscale/scales"),o=t("../../plots/cartesian/layout_attributes"),s=t("../../plots/font_attributes"),l=t("../../lib/extend"),c=l.extendDeepAll,u=l.extendFlat;e.exports={domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},labelfont:s({editType:"calc"}),tickfont:s({editType:"calc"}),rangefont:s({editType:"calc"}),dimensions:{_isLinkedToArray:"dimension",label:{valType:"string",editType:"calc"},tickvals:u({},o.tickvals,{editType:"calc"}),ticktext:u({},o.ticktext,{editType:"calc"}),tickformat:{valType:"string",dflt:"3s",editType:"calc"},visible:{valType:"boolean",dflt:!0,editType:"calc"},range:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},constraintrange:{valType:"info_array",items:[{valType:"number",editType:"calc"},{valType:"number",editType:"calc"}],editType:"calc"},values:{valType:"data_array",dflt:[],editType:"calc"},editType:"calc"},line:u(c(n("line","calc"),{colorscale:{dflt:a.Viridis},autocolorscale:{dflt:!1}}),{showscale:{valType:"boolean",dflt:!1,editType:"calc"},colorbar:i,editType:"calc"})}},{"../../components/colorbar/attributes":612,"../../components/colorscale/color_attributes":618,"../../components/colorscale/scales":629,"../../lib/extend":724,"../../plots/cartesian/layout_attributes":790,"../../plots/font_attributes":803}],1011:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plots/plots"),a=t("./plot"),o=t("../../constants/xmlns_namespaces"),s=t("./constants");r.name="parcoords",r.attr="type",r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"parcoords","parcoords");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("parcoords"),a=e._has&&e._has("parcoords");i&&!a&&(n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords-line-layers").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._paperdiv.selectAll(".parcoords").remove(),n._glimages.selectAll("*").remove())},r.toSVG=function(t){function e(e){var n=this,i=n.toDataURL("image/png"),a=r.append("svg:image"),l=t._fullLayout._size,c=t._fullData[e.model.key].domain;a.attr({xmlns:o.svg,"xlink:href":i,x:l.l+l.w*c.x[0]-s.overdrag,y:l.t+l.h*(1-c.y[1]),width:(c.x[1]-c.x[0])*l.w+2*s.overdrag,height:(c.y[1]-c.y[0])*l.h,preserveAspectRatio:"none"})}var r=t._fullLayout._glimages,i=n.select(t).selectAll(".svg-container");i.filter(function(t,e){return e===i.size()-1}).selectAll(".parcoords-lines.context, .parcoords-lines.focus").each(e),window.setTimeout(function(){n.selectAll("#filterBarPattern").attr("id","filterBarPattern")},60)}},{"../../constants/xmlns_namespaces":716,"../../plots/plots":838,"./constants":1014,"./plot":1019,d3:121}],1012:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){var r=!!e.line.colorscale&&a.isArray(e.line.color),s=r?e.line.color:Array.apply(0,Array(e.dimensions.reduce(function(t,e){return Math.max(t,e.values.length)},0))).map(function(){return.5}),l=r?e.line.colorscale:[[0,e.line.color],[1,e.line.color]];return n(e,"line")&&i(e,e.line.color,"line","c"),o({lineColor:s,cscale:l})}},{"../../components/colorscale/calc":617,"../../components/colorscale/has_colorscale":624,"../../lib":735,"../../lib/gup":732}],1013:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.line,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,c);var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":614,"../../components/colorscale":625,"../../lib":735,"../../plots/plots":838,"fast-isnumeric":131}],1014:[function(t,e,r){"use strict";e.exports={maxDimensionCount:60,overdrag:45,verticalPadding:2,tickDistance:50,canvasPixelRatio:1,blockLineCount:5e3,scatter:!1,layers:["contextLineLayer","focusLineLayer","pickLineLayer"],axisTitleOffset:28,axisExtentOffset:10,bar:{width:4,capturewidth:10,fillcolor:"magenta",fillopacity:1,strokecolor:"white",strokeopacity:1,strokewidth:1,handleheight:16,handleopacity:1,handleoverlap:0},cn:{axisExtentText:"axis-extent-text",parcoordsLineLayers:"parcoords-line-layers",parcoordsLineLayer:"parcoords-lines",parcoords:"parcoords",parcoordsControlView:"parcoords-control-view",yAxis:"y-axis",axisOverlays:"axis-overlays",axis:"axis",axisHeading:"axis-heading",axisTitle:"axis-title",axisExtent:"axis-extent",axisExtentTop:"axis-extent-top",axisExtentTopText:"axis-extent-top-text",axisExtentBottom:"axis-extent-bottom",axisExtentBottomText:"axis-extent-bottom-text",axisBrush:"axis-brush"},id:{filterBarPattern:"filter-bar-pattern"}}},{}],1015:[function(t,e,r){"use strict";function n(t,e,r,n,i){i("line.color",r),s(t,"line")&&a.isArray(t.line.color)?(i("line.colorscale"),l(t,e,n,i,{prefix:"line.",cLetter:"c"})):i("line.color",r)}function i(t,e){function r(t,e){return a.coerce(n,i,o.dimensions,t,e)}var n,i,s,l=t.dimensions||[],u=e.dimensions=[],f=1/0;for(l.length>c&&(a.log("parcoords traces support up to "+c+" dimensions at the moment"),l.splice(c)),s=0;s0);d&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),f=Math.min(f,i.values.length)),i._index=s,u.push(i)}if(isFinite(f))for(s=0;sf&&(i.values=i.values.slice(0,f));return u}var a=t("../../lib"),o=t("./attributes"),s=t("../../components/colorscale/has_colorscale"),l=t("../../components/colorscale/defaults"),c=t("./constants").maxDimensionCount;e.exports=function(t,e,r,s){function l(r,n){return a.coerce(t,e,o,r,n)}var c=i(t,e);n(t,e,r,s,l),l("domain.x"),l("domain.y"),Array.isArray(c)&&c.length||(e.visible=!1);var u={family:s.font.family,size:Math.round(s.font.size*(10/12)),color:s.font.color};a.coerceFont(l,"labelfont",u),a.coerceFont(l,"tickfont",u),a.coerceFont(l,"rangefont",u)}},{"../../components/colorscale/defaults":620,"../../components/colorscale/has_colorscale":624,"../../lib":735,"./attributes":1010,"./constants":1014}],1016:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1010,"./base_plot":1011,"./calc":1012,"./colorbar":1013,"./defaults":1015,"./plot":1019}],1017:[function(t,e,r){"use strict";function n(t){t.read({x:0,y:0,width:1,height:1,data:x})}function i(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function a(t,e,r,a,o,s){function l(n){var u;u=Math.min(a,o-n*a),s.offset=g*n*a,s.count=g*u,0===n&&(window.cancelAnimationFrame(r.currentRafs[c]),delete r.currentRafs[c],i(t,s.scissorX,s.scissorY,s.scissorWidth,s.viewBoxSize[1])),r.clearOnly||(e(s),n*a+u>>8*e)%256/255}function c(t,e,r,n){for(var i=[],a=0;a=v-4?l(a,v-2-s):.5);return i}function u(t,e,r){var n,i,a,o=[];for(i=0;ih&&(h=t[l].dim2.canvasX,u=l),t[l].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}function s(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?b.scale.ordinal().domain(r.tickvals.map(o(b.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):b.scale.linear().domain(n).range([t-e,e])}function l(t,e){return b.scale.linear().range([t-e,e])}function c(t){return b.scale.linear().domain(i(t))}function u(t){var e=i(t);return t.tickvals&&b.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}function f(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}),n=r.map(function(t){return b.rgb(t)}),i=function(t){return function(e){return e[t]}},a="rgb".split("").map(function(t){return b.scale.linear().clamp(!0).domain(e).range(n.map(i(t)))});return function(t){return a.map(function(e){return e(t)})}}function h(t,e,r){var i=M(e),a=i.trace,o=i.lineColor,s=i.cscale,l=a.line,u=a.domain,h=a.dimensions,d=t.width,p=a.labelfont,m=a.tickfont,v=a.rangefont,b=y.extendDeep({},l,{color:o.map(c({values:o,range:[l.cmin,l.cmax]})),blockLineCount:g.blockLineCount,canvasOverdrag:g.overdrag*g.canvasPixelRatio}),x=Math.floor(d*(u.x[1]-u.x[0])),_=Math.floor(t.height*(u.y[1]-u.y[0])),w=t.margin||{l:80,r:80,t:100,b:80},T=x,k=_;return{key:r,colCount:h.filter(n).length,dimensions:h,tickDistance:g.tickDistance,unitToColor:f(s),lines:b,labelFont:p,tickFont:m,rangeFont:v,translateX:u.x[0]*d,translateY:t.height-u.y[1]*t.height,pad:w,canvasWidth:T*g.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:k*g.canvasPixelRatio,width:T,height:k,canvasPixelRatio:g.canvasPixelRatio}}function d(t){var e=t.width,r=t.height,i=t.dimensions,a=t.canvasPixelRatio,o=function(r){return e*r/Math.max(1,t.colCount-1)},f=g.verticalPadding/(r*a),h=1-2*f,d=function(t){return f+h*t},p={key:t.key,xScale:o,model:t},m={};return p.dimensions=i.filter(n).map(function(e,n){var i=c(e),f=m[e.label];return m[e.label]=(f||0)+1,{key:e.label+(f?"__"+f:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:g.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(i).map(d),xScale:o,x:o(n),canvasX:o(n)*a,unitScale:l(r,g.verticalPadding),domainScale:s(r,g.verticalPadding,e),ordinalScale:u(e),domainToUnitScale:i,filter:e.constraintrange?e.constraintrange.map(i):[0,1],parent:p,model:t}}),p}function p(t){return g.layers.map(function(e){return{key:e,context:"contextLineLayer"===e,pick:"pickLineLayer"===e,viewModel:t,model:t.model}})}function m(t){t.classed(g.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var v=t("./lines"),g=t("./constants"),y=t("../../lib"),b=t("d3"),x=t("../../components/drawing"),_=t("../../lib/gup").keyFun,w=t("../../lib/gup").repeat,M=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i){function o(t){var e=t.selectAll("defs").data(w,_);e.enter().append("defs");var r=e.selectAll("#"+g.id.filterBarPattern).data(w,_);r.enter().append("pattern").attr("id",g.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-g.bar.width).attr("width",g.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(w,_);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",g.bar.width).attr("x",g.bar.width/2).attr("fill",g.bar.fillcolor).attr("fill-opacity",g.bar.fillopacity).attr("stroke",g.bar.strokecolor).attr("stroke-opacity",g.bar.strokeopacity).attr("stroke-width",g.bar.strokewidth)}function s(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function l(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=0;a<1;a++)for(var o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(o,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,f={x:o,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==D&&(c?i.hover(f):i.unhover&&i.unhover(f),D=u)}}),C.style("margin",function(t){var e=t.model.pad;return e.t+"px "+e.r+"px "+e.b+"px "+e.l+"px"}).attr("width",function(t){return t.model.canvasWidth}).attr("height",function(t){return t.model.canvasHeight}).style("width",function(t){return t.model.width+2*g.overdrag+"px"}).style("height",function(t){return t.model.height+"px"}).style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var P=e.selectAll("."+g.cn.parcoords).data(S,_);P.exit().remove(),P.enter().append("g").classed(g.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(o),P.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var z=P.selectAll("."+g.cn.parcoordsControlView).data(w,_);z.enter().append("g").classed(g.cn.parcoordsControlView,!0).style("box-sizing","content-box"),z.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var O=z.selectAll("."+g.cn.yAxis).data(function(t){return t.dimensions},_);O.enter().append("g").classed(g.cn.yAxis,!0).each(function(t){I.dimensions.push(t)}),z.each(function(t){u(O,t)}),C.each(function(t){t.lineLayer=v(this,t.model.lines,t.model.canvasWidth,t.model.canvasHeight,t.viewModel.dimensions,t.viewModel.panels,t.model.unitToColor,t.context,t.pick,g.scatter),t.viewModel[t.key]=t.lineLayer,I.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),O.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),O.call(b.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;E=!1,A||(t.x=Math.max(-g.overdrag,Math.min(t.model.width+g.overdrag,b.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,O.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),u(O,e),O.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),b.select(this).attr("transform","translate("+t.x+", 0)"),O.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer.render&&e.focusLineLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;if(A)return void("ending"===A&&(A=!1));t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,u(O,e),b.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLineLayer&&e.contextLineLayer.render(e.panels,!1,!s(e)),e.focusLineLayer&&e.focusLineLayer.render(e.panels),e.pickLineLayer&&e.pickLineLayer.render(e.panels,!0),E=!0,i&&i.axesMoved&&i.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex}))})),O.exit().remove();var R=O.selectAll("."+g.cn.axisOverlays).data(w,_);R.enter().append("g").classed(g.cn.axisOverlays,!0),R.selectAll("."+g.cn.axis).remove();var F=R.selectAll("."+g.cn.axis).data(w,_);F.enter().append("g").classed(g.cn.axis,!0),F.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();b.select(this).call(b.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),x.font(F.selectAll("text"),t.model.tickFont)}),F.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),F.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var j=R.selectAll("."+g.cn.axisHeading).data(w,_);j.enter().append("g").classed(g.cn.axisHeading,!0);var N=j.selectAll("."+g.cn.axisTitle).data(w,_);N.enter().append("text").classed(g.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),N.attr("transform","translate(0,"+-g.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){x.font(N,t.model.labelFont)});var B=R.selectAll("."+g.cn.axisExtent).data(w,_);B.enter().append("g").classed(g.cn.axisExtent,!0);var U=B.selectAll("."+g.cn.axisExtentTop).data(w,_);U.enter().append("g").classed(g.cn.axisExtentTop,!0),U.attr("transform","translate(0,"+-g.axisExtentOffset+")");var V=U.selectAll("."+g.cn.axisExtentTopText).data(w,_);V.enter().append("text").classed(g.cn.axisExtentTopText,!0).call(m),V.text(function(t){return f(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){x.font(V,t.model.rangeFont)});var H=B.selectAll("."+g.cn.axisExtentBottom).data(w,_);H.enter().append("g").classed(g.cn.axisExtentBottom,!0),H.attr("transform",function(t){return"translate(0,"+(t.model.height+g.axisExtentOffset)+")"});var q=H.selectAll("."+g.cn.axisExtentBottomText).data(w,_);q.enter().append("text").classed(g.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(m),q.text(function(t){return f(t)(t.domainScale.domain()[0])}).each(function(t){x.font(q,t.model.rangeFont)});var G=R.selectAll("."+g.cn.axisBrush).data(w,_),Y=G.enter().append("g").classed(g.cn.axisBrush,!0);G.each(function(t){t.brush||(t.brush=b.svg.brush().y(t.unitScale).on("brushstart",y).on("brush",T).on("brushend",k),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),b.select(this).call(t.brush))}),Y.selectAll("rect").attr("x",-g.bar.capturewidth/2).attr("width",g.bar.capturewidth),Y.selectAll("rect.extent").attr("fill","url(#"+g.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),Y.selectAll(".resize rect").attr("height",g.bar.handleheight).attr("opacity",0).style("visibility","visible"),Y.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",g.bar.handleoverlap-g.bar.handleheight),Y.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",g.bar.handleoverlap);var X=!1,W=!1;return I}},{"../../components/drawing":635,"../../lib":735,"../../lib/gup":732,"./constants":1014,"./lines":1017,d3:121}],1019:[function(t,e,r){"use strict";var n=t("./parcoords");e.exports=function(t,e){var r=t._fullLayout,i=r._paper,a=r._paperdiv,o={},s={},l=r._size;e.forEach(function(e,r){o[r]=t.data[r].dimensions,s[r]=t.data[r].dimensions.slice()});var c=function(e,r,n){var i=s[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},u=function(e){t.emit("plotly_hover",e)},f=function(e){t.emit("plotly_unhover",e)},h=function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return i===-1&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(s[e].filter(n));o[e].sort(a),s[e].filter(function(t){return!n(t)}).sort(function(t){return s[e].indexOf(t)}).forEach(function(t){o[e].splice(o[e].indexOf(t),1),o[e].splice(s[e].indexOf(t),0,t)}),t.emit("plotly_restyle")};n(a,i,e,{width:l.w,height:l.h,margin:{t:l.t,r:l.r,b:l.b,l:l.l}},{filterChanged:c,hover:u,unhover:f,axesMoved:h})}},{"./parcoords":1018}],1020:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,s=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},s,{}),insidetextfont:o({},s,{}),outsidetextfont:o({},s,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":610,"../../lib/extend":724,"../../plots/attributes":777,"../../plots/font_attributes":803}],1021:[function(t,e,r){"use strict";function n(t,e){for(var r=[],n=0;n")}}return g};var l},{"../../components/color":611,"./helpers":1025,"fast-isnumeric":131,tinycolor2:542}],1023:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),h=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),h&&"none"!==h){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,v=p||"outside"===d;if(m||v){var g=s(o,"textfont",a.font);m&&s(o,"insidetextfont",g),v&&s(o,"outsidetextfont",g)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":735,"./attributes":1020}],1024:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":649}],1025:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return r.lastIndexOf(".")!==-1&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),v={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},g=v.scale>h.scale?v:h;return c.scale<1&&g.scale>c.scale?g:c}function i(t,e){if(t.v===e.vTotal&&!e.trace.hole)return 1;var r=Math.PI*Math.min(t.v/e.vTotal,.5);return Math.min(1/(1+1/Math.sin(r)),(1-e.trace.hole)/2)}function a(t,e){var r=e.pxmid[0],n=e.pxmid[1],i=t.width/2,a=t.height/2;return r<0&&(i*=-1),n<0&&(a*=-1),{scale:1,rCenter:1,rotate:0,x:i+Math.abs(a)*(i>0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}function o(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}var i,a,o,s,l,c,u,f,h,d,m,v,g;for(a=0;a<2;a++)for(o=a?r:n,l=a?Math.max:Math.min,u=a?1:-1,i=0;i<2;i++){for(s=i?Math.max:Math.min,c=i?1:-1,f=t[a][i],f.sort(o),h=t[1-a][i],d=h.concat(f),v=[],m=0;m0&&(t.labelExtraY=x),Array.isArray(e.pull))for(i=0;i=(p.castOption(e.pull,o.pts)||0)||((t.pxmid[1]-o.pxmid[1])*u>0?(f=o.cyFinal+l(o.px0[1],o.px1[1]),(x=f-g-t.labelExtraY)*u>0&&(t.labelExtraY+=x)):(y+t.labelExtraY-b)*u>0&&(n=3*c*Math.abs(i-d.indexOf(t)),h=o.cxFinal+s(o.px0[0],o.px1[0]),(m=h+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*c>0&&(t.labelExtraX+=m)))}(v[m],y)}}}function s(t,e){var r,n,i,a,o,s,l,c,u,f=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&f.indexOf(s.scalegroup)===-1&&f.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}var c=t("d3"),u=t("../../components/fx"),f=t("../../components/color"),h=t("../../components/drawing"),d=t("../../lib/svg_text_utils"),p=t("./helpers"),m=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;s(e,r._size);var v=r._pielayer.selectAll("g.trace").data(e);v.enter().append("g").attr({"stroke-linejoin":"round",class:"trace"}),v.exit().remove(),v.order(),v.each(function(e){var s=c.select(this),v=e[0],g=v.trace;l(e),s.each(function(){var s=c.select(this).selectAll("g.slice").data(e);s.enter().append("g").classed("slice",!0),s.exit().remove();var l=[[[],[]],[[],[]]],y=!1;s.each(function(e){function o(){var n=t._fullLayout,a=t._fullData[g.index];if(!t._dragging&&n.hovermode!==!1){var o=a.hoverinfo;if(Array.isArray(o)&&(o=u.castHoverinfo({hoverinfo:[p.castOption(o,e.pts)],_module:g._module},n,0)),"all"===o&&(o="label+text+value+percent+name"),"none"!==o&&"skip"!==o&&o){var s=i(e,v),l=x+e.pxmid[0]*(1-s),f=_+e.pxmid[1]*(1-s),h=r.separators,d=[];if(o.indexOf("label")!==-1&&d.push(e.label),o.indexOf("text")!==-1){var y=p.castOption(a.hovertext||a.text,e.pts);y&&d.push(y)}o.indexOf("value")!==-1&&d.push(p.formatPieValue(e.v,h)),o.indexOf("percent")!==-1&&d.push(p.formatPiePercent(e.v/v.vTotal,h));var b=g.hoverlabel,w=b.font;u.loneHover({x0:l-s*v.r,x1:l+s*v.r,y:f,text:d.join("
"),name:o.indexOf("name")!==-1?a.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:p.castOption(b.bgcolor,e.pts)||e.color,borderColor:p.castOption(b.bordercolor,e.pts),fontFamily:p.castOption(w.family,e.pts),fontSize:p.castOption(w.size,e.pts),fontColor:p.castOption(w.color,e.pts)},{container:n._hoverlayer.node(),outerContainer:n._paper.node(),gd:t}),T=!0}t.emit("plotly_hover",{points:[m(e,a)],event:c.event}),k=!0}}function s(r){var n=t._fullLayout,i=t._fullData[g.index];k&&(r.originalEvent=c.event,t.emit("plotly_unhover",{points:[m(e,i)],event:c.event}),k=!1),T&&(u.loneUnhover(n._hoverlayer.node()),T=!1)}function f(){var r=t._fullLayout,n=t._fullData[g.index];t._dragging||r.hovermode===!1||(t._hoverdata=[m(e,n)],u.click(t,c.event))}function b(t,r,n,i){return"a"+i*v.r+","+i*v.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)return void c.select(this).selectAll("path,g").remove();e.pointNumber=e.i,e.curveNumber=g.index,l[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var x=v.cx,_=v.cy,w=c.select(this),M=w.selectAll("path.surface").data([e]),T=!1,k=!1;if(M.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),w.select("path.textline").remove(),w.on("mouseover",o).on("mouseout",s).on("click",f),g.pull){var A=+p.castOption(g.pull,e.pts)||0;A>0&&(x+=A*e.pxmid[0],_+=A*e.pxmid[1])}e.cxFinal=x,e.cyFinal=_;var E=g.hole;if(e.v===v.vTotal){var S="M"+(x+e.px0[0])+","+(_+e.px0[1])+b(e.px0,e.pxmid,!0,1)+b(e.pxmid,e.px0,!0,1)+"Z";E?M.attr("d","M"+(x+E*e.px0[0])+","+(_+E*e.px0[1])+b(e.px0,e.pxmid,!1,E)+b(e.pxmid,e.px0,!1,E)+"Z"+S):M.attr("d",S)}else{var L=b(e.px0,e.px1,!0,1);if(E){var C=1-E;M.attr("d","M"+(x+E*e.px1[0])+","+(_+E*e.px1[1])+b(e.px1,e.px0,!1,E)+"l"+C*e.px0[0]+","+C*e.px0[1]+L+"Z")}else M.attr("d","M"+x+","+_+"l"+e.px0[0]+","+e.px0[1]+L+"Z")}var I=p.castOption(g.textposition,e.pts),D=w.selectAll("g.slicetext").data(e.text&&"none"!==I?[0]:[]);D.enter().append("g").classed("slicetext",!0),D.exit().remove(),D.each(function(){var r=c.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(h.font,"outside"===I?g.outsidetextfont:g.insidetextfont).call(d.convertToTspans,t);var i,o=h.bBox(r.node());"outside"===I?i=a(o,e):(i=n(o,e,v),"auto"===I&&i.scale<1&&(r.call(h.font,g.outsidetextfont),g.outsidetextfont.family===g.insidetextfont.family&&g.outsidetextfont.size===g.insidetextfont.size||(o=h.bBox(r.node())),i=a(o,e)));var s=x+e.pxmid[0]*i.rCenter+(i.x||0),l=_+e.pxmid[1]*i.rCenter+(i.y||0);i.outside&&(e.yLabelMin=l-o.height/2,e.yLabelMid=l,e.yLabelMax=l+o.height/2,e.labelExtraX=0,e.labelExtraY=0,y=!0),r.attr("transform","translate("+s+","+l+")"+(i.scale<1?"scale("+i.scale+")":"")+(i.rotate?"rotate("+i.rotate+")":"")+"translate("+-(o.left+o.right)/2+","+-(o.top+o.bottom)/2+")")})}),y&&o(l,g),s.each(function(t){if(t.labelExtraX||t.labelExtraY){var e=c.select(this),r=e.select("g.slicetext text");r.attr("transform","translate("+t.labelExtraX+","+t.labelExtraY+")"+r.attr("transform"));var n=t.cxFinal+t.pxmid[0],i=t.cyFinal+t.pxmid[1],a="M"+n+","+i,o=(t.yLabelMax-t.yLabelMin)*(t.pxmid[0]<0?-1:1)/4;if(t.labelExtraX){var s=t.labelExtraX*t.pxmid[1]/t.pxmid[0],l=t.yLabelMid+t.labelExtraY-(t.cyFinal+t.pxmid[1]);Math.abs(s)>Math.abs(l)?a+="l"+l*t.pxmid[0]/t.pxmid[1]+","+l+"H"+(n+t.labelExtraX+o):a+="l"+t.labelExtraX+","+s+"v"+(l-s)+"h"+o}else a+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(f.stroke,g.outsidetextfont.color).attr({"stroke-width":Math.min(2,g.outsidetextfont.size/8),d:a,fill:"none"})}})})}),setTimeout(function(){v.selectAll("tspan").each(function(){var t=c.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":611,"../../components/drawing":635,"../../components/fx":652,"../../lib/svg_text_utils":757,"./event_data":1024,"./helpers":1025,d3:121}],1030:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0],r=e.trace,a=n.select(this);a.style({opacity:r.opacity}),a.selectAll("path.surface").each(function(t){n.select(this).call(i,t,r)})})}},{"./style_one":1031,d3:121}],1031:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":611,"./helpers":1025}],1032:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scattergl/attributes":1091}],1033:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=a(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}function i(t,e){var r=new n(t,e.uid);return r.update(e),r}var a=t("gl-pointcloud2d"),o=t("../../lib/str2rgbarray"),s=t("../scatter/get_trace_color"),l=["xaxis","yaxis"],c=n.prototype;c.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},c.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-(1/0),-(1/0)],this.updateFast(t),this.color=s(t,{})},c.updateFast=function(t){var e,r,n,i,a,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);if(h)r=h;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),ad[3]&&(d[3]=a);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=o(t.marker.color),m=o(t.marker.border.color),v=t.opacity*t.marker.opacity;p[3]*=v,this.pointcloudOptions.color=p;var g=t.marker.blend;if(null===g){g=l.length<100||c.length<100}this.pointcloudOptions.blend=g,m[3]*=v,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},c.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)r=this.scene[l[o]],n=r._min,n||(n=[]),n.push({val:t[o],pad:a}),i=r._max,i||(i=[]),i.push({val:t[o+2],pad:a})},c.dispose=function(){this.pointcloud.dispose()},e.exports=i},{"../../lib/str2rgbarray":756,"../scatter/get_trace_color":1054,"gl-pointcloud2d":235}],1034:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":735,"./attributes":1032}],1035:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":815,"../scatter3d/calc":1070,"./attributes":1032,"./convert":1033,"./defaults":1034}],1036:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;e.exports=l({hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":610,"../../components/fx/attributes":644,"../../lib/extend":724,"../../plot_api/edit_types":763,"../../plots/attributes":777,"../../plots/font_attributes":803}],1037:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/plots"),a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.attr="type",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i.getSubplotCalcData(t.calcdata,"sankey","sankey");e.length&&a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":653,"../../plot_api/edit_types":763,"../../plots/plots":838,"./plot":1042}],1038:[function(t,e,r){"use strict";function n(t,e,r){for(var n=t.map(function(){return[]}),a=0;a1})}var i=t("strongly-connected-components"),a=t("../../lib"),o=t("../../lib/gup").wrap;e.exports=function(t,e){return n(e.node.label,e.link.source,e.link.target)&&(a.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),o({link:e.link,node:e.node})}},{"../../lib":735,"../../lib/gup":732,"strongly-connected-components":537}],1039:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}], -1040:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}c("node.label"),c("node.pad"),c("node.thickness"),c("node.line.color"),c("node.line.width");var u=function(t){return a[t%a.length]};c("node.color",e.node.label.map(function(t,e){return o.addOpacity(u(e),.8)})),c("link.label"),c("link.source"),c("link.target"),c("link.value"),c("link.line.color"),c("link.line.width"),c("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),c("domain.x"),c("domain.y"),c("orientation"),c("valueformat"),c("valuesuffix"),c("arrangement"),n.coerceFont(c,"textfont",n.extendFlat({},l.font));var f=function(t,r){return e.link.source.indexOf(r)===-1&&e.link.target.indexOf(r)===-1};e.node.label.some(f)&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":611,"../../components/color/attributes":610,"../../lib":735,"./attributes":1036,tinycolor2:542}],1041:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1036,"./base_plot":1037,"./calc":1038,"./defaults":1040,"./plot":1042}],1042:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return t.node.sourceLinks.indexOf(e.link)!==-1||t.node.targetLinks.indexOf(e.link)!==-1}}function l(t){return function(e){return e.node.sourceLinks.indexOf(t.link)!==-1||e.node.targetLinks.indexOf(t.link)!==-1}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+b.sankeyNode).filter(l(t)).call(c)}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(b.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),v=t("../../components/fx"),g=t("../../components/color"),y=t("../../lib"),b=t("./constants").cn;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=function(e,r){var n=r.link;n.originalEvent=p.event,t._hoverdata=[n],v.click(t,{target:!0})},y=function(e,r,n){p.select(e).call(f.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},x=function(e,i){var s=i.link.trace,l=t._fullLayout._paperdiv.node().getBoundingClientRect(),c=e.getBoundingClientRect(),u=c.left+c.width/2,f=c.top+c.height/2,h=v.loneHover({x:u-l.left,y:f-l.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",["Source:",i.link.source.label].join(" "),["Target:",i.link.target.label].join(" ")].filter(n).join("
"),color:d(s,"bgcolor")||g.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(g,.85),o(g)},k=function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),v.loneUnhover(r._hoverlayer.node())};m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:y,follow:x,unhover:_,select:l},nodeEvents:{hover:M,follow:T,unhover:k,select:w}})}},{"../../components/color":611,"../../components/fx":652,"../../lib":735,"./constants":1039,"./render":1043,d3:121}],1043:[function(t,e,r){"use strict";function n(t){var e,r=[];for(e=0;e1||t.linkLineWidth>0}function g(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function y(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function b(t){return C.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+L.nodeTextOffsetHorizontal:L.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-L.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-L.nodeTextOffsetHorizontal,0]])}function x(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function _(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function w(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function M(t){return t.horizontal&&t.left?"100%":"0%"}function T(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function k(t,e,r){var n=C.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(n){if("fixed"!==n.arrangement&&(R.raiseToTop(this),n.interactionState.dragInProgress=n.node,i(n.node),n.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,n.interactionState.hovered),n.interactionState.hovered=!1),"snap"===n.arrangement)){var a=n.traceId+"|"+Math.floor(n.node.originalX);n.forceLayouts[a]?n.forceLayouts[a].alpha(1):A(t,a,n),E(t,e,n,a)}}).on("drag",function(r){if("fixed"!==r.arrangement){var n=C.event.x,o=C.event.y;"snap"===r.arrangement?(r.node.x=n,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=n),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),i(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),p(t.filter(a(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(n)}function A(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=O.forceSimulation(n).alphaDecay(0).force("collide",O.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(L.forceIterations)).force("constrain",S(t,e,n,r)).stop()}function E(t,e,r,n){window.requestAnimationFrame(function i(){for(var o=0;o0&&window.requestAnimationFrame(i)})}function S(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}var L=t("./constants"),C=t("d3"),I=t("tinycolor2"),D=t("../../components/color"),P=t("../../components/drawing"),z=t("@plotly/d3-sankey").sankey,O=t("d3-force"),R=t("../../lib"),F=t("../../lib/gup").keyFun,j=t("../../lib/gup").repeat,N=t("../../lib/gup").unwrap;e.exports=function(t,e,r,i){var a=t.selectAll("."+L.cn.sankey).data(e.filter(function(t){return N(t).trace.visible}).map(l.bind(null,r)),F);a.exit().remove(),a.enter().append("g").classed(L.cn.sankey,!0).style("box-sizing","content-box").style("position","absolute").style("left",0).style("shape-rendering","geometricPrecision").style("pointer-events","auto").style("box-sizing","content-box").attr("transform",g),a.transition().ease(L.ease).duration(L.duration).attr("transform",g);var o=a.selectAll("."+L.cn.sankeyLinks).data(j,F);o.enter().append("g").classed(L.cn.sankeyLinks,!0).style("fill","none");var s=o.selectAll("."+L.cn.sankeyLink).data(function(t){var e={};return t.sankey.links().filter(function(t){return t.value}).map(c.bind(null,e,t))},F);s.enter().append("path").classed(L.cn.sankeyLink,!0).attr("d",h).call(T,a,i.linkEvents),s.style("stroke",function(t){return v(t)?D.tinyRGB(I(t.linkLineColor)):t.tinyColorHue}).style("stroke-opacity",function(t){return v(t)?D.opacity(t.linkLineColor):t.tinyColorAlpha}).style("stroke-width",function(t){return v(t)?t.linkLineWidth:1}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),s.transition().ease(L.ease).duration(L.duration).attr("d",h),s.exit().transition().ease(L.ease).duration(L.duration).style("opacity",0).remove();var d=a.selectAll("."+L.cn.sankeyNodeSet).data(j,F);d.enter().append("g").classed(L.cn.sankeyNodeSet,!0),d.style("cursor",function(t){switch(t.arrangement){case"fixed":return"default";case"perpendicular":return"ns-resize";default:return"move"}});var p=d.selectAll("."+L.cn.sankeyNode).data(function(t){var e=t.sankey.nodes(),r={};return n(e),e.filter(function(t){return t.value}).map(u.bind(null,r,t))},F);p.enter().append("g").classed(L.cn.sankeyNode,!0).call(f).call(T,a,i.nodeEvents),p.call(k,s,i),p.transition().ease(L.ease).duration(L.duration).call(f),p.exit().transition().ease(L.ease).duration(L.duration).style("opacity",0).remove();var A=p.selectAll("."+L.cn.nodeRect).data(j);A.enter().append("rect").classed(L.cn.nodeRect,!0).call(m),A.style("stroke-width",function(t){return t.nodeLineWidth}).style("stroke",function(t){return D.tinyRGB(I(t.nodeLineColor))}).style("stroke-opacity",function(t){return D.opacity(t.nodeLineColor)}).style("fill",function(t){return t.tinyColorHue}).style("fill-opacity",function(t){return t.tinyColorAlpha}),A.transition().ease(L.ease).duration(L.duration).call(m);var E=p.selectAll("."+L.cn.nodeCapture).data(j);E.enter().append("rect").classed(L.cn.nodeCapture,!0).style("fill-opacity",0),E.attr("x",function(t){return t.zoneX}).attr("y",function(t){return t.zoneY}).attr("width",function(t){return t.zoneWidth}).attr("height",function(t){return t.zoneHeight});var S=p.selectAll("."+L.cn.nodeCentered).data(j);S.enter().append("g").classed(L.cn.nodeCentered,!0).attr("transform",y),S.transition().ease(L.ease).duration(L.duration).attr("transform",y);var C=S.selectAll("."+L.cn.nodeLabelGuide).data(j);C.enter().append("path").classed(L.cn.nodeLabelGuide,!0).attr("id",function(t){return t.uniqueNodeLabelPathId}).attr("d",b).attr("transform",x),C.transition().ease(L.ease).duration(L.duration).attr("d",b).attr("transform",x);var z=S.selectAll("."+L.cn.nodeLabel).data(j);z.enter().append("text").classed(L.cn.nodeLabel,!0).attr("transform",_).style("user-select","none").style("cursor","default").style("fill","black"),z.style("text-shadow",function(t){return t.horizontal?"-1px 1px 1px #fff, 1px 1px 1px #fff, 1px -1px 1px #fff, -1px -1px 1px #fff":"none"}).each(function(t){P.font(z,t.textFont)}),z.transition().ease(L.ease).duration(L.duration).attr("transform",_);var O=z.selectAll("."+L.cn.nodeLabelTextPath).data(j);O.enter().append("textPath").classed(L.cn.nodeLabelTextPath,!0).attr("alignment-baseline","middle").attr("xlink:href",function(t){return"#"+t.uniqueNodeLabelPathId}).attr("startOffset",M).style("fill",w),O.text(function(t){return t.horizontal||t.node.dy>5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),O.transition().ease(L.ease).duration(L.duration).attr("startOffset",M).style("fill",w)}},{"../../components/color":611,"../../components/drawing":635,"../../lib":735,"../../lib/gup":732,"./constants":1039,"@plotly/d3-sankey":39,d3:121,"d3-force":117,tinycolor2:542}],1044:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rm&&d.splice(m,d.length-m),p.length>m&&p.splice(m,p.length-m);var v={padded:!0},g={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,c=r.size,Array.isArray(c)){var y={type:"linear"};i.setConvert(y),c=y.makeCalcdata(e.marker,"size"),c.length>m&&c.splice(m,c.length-m)}var b,x=1.6*(e.marker.sizeref||1);b="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/x),3)}:function(t){return Math.max((t||0)/x,3)},v.ppad=g.ppad=Array.isArray(c)?c.map(b):b(c)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?e.error_y.visible||["tonexty","tozeroy"].indexOf(e.fill)===-1&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||d[0]===d[m-1]&&p[0]===p[m-1]?["tonextx","tozerox"].indexOf(e.fill)!==-1&&(g.padded=!1):g.tozero=!0,i.expand(f,d,v),i.expand(h,p,g);var _=new Array(m);for(u=0;u=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1048:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0===l||!l.showscale)return void a.autoMargin(t,c);var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}},{"../../components/colorbar/draw":614,"../../components/colorscale":625,"../../lib":735,"../../plots/plots":838,"fast-isnumeric":131}],1049:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":617,"../../components/colorscale/has_colorscale":624,"./subtypes":1066}],1050:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1051:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var v=s(t,e,p,m),g=vH!=O>=H&&(D=C[S-1][0],P=C[S][0],I=D+(P-D)*(H-z)/(O-z),N=Math.min(N,I),B=Math.max(B,I));N=Math.max(N,0),B=Math.min(B,d._length);var q=s.defaultLine;return s.opacity(h.fillcolor)?q=h.fillcolor:s.opacity((h.line||{}).color)&&(q=h.line.color),n.extendFlat(t,{distance:c+10,x0:N,x1:B,y0:H,y1:H,color:q}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":611,"../../components/errorbars":641,"../../components/fx":652,"../../lib":735,"./fill_hover_text":1052,"./get_trace_color":1054}],1056:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":789,"./arrays_to_calcdata":1044,"./attributes":1045,"./calc":1046,"./clean_data":1047,"./colorbar":1048,"./defaults":1051,"./hover":1055,"./plot":1063,"./select":1064,"./style":1065,"./subtypes":1066}],1057:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":620,"../../components/colorscale/has_colorscale":624}],1058:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=O.c2p(t[e].x),i=R.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function l(t){var e=t[0]/O._length,r=t[1]/R._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=it[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)et||t[1]nt)return[o(t[0],tt,et),o(t[1],rt,nt)]}function h(t,e){return t[0]===e[0]&&(t[0]===tt||t[0]===et)||(t[1]===e[1]&&(t[1]===rt||t[1]===nt)||void 0)}function d(t,e){var r=[],n=f(t),i=f(e);return n&&i&&h(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=f(n),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){var u;u=o&&s?c>0==o[t]>s[t]?o:s:o||s,u[t]+=c}return l}}function m(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?tt:et,nt]:[n>0?et:tt,rt]}function v(t){var e=t[0],r=t[1],n=e===q[G-1][0],i=r===q[G-1][1];if(!n||!i)if(G>1){var a=e===q[G-2][0],o=r===q[G-2][1];n&&(e===tt||e===et)&&a?o?G--:q[G-1]=t:i&&(r===rt||r===nt)&&o?a?G--:q[G-1]=t:q[G++]=t}else q[G++]=t}function g(t){q[G-1][0]!==t[0]&&q[G-1][1]!==t[1]&&v([W,Z]),v(t),J=null,W=Z=0}function y(t){if(Y=t[0]et?et:0,X=t[1]nt?nt:0,Y||X){if(G)if(J){var e=Q(J,t);e.length>1&&(g(e[0]),q[G++]=e[1])}else K=Q(q[G-1],t)[0],q[G++]=K;else q[G++]=[Y||t[0],X||t[1]];var r=q[G-1];Y&&X&&(r[0]!==Y||r[1]!==X)?(J&&(W!==Y&&Z!==X?v(W&&Z?m(J,t):[W||Y,Z||X]):W&&Z&&v([W,Z])),v([Y,X])):W-Y&&Z-X&&v([Y||W,X||Z]),J=t,W=Y,Z=X}else J&&g(Q(J,t)[0]),q[G++]=t}var b,x,_,w,M,T,k,A,E,S,L,C,I,D,P,z,O=e.xaxis,R=e.yaxis,F=e.simplify,j=e.connectGaps,N=e.baseTolerance,B=e.shape,U="linear"===B,V=[],H=s.minTolerance,q=new Array(t.length),G=0;F||(N=H=-1);var Y,X,W,Z,J,K,Q,$=s.maxScreensAway,tt=-O._length*$,et=O._length*(1+$),rt=-R._length*$,nt=R._length*(1+$),it=[[tt,rt,et,rt],[et,rt,et,nt],[et,nt,tt,nt],[tt,nt,tt,rt]];for("linear"===B||"spline"===B?Q=u:"hv"===B||"vh"===B?Q=d:"hvh"===B?Q=p(0,tt,et):"vhv"===B&&(Q=p(1,rt,nt)),b=0;bl(T))break;_=T,I=E[0]*A[0]+E[1]*A[1],I>L?(L=I,w=T,k=!1):I=t.length||!T)break;y(T),x=T}}else y(w)}J&&v([W||J[0],Z||J[1]]),V.push(q.slice(0,G))}return V}},{"../../constants/numerical":714,"../../lib":735,"./constants":1050}],1059:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1060:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i,a=null,o=0;o0?Math.max(e,i):0}}},{"fast-isnumeric":131}],1062:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u,f=o.isBubble(t),h=(t.line||{}).color;if(c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",f?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noLine||(u=h&&!Array.isArray(h)&&e.marker.color!==h?h:f?n.background:n.defaultLine,l("marker.line.color",u),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",f?1:0)),f&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":611,"../../components/colorscale/defaults":620,"../../components/colorscale/has_colorscale":624,"./subtypes":1066}],1063:[function(t,e,r){"use strict";function n(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=o.select(this);if(n=t[0].trace,n._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var i=":first-child";e.select(".js-fill.js-tozero").size()&&(i+=" + *"),n._nextFill=e.insert("path",i).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(l.setClipUrl,r.layerClipId)})}function i(t,e,r,n,i,h,p){function m(t){return M?t.transition():t}function v(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function y(t){if(t.ids)return g}function b(){return!1}function x(e){var n,i,a,c=e[0].trace,f=o.select(this),h=u.hasMarkers(c),d=u.hasText(c),p=y(c),g=b,x=b;h&&(g=c.marker.maxdisplayed||c._needsCull?v:s.identity),d&&(x=c.marker.maxdisplayed||c._needsCull?v:s.identity),i=f.selectAll("path.point"),n=i.data(g,p);var _=n.enter().append("path").classed("point",!0);M&&_.call(l.pointStyle,c,t).call(l.translatePoints,T,k).style("opacity",0).transition().style("opacity",1);var w=h&&l.tryColorscale(c.marker,""),A=h&&l.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=o.select(this),i=m(n);a=l.translatePoint(e,i,T,k),a?(l.singlePointStyle(e,i,c,w,A,t),r.layerClipId&&l.hideOutsideRangePoint(e,i,T,k),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):i.remove()}),M?n.exit().transition().style("opacity",0).remove():n.exit().remove(),i=f.selectAll("g"),n=i.data(x,p),n.enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=o.select(this),n=m(e.select("text"));a=l.translatePoint(t,n,T,k),a?r.layerClipId&&l.hideOutsideRangePoint(t,e,T,k):e.remove()}),n.selectAll("text").call(l.textPointStyle,c,t).each(function(t){var e=T.c2p(t.x),r=k.c2p(t.y);o.select(this).selectAll("tspan.line").each(function(){m(o.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var _,w;a(t,e,r,n,i);var M=!!p&&p.duration>0,T=r.xaxis,k=r.yaxis,A=n[0].trace,E=A.line,S=o.select(h);if(S.call(c.plot,r,p),A.visible===!0){m(S).style("opacity",A.opacity);var L,C,I=A.fill.charAt(A.fill.length-1);"x"!==I&&"y"!==I&&(I=""),n[0].node3=S;var D="",P=[],z=A._prevtrace;z&&(D=z._prevRevpath||"",C=z._nextFill,P=z._polygons);var O,R,F,j,N,B,U,V,H,q="",G="",Y=[],X=s.noop;if(L=A._ownFill,u.hasLines(A)||"none"!==A.fill){for(C&&C.datum(n),["hv","vh","hvh","vhv"].indexOf(E.shape)!==-1?(F=l.steps(E.shape),j=l.steps(E.shape.split("").reverse().join(""))):F=j="spline"===E.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),E.smoothing):l.smoothopen(t,E.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return j(t.reverse())},Y=f(n,{xaxis:T,yaxis:k,connectGaps:A.connectgaps,baseTolerance:Math.max(E.width||1,3)/4,shape:E.shape,simplify:E.simplify}),H=A._polygons=new Array(Y.length),w=0;w1){var r=o.select(this);if(r.datum(n),t)m(r.style("opacity",0).attr("d",O).call(l.lineGroupStyle)).style("opacity",1);else{var i=m(r);i.attr("d",O),l.singleLineStyle(n,i)}}}}}var W=S.selectAll(".js-line").data(Y);m(W.exit()).style("opacity",0).remove(),W.each(X(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(l.lineGroupStyle).each(X(!0)),l.setClipUrl(W,r.layerClipId),Y.length&&(L?B&&V&&(I?("y"===I?B[1]=V[1]=k.c2p(0,!0):"x"===I&&(B[0]=V[0]=T.c2p(0,!0)),m(L).attr("d","M"+V+"L"+B+"L"+q.substr(1)).call(l.singleFillStyle)):m(L).attr("d",q+"Z").call(l.singleFillStyle)):"tonext"===A.fill.substr(0,6)&&q&&D&&("tonext"===A.fill?m(C).attr("d",q+"Z"+D+"Z").call(l.singleFillStyle):m(C).attr("d",q+"L"+D.substr(1)+"Z").call(l.singleFillStyle),A._polygons=A._polygons.concat(P)),A._prevRevpath=G,A._prevPolygons=H);var Z=S.selectAll(".points");_=Z.data([n]),Z.each(x),_.enter().append("g").classed("points",!0).each(x),_.exit().remove(),_.each(function(t){var e=t[0].trace.cliponaxis===!1;l.setClipUrl(o.select(this),e?null:r.layerClipId)})}}function a(t,e,r,n,i){var a=r.xaxis,l=r.yaxis,c=o.extent(s.simpleMap(a.range,a.r2c)),f=o.extent(s.simpleMap(l.range,l.r2c)),h=n[0].trace;if(u.hasMarkers(h)){var d=h.marker.maxdisplayed;if(0!==d){var p=n.filter(function(t){return t.x>=c[0]&&t.x<=c[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),v=0;i.forEach(function(t,r){var n=t[0].trace;u.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0;for(u=p.selectAll("g.trace"),f=u.data(r,function(t){return t[0].trace.uid}),f.enter().append("g").attr("class",function(t){return"trace scatter trace"+t[0].trace.uid}).style("stroke-miterlimit",2),h(t,e,r),n(t,p,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),v){s&&(d=s());o.transition().duration(a.duration).ease(a.easing).each("end",function(){d&&d()}).each("interrupt",function(){d&&d()}).each(function(){p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)})})}else p.selectAll("g.trace").each(function(n,o){i(t,o,e,n,r,this,a)});m&&f.exit().remove(),p.selectAll("path:not([d])").remove()}},{"../../components/drawing":635,"../../components/errorbars":641,"../../lib":735,"../../lib/polygon":746,"./line_points":1058,"./link_traces":1060,"./subtypes":1066,d3:121}],1064:[function(t,e,r){"use strict";var n=t("./subtypes"),i=t("../../constants/interactions").DESELECTDIM;e.exports=function(t,e){var r,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace,d=h.marker;if(!n.hasMarkers(h)&&!n.hasText(h))return[];var p=Array.isArray(d.opacity)?1:d.opacity;if(e===!1)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}function s(t,e){return e(4*t)}function l(t){return M[t]}function c(t,e,r,n,i){var a=null;if(Array.isArray(t)){a=[];for(var o=0;o=0){var h=i(l.position,l.delaunayColor,l.delaunayAxis);h.opacity=t.opacity,this.delaunayMesh?this.delaunayMesh.update(h):(h.gl=o,this.delaunayMesh=v(h),this.delaunayMesh._trace=this,this.scene.glplot.add(this.delaunayMesh))}else this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose(),this.delaunayMesh=null)},k.dispose=function(){this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose()),this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose()),this.errorBars&&(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose()),this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose()),this.delaunayMesh&&(this.scene.glplot.remove(this.delaunayMesh),this.delaunayMesh.dispose())},e.exports=h},{"../../constants/gl3d_dashes":711,"../../constants/gl3d_markers":712,"../../lib":735,"../../lib/gl_format_color":731,"../../lib/str2rgbarray":756,"../scatter/make_bubble_size_func":1061,"./calc_errors":1071,"delaunay-triangulate":123,"gl-error3d":161,"gl-line3d":176,"gl-mesh3d":209,"gl-scatter3d":257}],1073:[function(t,e,r){"use strict";function n(t,e,r,n){var a=0,o=r("x"),s=r("y"),l=r("z");return i.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y","z"],n),o&&s&&l&&(a=Math.min(o.length,s.length,l.length),a=0&&h("surfacecolor",d||p);for(var m=["x","y","z"],v=0;v<3;++v){var g="projection."+m[v];h(g+".show")&&(h(g+".opacity"),h(g+".scale"))}u(t,e,r,{axis:"z"}),u(t,e,r,{axis:"y",inherit:"z"}),u(t,e,r,{axis:"x",inherit:"z"})}},{"../../components/errorbars/defaults":640,"../../lib":735,"../../registry":853,"../scatter/line_defaults":1057,"../scatter/marker_defaults":1062,"../scatter/subtypes":1066,"../scatter/text_defaults":1067,"./attributes":1069}],1074:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":712,"../../plots/gl3d":818,"../scatter/colorbar":1048,"./attributes":1069,"./calc":1070,"./convert":1072,"./defaults":1073}],1075:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":612,"../../components/colorscale/color_attributes":618,"../../lib/extend":724,"../../plots/attributes":777,"../scatter/attributes":1045}],1076:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e.a.length,d=new Array(h),p=!1;for(c=0;ch&&y.splice(h,y.length-h)}return o(e),s(d,e),d}}},{"../../plots/cartesian/axes":779,"../carpet/lookup_carpetid":911,"../scatter/arrays_to_calcdata":1044,"../scatter/colorscale_calc":1049,"../scatter/subtypes":1066,"fast-isnumeric":131}],1077:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),v=d("b");if(!(p=Math.min(m.length,v.length)))return void(e.visible=!1);m&&p0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&o[0].index!==!1){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=h.hi||d.hoverinfo,v=m.split("+"),g=[];v.indexOf("all")!==-1&&(v=["a","b"]),v.indexOf("a")!==-1&&a(p.aaxis,h.a),v.indexOf("b")!==-1&&a(p.baxis,h.b);var y=p.ab2ij([h.a,h.b]),b=Math.floor(y[0]),x=y[0]-b,_=Math.floor(y[1]),w=y[1]-_,M=p.evalxy([],b,_,x,w);return g.push("y: "+M[1].toFixed(3)),s.extraText=g.join("
"),o}}},{"../scatter/hover":1055}],1079:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":789,"../scatter/colorbar":1048,"./attributes":1075,"./calc":1076,"./defaults":1077,"./hover":1078,"./plot":1080,"./select":1081,"./style":1082}],1080:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}var i=t("../../components/fx"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("../scatter/get_trace_color"),l=t("../scatter/fill_hover_text"),c=t("./attributes");e.exports=function(t,e,r){function a(t){var n=t.lonlat;if(n[0]===o)return 1/0;if(d(n))return 1/0 -;var i=p(n),a=p([e,r]),s=Math.abs(i[0]-a[0]),l=Math.abs(i[1]-a[1]),c=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(s*s+l*l)-c,1-3/c)}var l=t.cd,c=l[0].trace,u=t.xa,f=t.ya,h=t.subplot,d=h.projection.isLonLatOverEdges,p=h.project;if(i.getClosest(l,a,t),t.index!==!1){var m=l[t.index],v=m.lonlat,g=[u.c2p(v),f.c2p(v)],y=m.mrc||1;return t.x0=g[0]-y,t.x1=g[0]+y,t.y0=g[1]-y,t.y1=g[1]+y,t.loc=m.loc,t.lon=v[0],t.lat=v[1],t.color=s(c,m),t.extraText=n(c,m,h.mockAxis),[t]}}},{"../../components/fx":652,"../../constants/numerical":714,"../../plots/cartesian/axes":779,"../scatter/fill_hover_text":1052,"../scatter/get_trace_color":1054,"./attributes":1083}],1088:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":807,"../scatter/colorbar":1048,"./attributes":1083,"./calc":1084,"./defaults":1085,"./event_data":1086,"./hover":1087,"./plot":1089,"./select":1090}],1089:[function(t,e,r){"use strict";function n(t,e){var r=t[0].trace;if(Array.isArray(r.locations))for(var n=u(r,e),i=r.locationmode,a=0;a=e.length?i:e[a]);return n}function o(t,e,r){return l(O(t,r),z(e,r),r)}function s(t,e,r,n){var i=T(t,e,n);return i=Array.isArray(i[0])?i:a(y.identity,[i],n),l(i,z(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;iZ?W-Z:0),!q||H.noBorder||H.noFill?u(this.scatter.options.colors,Y,h,B,G):u(this.scatter.options.colors,D,h,0),u(this.scatter.options.borderColors,X,h,B,G);N?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=T):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,f,j)},P.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r")}var i=t("../../components/fx"),a=t("../scatter/get_trace_color"),o=t("../scatter/fill_hover_text"),s=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){function o(t){var e=t.lonlat;if(e[0]===s)return 1/0;var n=Math.abs(u.c2p(e)-u.c2p([p,e[1]])),i=Math.abs(f.c2p(e)-f.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)}var l=t.cd,c=l[0].trace,u=t.xa,f=t.ya,h=e>=0?Math.floor((e+180)/360):Math.ceil((e-180)/360),d=360*h,p=e-d;if(i.getClosest(l,o,t),t.index!==!1){var m=l[t.index],v=m.lonlat,g=[v[0]+d,v[1]],y=u.c2p(g),b=f.c2p(g),x=m.mrc||1;return t.x0=y-x,t.x1=y+x,t.y0=b-x,t.y1=b+x,t.color=a(c,m),t.extraText=n(c,m),[t]}}},{"../../components/fx":652,"../../constants/numerical":714,"../scatter/fill_hover_text":1052,"../scatter/get_trace_color":1054}],1102:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":832,"../scatter/colorbar":1048,"../scattergeo/calc":1084,"./attributes":1097,"./defaults":1099,"./event_data":1100,"./hover":1101,"./plot":1103,"./select":1104}],1103:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=e[0].trace,i=new n(t,r.uid);return i.update(e),i}},{"./convert":1098}],1104:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(h._hasDimmedPts=!1,!n.hasMarkers(h))return[];if(e===!1)for(s=0;sT&&E.splice(T,E.length-T)}return o(e),s(k,e),k}},{"../../plots/cartesian/axes":779,"../scatter/arrays_to_calcdata":1044,"../scatter/colorscale_calc":1049,"../scatter/subtypes":1066,"fast-isnumeric":131}],1107:[function(t,e,r){"use strict" -;var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),f=t("./attributes");e.exports=function(t,e,r,h){function d(r,i){return n.coerce(t,e,f,r,i)}var p,m=d("a"),v=d("b"),g=d("c");if(m?(p=m.length,v?(p=Math.min(p,v.length),g&&(p=Math.min(p,g.length))):p=g?Math.min(p,g.length):0):v&&g&&(p=Math.min(v.length,g.length)),!p)return void(e.visible=!1);m&&p"),s}}},{"../../plots/cartesian/axes":779,"../scatter/hover":1055}],1109:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":846,"../scatter/colorbar":1048,"./attributes":1105,"./calc":1106,"./defaults":1107,"./hover":1108,"./plot":1110,"./select":1111,"./style":1112}],1110:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},a=0;a",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1123:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||u===t.length-1)&&(n[i]=s,s.key=c++,s.firstRowIndex=l,s.lastRowIndex=u,s=o(),i+=a,l=u+1,a=0);return n}function o(){return{firstRowIndex:null,lastRowIndex:null,rows:[]}}var s=t("./constants"),l=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),o=e.cells.values,c=e.domain,u=Math.floor(t._fullLayout._size.w*(c.x[1]-c.x[0])),f=Math.floor(t._fullLayout._size.h*(c.y[1]-c.y[0])),h=r.length?r[0].map(function(){return e.header.height}):[],d=o.length?o[0].map(function(){return e.cells.height}):[],p=h.reduce(function(t,e){return t+e},0),m=f-p,v=m+s.uplift,g=a(d,v),y=a(h,p),b=i(y,[]),x=i(g,b),_={},w=e._fullInput.columnorder,M=r.map(function(t,r){return Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:isFinite(e.columnwidth)&&null!==e.columnwidth?e.columnwidth:1}),T=M.reduce(function(t,e){return t+e},0);M=M.map(function(t){return t/T*u});var k={key:e.index,translateX:c.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-c.y[1]),size:t._fullLayout._size,width:u,height:f,columnOrder:w,groupHeight:f,rowBlocks:x,headerRowBlocks:b,scrollY:0,cells:e.cells,headerCells:l({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=_[t];return _[t]=(r||0)+1,{key:t+"__"+_[t],label:t,specIndex:e,xIndex:w[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:M[e]}})};return k.columns.forEach(function(t){t.calcdata=k,t.x=n(t)}),k}},{"../../lib/extend":724,"./constants":1122}],1124:[function(t,e,r){"use strict";function n(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}var i=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=i({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:i({},t.calcdata,{cells:t.calcdata.headerCells})});return[i({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),i({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=n(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":724}],1125:[function(t,e,r){"use strict";function n(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=g(n);t.latex=s;var l,c=s?"":x(t.calcdata.cells.prefix,e,r)||"",u=s?"":x(t.calcdata.cells.suffix,e,r)||"",f=s?null:x(t.calcdata.cells.format,e,r)||null,h=c+(f?N.format(f)(t.value):t.value)+u;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=y(h)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?y(h):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var d;if(t.wrappingNeeded){var p=" "===j.wrapSplitCharacter?h.replace(/i&&n.push(a),i+=l}return n}function A(t,e,r){var n=a(e)[0];if(void 0!==n){var i=n.rowBlocks,s=n.calcdata,l=P(i,i.length),c=n.calcdata.groupHeight-T(n),u=s.scrollY=Math.max(0,Math.min(l-c,s.scrollY)),f=k(i,u,c);1===f.length&&(f[0]===i.length-1?f.unshift(f[0]-1):f.push(f[0]+1)),f[0]%2&&f.reverse(),e.each(function(t,e){t.page=f[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(P(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(S(t,r,e,f,n.prevPages,n,0),S(t,r,e,f,n.prevPages,n,1),o(r,t))}}function E(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*N.event.dy:n;var l=o.selectAll("."+j.cn.yColumn).selectAll("."+j.cn.columnBlock).filter(w);A(t,l,o)}}function S(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function L(t,e,r){return function(){var n=N.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,c=t.column.columnWidth-2*j.cellPad;for(t.value="";o.length;)r=o.shift(),i=r.width+a,l+i>c&&(t.value+=s.join(j.wrapSpacer)+j.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(j.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),v(n.select("."+j.cn.cellText),r,t),N.select(e.parentNode.parentNode).call(D)}}function C(t,e,r,n,i){return function(){if(!i.settledY){var a=N.select(e.parentNode),s=R(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*j.cellPad:c,f=Math.max(u,c);f-s.rows[l].rowHeight&&(s.rows[l].rowHeight=f,t.selectAll("."+j.cn.columnCell).call(D),A(null,t.filter(w),0),o(r,n,!0)),a.attr("transform",function(){var t=this,e=t.parentNode,r=e.getBoundingClientRect(),n=N.select(t.parentNode).select("."+j.cn.cellRect).node().getBoundingClientRect(),a=t.transform.baseVal.consolidate(),o=n.top-r.top+(a?a.matrix.f:j.cellPad);return"translate("+I(i,N.select(t.parentNode).select("."+j.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+o+")"}),i.settledY=!0}}}function I(t,e){switch(t.align){case"left":return j.cellPad;case"right":return t.column.columnWidth-(e||0)-j.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return j.cellPad}}function D(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+z(e,1/0)},0);return"translate(0 "+(z(R(t),t.key)+e)+")"}).selectAll("."+j.cn.cellRect).attr("height",function(t){return F(R(t),t.key).rowHeight})}function P(t,e){for(var r=0,n=e-1;n>=0;n--)r+=O(t[n]);return r}function z(t,e){for(var r=0,n=0;n0){var y,b,x,_,w,M=t.xa,T=t.ya;"h"===h.orientation?(w=e,y="y",x=T,b="x",_=M):(w=r,y="x",x=M,b="y",_=T);var k=f[t.index];if(w>=k.span[0]&&w<=k.span[1]){var A=n.extendFlat({},t),E=_.c2p(w,!0),S=o.getKdeValue(k,h,w),L=o.getPositionOnKdePath(k,h,E),C=x._offset,I=x._length;A[y+"0"]=L[0],A[y+"1"]=L[1],A[b+"0"]=A[b+"1"]=E,A[b+"Label"]=b+": "+i.hoverLabelText(_,w)+", kde: "+S.toFixed(3),v.push(A),u={stroke:t.color},u[y+"1"]=n.constrain(C+L[0],C,C+I),u[y+"2"]=n.constrain(C+L[1],C,C+I),u[b+"1"]=u[b+"2"]=_._offset+E}}}d.indexOf("points")!==-1&&(c=a.hoverOnPoints(t,e,r));var D=l.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===s?c?[c]:v:c?(v.push(c),v):v}},{"../../lib":735,"../../plots/cartesian/axes":779,"../box/hover":879,"./helpers":1131}],1133:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":789,"../box/select":884,"./attributes":1128,"./calc":1129,"./defaults":1130,"./hover":1132,"./layout_attributes":1134,"./layout_defaults":1135,"./plot":1136,"./set_positions":1137,"./style":1138}],1134:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":735,"../box/layout_attributes":881}],1135:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){function o(r,a){return n.coerce(t,e,i,r,a)}a._supply(t,e,r,o,"violin")}},{"../../lib":735,"../box/layout_defaults":882,"./layout_attributes":1134}],1136:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,f=e.xaxis,h=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,v=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),g=a.bPos=m?2*a.dPos*(-.5+(a.num+.5)/p)*(1-u.violingap):0;if(s.visible!==!0||a.empty)return void n.select(this).remove();var y=e[a.valLetter+"axis"],b=e[a.posLetter+"axis"],x="both"===s.side,_=x||"positive"===s.side,w=x||"negative"===s.side,M=s.box&&s.box.visible,T=s.meanline&&s.meanline.visible,k=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+g,u=b.c2p(l);switch(s.scalemode){case"width":e=k.maxWidth/v;break;case"count":e=k.maxWidth/v*(k.maxCount/t.pts.length)}var f,h,d,p,m,M,T;if(_){for(M=new Array(o),p=0;pa&&(a=c,o=l)}}return a?i(o):h};case"rms":return function(t,e){for(var r=0,a=0,o=0;o":return function(t){return h(t)>i};case">=":return function(t){return h(t)>=i};case"[]":return function(t){var e=h(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=h(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=h(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=h(t);return ei[1]};case"](":return function(t){var e=h(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=h(t);return e=i[1]};case"{}":return function(t){return i.indexOf(h(t))!==-1};case"}{":return function(t){return i.indexOf(h(t))===-1}}}var i=t("../lib"),a=t("../registry"),o=t("../plots/cartesian/axes"),s=t("./helpers").pointsAccessorFunction,l=["=","!=","<",">=",">","<="],c=["[]","()","[)","(]","][",")(","](",")["],u=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(l).concat(c).concat(u),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,a){return i.coerce(t,n,r.attributes,e,a)}var n={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=a.getComponentMethod("calendars","handleDefaults");o(t,n,"valuecalendar",null),o(t,n,"targetcalendar",null)}return n},r.calcTransform=function(t,e,r){function a(t,r){for(var n=0;n1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;oMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,h*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":38,"mouse-change":453,"mouse-event-offset":454,"mouse-wheel":456,"right-now":511}],38:[function(t,e,r){"use strict";function n(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}e.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],c=t.mode||"turntable",u=i(),h=a(),f=o();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new n({turntable:u,orbit:h,matrix:f},c)};var i=t("turntable-camera-controller"),a=t("orbit-camera-controller"),o=t("matrix-camera-controller"),s=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+u;if((r=a-u-h[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)(r=(e=t[n]).y+e.dy+u-a)>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(f).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(h[1]-(t.length-1)*u)/e.sum(t,s)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),d.forEach(function(e){e.dy=e.value*t})}(),n();for(var l=1;t>0;--t)!function(t){function r(t){return o(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,s);n.y+=(i-o(n))*t}})})}(l*=.99),n(),function(t){function r(t){return o(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,s);n.y+=(i-o(n))*t}})})}(l),n()}function a(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}f.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),f.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function o(t){return t.y+t.dy/2}function s(t){return t.value}var l={},c=24,u=8,h=[1,1],f=[],d=[];return l.nodeWidth=function(t){return arguments.length?(c=+t,l):c},l.nodePadding=function(t){return arguments.length?(u=+t,l):u},l.nodes=function(t){return arguments.length?(f=t,l):f},l.links=function(t){return arguments.length?(d=t,l):d},l.size=function(t){return arguments.length?(h=t,l):h},l.layout=function(r){return f.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),d.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=f[t.source]),"number"==typeof n&&(n=t.target=f[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),f.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,s),e.sum(t.targetLinks,s))}),t(),i(r),a(),l},l.relayout=function(){return a(),l},l.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,h=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+h+"C"+s+","+h+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},l},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":115,"d3-collection":116,"d3-interpolate":120}],40:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":157,"gl-vao":272,"weak-map":568}],41:[function(t,e,r){var n=t("pad-left");e.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var i=t.split(/\r?\n/),a=String(i.length+e-1).length;return i.map(function(t,i){var o=i+e,s=String(o).length;return n(o,a-s)+r+t}).join("\n")}},{"pad-left":475}],42:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;ni&&(i=t[o]),t[o]>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3])),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t.str2RgbaArray=function(t,n){var i,a;if("string"!=typeof t)return t;if(i=[],"#"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),a=parseInt(t,16),i[0]=a>>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3]),a[4]?i[3]=parseFloat(a[4]):i[3]=1),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t}()},{}],48:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!f(t[o],e[o],r,n))return!1;return!0}(t,e,r,s))}return r?t===e:t==e}function d(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function p(t,e,r){f(t,e,!0)&&u(t,e,r,"notDeepStrictEqual",p)}function m(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function g(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&u(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&v.isError(i),s=!t&&i&&!r;if((o&&a&&m(i,r)||s)&&u(i,r,"Got unwanted exception"+n),t&&i&&r&&!m(i,r)||!t&&i)throw i}var v=t("util/"),y=Object.prototype.hasOwnProperty,b=Array.prototype.slice,x="foo"===function(){}.name,_=e.exports=h,w=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return l(c(t.actual),128)+" "+t.operator+" "+l(c(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=u,_.ok=h,_.equal=function(t,e,r){t!=e&&u(t,e,r,"==",_.equal)},_.notEqual=function(t,e,r){t==e&&u(t,e,r,"!=",_.notEqual)},_.deepEqual=function(t,e,r){f(t,e,!1)||u(t,e,r,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,e,r){f(t,e,!0)||u(t,e,r,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,e,r){f(t,e,!1)&&u(t,e,r,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=p,_.strictEqual=function(t,e,r){t!==e&&u(t,e,r,"===",_.strictEqual)},_.notStrictEqual=function(t,e,r){t===e&&u(t,e,r,"!==",_.notStrictEqual)},_.throws=function(t,e,r){g(!0,t,e,r)},_.doesNotThrow=function(t,e,r){g(!1,t,e,r)},_.ifError=function(t){if(t)throw t};var M=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":558}],49:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],50:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(h):h<0&&(u=u.ushln(-h)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":53,"./is-rat":55,"./lib/is-bn":59,"./lib/num-to-bn":60,"./lib/rationalize":61,"./lib/str-to-bn":62}],55:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":59}],56:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":69}],57:[function(t,e,r){"use strict";var n=t("./bn-sign");e.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}},{"bit-twiddle":68,"double-bits":125}],59:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":69}],60:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.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)}},{"bn.js":69,"double-bits":125}],61:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.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]}},{"./bn-sign":56,"./num-to-bn":60}],62:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":69}],63:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":61}],64:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":56}],65:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":61}],66:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.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,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(f=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":57,"./lib/ctz":58}],67:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],68:[function(t,e,r){"use strict";"use restrict";function n(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}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.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},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=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|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],69:[function(t,e,r){!function(e,r){"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"))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(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}function l(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 c=1;c>>26,h=67108863&l,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}function c(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function h(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 f(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(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 v(t){g.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)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var y;try{y=t("buffer").Buffer}catch(t){}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++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;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){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),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,l=Math.min(a,a-o)+r,c=0,u=r;u1&&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 b=["","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"],x=[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],_=[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];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?b[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 c=x[t],u=_[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modn(u).toString(t);r=(h=h.idivn(u)).isZero()?f+r:b[c-f.length]+f+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!==y),this.toArrayLike(y,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,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[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=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=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,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,k=w>>>13,T=0|o[5],A=8191&T,S=T>>>13,E=0|o[6],L=8191&E,C=E>>>13,I=0|o[7],P=8191&I,D=I>>>13,z=0|o[8],O=8191&z,F=z>>>13,R=0|o[9],j=8191&R,N=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,X=Y>>>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,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;c=((a=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,q)|0))<<13)|0;c=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,W)|0))<<13)|0;c=((a=a+Math.imul(f,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var bt=(c+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,J)|0))<<13)|0;c=((a=a+Math.imul(f,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|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(m,J)|0,a=a+Math.imul(m,K)|0;var xt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,q)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,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(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,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(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;c=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(D,U)|0,a=Math.imul(D,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,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(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((a=a+Math.imul(f,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(F,U)|0,a=Math.imul(F,V),n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,q)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,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,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(F,q)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0;var Tt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,W),i=(i=Math.imul(j,X))+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,K)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0;var St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,a=a+Math.imul(D,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0;var Et=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(F,rt)|0,a=a+Math.imul(F,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(D,at)|0,a=a+Math.imul(D,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(F,at)|0,a=a+Math.imul(F,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,lt)|0,a=a+Math.imul(D,ct)|0,n=n+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,at),i=(i=Math.imul(j,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(F,lt)|0,a=a+Math.imul(F,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(D,ht)|0,a=a+Math.imul(D,ft)|0;var It=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,lt),i=(i=Math.imul(j,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(F,ht)|0,a=a+Math.imul(F,ft)|0;var Pt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((a=a+Math.imul(D,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(N,ht)|0,a=Math.imul(N,ft);var Dt=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(F,pt)|0))<<13)|0;c=((a=a+Math.imul(F,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var zt=(c+(n=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(N,pt)|0))<<13)|0;return c=((a=Math.imul(N,mt))+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=Tt,l[10]=At,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=It,l[16]=Pt,l[17]=Dt,l[18]=zt,0!==c&&(l[19]=c,r.length++),r};Math.imul||(w=l),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):r<63?l(this,t,e):r<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):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},u.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);var i;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,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),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&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;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 c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}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){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 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)},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),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),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(c)}},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=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var f;return(f=0===e.cmpn(1)?i:o).cmpn(0)<0&&f.iadd(t),f},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=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=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 g(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};h.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},h.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):r.strip(),r},h.prototype.split=function(t,e){t.iushrn(this.n,0,e)},h.prototype.imulK=function(t){return t.imul(this.k)},i(f,h),f.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},f.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 f;else if("p224"===t)e=new d;else if("p192"===t)e=new p;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new m}return M[t]=e,e},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.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")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.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)},g.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},g.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)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.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(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new v(t)},i(v,g),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.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)},v.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)},v.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],70:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var h,f=l.mallocDouble(2*s*a),d=l.mallocInt32(a);if((a=i(t,s,f,d))>0){if(1===s&&n)c.init(a),h=c.sweepComplete(s,r,0,a,f,d,0,a,f,d);else{var p=l.mallocDouble(2*s*o),m=l.mallocInt32(o);(o=i(e,s,p,m))>0&&(c.init(a+o),h=1===s?c.sweepBipartite(s,r,0,a,f,d,0,o,p,m):u(s,r,n,a,f,d,o,p,m),l.free(p),l.free(m))}l.free(f),l.free(d)}return h}}}function o(t,e){s.push([t,e])}e.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return s=[],a(t,t,o,!0),s}(t);case 2:return"function"==typeof e?a(t,t,e,!0):function(t,e){return s=[],a(t,e,o,!1),s}(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var s,l=t("typedarray-pool"),c=t("./lib/sweep"),u=t("./lib/intersect")},{"./lib/intersect":73,"./lib/sweep":77,"typedarray-pool":550}],72:[function(t,e,r){"use strict";function n(t){function e(e,r){var s=function(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),s=["function ",n,"(",_.join(),"){","var ",l,"=2*",i,";"],w="for(var i="+c+","+d+"="+l+"*"+c+";i<"+u+";++i,"+d+"+="+l+"){var x0="+h+"["+a+"+"+d+"],x1="+h+"["+a+"+"+d+"+"+i+"],xi="+f+"[i];",M="for(var j="+p+","+y+"="+l+"*"+p+";j<"+m+";++j,"+y+"+="+l+"){var y0="+g+"["+a+"+"+y+"],"+(r?"y1="+g+"["+a+"+"+y+"+"+i+"],":"")+"yi="+v+"[j];";return t?s.push(w,x,":",M):s.push(M,x,":",w),r?s.push("if(y1"+m+"-"+p+"){"),t?(e(!0,!1),M.push("}else{"),e(!1,!1)):(M.push("if("+s+"){"),e(!0,!0),M.push("}else{"),e(!0,!1),M.push("}}else{if("+s+"){"),e(!1,!0),M.push("}else{"),e(!1,!1),M.push("}")),M.push("}}return "+r);var k=n.join("")+M.join("");return new Function(k)()}var i="d",a="ax",o="vv",s="fp",l="es",c="rs",u="re",h="rb",f="ri",d="rp",p="bs",m="be",g="bb",v="bi",y="bp",b="rv",x="Q",_=[i,a,o,c,u,h,f,p,m,g,v];r.partial=n(!1),r.full=n(!0)},{}],73:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){var c=M*t;T[c]=e,T[c+1]=r,T[c+2]=n,T[c+3]=i,T[c+4]=a,T[c+5]=o;var u=k*t;A[u]=s,A[u+1]=l}function i(t,e,r,n,i,a,o,s,l,c,u){var h=2*t,f=l*h,d=c[f+e];t:for(var p=i,m=i*h;p0;){var z=(P-=1)*M,O=T[z],F=T[z+1],R=T[z+2],j=T[z+3],N=T[z+4],B=T[z+5],U=P*k,V=A[U],H=A[U+1],q=1&B,G=!!(16&B),Y=d,W=S,X=L,Z=C;if(q&&(Y=L,W=C,X=d,Z=S),!(2&B&&(R=b(t,O,F,R,Y,W,H),F>=R)||4&B&&(F=x(t,O,F,R,Y,W,V))>=R)){var J=R-F,K=N-j;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),y=d("lo===p0",["p0"]),b=d("lor&&i[h+e]>c;--u,h-=o){for(var f=h,d=h+o,p=0;p>>1,f=2*t,d=h,p=s[f*h+e];c=b?(d=y,p=b):v>=_?(d=g,p=v):(d=x,p=_):b>=_?(d=y,p=b):_>=v?(d=g,p=v):(d=x,p=_);for(var w=f*(u-1),M=f*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],76:[function(t,e,r){"use strict";function n(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 c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>1,g=m-f,v=m+f,y=d,b=g,x=m,_=v,w=p,M=t+1,k=e-1,T=0;l(y,b,r)&&(T=y,y=b,b=T),l(_,w,r)&&(T=_,_=w,w=T),l(y,x,r)&&(T=y,y=x,x=T),l(b,x,r)&&(T=b,b=x,x=T),l(y,_,r)&&(T=y,y=_,_=T),l(x,_,r)&&(T=x,x=_,_=T),l(b,w,r)&&(T=b,b=w,w=T),l(b,x,r)&&(T=b,b=x,x=T),l(_,w,r)&&(T=_,_=w,w=T);for(var A=r[2*b],S=r[2*b+1],E=r[2*_],L=r[2*_+1],C=2*y,I=2*x,P=2*w,D=2*d,z=2*m,O=2*p,F=0;F<2;++F){var R=r[C+F],j=r[I+F],N=r[P+F];r[D+F]=R,r[z+F]=j,r[O+F]=N}a(g,t,r),a(v,e,r);for(var B=M;B<=k;++B)if(c(B,A,S,r))B!==M&&i(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,A,S,r)?(o(B,M,k,r),++M,--k):(i(B,k,r),--k);break}if(--k>>1;s(m,S);var E=0,L=0;for(M=0;M=l)n(h,f,L--,C=C-l|0);else if(C>=0)n(c,u,E--,C);else if(C<=-l){C=-C-l|0;for(var I=0;I>>1;s(m,E);var L=0,C=0,I=0;for(k=0;k>1==m[2*k+3]>>1&&(D=2,k+=1),P<0){for(var z=-(P>>1)-1,O=0;O>1)-1,0===D?n(c,u,L--,z):1===D?n(h,f,C--,z):2===D&&n(d,p,I--,z)}},scanBipartite:function(t,e,r,a,o,h,f,d,p,g,v,y){var b=0,x=2*t,_=e,w=e+t,M=1,k=1;a?k=l:M=l;for(var T=o;T>>1;s(m,L);var C=0;for(T=0;T=l?(P=!a,A-=l):(P=!!a,A-=1),P)i(c,u,C++,A);else{var D=y[A],z=x*A,O=v[z+e+1],F=v[z+e+1+t];t:for(var R=0;R>>1;s(m,M);var k=0;for(b=0;b=l)c[k++]=x-l;else{var A=d[x-=1],S=g*x,E=f[S+e+1],L=f[S+e+1+t];t:for(var C=0;C=0;--C)if(c[C]===x){for(z=C+1;zz)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?function(t,e,r){if(e<0||t.byteLength=z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z.toString(16)+" bytes");return 0|t}function u(t,e){if(i.isBuffer(t))return t.length;if(C(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function h(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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,I(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:p(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var 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}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var h=!0,f=0;fi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function _(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,c,u,h;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}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<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function k(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 T(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),D.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),D.write(t,e,r,n,52,8),r+8}function S(t,e){e=e||1/0;for(var r,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 E(t){return P.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function I(t){return t!=t}var P=t("base64-js"),D=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var z=2147483647;r.kMaxLength=z,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=t.slice(e,r),h=0;h>>=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 m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),D.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),D.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),D.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),D.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){M(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){M(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},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var n,a=[],o=e;o0?u-4:u;var h=0;for(e=0,r=0;e>16&255,c[h++]=a>>8&255,c[h++]=255&a;return 2===o?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,c[h++]=255&a):1===o&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,c[h++]=a>>8&255,c[h++]=255&a),c},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",s=[],l=0,c=r-n;lc?c:l+16383));return 1===n?(e=t[r-1],i+=o[e>>2],i+=o[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=o[e>>10],i+=o[e>>4&63],i+=o[e<<2&63],i+="="),s.push(i),s.join("")};for(var o=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,h=c.length;u0;){for(var d=r.pop(),p=(u=-1,h=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),n(t,e,r,u,s,h),n(t,e,r,s,h,u),n(t,e,r,h,d,u),n(t,e,r,d,u,h))}}},{"binary-search-bounds":85,"robust-in-sphere":515}],82:[function(t,e,r){"use strict";function n(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 i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}var a=t("binary-search-bounds");e.exports=function(t,e,r){var a=function(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var p=0;p<3;++p){var m=f[3*d+p];m>=0&&0===c[m]&&(h[3*d+p]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var v=function(t,e,r){for(var n=0,i=0;i1&&f(r[u[d-2]],r[u[d-1]],n)>0;)t.push([u[d-1],u[d-2],i]),d-=1;u.length=d,u.push(i);var p=c.upperIds;for(d=p.length;d>1&&f(r[p[d-2]],r[p[d-1]],n)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var r;return(r=t.a[0]v[0]&&l.push(new i(v,g,m,h),new i(g,v,p,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],_=(h=0,l.length);h<_;++h){var w=l[h],M=w.type;M===d?s(x,b,t,w.a,w.idx):M===m?c(b,0,w):u(b,0,w)}return x}},{"binary-search-bounds":85,"robust-orientation":517}],84:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],86:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],90:[function(t,e,r){"use strict";function n(t){var e=m(t);return[v(e,-1/0),v(e,1/0)]}function i(t){for(var e=new Array(t.length),r=0;re[2]?1:0)}function l(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var b=e[o=(S=n[a])[0]],x=b[0],_=b[1],w=t[x],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=x;x=_,_=k}b[0]=x;var T,A=b[1]=S[1];for(i&&(T=b[2]);a>0&&n[a-1][0]===o;){var S,E=(S=n[--a])[1];i?e.push([A,E,T]):e.push([A,E]),A=E}i?e.push([A,_,T]):e.push([A,_])}return s}(t,e,o,c,r));return l(e,u,r),!!u||(o.length>0||c.length>0)}e.exports=function(t,e,r){var n;if(r){n=e;for(var o=new Array(e.length),s=0;s>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:89}],94:[function(t,e,r){"use strict";e.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]}},{}],95:[function(t,e,r){(function(r){"use strict";e.exports=function(t){var e,o,s=[],l=1;if("string"==typeof t)if(n[t])s=n[t].slice(),o="rgb";else if("transparent"===t)l=0,o="rgb",s=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=t.slice(1);l=1,(h=c.length)<=4?(s=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===h&&(l=parseInt(c[3]+c[3],16)/255)):(s=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===h&&(l=parseInt(c[6]+c[7],16)/255)),s[0]||(s[0]=0),s[1]||(s[1]=0),s[2]||(s[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var u=e[1];o=c=u.replace(/a$/,"");var h="cmyk"===c?4:"gray"===c?1:3;s=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==a[t])return a[t]}return parseFloat(t)}),u===c&&s.push(1),l=void 0===s[h]?1:s[h],s=s.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(s=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),o=t.match(/([a-z])/gi).join("").toLowerCase());else"number"==typeof t?(o="rgb",s=[t>>>16,(65280&t)>>>8,255&t]):i(t)?(null!=t.r?(s=[t.r,t.g,t.b],o="rgb"):null!=t.red?(s=[t.red,t.green,t.blue],o="rgb"):null!=t.h?(s=[t.h,t.s,t.l],o="hsl"):null!=t.hue&&(s=[t.hue,t.saturation,t.lightness],o="hsl"),null!=t.a?l=t.a:null!=t.alpha?l=t.alpha:null!=t.opacity&&(l=t.opacity/100)):(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(s=[t[0],t[1],t[2]],o="rgb",l=4===t.length?t[3]:1);return{space:o,values:s,alpha:l}};var n=t("color-name"),i=t("is-plain-obj"),a={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":94,"is-plain-obj":298}],96:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t,e){if(Array.isArray(t))return t;null==e&&(e=!0);var r=n(t);if(!r.space)return[];var o,s=r.values,l=s.length;for(o=0;o1&&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[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":98}],98:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],99:[function(t,e,r){e.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]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,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:0,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]}]}},{}],100:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,c,u,h,f,d,p,m,g,v,y,b=[],x=[],_=[],w=[];if(a.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",(f=t.colormap)||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!s[f])throw Error(f+" not a supported colorscale");h=o(s[f])}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);h=o(f)}if(h.length>p)throw new Error(f+" map requires nshades to be at least size "+h.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:o(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=h.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y=0}e.exports=function(t,e,r,o){var s=i(e,r,o);if(0===s){var l=a(i(t,e,r)),c=a(i(t,e,o));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,o)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,o)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:a(c-l)}var h=i(t,e,r);return h>0?s>0&&i(t,e,o)>0?1:-1:h<0?s>0||i(t,e,o)>0?1:-1:i(t,e,o)>0?1:n(t,e,r)?1:-1};var i=t("robust-orientation"),a=t("signum"),o=t("two-sum"),s=t("robust-product"),l=t("robust-sum")},{"robust-orientation":517,"robust-product":518,"robust-sum":522,signum:524,"two-sum":549}],102:[function(t,e,r){function n(t,e){return t-e}e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]);return i(l,t[2])-i(c,e[2])||i(l+t[2],o)-i(c+e[2],s);case 4:var u=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return u+h+f+d-(p+m+g+v)||i(u,h,f,d)-i(p,m,g,v,p)||i(u+h,u+f,u+d,h+f,h+d,f+d)-i(p+m,p+g,p+v,m+g,m+v,g+v)||i(u+h+f,u+h+d,u+f+d,h+f+d)-i(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],106:[function(t,e,r){"use strict";e.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=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":42,"incremental-convex-hull":291}],108:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],109:[function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r;return(r=parseInt(e.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var u=e.substr(0,i),h=e.substr(i+1,l-(i+1)).split(","),f=1;switch(u){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),f];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],110:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+h*r[d]+f*n[d];return a}return c*t+u*e+h*r+f*n},e.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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],111:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":113}],112:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,h=0;for(n=0;n0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(l=0;l0&&v.push("var "+y.join(",")),l=0;l3&&v.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&v.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",g.join(","),"){",v.join("\n"),"} return ",T].join(""))()}},{uniq:552}],113:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u=0?(a>=x?10:a>=_?5:a>=w?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=x?10:a>=_?5:a>=w?2:1)}function n(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=x?i*=10:a>=_?i*=5:a>=w&&(i*=2),ee?1:t>=e?0:NaN},o=function(t){return 1===t.length&&(t=function(t){return function(e,r){return a(t(e),r)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},s=o(a),l=s.right,c=s.left,u=function(t){return null===t?NaN:+t},h=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},f=function(t,e){var r=h(t,e);return r?Math.sqrt(r):r},d=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},T=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},A=function(t){if(!(a=t.length))return[];for(var e=-1,r=T(t,i),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=f,t.extent=d,t.histogram=function(){function t(t){var a,o,s=t.length,c=new Array(s);for(a=0;af;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)(m=g[a]=[]).x0=a>0?d[a-1]:h,m.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=T,t.pairs=function(t,r){null==r&&(r=e);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l=u.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,c,h,f=-1,d=e.length,p=u[n++],m=r(),g=i();++fu.length)return t;var n,i=h[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],h=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return h[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},t.set=l,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],117:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=E.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=L.exec(t))?i(parseInt(e[1],16)):(e=C.exec(t))?new l(e[1],e[2],e[3],1):(e=I.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=P.exec(t))?a(e[1],e[2],e[3],e[4]):(e=D.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=z.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=O.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new h(t,e,r,n)}function u(t,e,i,a){return 1===arguments.length?function(t){if(t instanceof h)return new h(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new h;if(t instanceof h)return t;var e=(t=t.rgb()).r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new h(l,c,u,t.opacity)}(t):new h(t,e,i,null==a?1:a)}function h(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function f(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function d(t){if(t instanceof m)return new m(t.l,t.a,t.b,t.opacity);if(t instanceof _){var e=t.h*R;return new m(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=b(t.r),n=b(t.g),i=b(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/N),s=g((.2126729*r+.7151522*n+.072175*i)/B);return new m(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/U)),t.opacity)}function p(t,e,r,n){return 1===arguments.length?d(t):new m(t,e,r,null==n?1:n)}function m(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>G?Math.pow(t,1/3):t/q+V}function v(t){return t>H?t*t*t:q*(t-V)}function y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function b(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function x(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof _)return new _(t.h,t.c,t.l,t.opacity);t instanceof m||(t=d(t));var e=Math.atan2(t.b,t.a)*j;return new _(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function w(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,s=(X*(r-i)-Y*a)/W,c=Math.sqrt(s*s+a*a)/(X*i*(1-i)),u=c?Math.atan2(s,a)*j-120:NaN;return new M(u<0?u+360:u,c,i,t.opacity)}(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var k=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},T="\\s*([+-]?\\d+)\\s*",A="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E=/^#([0-9a-f]{3})$/,L=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[T,T,T]+"\\)$"),I=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),P=new RegExp("^rgba\\("+[T,T,T,A]+"\\)$"),D=new RegExp("^rgba\\("+[S,S,S,A]+"\\)$"),z=new RegExp("^hsl\\("+[A,S,S]+"\\)$"),O=new RegExp("^hsla\\("+[A,S,S,A]+"\\)$"),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),k(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),k(h,u,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new h(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new h(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(f(t>=240?t-240:t+120,i,n),f(t,i,n),f(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var R=Math.PI/180,j=180/Math.PI,N=.95047,B=1,U=1.08883,V=4/29,H=6/29,q=3*H*H,G=H*H*H;k(m,p,e(r,{brighter:function(t){return new m(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new m(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=B*v(t),e=N*v(e),r=U*v(r),new l(y(3.2404542*e-1.5371385*t-.4985314*r),y(-.969266*e+1.8760108*t+.041556*r),y(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),k(_,x,e(r,{brighter:function(t){return new _(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}));var Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=1.78277*X,K=1.78277*Y- -.14861*W;k(M,w,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*R,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(-.14861*n+1.78277*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=u,t.lab=p,t.hcl=x,t.cubehelix=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],118:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",i),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;ad+s||np+s||ih.index){var l=d-a.x-a.vx,u=p-a.y-a.vy,v=l*l+u*u;vt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e=m)){(t.data!==o||t.next)&&(0===i&&(i=f(),u+=i*i),0===a&&(a=f(),u+=a*a),u1?(null==e?g.remove(t):g.set(t,s(e)),l):g.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,r=0,o=n.length;r180||r<-180?r-360*Math.round(r/360):r):b(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?o:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):b(isNaN(e)?r:e)}}function o(t,e){var r=e-t;return r?n(t,r):b(isNaN(t)?e:t)}function s(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:T(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:T(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:T(t,r)},{i:s-2,x:T(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(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:T(r,n)})),a=E.lastIndex;return a=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=d,i[h]=p,t}function r(t){return t[0]}function n(t){return t[1]}function i(t,e,i){var o=new a(null==e?r:e,null==i?n:i,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function a(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function o(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var s=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},l=i.prototype=a.prototype;l.copy=function(){var t,e,r=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=o(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=o(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),af&&(f=a));for(ht||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,r){var n,i,a,o,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new s(g,h,f,d,p)),null==r?r=1/0:(h=t-r,f=e-r,d=t+r,p=e+r,r*=r);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(a=c.y0)>p||(o=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var b=t-+this._x.call(null,g.data),x=e-+this._y.call(null,g.data),_=b*b+x*x;if(_=(s=(p+g)/2))?p=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[h=u<<1|c]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--h}function o(){g=(m=y.now())+v,h=f=0;try{a()}finally{h=0,function(){var t,e,r=c,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);u=t,l(n)}(),g=0}}function s(){var t=y.now(),e=t-m;e>p&&(v-=e,m=t)}function l(t){if(!h){f&&(f=clearTimeout(f));var e=t-g;e>24?(t<1/0&&(f=setTimeout(o,e)),d&&(d=clearInterval(d))):(d||(m=g,d=setInterval(s,p)),h=1,b(o))}}var c,u,h=0,f=0,d=0,p=1e3,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,b="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||u===this||(u?u._next=this:c=this,u=this),this._call=t,this._time=n,l()},stop:function(){this._call&&(this._call=null,this._time=1/0,l())}};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},t.interval=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],123:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(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}}}function s(t){return t.length}function l(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function u(t){return(t+="")===ua||t[0]===ha?ha+t:t}function h(t){return(t+="")[0]===ha?t.slice(1):t}function f(t){return u(t)in this._}function d(t){return(t=u(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(h(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function b(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=fa.length;r0&&(t=t.slice(0,a));var s=wa.get(t);return s&&(t=s,o=G),a?e?function(){var a=o(e,ea(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}:n:e?x:function(){var e,r=new RegExp("^__on([^.]+)"+$i.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]}}}function q(t,e){return function(r){var n=$i.event;$i.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{$i.event=n}}}function G(t,e){var r=q(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}function Y(e){var n=".dragsuppress-"+ ++ka,i="click"+n,a=$i.select(r(e)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==Ma&&(Ma=!("onselectstart"in e)&&b(e.style,"userSelect")),Ma){var o=t(e).style,s=o[Ma];o[Ma]="none"}return function(t){if(a.on(n,null),Ma&&(o[Ma]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Ta<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=$i.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Ta=!(o.f||o.e),n.remove()}}return Ta?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function X(){return $i.event.changedTouches[0].identifier}function Z(t){return t>0?1:t<0?-1:0}function J(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function K(t){return t>1?0:t<-1?Ea:Math.acos(t)}function Q(t){return t>1?Ia:t<-1?-Ia:Math.asin(t)}function $(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return(t=Math.sin(t/2))*t}function et(){}function rt(t,e,r){return this instanceof rt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof rt?new rt(t.h,t.s,t.l):gt(""+t,vt,rt):new rt(t,e,r)}function nt(t,e,r){function n(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(a-i)*t/60:t<180?a:t<240?i+(a-i)*(240-t)/60:i}(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,a=r<=.5?r*(1+e):r+e-r*e,i=2*r-a,new ft(n(t+120),n(t),n(t-120))}function it(t,e,r){return this instanceof it?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof it?new it(t.h,t.c,t.l):lt(t instanceof ot?t.l:(t=yt((t=$i.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new it(t,e,r)}function at(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ot(r,Math.cos(t*=Pa)*e,Math.sin(t)*e)}function ot(t,e,r){return this instanceof ot?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ot?new ot(t.l,t.a,t.b):t instanceof it?at(t.h,t.c,t.l):yt((t=ft(t)).r,t.g,t.b):new ot(t,e,r)}function st(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=ct(i)*Ua,n=ct(n)*Va,a=ct(a)*Ha,new ft(ht(3.2404542*i-1.5371385*n-.4985314*a),ht(-.969266*i+1.8760108*n+.041556*a),ht(.0556434*i-.2040259*n+1.0572252*a))}function lt(t,e,r){return t>0?new it(Math.atan2(r,e)*Da,Math.sqrt(e*e+r*r),t):new it(NaN,NaN,t)}function ct(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ut(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ht(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ft(t,e,r){return this instanceof ft?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ft?new ft(t.r,t.g,t.b):gt(""+t,ft,nt):new ft(t,e,r)}function dt(t){return new ft(t>>16,t>>8&255,255&t)}function pt(t){return dt(t)+""}function mt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function gt(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(xt(i[0]),xt(i[1]),xt(i[2]))}return(a=Ya.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 vt(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 rt(n,i,l)}function yt(t,e,r){var n=ut((.4124564*(t=bt(t))+.3575761*(e=bt(e))+.1804375*(r=bt(r)))/Ua),i=ut((.2126729*t+.7151522*e+.072175*r)/Va);return ot(116*i-16,500*(n-i),200*(i-ut((.0193339*t+.119192*e+.9503041*r)/Ha)))}function bt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function xt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function _t(t){return"function"==typeof t?t:function(){return t}}function wt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Mt(e,r,t,n)}}function Mt(t,e,r,n){function i(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=$i.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=$i.event;$i.event=t;try{o.progress.call(a,l)}finally{$i.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ea(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},$i.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}function kt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return Xa?Xa.n=i:Wa=i,Xa=i,Za||(Ja=clearTimeout(Ja),Za=1,Ka(Tt)),i}function Tt(){var t=At(),e=St()-t;e>24?(isFinite(e)&&(clearTimeout(Ja),Ja=setTimeout(Tt,e)),Za=0):(Za=1,Ka(Tt))}function At(){for(var t=Date.now(),e=Wa;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function St(){for(var t,e=Wa,r=1/0;e;)e.c?(e.t1?Date.UTC.apply(this,arguments):arguments[0])}function Ct(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3)}(+n[0]),r+n[0].length):-1}function Bt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ut(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Vt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ht(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function qt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Gt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Yt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Wt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Xt(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=ca(e)/60|0,i=ca(e)%60;return r+Pt(n,"0",2)+Pt(i,"0",2)}function Zt(t,e,r){oo.lastIndex=0;var n=oo.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jt(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,h=i*l+u*Math.cos(s),f=u*o*Math.sin(s);fo.add(Math.atan2(f,h)),n=t,i=l,a=c}var e,r,n,i,a;po.point=function(o,s){po.point=t,n=(e=o)*Pa,i=Math.cos(s=(r=s)*Pa/2+Ea/4),a=Math.sin(s)},po.lineEnd=function(){t(e,r)}}function ne(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function oe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function se(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function le(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ce(t){return[Math.atan2(t[1],t[0]),Q(t[2])]}function ue(t,e){return ca(t[0]-e[0])=0;--s)i.point((h=u[s])[0],h[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function be(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(we))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=$i.merge(d);var t=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;fo.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>Ea,T=p*b;if(fo.add(Math.atan2(T*w*Math.sin(M),m*x+T*Math.cos(M))),a+=k?_+w*La:_,k^f>=r^v>=r){var A=ae(ne(h),ne(t));le(A);var S=ae(i,A);le(S);var E=(k^_>=0?-1:1)*Q(S[2]);(n>E||n===E&&(A[0]||A[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;f=v,p=b,m=x,h=t}}return(a<-Aa||a1}function Me(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:x,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ke(t,e){return((t=t.x)[0]<0?t[1]-Ia-Aa:Ia-t[1])-((e=e.x)[0]<0?e[1]-Ia-Aa:Ia-e[1])}function Te(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,h=1,f=s.x-l,d=s.y-c;if(a=t-l,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>u&&(u=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>h)return;a>u&&(u=a)}else if(d>0){if(a0&&(i.a={x:l+u*f,y:c+u*d}),h<1&&(i.b={x:l+h*f,y:c+h*d}),i}}}}}}function Ae(t,e,r,n){function i(n,i){return ca(n[0]-t)0?0:3:ca(n[0]-r)0?2:1:ca(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(a,s,l,c){var u=0,h=0;if(null==a||(u=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==h);else c.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function u(t,e){c(t,e)&&s.point(t,e)}function h(t,e){var r=c(t=Math.max(-Eo,Math.min(Eo,t)),e=Math.max(-Eo,Math.min(Eo,e)));if(d&&p.push([t,e]),_)m=t,g=e,v=r,_=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&x)s.point(t,e);else{var n={a:{x:y,y:b},b:{x:t,y:e}};T(n)?(x||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),w=!1):r&&(s.lineStart(),s.point(t,e),w=!1)}y=t,b=e,x=r}var f,d,p,m,g,v,y,b,x,_,w,M=s,k=Me(),T=Te(t,e,r,n),A={point:u,lineStart:function(){A.point=h,d&&d.push(p=[]),_=!0,x=!1,y=b=NaN},lineEnd:function(){f&&(h(m,g),v&&x&&k.rejoin(),f.push(k.buffer())),A.point=u,x&&s.lineEnd()},polygonStart:function(){s=k,f=[],d=[],w=!0},polygonEnd:function(){s=M,f=$i.merge(f);var e=function(t){for(var e=0,r=d.length,n=t[1],i=0;in&&J(c,a,t)>0&&++e:a[1]<=n&&J(c,a,t)<0&&--e,c=a;return 0!==e}([t,n]),r=w&&e,i=f.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&ye(f,a,e,l,s),s.polygonEnd()),f=d=p=null}};return A}}function Se(t){var e=0,r=Ea/3,n=Ne(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Ea/180,r=t[1]*Ea/180):[e/Ea*180,r/Ea*180]},i}function Ee(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,Q((a-(t*t+r*r)*i*i)/(2*i))]},r}function Le(){function t(t,e){Co+=i*t-n*e,n=t,i=e}var e,r,n,i;Oo.point=function(a,o){Oo.point=t,e=n=a,r=i=o},Oo.lineEnd=function(){t(e,r)}}function Ce(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ie(t,e){vo+=t,yo+=e,++bo}function Pe(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);xo+=o*(e+t)/2,_o+=o*(r+n)/2,wo+=o,Ie(e=t,r=n)}var e,r;Ro.point=function(n,i){Ro.point=t,Ie(e=n,r=i)}}function De(){Ro.point=Ie}function ze(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);xo+=o*(n+t)/2,_o+=o*(i+e)/2,wo+=o,Mo+=(o=i*t-n*e)*(n+t),ko+=o*(i+e),To+=3*o,Ie(n=t,i=e)}var e,r,n,i;Ro.point=function(a,o){Ro.point=t,Ie(e=n=a,r=i=o)},Ro.lineEnd=function(){t(e,r)}}function Oe(t){function e(e){return(a?function(e){function n(r,n){r=t(r,n),e.point(r[0],r[1])}function i(){y=NaN,M.point=o,e.lineStart()}function o(n,i){var o=ne([n,i]),s=t(n,i);r(y,b,v,x,_,w,y=s[0],b=s[1],v=n,x=o[0],_=o[1],w=o[2],a,e),e.point(y,b)}function s(){M.point=n,e.lineEnd()}function l(){i(),M.point=c,M.lineEnd=u}function c(t,e){o(h=t,e),f=y,d=b,p=x,m=_,g=w,M.point=o}function u(){r(y,b,v,x,_,w,f,d,h,p,m,g,a,e),M.lineEnd=s,s()}var h,f,d,p,m,g,v,y,b,x,_,w,M={point:n,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),M.lineStart=l},polygonEnd:function(){e.polygonEnd(),M.lineStart=i}};return M}:function(e){return Re(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function r(e,a,o,s,l,c,u,h,f,d,p,m,g,v){var y=u-e,b=h-a,x=y*y+b*b;if(x>4*n&&g--){var _=s+d,w=l+p,M=c+m,k=Math.sqrt(_*_+w*w+M*M),T=Math.asin(M/=k),A=ca(ca(M)-1)n||ca((y*C+b*I)/x-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(n)},e}function Fe(t){this.stream=t}function Re(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function je(t){return Ne(function(){return t})()}function Ne(t){function e(t){return t=o(t[0]*Pa,t[1]*Pa),[t[0]*h+s,l-t[1]*h]}function r(){o=ge(a=He(g,v,b),i);var t=i(p,m);return s=f-t[0]*h,l=d+t[1]*h,n()}function n(){return c&&(c.valid=!1,c=null),e}var i,a,o,s,l,c,u=Oe(function(t,e){return t=i(t,e),[t[0]*h+s,l-t[1]*h]}),h=150,f=480,d=250,p=0,m=0,g=0,v=0,b=0,x=So,_=y,w=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=Be(x(a,u(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(x=null==t?(w=t,So):function(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t,e,r){var n=[1,0,0],a=ae(ne(t),ne(e)),o=ie(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=i*o/l,u=-i*s/l,h=ae(n,a),f=se(n,c);oe(f,se(a,u));var d=h,p=ie(f,d),m=ie(d,d),g=p*p-m*(ie(f,f)-1);if(!(g<0)){var v=Math.sqrt(g),y=se(d,(-p-v)/m);if(oe(y,f),y=ce(y),!r)return y;var b,x=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(ca(y[0]-x)Ea^(x<=y[0]&&y[0]<=_)){var A=se(d,(-p+v)/m);return oe(A,f),[y,ce(A)]}}}function n(e,r){var n=a?t:Ea-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var i=Math.cos(t),a=i>0,o=ca(i)>Aa;return _e(e,function(t){var i,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var d,p=[h,f],m=e(h,f),g=a?m?0:n(h,f):m?n(h+(h<0?Ea:-Ea),f):0;if(!i&&(c=l=m)&&t.lineStart(),m!==l&&(d=r(i,p),(ue(i,d)||ue(p,d))&&(p[0]+=Aa,p[1]+=Aa,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=r(p,i),t.point(d[0],d[1])):(d=r(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(o&&i&&a^m){var v;g&s||!(v=r(p,i,!0))||(u=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||i&&ue(i,p)||t.point(p[0],p[1]),i=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},We(t,6*Pa),a?[0,-t]:[-Ea,t-Ea])}((w=+t)*Pa),n()):w},e.clipExtent=function(t){return arguments.length?(M=t,_=t?Ae(t[0][0],t[0][1],t[1][0],t[1][1]):y,n()):M},e.scale=function(t){return arguments.length?(h=+t,r()):h},e.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],r()):[f,d]},e.center=function(t){return arguments.length?(p=t[0]%360*Pa,m=t[1]%360*Pa,r()):[p*Da,m*Da]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Pa,v=t[1]%360*Pa,b=t.length>2?t[2]%360*Pa:0,r()):[g*Da,v*Da,b*Da]},$i.rebind(e,u,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&function(t){return(t=o.invert((t[0]-s)/h,(l-t[1])/h))&&[t[0]*Da,t[1]*Da]},r()}}function Be(t){return Re(t,function(e,r){t.point(e*Pa,r*Pa)})}function Ue(t,e){return[t,e]}function Ve(t,e){return[t>Ea?t-La:t<-Ea?t+La:t,e]}function He(t,e,r){return t?e||r?ge(Ge(t),Ye(e,r)):Ge(t):e||r?Ye(e,r):Ve}function qe(t){return function(e,r){return e+=t,[e>Ea?e-La:e<-Ea?e+La:e,r]}}function Ge(t){var e=qe(t);return e.invert=qe(-t),e}function Ye(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),Q(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),Q(u*n-s*i)]},r}function We(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Xe(r,i),a=Xe(r,a),(o>0?ia)&&(i+=o*La)):(i=t+o*La,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-Ia+Aa&&(e=-Ia+Aa):e>Ia-Aa&&(e=Ia-Aa);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Ea/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=Z(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Ia]},r):rr}function er(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return ca(i)1&&J(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function lr(t,e){return t[0]-e[0]||t[1]-e[1]}function cr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ur(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,h=n[1]-c,f=(s*(l-c)-h*(i-a))/(h*o-s*u);return[i+f*o,l+f*u]}function hr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function fr(t){var e=Ko.pop()||new function(){Sr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function dr(t){_r(t),Xo.remove(t),Ko.push(t),Sr(t)}function pr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];dr(t);for(var l=a;l.circle&&ca(r-l.circle.x)Aa)s=s.L;else{if(!((i=a-function(t,e){var r=t.N;if(r)return gr(r,e);var n=t.site;return n.y===e?n.x:1/0}(s,o))>Aa)){n>-Aa?(e=s.P,r=s):i>-Aa?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=fr(t);if(Xo.insert(e,l),e||r){if(e===r)return _r(e),r=fr(e.site),Xo.insert(l,r),l.edge=r.edge=Mr(e.site,l.site),xr(e),void xr(r);if(r){_r(e),_r(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,d=t.y-h,p=r.site,m=p.x-u,g=p.y-h,v=2*(f*g-d*m),y=f*f+d*d,b=m*m+g*g,x={x:(g*y-d*b)/v+u,y:(f*b-m*y)/v+h};kr(r.edge,c,p,x),l.edge=Mr(c,t,null,x),r.edge=Mr(t,p,null,x),xr(e),xr(r)}else l.edge=Mr(e.site,l.site)}}function gr(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,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function vr(t){this.site=t,this.edges=[]}function yr(t){for(var e,r,n,i,a,o,s,l,c,u,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=Wo,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;oAa||ca(i-r)>Aa)&&(s.splice(o,0,new Tr(function(t,e,r){var n=new wr(t,null);return n.a=e,n.b=r,Yo.push(n),n}(a.site,u,ca(n-h)Aa?{x:h,y:ca(e-h)Aa?{x:ca(r-p)Aa?{x:f,y:ca(e-f)Aa?{x:ca(r-d)=-Sa)){var f=l*l+c*c,d=u*u+g*g,p=(g*f-c*d)/h,m=(l*d-u*f)/h,g=m+s,v=Qo.pop()||new function(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,b=Jo._;b;)if(v.y=s)return;if(f>p){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(f>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}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.xa&&(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:jr(r,n)})),a=es.lastIndex;return a=0&&!(r=$i.interpolators[n](t,e)););return r}function Ur(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(tn(r)+"rotate(",null,")")-2,x:jr(t,e)})):e&&r.push(tn(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(tn(r)+"skewX(",null,")")-2,x:jr(t,e)}):e&&r.push(tn(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(tn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:jr(t[0],e[0])},{i:i-2,x:jr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(tn(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function pn(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;++oi&&(n=r,i=e);return n}function Tn(t){return t.reduce(An,0)}function An(t,e){return t+e[1]}function Sn(t,e){return En(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function En(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 Ln(t){return[$i.min(t),$i.max(t)]}function Cn(t,e){return t.value-e.value}function In(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Pn(t,e){t._pack_next=e,e._pack_prev=t}function Dn(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 zn(t){function e(t){u=Math.min(t.x-t.r,u),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,h=-1/0,f=1/0,d=-1/0;if(r.forEach(On),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(jn(n,i,a=r[2]),e(a),In(n,a),n._pack_prev=a,In(a,i),i=n._pack_next,o=3;o2?Kn:Xn,l=n?nn:rn;return o=i(t,e,l,r),s=i(e,t,l,Br),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Jr)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ri(t,e)},a.tickFormat=function(e,r){return ni(t,e,r)},a.nice=function(e){return ti(t,e),i()},a.copy=function(){return Qn(t,e,r,n)},i()}function $n(t,e){return $i.rebind(t,e,"range","rangeRound","interpolate","clamp")}function ti(t,e){return Zn(t,Jn(ei(t,e)[2])),Zn(t,Jn(ei(t,e)[2])),t}function ei(t,e){null==e&&(e=10);var r=Yn(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 ri(t,e){return $i.range.apply($i,ei(t,e))}function ni(t,e,r){var n=ei(t,e);if(r){var i=$a.exec(r);if(i.shift(),"s"===i[8]){var a=$i.formatPrefix(Math.max(ca(n[0]),ca(n[1])));return i[7]||(i[7]="."+ii(a.scale(n[2]))),i[8]="f",r=$i.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+function(t,e){var r=ii(e[2]);return t in ds?Math.abs(r-ii(Math.max(ca(e[0]),ca(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],n)),r=i.join("")}else r=",."+ii(n[2])+"f";return $i.format(r)}function ii(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ai(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=Zn(n.map(i),r?Math:ms);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Yn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;f--)o.push(a(c)*f);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return ps;arguments.length<2?r=ps:"function"!=typeof r&&(r=$i.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function xi(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,c=-s*a,u=t[0]+l,h=t[1]+c,f=e[0]+l,d=e[1]+c,p=(u+f)/2,m=(h+d)/2,g=f-u,v=d-h,y=g*g+v*v,b=r-n,x=u*d-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*v-g*_)/y,M=(-x*g-v*_)/y,k=(x*v+g*_)/y,T=(-x*g+v*_)/y,A=w-p,S=M-m,E=k-p,L=T-m;return A*A+S*S>E*E+L*L&&(w=k,M=T),[[w-l,M-c],[w*r/b,M*r/b]]}function _i(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],h=-1,f=e.length,d=_t(r),p=_t(n);++h1?t.join("L"):t+"Z"}function Mi(t){return t.join("L")+"Z"}function ki(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 c=2;c9&&(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}function Di(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,h,f,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=kt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function Yi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Wi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function Xi(t){return t.toISOString()}function Zi(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=$i.bisect(Bs,n);return i==Bs.length?[e.year,ei(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Bs[i-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=Ji(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=Ji(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Yn(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],Ji(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Zi(t.copy(),e,r)},$n(n,t)}function Ji(t){return new Date(t)}function Ki(t){return JSON.parse(t.responseText)}function Qi(t){var e=ra.createRange();return e.selectNode(ra.body),e.createContextualFragment(t.responseText)}var $i={version:"3.5.17"},ta=[].slice,ea=function(t){return ta.call(t)},ra=this.document;if(ra)try{ea(ra.documentElement.childNodes)[0].nodeType}catch(t){ea=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}),ra)try{ra.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var na=this.Element.prototype,ia=na.setAttribute,aa=na.setAttributeNS,oa=this.CSSStyleDeclaration.prototype,sa=oa.setProperty;na.setAttribute=function(t,e){ia.call(this,t,e+"")},na.setAttributeNS=function(t,e,r){aa.call(this,t,e,r+"")},oa.setProperty=function(t,e,r){sa.call(this,t,e+"",r)}}$i.ascending=n,$i.descending=function(t,e){return et?1:e>=t?0:NaN},$i.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},$i.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},$i.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 l/(u-1)},$i.deviation=function(){var t=$i.variance.apply(this,arguments);return t?Math.sqrt(t):t};var la=o(n);$i.bisectLeft=la.left,$i.bisect=$i.bisectRight=la.right,$i.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},$i.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},$i.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},$i.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 ca=Math.abs;$i.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}(ca(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)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,h,f,d=-1,p=o.length,m=a[s++],g=new c;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t($i.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},$i.set=function(t){var e=new v;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}},$i.event=null,$i.requote=function(t){return t.replace(da,"\\$&")};var da=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,pa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},ma=function(t,e){return e.querySelector(t)},ga=function(t,e){return e.querySelectorAll(t)},va=function(t,e){var r=t.matches||t[b(t,"matchesSelector")];return(va=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(ma=function(t,e){return Sizzle(t,e)[0]||null},ga=Sizzle,va=Sizzle.matchesSelector),$i.selection=function(){return $i.select(ra.documentElement)};var ya=$i.selection.prototype=[];ya.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),xa.hasOwnProperty(r)?{space:xa[r],local:t}:t}},ya.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=$i.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ya.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=P(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},ya.sort=function(t){t=function(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.transition().duration(E)),e.call(t.event)}function o(){x&&x.domain(b.range().map(function(t){return(t-k.x)/k.k}).map(b.invert)),w&&w.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){L++||t({type:"zoomstart"})}function l(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=z.of(t,arguments),a=0,o=$i.select(r(t)).on(I,function(){a=1,i($i.mouse(t),u),l(n)}).on(P,function(){o.on(I,null).on(P,null),h(a),c(n)}),u=e($i.mouse(t)),h=Y(t);Cs.call(t),s(n)}function h(){function t(){var t=$i.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=$i.event.target;$i.select(e).on(x,o).on(_,f),w.push(e);for(var r=$i.event.changedTouches,n=0,i=r.length;n1){c=s[0];var u=s[1],h=c[0]-u[0],d=c[1]-u[1];v=h*h+d*d}}function o(){var t,e,r,a,o=$i.touches(p);Cs.call(p);for(var s=0,c=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++8?function(t){return t/r}:function(t){return t*r},symbol:t}});$i.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=$i.round(t,Et(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Qa[8+r/3]};var $a=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,to=$i.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=$i.round(t,Et(t,e))).toFixed(Math.max(0,Math.min(20,Et(t*(1+1e-15),e))))}}),eo=$i.time={},ro=Date;Lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){no.setUTCDate.apply(this._,arguments)},setDay:function(){no.setUTCDay.apply(this._,arguments)},setFullYear:function(){no.setUTCFullYear.apply(this._,arguments)},setHours:function(){no.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){no.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){no.setUTCMinutes.apply(this._,arguments)},setMonth:function(){no.setUTCMonth.apply(this._,arguments)},setSeconds:function(){no.setUTCSeconds.apply(this._,arguments)},setTime:function(){no.setTime.apply(this._,arguments)}};var no=Date.prototype;eo.year=Ct(function(t){return(t=eo.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),eo.years=eo.year.range,eo.years.utc=eo.year.utc.range,eo.day=Ct(function(t){var e=new ro(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),eo.days=eo.day.range,eo.days.utc=eo.day.utc.range,eo.dayOfYear=function(t){var e=eo.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=eo[t]=Ct(function(t){return(t=eo.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});eo[t+"s"]=r.range,eo[t+"s"].utc=r.utc.range,eo[t+"OfYear"]=function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)}}),eo.week=eo.sunday,eo.weeks=eo.sunday.range,eo.weeks.utc=eo.sunday.utc.range,eo.weekOfYear=eo.sundayOfYear;var io={"-":"",_:" ",0:"0"},ao=/^\s*\d+/,oo=/^%/;$i.locale=function(t){return{numberFormat:function(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:y;return function(t){var r=$a.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],h=r[7],f=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(f&&(f=+f.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":h=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=to.get(d)||function(t){return t+""};var b=c&&h;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=$i.formatPrefix(t,f);t=l.scale(t),r=l.symbol+g}else t*=p;var x,_,w=(t=d(t,f)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(x=t,_=""):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!c&&h&&(x=a(x,1/0));var k=m.length+x.length+_.length+(b?0:i.length),T=k"===o?T+i+t:"^"===o?T.substring(0,k>>=1)+i+t+T.substring(k):i+(b?t:T+t))+r}}}(t),timeFormat:function(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=_[o in io?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}var n=t.dateTime,i=t.date,a=t.time,o=t.periods,s=t.days,l=t.shortDays,c=t.months,u=t.shortMonths;e.multi=(e.utc=function(t){function r(t){try{var e=new(ro=Lt);return e._=t,n(e)}finally{ro=Date}}var n=e(t);return r.parse=function(t){try{ro=Lt;var e=n.parse(t);return e&&e._}finally{ro=Date}},r.toString=n.toString,r}).multi=Jt;var h=$i.map(),f=Dt(s),d=zt(s),p=Dt(l),m=zt(l),g=Dt(c),v=zt(c),y=Dt(u),b=zt(u);o.forEach(function(t,e){h.set(t.toLowerCase(),e)});var x={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Pt(t.getDate(),e,2)},e:function(t,e){return Pt(t.getDate(),e,2)},H:function(t,e){return Pt(t.getHours(),e,2)},I:function(t,e){return Pt(t.getHours()%12||12,e,2)},j:function(t,e){return Pt(1+eo.dayOfYear(t),e,3)},L:function(t,e){return Pt(t.getMilliseconds(),e,3)},m:function(t,e){return Pt(t.getMonth()+1,e,2)},M:function(t,e){return Pt(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Pt(t.getSeconds(),e,2)},U:function(t,e){return Pt(eo.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Pt(eo.mondayOfYear(t),e,2)},x:e(i),X:e(a),y:function(t,e){return Pt(t.getFullYear()%100,e,2)},Y:function(t,e){return Pt(t.getFullYear()%1e4,e,4)},Z:Xt,"%":function(){return"%"}},_={a:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){f.lastIndex=0;var n=f.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,n){return r(t,x.c.toString(),e,n)},d:Vt,e:Vt,H:qt,I:qt,j:Ht,L:Wt,m:Ut,M:Gt,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Yt,U:Ft,w:Ot,W:Rt,x:function(t,e,n){return r(t,x.x.toString(),e,n)},X:function(t,e,n){return r(t,x.X.toString(),e,n)},y:Nt,Y:jt,Z:Bt,"%":Zt};return e}(t)}};var so=$i.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});$i.format=so.numberFormat,$i.geo={},Kt.prototype={s:0,t:0,add:function(t){Qt(t,this.t,lo),Qt(lo.s,this.s,this),this.s?this.t+=lo.t:this.s=lo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var lo=new Kt;$i.geo.stream=function(t,e){t&&co.hasOwnProperty(t.type)?co[t.type](t,e):$t(t,e)};var co={Feature:function(t,e){$t(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ne([e*Pa,r*Pa]);if(v){var i=ae(v,n),a=ae([i[1],-i[0],0],i);le(a),a=ce(a);var o=e-p,l=o>0?1:-1,c=a[0]*Da*l,m=ca(o)>180;if(m^(l*pd&&(d=g)}else if(c=(c+360)%360-180,m^(l*pd&&(d=r);m?es(u,f)&&(f=e):s(e,f)>s(u,f)&&(u=e):f>=u?(ef&&(f=e)):e>p?s(u,e)>s(u,f)&&(f=e):s(e,f)>s(u,f)&&(u=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){x[0]=u,x[1]=f,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=ca(n)>180?n+(n>0?360:-360):n}else m=t,g=r;po.point(t,r),e(t,r)}function a(){po.lineStart()}function o(){i(m,g),po.lineEnd(),ca(y)>Aa&&(u=-(f=180)),x[0]=u,x[1]=f,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tAa?d=90:y<-Aa&&(h=-90),x[0]=u,x[1]=f}};return function(t){d=f=-(u=h=1/0),b=[],$i.geo.stream(t,_);if(i=b.length){b.sort(l);for(var e=1,r=[p=b[0]];es(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):r.push(p=a);for(var n,i,a,o=-1/0,p=(e=0,r[i=r.length-1]);e<=i;p=a,++e)a=r[e],(n=s(p[1],a[0]))>o&&(o=n,u=a[0],f=p[1])}return b=x=null,u===1/0||h===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,h],[f,d]]}}(),$i.geo.centroid=function(t){mo=go=vo=yo=bo=xo=_o=wo=Mo=ko=To=0,$i.geo.stream(t,Ao);var e=Mo,r=ko,n=To,i=e*e+r*r+n*n;return i0?Ea:-Ea,l=ca(a-r);ca(l-Ea)0?Ia:-Ia),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Ea&&(ca(r-i)Aa?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*Ia,n.point(-Ea,i),n.point(0,i),n.point(Ea,i),n.point(Ea,0),n.point(Ea,-i),n.point(0,-i),n.point(-Ea,-i),n.point(-Ea,0),n.point(-Ea,i);else if(ca(t[0]-e[0])>Aa){var a=t[0]=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],h=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,h-.238*c],[u+.455*c,h+.238*c]]).stream(l).point,n=o.translate([u-.307*c,h+.201*c]).clipExtent([[u-.425*c+Aa,h+.12*c+Aa],[u-.214*c-Aa,h+.234*c-Aa]]).stream(l).point,i=s.translate([u-.205*c,h+.212*c]).clipExtent([[u-.214*c+Aa,h+.166*c+Aa],[u-.115*c-Aa,h+.234*c-Aa]]).stream(l).point,t},t.scale(1070)};var Lo,Co,Io,Po,Do,zo,Oo={point:x,lineStart:x,lineEnd:x,polygonStart:function(){Co=0,Oo.lineStart=Le},polygonEnd:function(){Oo.lineStart=Oo.lineEnd=Oo.point=x,Lo+=ca(Co/2)}},Fo={point:function(t,e){tDo&&(Do=t),ezo&&(zo=e)},lineStart:x,lineEnd:x,polygonStart:x,polygonEnd:x},Ro={point:Ie,lineStart:Pe,lineEnd:De,polygonStart:function(){Ro.lineStart=ze},polygonEnd:function(){Ro.point=Ie,Ro.lineStart=Pe,Ro.lineEnd=De}};$i.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),$i.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Lo=0,$i.geo.stream(t,i(Oo)),Lo},t.centroid=function(t){return vo=yo=bo=xo=_o=wo=Mo=ko=To=0,$i.geo.stream(t,i(Ro)),To?[Mo/To,ko/To]:wo?[xo/wo,_o/wo]:bo?[vo/bo,yo/bo]:[NaN,NaN]},t.bounds=function(t){return Do=zo=-(Io=Po=1/0),$i.geo.stream(t,i(Fo)),[[Io,Po],[Do,zo]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||function(t){var e=Oe(function(e,r){return t([e*Da,r*Da])});return function(t){return Be(e(t))}}(t):y,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new function(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ce(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ce(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}:new function(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,La)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:x};return s}(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection($i.geo.albersUsa()).context(null)},$i.geo.transform=function(t){return{stream:function(e){var r=new Fe(e);for(var n in t)r[n]=t[n];return r}}},Fe.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},$i.geo.projection=je,$i.geo.projectionMutator=Ne,($i.geo.equirectangular=function(){return je(Ue)}).raw=Ue.invert=Ue,$i.geo.rotation=function(t){function e(e){return e=t(e[0]*Pa,e[1]*Pa),e[0]*=Da,e[1]*=Da,e}return t=He(t[0]%360*Pa,t[1]*Pa,t.length>2?t[2]*Pa:0),e.invert=function(e){return e=t.invert(e[0]*Pa,e[1]*Pa),e[0]*=Da,e[1]*=Da,e},e},Ve.invert=Ue,$i.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=He(-t[0]*Pa,-t[1]*Pa,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Da,t[1]*=Da}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=We((e=+n)*Pa,i*Pa),t):e},t.precision=function(n){return arguments.length?(r=We(e*Pa,(i=+n)*Pa),t):i},t.angle(90)},$i.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Pa,i=t[1]*Pa,a=e[1]*Pa,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=c*u-l*h*s)*r),l*u+c*h*s)},$i.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return $i.range(Math.ceil(a/g)*g,i,g).map(f).concat($i.range(Math.ceil(c/v)*v,l,v).map(d)).concat($i.range(Math.ceil(n/p)*p,r,p).filter(function(t){return ca(t%g)>Aa}).map(u)).concat($i.range(Math.ceil(s/m)*m,o,m).filter(function(t){return ca(t%v)>Aa}).map(h))}var r,n,i,a,o,s,l,c,u,h,f,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=Ze(s,o,90),h=Je(n,r,y),f=Ze(c,l,90),d=Je(a,i,y),t):y},t.majorExtent([[-180,-90+Aa],[180,90-Aa]]).minorExtent([[-180,-80-Aa],[180,80+Aa]])},$i.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=Ke,i=Qe;return t.distance=function(){return $i.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},$i.geo.interpolate=function(t,e){return function(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),c=i*Math.sin(t),u=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(tt(n-e)+i*o*tt(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*u,i=r*c+e*h,o=r*a+e*s;return[Math.atan2(i,n)*Da,Math.atan2(o,Math.sqrt(n*n+i*i))*Da]}:function(){return[t*Da,e*Da]};return p.distance=f,p}(t[0]*Pa,t[1]*Pa,e[0]*Pa,e[1]*Pa)},$i.geo.length=function(t){return jo=0,$i.geo.stream(t,No),jo};var jo,No={sphere:x,point:x,lineStart:function(){function t(t,i){var a=Math.sin(i*=Pa),o=Math.cos(i),s=ca((t*=Pa)-e),l=Math.cos(s);jo+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;No.point=function(i,a){e=i*Pa,r=Math.sin(a*=Pa),n=Math.cos(a),No.point=t},No.lineEnd=function(){No.point=No.lineEnd=x}},lineEnd:x,polygonStart:x,polygonEnd:x},Bo=$e(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});($i.geo.azimuthalEqualArea=function(){return je(Bo)}).raw=Bo;var Uo=$e(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);($i.geo.azimuthalEquidistant=function(){return je(Uo)}).raw=Uo,($i.geo.conicConformal=function(){return Se(tr)}).raw=tr,($i.geo.conicEquidistant=function(){return Se(er)}).raw=er;var Vo=$e(function(t){return 1/t},Math.atan);($i.geo.gnomonic=function(){return je(Vo)}).raw=Vo,rr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ia]},($i.geo.mercator=function(){return nr(rr)}).raw=rr;var Ho=$e(function(){return 1},Math.asin);($i.geo.orthographic=function(){return je(Ho)}).raw=Ho;var qo=$e(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});($i.geo.stereographic=function(){return je(qo)}).raw=qo,ir.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ia]},($i.geo.transverseMercator=function(){var t=nr(ir),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=ir,$i.geom={},$i.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=_t(r),a=_t(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+h;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Aa)*Aa,y:Math.round(o(t,e)/Aa)*Aa,i:e}})}var n=ar,i=or,a=n,o=i,s=$o;return t?e(t):(e.links=function(t){return Ir(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return Ir(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(br),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,f=n>=u,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),h?i=c:s=c,f?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,h,f,d,p,m,g,v,y,b=_t(s),x=_t(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),h=[],f=[],p=t.length,o)for(d=0;dv&&(v=u.x),u.y>y&&(y=u.y),h.push(u.x),f.push(u.y);else for(d=0;dv&&(v=_),w>y&&(y=w),h.push(_),f.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var T={leaf:!0,nodes:[],point:null,x:null,y:null};if(T.add=function(t){a(T,t,+b(t,++d),+x(t,d),m,g,v,y)},T.visit=function(t){Or(t,T,m,g,v,y)},T.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,h,f,d){if(!(u>a||h>o||f=_)<<1|e>=x,M=w+4;w=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ns.get(r)||rs,n=is.get(n)||y,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}(n(r.apply(null,ta.call(arguments,1))))},$i.interpolateHcl=function(t,e){t=$i.hcl(t),e=$i.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return at(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateHsl=function(t,e){t=$i.hsl(t),e=$i.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return nt(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateLab=function(t,e){t=$i.lab(t),e=$i.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return st(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateRound=Jr,$i.transform=function(t){var e=ra.createElementNS($i.ns.prefix.svg,"g");return($i.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Kr(r?r.matrix:as)})(t)},Kr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var as={a:1,b:0,c:0,d:1,e:0,f:0};$i.interpolateTransform=en,$i.layout={},$i.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=kt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return pn(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=vn,r=mn,n=gn;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(dn(e,function(t){t.children&&(t.value=0)}),pn(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},$i.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&((o=l[$i.bisect(h,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Ln,i=Sn;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=_t(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return En(t,e)}:_t(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},$i.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,pn(s,function(t){t.r=+u(t.value)}),pn(s,zn),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;pn(s,function(t){t.r+=h}),pn(s,zn),pn(s,function(t){t.r-=h})}return Rn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=$i.layout.hierarchy().sort(Cn),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},fn(t,r)},$i.layout.tree=function(){function t(t,l){var c=i.call(this,t,l),u=c[0],h=function(t){var e,r={A:null,children:[t]},n=[r];for(;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 m=a(f,d)/2-f.x,g=o[0]/(d.x+a(d,f)/2+m),v=o[1]/(p.depth||1);dn(u,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return c}function e(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.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 i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+a(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+a(t._,n._));t.parent.A=function(t,e,r){if(e){for(var n,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,h=s.m,f=l.m;s=Un(s),i=Bn(i),s&&i;)l=Bn(l),(o=Un(o)).a=t,(n=s.z+h-i.z-c+a(s._,i._))>0&&(!function(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}(function(t,e,r){return t.a.parent===e.parent?t.a:r}(s,t,r),t,n),c+=n,u+=n),h+=s.m,c+=i.m,f+=l.m,u+=o.m;s&&!Un(o)&&(o.t=s,o.m+=h-u),i&&!Bn(l)&&(l.t=i,l.m+=c-f,r=t)}return r}(t,n,t.parent.A||r[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function n(t){t.x*=o[0],t.y=t.depth*o[1]}var i=$i.layout.hierarchy().sort(null).value(null),a=Nn,o=[1,1],s=null;return t.separation=function(e){return arguments.length?(a=e,t):a},t.size=function(e){return arguments.length?(s=null==(o=e)?n:null,t):s?null:o},t.nodeSize=function(e){return arguments.length?(s=null==(o=e)?null:n,t):s?o:null},fn(t,i)},$i.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;pn(l,function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(e),t.y=function(t){return 1+$i.max(t,function(t){return t.y})}(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Vn(l),h=Hn(l),f=u.x-r(u,h)/2,d=h.x+r(h,u)/2;return pn(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=$i.layout.hierarchy().sort(null).value(null),r=Nn,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},fn(t,e)},$i.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(a=h[s-1]),c.area+=a.area,"squarify"!==f||(o=function(t,e){var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;for(;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}(c,m))<=p?(h.pop(),p=o):(c.area-=c.pop().area,n(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(n(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function r(e){var i=e.children;if(i&&i.length){var a,o=u(e),s=i.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(n(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);i.forEach(r)}}function n(t,e,r,n){var i,a=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=$i.random.normal.apply($i,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=$i.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rh?0:1;if(c=Ca)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,b,x,_,w,M,k,T,A=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===xs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(S*=-1),c&&(S=Q(g/c*Math.sin(v))),t&&(A=Q(g/t*Math.sin(v)))),c){y=c*Math.cos(u+S),b=c*Math.sin(u+S),x=c*Math.cos(h-S),_=c*Math.sin(h-S);var L=Math.abs(h-u-2*S)<=Ea?0:1;if(S&&bi(y,b,x,_)===d^L){var C=(u+h)/2;y=c*Math.cos(C),b=c*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(h-A),M=t*Math.sin(h-A),k=t*Math.cos(u+A),T=t*Math.sin(u+A);var I=Math.abs(u-h+2*A)<=Ea?0:1;if(A&&bi(w,M,k,T)===1-d^I){var P=(u+h)/2;w=t*Math.cos(P),M=t*Math.sin(P),k=T=null}}else w=M=0;if(f>Aa&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ti,basis:Ei,"basis-open":function(t){if(t.length<4)return wi(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(Li(ks,a)+","+Li(ks,o)),--n;++nEa)+",1 "+e}function n(t,e,r,n){return"Q 0,0 "+n}var i=Ke,a=Qe,o=Oi,s=gi,l=vi;return t.radius=function(e){return arguments.length?(o=_t(e),t):o},t.source=function(e){return arguments.length?(i=_t(e),t):i},t.target=function(e){return arguments.length?(a=_t(e),t):a},t.startAngle=function(e){return arguments.length?(s=_t(e),t):s},t.endAngle=function(e){return arguments.length?(l=_t(e),t):l},t},$i.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,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(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Ke,r=Qe,n=Fi;return t.source=function(r){return arguments.length?(e=_t(r),t):e},t.target=function(e){return arguments.length?(r=_t(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},$i.svg.diagonal.radial=function(){var t=$i.svg.diagonal(),e=Fi,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]-Ia;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},$i.svg.symbol=function(){function t(t,n){return(Ts.get(e.call(this,t,n))||Ni)(r.call(this,t,n))}var e=ji,r=Ri;return t.type=function(r){return arguments.length?(e=_t(r),t):e},t.size=function(e){return arguments.length?(r=_t(e),t):r},t};var Ts=$i.map({circle:Ni,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*Ss)),r=e*Ss;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/As),r=e*As/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/As),r=e*As/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});$i.svg.symbolTypes=Ts.keys();var As=Math.sqrt(3),Ss=Math.tan(30*Pa);ya.transition=function(t){for(var e,r,n=Es||++Ps,i=qi(t),a=[],o=Ls||{time:Date.now(),ease:function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){var t=$i.mouse(b),r=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||($i.event.altKey?(v||(v=[(h[0]+h[1])/2,(f[0]+f[1])/2]),L[0]=h[+(t[0]=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(u=0;u<_.length;++u)f=(x=_[u])[0],x[0]=x[1],x[1]=f;return _}},{"incremental-convex-hull":291,uniq:552}],125:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]};function a(t,e){return i[0]=t,i[1]=e,n[0]}e.exports.pack=a;function o(t){return n[0]=t,i[0]}e.exports.lo=o;function s(t){return n[0]=t,i[1]}e.exports.hi=s}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]};function l(t,e){return i[1]=t,i[0]=e,n[0]}e.exports.pack=l;function c(t){return n[0]=t,i[1]}e.exports.lo=c;function u(t){return n[0]=t,i[0]}e.exports.hi=u}else r=!1}if(!r){var h=new t(8);e.exports=function(t){return h.writeDoubleLE(t,0,!0),[h.readUInt32LE(0,!0),h.readUInt32LE(4,!0)]};function f(t,e){return h.writeUInt32LE(t,0,!0),h.writeUInt32LE(e,4,!0),h.readDoubleLE(0,!0)}e.exports.pack=f;function d(t){return h.writeDoubleLE(t,0,!0),h.readUInt32LE(0,!0)}e.exports.lo=d;function p(t){return h.writeDoubleLE(t,0,!0),h.readUInt32LE(4,!0)}e.exports.hi=p}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:78}],126:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=h&&c(ar.x)&&d(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=p(e,t);a(r,r.next)}}(m[o],r),r=a(r,r.next);return r}(t,e,u,r)),t.length>80*r){f=g=t[0],m=v=t[1];for(var _=r;_g&&(g=y),b>v&&(v=b);x=Math.max(g-f,v-m)}return o(u,h,r,f,m,x),h}function i(t,e,r,n,i){var a,o;if(i===y(t,e,r,n)>0)for(a=e;a=e;a-=n)o=m(a,t[a],t[a+1],o);return o&&h(o,o.next)&&(g(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!h(n,n.next)&&0!==u(n.prev,n,n.next))n=n.next;else{if(g(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,s,m){if(t){!m&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=l(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,s);for(var v,y,b=t;t.prev!==t.next;)if(v=t.prev,y=t.next,s?function(t,e,r,n){var i=t.prev,a=t,o=t.next;if(u(i,a,o)>=0)return!1;var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,d=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=l(s,h,e,r,n),m=l(f,d,e,r,n),g=t.nextZ;for(;g&&g.z<=m;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.nextZ}g=t.prevZ;for(;g&&g.z>=p;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}(t,n,i,s):function(t){var e=t.prev,r=t,n=t.next;if(u(e,r,n)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(c(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&u(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(v.i/r),e.push(t.i/r),e.push(y.i/r),g(t),t=y.next,b=y.next;else if((t=y)===b){m?1===m?o(t=function(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!h(i,a)&&f(i,n,n.next,a)&&d(i,a)&&d(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),g(n),g(n.next),n=t=a),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,s,2):2===m&&function(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&f(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&d(t,e)&&d(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(l,c)){var u=p(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}(t,e,r,n,i,s):o(a(t),e,r,n,i,s,1);break}}}function s(t,e){return t.x-e.x}function l(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function c(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function u(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function h(t,e){return t.x===e.x&&t.y===e.y}function f(t,e,r,n){return!!(h(t,e)&&h(r,n)||h(t,n)&&h(r,e))||u(t,e,r)>0!=u(t,e,n)>0&&u(r,n,t)>0!=u(r,n,e)>0}function d(t,e){return u(t.prev,t,t.next)<0?u(t,e,t.next)>=0&&u(t,t.prev,e)>=0:u(t,e,t.prev)<0||u(t,t.next,e)<0}function p(t,e){var r=new v(t.i,t.x,t.y),n=new v(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function m(t,e,r,n){var i=new v(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function g(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],128:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],131:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],132:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&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}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],133:[function(t,e,r){"use strict";function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";return"("+("=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?o(t.slice(1),"||"):"all"===e?o(t.slice(1),"&&"):"none"===e?c(o(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?c(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var a=i(t),o="$type"===t?h.indexOf(e):JSON.stringify(e);return(n?"typeof "+a+"=== typeof "+o+"&&":"")+a+r+o}function o(t,e){return t.map(n).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(u)),n=i(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function u(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))};var h=["Unknown","Point","LineString","Polygon"]},{}],134:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){f=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var u=a.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)i.push(n(l[h-1],c[h-1],arguments[h])),a.push(0)}},l.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(c[f-1],u[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],c[f-1],i[o++]+d)),a.push(d*h)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--h)i.push(n(l[h],c[h],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":67,"cubic-hermite":110}],135:[function(t,e,r){"use strict";var n=t("tiny-sdf"),i=t("optical-properties");e.exports=function(t){var e,r,o=(t=t||{}).canvas||document.createElement("canvas"),s=t.family||"sans-serif",l=t.shape||[512,512],c=t.step||[32,32],u=parseFloat(t.size)||16,h=t.chars||[32,126],f=Math.floor((c[0]-u)/2),d=t.radius||1.5*f,p=new n(u,f,d,0,s),m=null==t.align?"optical":t.align,g=null==t.fit||1==t.fit?.5:t.fit;if(Array.isArray(h)){if(2===h.length&&"number"==typeof h[0]&&"number"==typeof h[1]){var v=[];for(e=h[0],r=0;e<=h[1];e++)v[r++]=String.fromCharCode(e);h=v}}else h=String(h).split("");l=l.slice(),o.width=l[0],o.height=l[1];var y=o.getContext("2d");y.fillStyle="#000",y.fillRect(0,0,o.width,o.height),y.textBaseline="middle";var b=c[0],x=c[1],_=0,w=0,M=u/x,k=Math.min(h.length,Math.floor(l[0]/b)*Math.ceil(l[1]/x)),T=p.ctx.textAlign,A=p.buffer,S=p.middle;for(p.ctx.textAlign="center",p.buffer=p.size/2,e=0;el[0]-c[0]&&(_=0,w+=c[1])}return p.ctx.textAlign=T,p.buffer=A,p.middle=S,o};var a={}},{"optical-properties":472,"tiny-sdf":542}],136:[function(t,e,r){"use strict";function n(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 i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){if(r=l(t,e.left))return r}var r;return(r=t(e.key,e.value))||(e.right?l(t,e.right):void 0)}function c(t,e,r,n){if(e(t,n.key)<=0){if(n.left){if(i=c(t,e,r,n.left))return i}var i;if(i=r(n.key,n.value))return i}if(n.right)return c(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 h(t,e){this.tree=t,this._stack=e}function f(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}e.exports=function(t){return new s(t||function(t,e){return te?1:0},null)};var d=0,p=1,m=s.prototype;Object.defineProperty(m,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(m,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(d,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){i=l[h];c[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(h=l.length-1;h>1;--h){var f=l[h-1];i=l[h];if(f._color===p||i._color===p)break;var m=l[h-2];if(m.left===f)if(f.left===i){if(!(g=m.right)||g._color!==d){if(m._color=d,m.left=f.right,f._color=p,f.right=m,l[h-2]=f,l[h-1]=i,o(m),o(f),h>=3){(v=l[h-3]).left===m?v.left=f:v.right=f}break}f._color=p,m.right=a(p,g),m._color=d,h-=1}else{if(!(g=m.right)||g._color!==d){if(f.right=i.left,m._color=d,m.left=i.right,i._color=p,i.left=f,i.right=m,l[h-2]=i,l[h-1]=f,o(m),o(f),o(i),h>=3){(v=l[h-3]).left===m?v.left=i:v.right=i}break}f._color=p,m.right=a(p,g),m._color=d,h-=1}else if(f.right===i){if(!(g=m.left)||g._color!==d){if(m._color=d,m.right=f.left,f._color=p,f.left=m,l[h-2]=f,l[h-1]=i,o(m),o(f),h>=3){(v=l[h-3]).right===m?v.right=f:v.left=f}break}f._color=p,m.left=a(p,g),m._color=d,h-=1}else{var g;if(!(g=m.left)||g._color!==d){if(f.left=i.right,m._color=d,m.right=i.left,i._color=p,i.right=f,i.left=m,l[h-2]=i,l[h-1]=f,o(m),o(f),o(i),h>=3){var v;(v=l[h-3]).right===m?v.right=i:v.left=i}break}f._color=p,m.left=a(p,g),m._color=d,h-=1}}return l[0]._color=p,new s(r,l[0])},m.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(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(m,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(m,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),m.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},m.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 h(this,n)},m.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 h(this,n)},m.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 h(this,n)},m.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 h(this,n)},m.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 h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},m.remove=function(t){var e=this.find(t);return e?e.remove():this},m.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 g=h.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new h(this.tree,this._stack.slice())},g.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if((r=e[e.length-1])._color===d){var h=e[e.length-2];h.left===r?h.left=null:h.right===r&&(h.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=p);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===d)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=p,r._color=p,s._color=p,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),void(t[l-1]=n);if(n.left&&n.left._color===d)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).left===r?c.left=s:c.right=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.right=a(d,n));r.right=a(d,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=d,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11&&((c=t[l-2]).right===r?c.right=n:c.left=n),void(t[l-1]=n);if(n.right&&n.right._color===d)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).right===r?c.right=s:c.left=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.left=a(d,n));r.left=a(d,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=d,o(r),o(n),l>1){var c;(c=t[l-2]).right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"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}),g.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(g,"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}}),g.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},g.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(g,"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}})},{}],137:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],138:[function(t,e,r){function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}(t)===e?t:t.reverse()}var s=t("geojson-area");e.exports=n},{"geojson-area":138}],140:[function(t,e,r){"use strict";function n(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,r,a,o,s,l,c){if(r/=e,a/=e,l>=r&&c<=a)return t;if(l>a||c=r&&d<=a)u.push(p);else if(!(f>a||d=e&&s<=r&&i.push(o)}return i}(m,r,a,o):function(t,e,r,i,a,o){for(var s=[],l=0;lr?(x.push(a(c,p,e),a(c,p,r)),o||(x=n(s,x,g,v,y))):d>=e&&x.push(a(c,p,e)):f>r?dr&&(x.push(a(c,p,r)),o||(x=n(s,x,g,v,y))));c=m[b-1],(f=c[i])>=e&&f<=r&&x.push(c),h=x[x.length-1],o&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),n(s,x,g,v,y)}return s}(m,r,a,o,s,3===g);v.length&&u.push(i(p.tags,g,v,p.id))}}return u.length?u:null};var i=t("./feature")},{"./feature":142}],141:[function(t,e,r){"use strict";function n(t,e,r){if(null!==e.geometry){var o,l,c,u,h=e.geometry,f=h.type,d=h.coordinates,p=e.properties,m=e.id;if("Point"===f)t.push(s(p,1,[a(d)],m));else if("MultiPoint"===f)t.push(s(p,1,i(d),m));else if("LineString"===f)t.push(s(p,2,[i(d,r)],m));else if("MultiLineString"===f||"Polygon"===f){for(c=[],o=0;o1?1:n,[r,n,0]}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),b=this.tiles[y]=f(t,v,r,n,x,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,l){if(e===p.maxZoom||e===l)continue;var w=1<1&&console.time("clipping");var M,k,T,A,S,E,L=.5*p.buffer/p.extent,C=.5-L,I=.5+L,P=1+L;M=k=T=A=null,S=u(t,v,r-L,r+I,0,a,b.min[0],b.max[0]),E=u(t,v,r+C,r+P,0,a,b.min[0],b.max[0]),S&&(M=u(S,v,n-L,n+I,1,o,b.min[1],b.max[1]),k=u(S,v,n+C,n+P,1,o,b.min[1],b.max[1])),E&&(T=u(E,v,n-L,n+I,1,o,b.min[1],b.max[1]),A=u(E,v,n+C,n+P,1,o,b.min[1],b.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(T||[],e+1,2*r+1,2*n),d.push(A||[],e+1,2*r+1,2*n+1))}else l&&(g=e)}return g},n.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,l=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var h,f=t,d=e,p=r;!h&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),h=this.tiles[i(f,d,p)];if(!h||!h.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",f,d,p),s(h,a,n.buffer))return c.tile(h,a);o>1&&console.time("drilling down");var m=this.splitTile(h.source,f,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<1?(n=a,i=o):h>0&&(n+=c*h,i+=u*h)}return c=s-n,u=l-i,c*c+u*u}(t[r],t[s],t[l]))>n&&(a=r,n=i);n>o?(t[a][2]=n,c.push(s),c.push(a),s=a):(l=c.pop(),s=c.pop())}}},{}],145:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){for(var o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},s=0;sh)&&(f.push(s),t.numSimplified++),t.numPoints++;3===c&&function(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;io.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1])}return o}},{}],146:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}e.exports=function(t,e){var r=new i(t);return r.update(e),r};var s=t("./lib/text.js"),l=t("./lib/lines.js"),c=t("./lib/background.js"),u=t("./lib/cube.js"),h=t("./lib/ticks.js"),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(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,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(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,u=!1;if("bounds"in t)for(var f=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)f[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=f[d][p];if("ticks"in t){r=t.ticks,c=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=h.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});h.equal(r,this.ticks)?c=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(c=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new a,new a,new a],m=[0,0,0],g={model:f,view:f,projection:f};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],b=[0,0,0];d.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||f,i=t.view||f,a=t.projection||f,s=this.bounds,l=u(r,i,a,s),c=l.cubeEdges,h=l.axis,d=i[12],x=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*d+a[7]*x+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=c[k],this.lastCubeProps.axis[k]=h[k];var T=p;for(k=0;k<3;++k)o(p[k],k,this.bounds,c,h);e=this.gl;var A=m;for(k=0;k<3;++k)this.backgroundEnable[k]?A[k]=h[k]:A[k]=0;this._background.draw(r,i,a,s,A,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];h[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(E=0;E<2;++E){L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,T[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,T[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var I=n(v,T[k].primalMinor),P=n(y,T[k].mirrorMinor),D=this.lineTickLength;for(E=0;E<3;++E){var z=M/r[5*E];I[E]*=D[E]*z,P[E]*=D[E]*z}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,T[k].primalOffset,I,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,T[k].mirrorOffset,P,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){var O=T[k].primalMinor,F=n(b,T[k].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[k]&&(F[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],F,this.tickColor[k])}if(this.labelEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.labelPad[E]/r[5*E];F[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],F,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":150,"./lib/cube.js":151,"./lib/lines.js":152,"./lib/text.js":154,"./lib/ticks.js":155}],150:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[c]=p;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=c;c=u,u=g}var v=i(t,new Float32Array(e)),y=i(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=o(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,v,b,x)};var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders").bg,s=n.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),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":153,"gl-buffer":157,"gl-vao":272}],151:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<h[y][1]&&(O=y));var F=-1;for(y=0;y<3;++y)(j=O^1<h[R][0]&&(R=j))}var N=m;N[0]=N[1]=N[2]=0,N[a.log2(F^O)]=O&F,N[a.log2(O^R)]=O&R;var B=7^R;B===_||B===z?(B=7^F,N[a.log2(R^B)]=B&R):N[a.log2(F^B)]=B&F;var U=g,V=_;for(k=0;k<3;++k)U[k]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 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 colorChannel = abs(normal);\n}","precision mediump 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}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":256}],154:[function(t,e,r){(function(r){"use strict";function n(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}e.exports=function(t,e,r,o,l,c){var u=i(t),h=a(t,[{buffer:u,size:3}]),f=s(t);f.attributes.position.location=0;var d=new n(t,f,u,h);return d.update(e,r,o,l,c),d};var i=t("gl-buffer"),a=t("gl-vao"),o=t("vectorize-text"),s=t("./shaders").text,l=window||r.global||{},c=l.__TEXT_CACHE||{};l.__TEXT_CACHE={};var u=n.prototype,h=[0,0];u.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},u.update=function(t,e,r,n,i){function a(t,e,r,n){var i=c[r];i||(i=c[r]={});var a=i[e];a||(a=i[e]=function(t,e){try{return o(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,h=a.cells,f=0,d=h.length;f=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],d=0;d<3;++d){h[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],r),f[d]=(s.length/3|0)-h[d],l[d]=s.length/3|0;for(var p=0;p=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.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 a(t,e){for(var r=o.malloc(t.length,e),n=t.length,i=0;i=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=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=o.malloc(t.size,r),u=l(n,t.shape);s.assign(u,t),this.length=i(this.gl,this.type,this.length,this.usage,e<0?n:n.subarray(0,t.size),e),o.free(n)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=i(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),o.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(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}},e.exports=function(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||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(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==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 a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}},{ndarray:468,"ndarray-ops":462,"typedarray-pool":550}],158:[function(t,e,r){e.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"}},{}],159:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":158}],160:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-1/0,-1/0],this.numPoints=0,this.color=[0,0,0,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("typedarray-pool"),s=t("./lib/shaders");e.exports=function(t,e){var r=new n(t,i(t.gl,s.vertex,s.fragment),a(t.gl),a(t.gl));return r.update(e),t.addObject(r),r};var l=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,c=this.numPoints;if(c){var u=a.gl,h=a.dataBox,f=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],g=h[2]-h[0],v=h[3]-h[1],y=2*p/g,b=2*m/v,x=(s[0]-h[0]-.5*g)/p,_=(s[1]-h[1]-.5*v)/m;t[0]=y,t[1]=b,e[0]=y-t[0],e[1]=b-t[1],r[0]=x,r[1]=_,n[0]=x-r[0],n[1]=_-r[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(u.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(u.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(u.FLOAT,!1,16,8),u.drawArrays(u.TRIANGLES,0,c*l.length)}}}(),c.drawPick=function(t){return t},c.pick=function(){return null},c.update=function(t){var e,r,n,i=(t=t||{}).positions||[],a=t.errors||[],s=1;"lineWidth"in t&&(s=+t.lineWidth);var c=5;"capSize"in t&&(c=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var u=this.bounds=[1/0,1/0,-1/0,-1/0],h=this.numPoints=i.length>>1;for(e=0;e0&&(A*=_),S<0?S*=w:S>0&&(S*=M),g[b++]=f*(r-p+A),g[b++]=d*(n-m+S),g[b++]=s*T[2]+(c+s)*T[4],g[b++]=s*T[3]+(c+s)*T[5]}}for(e=0;e=1},u.isTransparent=function(){return this.opacity<1},u.drawTransparent=u.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var h=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}();u.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m;(m=h.slice())[c]+=d[1][c],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":164,"gl-buffer":157,"gl-vao":272}],163:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&f.drawBuffersWEBGL(m[h]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=o(r,c,u,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=o(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=s(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=s(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=s(r,c,u,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==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),v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),c=0;ca||r<0||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");var o=1;if("color"in(n=n||{})){if((o=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(o>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(o>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+o+" draw buffers")}}var s=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&o>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");s=t.FLOAT}else n.preferFloat&&o>0&&c&&(s=t.FLOAT);var u=!0;"depth"in n&&(u=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new l(t,e,r,s,o,u,g,i)};var h,f,d,p,m=null,g=l.prototype;Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return c(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,c(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,c(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),u.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]]}},u.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),n=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,f=this.bounds,d=f[0]=r[0],p=f[1]=n[0],m=1/((f[2]=r[r.length-1])-d),g=1/((f[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var b=(v-1)*(y-1)*(h.length>>>1);this.numVertices=b;for(var x=o.mallocUint8(4*b),_=o.mallocFloat32(2*b),w=o.mallocUint8(2*b),M=o.mallocUint32(b),k=0,T=0;T2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,a),x.color=u,x.radius=s*c,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),u.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,c=this.pickShader,u=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,c.bind();var h=c.uniforms;this.setProjectionUniforms(h,i),h.width=o*l,h.pickOffset=t;var f=c.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),u.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),u.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},u.update=function(t){t=t||{};var e,r,n,i,a,c=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=function(t){return t.map(function(t){return t.slice()})}(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var u=t.dashes||[1],h=0;for(e=0;e1,this.dashPattern=o(c,s(f,[h,1,4],[1,0,0])),this.dashPattern.minFilter=c.NEAREST,this.dashPattern.magFilter=c.NEAREST,this.dashLength=h,l.free(f);var p=t.positions;this.data=p;var m=this.bounds;m[0]=m[1]=1/0,m[2]=m[3]=-1/0;var g=this.numPoints=p.length>>>1;if(0!==g){for(e=0;e1;){var k=--n;i=p[2*n],a=p[2*n+1];var T=k-1,A=p[2*T],S=p[2*T+1];if(!(isNaN(i)||isNaN(a)||isNaN(A)||isNaN(S))){M+=1,i=(i-m[0])/(m[2]-m[0]),a=(a-m[1])/(m[3]-m[1]);var E=(A=(A-m[0])/(m[2]-m[0]))-i,L=(S=(S-m[1])/(m[3]-m[1]))-a,C=k|1<<24,I=k-1,P=k,D=k-1|1<<24;v[--_]=-L,v[--_]=-E,v[--_]=a,v[--_]=i,x[--w]=C,x[--w]=I,v[--_]=L,v[--_]=E,v[--_]=S,v[--_]=A,x[--w]=P,x[--w]=D,v[--_]=-L,v[--_]=-E,v[--_]=S,v[--_]=A,x[--w]=P,x[--w]=D,v[--_]=L,v[--_]=E,v[--_]=S,v[--_]=A,x[--w]=P,x[--w]=D,v[--_]=-L,v[--_]=-E,v[--_]=a,v[--_]=i,x[--w]=C,x[--w]=I,v[--_]=L,v[--_]=E,v[--_]=a,v[--_]=i,x[--w]=C,x[--w]=I}}for(e=0;e 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 highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp 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 highp 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\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":256}],173:[function(t,e,r){"use strict";function n(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 i(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 a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(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.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=p(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 n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=s(e),a=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),u=f(new Array(1024),[256,1,4]),h=0;h<1024;++h)u.data[h]=255;var d=c(e,u);d.wrap=e.REPEAT;var g=new o(e,r,n,i,a,d);return g.update(t),g};var s=t("gl-buffer"),l=t("gl-vao"),c=t("gl-texture2d"),u=t("glsl-read-float"),h=t("binary-search-bounds"),f=t("ndarray"),d=t("./lib/shaders"),p=d.createShader,m=d.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v=o.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(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)},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],v[0],v[1],v[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(d),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,h=i*l,f=i*c,d=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,b=s*u,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*_,t[5]=(1-(h+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,h=s+s,f=a*c,d=a*u,p=a*h,m=o*u,g=o*h,v=s*h,y=l*c,b=l*u,x=l*h,_=n[0],w=n[1],M=n[2],k=i[0],T=i[1],A=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(g-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*T+t[8]*A),t[13]=r[1]+T-(t[1]*k+t[5]*T+t[9]*A),t[14]=r[2]+A-(t[2]*k+t[6]*T+t[10]*A),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=u+v,t[2]=f-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,h,f,d,p,m,g=e[0],v=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+h*m+f*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=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,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":195,"./mat3.js":198,"./vec3.js":202,"./vec4.js":203}],201:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=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},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,h=3*l*o,f=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*h+i[0]*f,t[1]=e[1]*c+r[1]*u+n[1]*h+i[1]*f,t[2]=e[2]*c+r[2]*u+n[2]*h+i[2]*f,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=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},i.transformMat3=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+h*-l-f*-s,t[1]=h*c+d*-s+f*-o-u*-l,t[2]=f*c+d*-l+u*-s-h*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=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.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":195}],203:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=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},i.subtract=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},i.sub=i.subtract,i.multiply=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},i.mul=i.multiply,i.divide=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},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=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},i.max=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},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=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},i.scaleAndAdd=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},i.distance=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)},i.dist=i.distance,i.squaredDistance=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},i.sqrDist=i.squaredDistance,i.length=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)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=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},i.normalize=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},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=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},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+h*-l-f*-s,t[1]=h*c+d*-s+f*-o-u*-l,t[2]=f*c+d*-l+u*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[u]}return Math.abs(g-1)>.001?null:[h,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump 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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump 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}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],206:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,h,f,d,p,m,g,v,y,b,x,_,w,k,T,A,S){this.gl=t,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=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=x,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!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._model=M,this._view=M,this._projection=M,this._resolution=[1,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("gl-vao"),s=t("gl-texture2d"),l=t("normals"),c=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),h=t("ndarray"),f=t("colormap"),d=t("simplicial-complex-contour"),p=t("typedarray-pool"),m=t("./lib/shaders"),g=t("./lib/closest-point"),v=m.meshShader,y=m.wireShader,b=m.pointShader,x=m.pickShader,_=m.pointPickShader,w=m.contourShader,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=n.prototype;k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){(p=this.triShader).bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){(p=this.lineShader).bind(),p.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){(p=this.pointShader).bind(),p.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p;(p=this.contourShader).bind(),p.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||M,n=t.view||M,i=t.projection||M,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,pickId:this.pickId/255};if((l=this.pickShader).bind(),l.uniforms=s,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),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l;(l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},k.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;al[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],c.drawArrays(c.TRIANGLES,l[k],l[T]-l[k]))),y[n]&&M&&(e[1^n]-=A*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=A*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=A*d*m[n+2],kl[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],c.drawArrays(c.TRIANGLES,l[k],l[T]-l[k]))),y[n+2]&&M&&(e[1^n]+=A*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),c.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],h=a[c+2]-u,f=.5*(o[c+2]+o[c]),d=o[c+2]-o[c],p=l[c],m=l[c+2]-p,g=s[c],v=s[c+2]-g;e[c]=2*h/d*m/v,t[c]=2*(u-f)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],h=[-1/0],f=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),T=new Array(k),A=0;A=0;)S+=1;w[b]=S}var E=new Array(r.length);h(),d._relink=h,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,x,w),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":214,"./lib/create-attributes":215,"./lib/create-uniforms":216,"./lib/reflect":217,"./lib/runtime-reflect":218,"./lib/shader-cache":219}],214:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}(n.prototype=new Error).name="GLError",n.prototype.constructor=n,e.exports=n},{}],215:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){if((p=f.charCodeAt(f.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+h+": "+f);i(t,e,d[0],n,p,s,h)}else{if(!(f.indexOf("mat")>=0))throw new o("","Unknown data type for attribute "+h+": "+f);var p;if((p=f.charCodeAt(f.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+h+": "+f);a(t,e,d,n,p,s,h)}}}return s};var o=t("./GLError"),s=n.prototype;s.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(s,"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}})},{"./GLError":214}],216:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new o("","Unknown uniform data type for "+name+": "+r)}var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new o("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new o("","Unrecognized data type for vector "+name+": "+r)}}}function c(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,c(a,i)):r.push([a,i])}return r}function u(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a4)throw new o("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(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 o("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new o("","Unknown uniform data type for "+name+": "+t)}}(r[c].type)}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){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],f[p]):o.drawLine(e[0],m,e[2],m,d[p],f[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},h.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},h.removeObject=function(t){for(var e=this.objects,r=0;r0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function i(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!b&&U.autoResize){var t=x.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*U.pixelRatio),i=0|Math.ceil(r*U.pixelRatio);if(n!==x.width||i!==x.height){x.width=n,x.height=i;var a=x.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",O=!0}}}function r(){for(var t=I.length,e=z.length,r=0;r0&&0===D[e-1];)D.pop(),z.pop().dispose()}function g(){if(U.contextLost)return!0;_.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}function v(){if(!g()){e();var t=U.camera.tick();N.view=U.camera.matrix,O=O||t,F=F||t,E.pixelRatio=U.pixelRatio,C.pixelRatio=U.pixelRatio;var r=I.length,i=G[0],a=G[1];i[0]=i[1]=i[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;oM.distance)continue;for(var c=0;c>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),r=0;r>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,o),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/s,t[4]=2/l,t[6]=-2*o[0]/s-1,t[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=u<5,i.uniforms.pointSize=u,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var h=a.getParameter(a.BLEND),f=a.getParameter(a.DITHER);return h&&!this.blend&&a.disable(a.BLEND),f&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),h&&!this.blend&&a.enable(a.BLEND),f&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.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]]}}},{"./lib/shader":223,"gl-buffer":157,"gl-shader":224,"typedarray-pool":550}],232:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+h*m+f*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t}},{}],233:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],234:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85}],235:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{"./lib/GLError":236,"./lib/create-attributes":237,"./lib/create-uniforms":238,"./lib/reflect":239,"./lib/runtime-reflect":240,"./lib/shader-cache":241,dup:213}],236:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{dup:214}],237:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":236,dup:215}],238:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{"./GLError":236,"./reflect":239,dup:216}],239:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],240:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],241:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":236,dup:219,"gl-format-compiler-error":166,"weakmap-shim":571}],242:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=c,i[f]=u,a[f]=h}}function i(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function a(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function o(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=h}function s(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function l(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function u(t,e,r,f,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,b=y-m,x=y+m,_=g,w=b,M=y,k=x,T=v,A=t+1,S=e-1,E=0;l(_,w,r,f,d)&&(E=_,_=w,w=E),l(k,T,r,f,d)&&(E=k,k=T,T=E),l(_,M,r,f,d)&&(E=_,_=M,M=E),l(w,M,r,f,d)&&(E=w,w=M,M=E),l(_,k,r,f,d)&&(E=_,_=k,k=E),l(M,k,r,f,d)&&(E=M,M=k,k=E),l(w,T,r,f,d)&&(E=w,w=T,T=E),l(w,M,r,f,d)&&(E=w,w=M,M=E),l(k,T,r,f,d)&&(E=k,k=T,T=E);var L=r[w],C=f[2*w],I=f[2*w+1],P=d[w],D=p[w],z=r[k],O=f[2*k],F=f[2*k+1],R=d[k],j=p[k],N=_,B=M,U=T,V=g,H=y,q=v,G=r[N],Y=r[B],W=r[U];r[V]=G,r[H]=Y,r[q]=W;for(var X=0;X<2;++X){var Z=f[2*N+X],J=f[2*B+X],K=f[2*U+X];f[2*V+X]=Z,f[2*H+X]=J,f[2*q+X]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[H]=$,d[q]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[H]=rt,p[q]=nt,a(b,t,r,f,d,p),a(x,e,r,f,d,p);for(var it=A;it<=S;++it)if(c(it,L,C,0,P,r,f,d))it!==A&&i(it,A,r,f,d,p),++A;else if(!c(it,z,O,0,R,r,f,d))for(;;){if(c(S,z,O,0,R,r,f,d)){c(S,L,C,0,P,r,f,d)?(o(it,A,S,r,f,d,p),++A,--S):(i(it,S,r,f,d,p),--S);break}if(--S=Math.max(.9*d,32)){var b=c+s>>>1;l(g,v,h,f,b,u+1),f=b}l(g,v,h,f,y,u+1),f=y}}}var c=t.length>>>1;if(c<1)return[];for(var u=1/0,h=1/0,f=-1/0,d=-1/0,p=0;p=0;--_){t[2*_]=(t[2*_]-u)*v,t[2*_+1]=(t[2*_+1]-h)*y;var T=x[_];T!==M&&(w.push(new i(b*Math.pow(.5,T),_+1,k-(_+1))),k=_+1,M=T)}return w.push(new i(b*Math.pow(.5,T+1),0,k)),a.free(x),w}},{"./lib/sort":242,"typedarray-pool":550}],244:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=d(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=d(this.plot.gl,[256,1])}e.exports=function(t,e){var r=t.gl,i=new n(t,s(r,u.vertex,u.fragment),s(r,u.pickVertex,u.pickFragment),l(r),l(r),l(r),l(r),l(r));return i.update(e),t.addObject(i),i};var i,a,o,s=t("gl-shader"),l=t("gl-buffer"),c=t("typedarray-pool"),u=t("./lib/shaders"),h=t("snap-points-2d"),f=t("font-atlas-sdf"),d=t("gl-texture2d"),p=t("color-id"),m=t("ndarray"),g=t("clamp"),v=t("binary-search-bounds"),y=n.prototype,b=new Float32Array([0,0]),x=new Float32Array([0,0]),_=new Float32Array([0,0]),w=new Float32Array([0,0]),M=[0,0],k=[0,0,0,0];y.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,s=n>this.snapThreshold;if(!n)return t;(function(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,s=r[2]-r[0],l=r[3]-r[1],c=2/s,u=2/l,h=-r[0]-.5*s,f=-r[1]-.5*l;b[0]=c,x[0]=c-b[0],b[1]=u,x[1]=u-b[1],_[0]=h,w[0]=h-_[0],_[1]=f,w[1]=f-_[1];var d=e[2]-e[0],p=e[3]-e[1];i=Math.min(s/d,l/p),M[0]=2*n/d,M[1]=2*n/p,a=r[0],o=r[2]}).call(this);var l=r.gl,c=e?this.pickShader:this.shader,u=l.isEnabled(l.BLEND);if(c.bind(),e){this.pickOffset=t;for(var h=0;h<4;++h)k[h]=t>>8*h&255;c.uniforms.pickOffset=k,this.idBuffer.bind(),c.attributes.id.pointer(l.UNSIGNED_BYTE,!1)}else l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA),l.blendColor(0,0,0,1),u||l.enable(l.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(l.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(l.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(l.FLOAT,!1,8,0),e||c.attributes.border.pointer(l.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(l.FLOAT,!1,16,0),c.attributes.positionLo.pointer(l.FLOAT,!1,16,8),c.uniforms.pixelRatio=r.pixelRatio,c.uniforms.scaleHi=b,c.uniforms.scaleLo=x,c.uniforms.translateHi=_,c.uniforms.translateLo=w,c.uniforms.viewBox=r.viewBox;var f=this.scales;if(s)for(var d=f.length-1;d>=0;d--){var p=f[d];if(!(p.pixelSize&&p.pixelSize<1.25*i&&d>1)){var m=p.offset,g=p.count+m,y=v.ge(this.xCoords,a,m,g-1),T=v.lt(this.xCoords,o,y,g-1)+1;T>y&&l.drawArrays(l.POINTS,y,T-y)}}else l.drawArrays(l.POINTS,0,n);if(e)return t+n;u?l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA):l.disable(l.BLEND)},y.draw=y.drawPick,y.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]]}},y.update=function(t){var e=(t=t||{}).positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,u=(l=this.points.length/2)>this.snapThreshold;var d=c.mallocFloat32(2*l),v=c.mallocFloat64(2*l),y=c.mallocUint32(l),b=c.mallocFloat32(4*l);v.set(this.points),u&&(this.i2idx&&c.free(this.i2idx),this.i2idx=c.mallocInt32(l),this.scales=h(v,this.i2idx,d)),this.pointCount=l;for(var x=0;xO&&(O=i[x]);var F=this.charStep;this.charStep=g(Math.ceil(4*O),128,768);var R=Object.keys(z),j=this.charStep,N=Math.floor(j/2),B=s.getParameter(s.MAX_TEXTURE_SIZE),U=B/j*(B/j),V=Math.min(B,j*R.length),H=Math.min(B,j*Math.ceil(j*R.length/B)),q=Math.floor(V/j);R.length>U&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==R+""&&this.charStep==F||(this.charCanvas=f({canvas:this.charCanvas,family:"sans-serif",size:N,shape:[V,H],step:[j,j],chars:R,align:!0,fit:this.charFit}),this.chars=R);for(x=0;x>>1,n=l.mallocInt32(r),i=l.mallocFloat32(r),a=l.mallocFloat64(2*r);if(a.set(this.points),this.snapPoints)this.scales=s(a,n,i,this.bounds);else{this.bounds=h(a,2),u(a,2,this.bounds);for(var o=0;o>8&255,v[2]=t>>16&255,v[3]=t>>24&255,n.uniforms.pickOffset=v,s.bind(),n.attributes.pickId.pointer(h.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var I=!0;if(this.snapPoints)for(var P=i.length-1;P>=0;P--){var D=i[P];if(!(D.pixelSize1)){var z=this.getVisibleRange(D),O=z[0],F=z[1];F>O&&h.drawArrays(h.POINTS,O,F-O),!e&&I&&(I=!1,n.uniforms.useWeight=0)}}else h.drawArrays(h.POINTS,0,this.pointCount);return t+this.pointCount},f.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,i=this.size,a=this.plot.pixelRatio,s=r[2]-r[0];r[3],r[1];if(!t)for(var l=this.scales.length-1;l>=0&&((t=this.scales[l]).pixelSize1);l--);var c=this.xCoords,u=(e[0]-r[0]-n*i*a)/s,h=(e[2]-r[0]+n*i*a)/s,f=t.offset,d=t.count+f,p=o.ge(c,u,f,d-1);return[p,o.lt(c,h,p,d-1)+1]},f.drawPick=f.draw,f.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":245,"array-bounds":45,"array-normalize":46,"binary-search-bounds":246,"gl-buffer":157,"gl-shader":256,"snap-points-2d":248,"typedarray-pool":550}],250:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];if(r||(r=i[e]={}),t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(F[1])){var R=O;O=F,F=R,R=D,D=z,z=R;var j=I;I=P,P=j}O[0]<0&&(D[I]=-1),F[1]>0&&(z[P]=-1);var N=0,B=0;for(C=0;C<4;++C)N+=Math.pow(d[4*I+C],2),B+=Math.pow(d[4*P+C],2);D[I]/=Math.sqrt(N),z[P]/=Math.sqrt(B),f.axes[0]=D,f.axes[1]=z,f.fragClipBounds[0]=l(T,S[0],E,-1e8),f.fragClipBounds[1]=l(T,S[1],E,1e8),e.vao.draw(h.TRIANGLES,e.vertexCount),e.lineWidth>0&&(h.lineWidth(e.lineWidth),e.vao.draw(h.LINES,e.lineVertexCount,e.vertexCount))}}function u(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||v,s.view=n.view||v,s.projection=n.projection||v,b[0]=2/o.drawingBufferWidth,b[1]=2/o.drawingBufferHeight,s.screenSize=b,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}c(e,r,n,i),r.vao.unbind()}var h=t("gl-buffer"),f=t("gl-vao"),d=t("typedarray-pool"),p=t("gl-mat4/multiply"),m=t("./lib/shaders"),g=t("./lib/glyphs"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,r=m.createPerspective(e),n=m.createOrtho(e),i=m.createProject(e),o=m.createPickPerspective(e),s=m.createPickOrtho(e),l=m.createPickProject(e),c=h(e),u=h(e),d=h(e),p=h(e),g=new a(e,r,n,i,c,u,d,p,f(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return g.update(t),g};var y=a.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},y.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var b=[0,0],x=[0,0,0],_=[0,0,0],w=[0,0,0,1],M=[0,0,0,1],k=v.slice(),T=[0,0,0],A=[[0,0,0],[0,0,0]],S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];y.draw=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},y.drawTransparent=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},y.drawPick=function(t){u(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(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},y.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]},y.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(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,c=t.color,u=t.size,h=t.angle,f=t.lineColor,p=0,m=0,v=0,y=n.length;t:for(var b=0;b0&&(C[0]=-a[0]*(1+k[0][0]));var H=w.cells,q=w.positions;for(_=0;_0){var v=r*u;o.drawBox(h-v,f-v,d+v,f+v,a),o.drawBox(h-v,p-v,d+v,p+v,a),o.drawBox(h-v,f-v,h+v,p+v,a),o.drawBox(d-v,f-v,d+v,p+v,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)}},{"./lib/shaders":253,"gl-buffer":157,"gl-shader":256}],255:[function(t,e,r){"use strict";function n(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)}}e.exports=function(t,e){return new n(t,i(t,e),a.mallocUint8(e[0]*e[1]*4))};var i=t("gl-fbo"),a=t("typedarray-pool"),o=t("ndarray"),s=t("bit-twiddle").nextPow2,l=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),T=new Array(k),A=0;A=0;)S+=1;_[w]=S}var E=new Array(r.length);h(),d._relink=h,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,b,_),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":257,"./lib/create-attributes":258,"./lib/create-uniforms":259,"./lib/reflect":260,"./lib/runtime-reflect":261,"./lib/shader-cache":262}],257:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{dup:214}],258:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":257,dup:215}],259:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{"./GLError":257,"./reflect":260,dup:216}],260:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],261:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],262:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":257,dup:219,"gl-format-compiler-error":166,"weakmap-shim":571}],263:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],264:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":256}],265:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders/index");e.exports=function(t,e){function r(t,e,r,n,i,a){var o=[t,e,r,0,0,0,1];o[n+3]=1,o[n]=i,s.push.apply(s,o),o[6]=-1,s.push.apply(s,o),o[n]=a,s.push.apply(s,o),s.push.apply(s,o),o[6]=1,s.push.apply(s,o),o[n]=i,s.push.apply(s,o)}var s=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=i(t,s),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=o(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var h=new n(t,l,c,u);return h.update(e),h};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=n.prototype,c=[0,0,0],u=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||s,o=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var f=c,d=u,p=0;p<3;++p)i&&i[p]<0?(f[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(f[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,f,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=h;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":264,"gl-buffer":157,"gl-vao":272}],266:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\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 worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(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\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\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 (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\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_1_1(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 \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + 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",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\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 vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\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",s="precision mediump float;\n#define GLSLIFY 1\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 any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n 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";r.createShader=function(t){var e=n(t,i,a,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},r.createPickShader=function(t){var e=n(t,i,s,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},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":256}],267:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,h,f,d){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=s,this._contourShader=l,this._contourPickShader=c,this._contourBuffer=u,this._contourVAO=h,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=f,this._dynamicVAO=d,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=[y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0]),y(p.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.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}function i(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=F.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],x(l,t.model,l);var c=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function a(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||C,n.view=t.view||C,n.projection=t.projection||C,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.contourColor=this.contourColor[0],n.inverseModel=_(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var o=n.clipBounds[a],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[a][s],-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=N,n.vertexColor=this.vertexColor;var l=j;for(x(l,n.view,n.model),x(l,n.projection,l),_(l,l),a=0;a<3;++a)n.eyePosition[a]=l[12+a]/l[15];var c=l[15];for(a=0;a<3;++a)c+=this.lightPosition[a]*l[4*a+3];for(a=0;a<3;++a){var u=l[12+a];for(s=0;s<3;++s)u+=l[4*s+a]*this.lightPosition[s];n.lightPosition[a]=u/c}var h=i(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[a],this._shader.uniforms.clipBounds=h.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(f.uniforms.permutation=P[a],r.lineWidth(this.contourWidth[a]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},z.pickSlots=1,z.setPickBase=function(t){this.pickId=t};var O=[0,0,0],F={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},R={model:C,view:C,projection:C,inverseModel:C.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,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},j=C.slice(),N=[1,0,0,0,1,0,0,0,1];z.draw=function(t){return a.call(this,t,!1)},z.drawTransparent=function(t){return a.call(this,t,!0)};var B={model:C,view:C,projection:C,inverseModel:C,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};z.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=B;r.model=t.model||C,r.view=t.view||C,r.projection=t.projection||C,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=N;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=i(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=P[o],n=0;n>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var d=i+u,p=s+f,m=h*(f?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=w.le(this.contourLevels[y],c[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]Math.abs(x-c[y])&&(v[y]+=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],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},z.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=s(t.contourWidth,Number)),"showContour"in t&&(this.showContour=s(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=s(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=c(t.contourColor)),"contourProject"in t&&(this.contourProject=s(t.contourProject,function(t){return s(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=c(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=s(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=s(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);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 n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(p.freeFloat(this._field[2].data),this._field[2].data=p.mallocFloat(u.nextPow2(n))),this._field[2]=y(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),o(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(p.freeFloat(this._field[a].data),this._field[a].data=p.mallocFloat(this._field[2].size)),this._field[a]=y(this._field[a].data,[i[0]+2,i[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(a=0;a<2;++a){var h=l[a];for(w=0;w<2;++w)if(h.shape[w]!==i[w])throw new Error("gl-surface: coords have incorrect shape");o(this._field[a],h)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var d=f[a];if((Array.isArray(d)||d.length)&&(d=y(d)),d.shape[0]!==i[a])throw new Error("gl-surface: invalid tick length");var x=y(d.data,i);x.stride[a]=d.stride[0],x.stride[1^a]=0,o(this._field[a],x)}}else{for(a=0;a<2;++a){var _=[0,0];_[a]=1,this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var w=0;w0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=p.mallocFloat(nt.length);for(a=0;ai||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 a(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}function o(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 s(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 l(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)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 l=s(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,l,e,r,n,i)}var c=t("ndarray"),u=t("ndarray-ops"),h=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(f||function(t){f=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],d=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],p=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return l(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return l(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=n(e)?e:e.raw;if(r)return function(t,e,r,n,i,o){var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,l,r,n,i,o)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var l=o(n,e.stride.slice()),f=0;"float32"===r?f=t.FLOAT:"float64"===r?(f=t.FLOAT,l=!1,r="float32"):"uint8"===r?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,l=!1,r="uint8");var d=0;if(2===n.length)d=t.LUMINANCE,n=[n[0],n[1],1],e=c(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])d=t.ALPHA;else if(2===n[2])d=t.LUMINANCE_ALPHA;else if(3===n[2])d=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}f!==t.FLOAT||t.getExtension("OES_texture_float")||(f=t.UNSIGNED_BYTE,l=!1);var p,g,v=e.size;if(l)p=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[n[2],n[2]*n[0],1];g=h.malloc(v,r);var b=c(g,n,y,0);"float32"!==r&&"float64"!==r||f!==t.UNSIGNED_BYTE?u.assign(b,e):m(b,e),p=g.subarray(0,v)}var x=s(t);return t.texImage2D(t.TEXTURE_2D,0,d,n[0],n[1],0,d,f,p),l||h.free(g),new a(t,x,n[0],n[1],d,f)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var f=null,d=null,p=null,m=function(t,e){u.muls(t,e,255)},g=a.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&f.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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&&f.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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(),p.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(),p.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(p.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 i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),g.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},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.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)},g.setPixels=function(t,e,r,i){var a=this.gl;this.bind(),Array.isArray(e)?(i=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),i=i||0;var s=n(t)?t:t.raw;if(s){this._mipLevels.indexOf(i)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(i)):a.texSubImage2D(a.TEXTURE_2D,i,e,r,this.format,this.type,s)}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]>>>i||r+t.shape[0]>this._shape[0]>>>i||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,n,i,a,s,l){var f=l.dtype,d=l.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,g=0,v=o(d,l.stride.slice());if("float32"===f?p=t.FLOAT:"float64"===f?(p=t.FLOAT,v=!1,f="float32"):"uint8"===f?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,v=!1,f="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],l=c(l.data,d,[l.stride[0],l.stride[1],1],l.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||i!==t.LUMINANCE&&i!==t.ALPHA||(g=i),g!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,b=s.indexOf(n)<0;if(b&&s.push(n),p===a&&v)0===l.offset&&l.data.length===y?b?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data):b?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var x;x=a===t.FLOAT?h.mallocFloat32(y):h.mallocUint8(y);var _=c(x,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&a===t.UNSIGNED_BYTE?m(_,l):u.assign(_,l),b?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,x.subarray(0,y)),a===t.FLOAT?h.freeFloat32(x):h.freeUint8(x)}}(a,e,r,i,this.format,this.type,this._mipLevels,t)}}},{ndarray:468,"ndarray-ops":462,"typedarray-pool":550}],269:[function(t,e,r){"use strict";e.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;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],278:[function(t,e,r){e.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}},{}],279:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],280:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r-1?y:N.indexOf(t)>-1?v:g,e(I.join("")),C=l,E}return I.push(T),A=T,E+1}();break;case b:E=/[^\s]/g.test(T)?(e(I.join("")),C=l,E):(I.push(T),A=T,E+1);break;case l:I=I.length?[]:I,E="/"===A&&"*"===T?(O=L+E-1,C=u,A=T,E+1):"/"===A&&"/"===T?(O=L+E-1,C=h,A=T,E+1):"#"===T?(C=f,O=L+E,E):/\s/.test(T)?(C=b,O=L+E,E):(F=/\d/.test(T),R=/[^\w_]/.test(T),O=L+E,C=F?p:R?d:c,E)}if(r!==E)switch(j[r]){case"\n":z=0,++D;break;default:++z}}return L+=E,j=j.slice(E),P}function M(){return"\r"!==T&&"\n"!==T||"\\"===A?(I.push(T),A=T,E+1):(e(I.join("")),C=l,E)}function k(t){for(var r,n,a=0;;){if(r=i.indexOf(t.slice(0,t.length+a).join("")),n=i[r],-1===r){if(a--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),O+=n.length,(I=I.slice(n.length)).length}}var T,A,S,E=0,L=0,C=l,I=[],P=[],D=1,z=0,O=0,F=!1,R=!1,j="",N=a,B=n;return"300 es"===(t=t||{}).version&&(N=s,B=o),function(t){return P=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):(I.length&&e(I.join("")),C=x,e("(eof)"),P)}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,h=1,f=2,d=3,p=4,m=5,g=6,v=7,y=8,b=9,x=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":283,"./lib/builtins-300es":282,"./lib/literals":285,"./lib/literals-300es":284,"./lib/operators":286}],282:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.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"])},{"./builtins":283}],283:[function(t,e,r){e.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"]},{}],284:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","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"])},{"./literals":285}],285:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","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"]},{}],286:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],287:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=i.concat(r(t)),i=i.concat(r(null))}},{"./index":281}],288:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[f+0]&&n>=c[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),h=s;h<=c;h++)for(var f=l;f<=u;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-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,c-=8);t[r+d-p]|=128*m}},{}],291:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return l(t.vertices,e.vertices)}function o(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=c[t];i||(i=c[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=s[t+1];return i||(i=s),n(i)}(t)),this.orient=i}e.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 a=t.slice(0,i+1),l=s.apply(void 0,a);if(0===l)throw new Error("Input not in general position");for(var c=new Array(i+1),u=0;u<=i;++u)c[u]=u;l<0&&(c[0]=1,c[1]=0);var h=new n(c,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var p=c.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);f[u]=v,d[u]=v}for(d[i+1]=h,u=0;u<=i;++u){p=f[u].vertices;var y=f[u].adjacent;for(m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=h;else for(var x=0;x<=i;++x)f[x].vertices.indexOf(b)<0&&(y[m]=f[x])}}var _=new o(i,a,d),w=!!e;for(u=i+1;u0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?e:a[f]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=t;var d=this.orient();if(a[u]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var f=[];h.length>0;){var d=(e=h.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];if(this.orient()>0){y[b]=r,v.boundary=!1,c.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=d.slice(),M=p.slice(),k=new n(w,M,!0);u.push(k);var T=_.indexOf(e);if(!(T<0)){_[T]=k,M[m]=v,w[g]=-1,M[g]=e,p[g]=k,k.flip();for(x=0;x<=o;++x){var A=w[x];if(!(A<0||A===r)){for(var S=new Array(o-1),E=0,L=0;L<=o;++L){var C=w[L];C<0||L===x||(S[E++]=C)}f.push(new i(S,k,x))}}}}}}f.sort(a);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":517,"simplicial-complex":528}],292:[function(t,e,r){"use strict";function n(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}function i(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 a(t,e){var r=p(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 o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?v:(r.splice(n,1),a(t,r),y)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,f),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},b.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);return 2===(o=this.left.remove(t))?(this.left=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return v;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);return 2===(o=this.right.remove(t))?(this.right=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:v;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(a=g.ge(this.leftPoints,t,f);athis.mid){if(this.right){var r;if(r=this.right.queryPoint(t,e))return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},b.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n;if(n=this.right.queryInterval(t,e,r))return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var x=m.prototype;x.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},x.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==v}return!1},x.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},x.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(x,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":67}],293:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(f),c.push(g))}}return u}},{}],301:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*h/l+f)),Math.min(o,Math.floor(r+(l-c)*h/l+f)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],302:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],g=e[2*p+1];n(m,g,r,i)<=c&&l.push(t[p]);var v=(u+1)%2;(0===u?r-a<=m:i-a<=g)&&(s.push(f),s.push(p-1),s.push(v)),(0===u?r+a>=m:i+a>=g)&&(s.push(p+1),s.push(h),s.push(v))}}return l}},{}],303:[function(t,e,r){"use strict";function n(t,e){var r;if(u(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],h=c||void 0!==t.property,f=c||!h,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],g=0;g=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?function(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:477}],305:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:558}],306:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:f.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?h[c.type]:c}))}},{"../error/validation_error":305,"../util/extend":306,"../util/get_type":307,"./validate_array":310,"./validate_boolean":311,"./validate_color":312,"./validate_constants":313,"./validate_enum":314,"./validate_filter":315,"./validate_function":316,"./validate_layer":318,"./validate_number":320,"./validate_object":321,"./validate_source":323,"./validate_string":324}],310:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":305,"../util/get_type":307}],314:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":305,"../util/unbundle_jsonlint":308}],315:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;h=8&&(h&&!t.valueSpec["property-function"]?d.push(new n(t.key,t.value,"property functions not supported")):f&&!t.valueSpec["zoom-function"]&&d.push(new n(t.key,t.value,"zoom functions not supported"))),d}},{"../error/validation_error":305,"../util/get_type":307,"./validate":309,"./validate_array":310,"./validate_number":320,"./validate_object":321}],317:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":305,"./validate_string":324}],318:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":305,"../util/get_type":307}],321:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],h=i(r);if("object"!==h)return[new n(e,r,"object expected, %s found",h)];for(var f in r){var d=f.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+f,value:r[f],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:f})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[f],'unknown property "%s"',f))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":305,"../util/get_type":307,"./validate":309}],322:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":305,"./validate":309}],323:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":305,"../util/unbundle_jsonlint":308,"./validate_enum":314,"./validate_object":321}],324:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":305,"../util/get_type":307}],325:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":326,"./validate/validate":309,"./validate/validate_constants":313,"./validate/validate_filter":315,"./validate/validate_glyphs_url":317,"./validate/validate_layer":318,"./validate/validate_layout_property":319,"./validate/validate_paint_property":322,"./validate/validate_source":323}],326:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":327}],327:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],328:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],329:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":443}],330:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},a=0;a1?p.name+x:p.name]=m[x]*g}}},n.VertexArrayType=function(t){return new c({members:t,alignment:4})},n.ElementArrayType=function(t){return new c({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":441,"../util/util":443,"./array_group":329,"./bucket/circle_bucket":331,"./bucket/fill_bucket":332,"./bucket/line_bucket":333,"./bucket/symbol_bucket":334,"./buffer_group":336,assert:48,"feature-filter":133}],331:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,(n.prototype=a.inherit(i,{})).addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var h=this.prepareArrayGroup("circle",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,c,u,-1,-1);this.addCircleVertex(f,c,u,1,-1),this.addCircleVertex(f,c,u,1,1),this.addCircleVertex(f,c,u,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":443,"../bucket":330,"../load_geometry":338}],332:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,(n.prototype=a.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],h=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!h){this.distance=0;var f,d,p,m,g,v,y,b=r,x=h?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,h&&(f=t[a-2],g=c.sub(f)._unit()._perp());for(var w=0;w0){var S=f.dist(d);if(S>2*o){var E=f.sub(f.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?b:x;if(L&&"round"===C&&(Tn&&(C="bevel"),"bevel"===C&&(T>2&&(C="flipbevel"),T100)M=g.clone();else{var I=m.x*g.y-m.y*g.x>0?-1:1,P=T*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(P*I)}this.addCurrentVertex(f,this.distance,M,0,0,!1),this.addCurrentVertex(f,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var D=m.x*g.y-m.y*g.x>0,z=-Math.sqrt(T*T-1);if(D?(y=0,v=z):(v=0,y=z),_||this.addCurrentVertex(f,this.distance,m,v,y,!1),"fakeround"===C){for(var O,F=Math.floor(8*(.5-(k-.5))),R=0;R=0;j--)O=m.mult((j+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(f,this.distance,O,D)}p&&this.addCurrentVertex(f,this.distance,g,-v,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(f,this.distance,m,0,0,!1),p&&this.addCurrentVertex(f,this.distance,g,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(f,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(f,this.distance,g,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(f,this.distance,m,0,0,!1),this.addCurrentVertex(f,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(f,this.distance,g,-1,-1,!0),this.addCurrentVertex(f,this.distance,g,0,0,!1)));if(A&&w2*o){var B=f.add(p.sub(f)._mult(o/N)._round());this.distance+=B.dist(f),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),f=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,h=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":443,"../bucket":330,"../load_geometry":338}],334:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),h=t("../../symbol/shaping"),f=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=h.shapeText,b=h.shapeIcon,x=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,(n.prototype=m.inherit(o,{})).serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var h="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,f=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,v=24*a["text-letter-spacing"],x=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var I=C||x;this.addSymbolInstance(L,A,e,r,this.layer,I,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,h,g,b,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,b=p.br,x=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),T=i(u,_.x,_.y,g.x,g.y,x.x,x.y,w,M,f,k);i(u,_.x,_.y,v.x,v.y,x.x+x.w,x.y,w,M,f,k),i(u,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,f,k),i(u,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,f,k),c.emplaceBack(T,T+1,T+2),c.emplaceBack(T+1,T+2,T+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),T>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(D,z,O,F,k,T,A,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":392,"../../symbol/clip_line":394,"../../symbol/collision_feature":396,"../../symbol/get_anchors":398,"../../symbol/mergelines":401,"../../symbol/quads":402,"../../symbol/resolve_text":403,"../../symbol/shaping":404,"../../util/token":442,"../../util/util":443,"../bucket":330,"../load_geometry":338,"point-geometry":485}],335:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=l.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||f.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":443,"./bucket":330,assert:48}],339:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],340:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":443}],341:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":340}],342:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,h=t("gl-matrix"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.locationCoordinate(this.center)._zoomTo(e),i=new a(n.column-.5,n.row-.5);return c.cover(e,[this.pointCoordinate(new a(0,0))._zoomTo(e),this.pointCoordinate(new a(this.width,0))._zoomTo(e),this.pointCoordinate(new a(this.width,this.height))._zoomTo(e),this.pointCoordinate(new a(0,this.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return i.dist(t)-i.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,h=e[2]/n,d=r[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return f.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":330,"../source/tile_coord":370,"../util/interpolate":437,"../util/util":443,"./coordinate":339,"./lng_lat":340,"gl-matrix":194,"point-geometry":485}],343:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,h,f,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":364,"./create_uniform_pragmas":345}],347:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,f>>16),s.uniform2f(o.u_pixel_coord_lower,65535&h,65535&f),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}var i=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){var a=t.gl;a.enable(a.STENCIL_TEST);var o;if(o=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"],t.isOpaquePass===o){t.setDepthSublayer(1);for(var s=0;s0?1-1/(1.001-t):-t}(r.paint["raster-saturation"])),a.uniform1f(l.u_contrast_factor,function(t){return t>0?1/(1-t):1+t}(r.paint["raster-contrast"])),a.uniform3fv(l.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var c,u,h=o.source&&o.source.findLoadedParent(n,0,{}),f=function(t,e,r,n){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=n.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||h?(a[0]=i.clamp(l,0,1),a[1]=1-a[0]):(a[0]=i.clamp(1-c,0,1),a[1]=1-a[0])}var f=r.paint["raster-opacity"];return a[0]*=f,a[1]*=f,a}(o,h,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o.texture),a.activeTexture(a.TEXTURE1),h?(a.bindTexture(a.TEXTURE_2D,h.texture),c=Math.pow(2,h.coord.z-o.coord.z),u=[o.coord.x*c%1,o.coord.y*c%1]):(a.bindTexture(a.TEXTURE_2D,o.texture),f[1]=0);a.uniform2fv(l.u_tl_parent,u||[0,0]),a.uniform1f(l.u_scale_parent,c||1),a.uniform1f(l.u_buffer_scale,1),a.uniform1f(l.u_opacity0,f[0]),a.uniform1f(l.u_opacity1,f[1]),a.uniform1i(l.u_image0,0),a.uniform1i(l.u_image1,1);var d=o.boundsBuffer||t.rasterBoundsBuffer;(o.boundsVAO||t.rasterBoundsVAO).bind(a,l,d),a.drawArrays(a.TRIANGLE_STRIP,0,d.length)}(t,e,r,l)}a.depthFunc(a.LEQUAL)}}var i=t("../util/util"),a=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new a({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":441,"../util/util":443}],353:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,l,c,u,h,f,d,p,m,g){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],355:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":330,"../data/buffer":335,"../source/pixels_to_tile_units":364,"../source/source_cache":368,"../util/browser":427,"../util/struct_array":441,"../util/util":443,"./create_uniform_pragmas":345,"./draw_background":346,"./draw_circle":347,"./draw_debug":349,"./draw_fill":350,"./draw_line":351,"./draw_raster":352,"./draw_symbol":353,"./frame_history":354,"./painter/use_program":357,"./vertex_array_object":358,"gl-matrix":194}],357:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),h=o[t],f="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":330,"../util/evented":435,"../util/util":443,"resolve-url":510}],360:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),h.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),h=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":426,"../util/util":443,"./geojson_wrapper":361,"./vector_tile_worker_source":372,"geojson-rewind":139,"geojson-vt":143,supercluster:538,"vt-pbf":565}],361:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rh-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var b=f.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,u=0;u=0&&v[1].y>=0){for(var y=[],b=0;b=0&&t%1==0),s(!isNaN(e)&&e>=0&&e%1==0),s(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,f=a;fu.dy&&(l=c,c=u,u=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy&&a(h,c,n,o,s),u.dy&&a(h,u,n,o,s)}var s=t("assert"),l=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<0;a--)i+=(e&(n=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var o,l;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":435,"../util/mapbox":440,"../util/util":443,"./load_tilejson":363}],372:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new s(t);i.abort=this.loadVectorData(t,function(t,a){return delete this.loading[r][n],t?e(t):a?(i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][n]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=i.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":426,"./worker_tile":375,pbf:479,"vector-tile":559}],373:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,h=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":330,"../data/buffer":335,"../geo/lng_lat":340,"../render/draw_raster":352,"../render/vertex_array_object":358,"../util/ajax":426,"../util/evented":435,"../util/util":443,"./tile_coord":370,"point-geometry":485}],374:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)b(E,z[e]);x()}}function b(t,e){if(e.populateArrays(T,j,R),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=u.create({layer:w,index:I++,childLayers:e[P],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var D=[],z=this.symbolBuckets=[],O=[];A.bucketLayerIDs={};for(var F in L)0!==(k=L[F]).features.length&&(A.bucketLayerIDs[k.index]=k.childLayers.map(s),D.push(k),"symbol"===k.type?z.push(k):O.push(k));var R={},j={},N=0;if(z.length>0){for(_=z.length-1;_>=0;_--)z[_].updateIcons(R),z[_].updateFont(j);for(var B in j)j[B]=Object.keys(j[B]).map(Number);R=Object.keys(R),r.send("get glyphs",{uid:this.uid,stacks:j},function(t,e){j=e,y(t)}),R.length?r.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)b(0,O[_]);if(0===z.length)return x()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),h=s.filter(i);return{result:{buckets:h.map(a),collisionTile:u.data},transferables:o(h).concat(u.transferables)}}},{"../data/bucket":330,"../data/feature_index":337,"../symbol/collision_box":395,"../symbol/collision_tile":397,"../symbol/symbol_instances":406,"../symbol/symbol_quads":407,"../util/dictionary_coder":433,"../util/util":443}],376:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],377:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":426,"../util/browser":427,"../util/evented":435,"../util/mapbox":440}],378:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":443,"./style_function":381,csscolorparser:109}],379:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire("error",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),h=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),b=t("../source/source_cache"),x=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new b(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);return!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:1,t:n}}}(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var o=[],s=this.value.stops,l=0;l=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}},{}],394:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s=i&&f.x>=i||(h.x>=i?h=new n(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round():f.x>=i&&(f=new n(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new n(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new n(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),l&&h.equals(l[l.length-1])||(l=[h],o.push(l)),l.push(f)))))}return o}},{"point-geometry":485}],395:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":441,"../util/util":443,"point-geometry":485}],396:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var h=o.top*s-l,f=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=f-h,g=p-d;if(m>0)if(m=Math.max(10*s,m),u){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,h,p,f,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),h=-a/2,f=this.boxes,d=r,p=n+1,m=h;do{if(--p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return f;g=e[p].dist(e[p+1])}var b=y-m,x=e[p],_=e[p+1].sub(x)._unit()._mult(b)._add(x)._round(),w=i/2/Math.max(Math.abs(y-h)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return f}},{}],397:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),k=new i(c.x2,c.y1).matMult(w),T=new i(c.x1,c.y2).matMult(w),A=new i(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,T.x,A.x),_.y1=Math.min(M.y,k.x,T.x,A.x),_.x2=Math.max(M.x,k.x,T.x,A.x),_.y2=Math.max(M.y,k.x,T.x,A.x),_.maxScale=c.maxScale}else _=c;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),h=this.tempCollisionBox;h.anchorX=u.x,h.anchorY=u.y,h.x1=0,h.y1=0,h.x2=r-t,h.y2=n-e,h.maxScale=a,a=h.maxScale;for(var f=[u.x+h.x1/a,u.y+h.y1/a*this.yStretch,u.x+h.x2/a,u.y+h.y2/a*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m=a&&(o[y][b]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var h=Math.min(Math.max(s,l),Math.max(c,u)),f=i.maxScale,d=r.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&T=0&&A=0&&v+d<=p){var S=new a(T,A,M,b)._round();s&&!o(t,S,c,s,l)||y.push(S)}}g+=w}return h||y.length||u||(y=n(t,g/2,r,s,l,c,u,!0,f)),y}var i=t("../util/interpolate"),a=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,i,a,o,s,l,c){var u=i?.6*o*s:0,h=Math.max(i?i.right-i.left:0,a?a.right-a.left:0),f=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return e-h*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);o(i,function(t,r){for(var i=!t&&new s(new c(new Uint8Array(r))),a=0;an&&null!==h){var b=g[h+1].x;m=Math.max(b,m);for(var x=h+1;x<=v;x++)g[x].y+=r,g[x].x-=b;if(c){var _=h;a[g[h].codePoint]&&_--,i(g,e,d,_,c)}d=h+1,h=null,f+=b,p++}o[y.codePoint]&&(h=v)}var w=g[g.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;i(g,e,d,g.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(h?(clearTimeout(h),h=null,o("dblclick",e)):h=setTimeout(r,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){n.mousePos(l,t).equals(u)&&o("click",t)},!1),l.addEventListener("dblclick",function(t){o("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){c=t,t.preventDefault()},!1)}},{"../util/dom":429,"./handler/box_zoom":414,"./handler/dblclick_zoom":415,"./handler/drag_pan":416,"./handler/drag_rotate":417,"./handler/keyboard":418,"./handler/scroll_zoom":419,"./handler/touch_zoom_rotate":420,"point-geometry":485}],409:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&p.lng<0?p.lng+=360:c.center.lng<0&&p.lng>0&&(p.lng-=360));var y=c.zoomScale(m-h),b=c.point,x="center"in t?c.project(p).sub(u.div(y)):b,_=c.worldSize,w=t.curve,M=Math.max(c.width,c.height),k=M/y,T=x.sub(b).mag();if("minZoom"in t){var A=n.clamp(Math.min(t.minZoom,h,m),c.minZoom,c.maxZoom),S=M/c.zoomScale(A-h);w=Math.sqrt(S/T*2)}var E=w*w,L=r(0),C=function(t){return s(L)/s(L+w*t)},I=function(t){return M*((s(L)*function(t){return a(t)/s(t)}(L+w*t)-a(L))/E)/T},P=(r(1)-L)/w;if(Math.abs(T)<1e-6){if(Math.abs(M-k)<1e-6)return this.easeTo(t);var D=k=0)return!1;return!0})).join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":429,"../../util/util":443,"./control":411}],411:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":435,"../../util/util":443}],412:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":427,"../../util/dom":429,"../../util/util":443,"./control":411}],413:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":429,"../../util/util":443,"./control":411}],414:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":341,"../../util/dom":429,"../../util/util":443}],415:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],416:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,h=l.mult(-u/2);this._map.panBy(h,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":429,"../../util/util":443}],417:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=h*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":429,"../../util/util":443,"point-geometry":485}],418:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],419:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),c=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":427,"../../util/dom":429,"../../util/util":443}],420:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&a!==s){var h=.15*l/c;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=a+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:o,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":429,"../../util/util":443}],421:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":443}],422:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(b.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof b||"number"==typeof t[0]){e=[b.convert(t)]}else{var r=[b.convert(t[0]),b.convert(t[1])];e=[r[0],new b(r[1].x,r[0].y),r[1],new b(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new f(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":340,"../geo/lng_lat_bounds":341,"../geo/transform":342,"../render/painter":356,"../style/animation_loop":376,"../style/style":379,"../util/browser":427,"../util/canvas":428,"../util/dom":429,"../util/evented":435,"../util/util":443,"./bind_handlers":408,"./camera":409,"./control/attribution":410,"./hash":421,"point-geometry":485}],423:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":340,"../util/dom":429,"point-geometry":485}],424:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)r.appendChild(e);return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":340,"../util/dom":429,"../util/evented":435,"../util/util":443}],425:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],426:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":328}],428:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":443,"mapbox-gl-supported":328}],429:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var u=0;u=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i(e.y-t.y)*(r.x-t.x)}function a(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}(t,e[i-1],e[i])e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function s(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var n=0;n=3)for(var u=0;u1){if(n(t,e))return!0;for(var i=0;ithis.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],440:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}var a=t("./config"),o=t("./browser"),s=t("url"),l=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=s.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==s.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=s.parse(t);if("mapbox:"!==r.protocol)return t;return n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=s.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,s.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=s.parse(t,!0);if(!e)return t;if("mapbox:"!==s.parse(e).protocol)return t;var i=o.supportsWebp?".webp":"$1",c=o.devicePixelRatio>=2||512===r?"@2x":"";return s.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,c+i),query:function(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?l.extend({},t,{access_token:a.ACCESS_TOKEN}):t}(n.query)})}},{"./browser":427,"./config":432,"./util":443,url:554}],441:[function(t,e,r){"use strict";function n(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function a(t){return h[t].BYTES_PER_ELEMENT}function o(t){return t.toLowerCase()}function s(t,e){var r="this._pos"+a(t.type).toFixed(0)+" + "+(t.offset/a(t.type)+e).toFixed(0);return"this._structArray."+o(t.type)+"["+r+"]"}function l(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function c(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var u=t("assert");e.exports=function(t){function e(){l.apply(this,arguments)}function r(){c.apply(this,arguments),this.members=e.prototype.members}var d=JSON.stringify(t);if(f[d])return f[d];void 0===t.alignment&&(t.alignment=1);var p=0,m=0,g=["Uint8"];return(e.prototype=Object.create(l.prototype)).members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},u(r.name.length),u(r.type in h),g.indexOf(r.type)<0&&g.push(r.type);var n=a(r.type);m=Math.max(m,n),r.offset=p=i(p,Math.max(t.alignment,n));for(var o=0;othis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},c.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":339,unitbezier:553}],444:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],445:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],446:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ip[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":448,"gl-mat4/clone":176,"gl-mat4/create":177,"gl-mat4/determinant":178,"gl-mat4/invert":182,"gl-mat4/transpose":192,"gl-vec3/cross":273,"gl-vec3/dot":274,"gl-vec3/length":275,"gl-vec3/normalize":277}],448:[function(t,e,r){e.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}},{}],449:[function(t,e,r){function n(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var a=t("gl-vec3/lerp"),o=t("mat4-recompose"),s=t("mat4-decompose"),l=t("gl-mat4/determinant"),c=t("quat-slerp"),u=n(),h=n(),f=n();e.exports=function(t,e,r,n){if(0===l(e)||0===l(r))return!1;var i=s(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),d=s(r,h.translate,h.scale,h.skew,h.perspective,h.quaternion);return!(!i||!d||(a(f.translate,u.translate,h.translate,n),a(f.skew,u.skew,h.skew,n),a(f.scale,u.scale,h.scale,n),a(f.perspective,u.perspective,h.perspective,n),c(f.quaternion,u.quaternion,h.quaternion,n),o(t,f.translate,f.scale,f.skew,f.perspective,f.quaternion),0))}},{"gl-mat4/determinant":178,"gl-vec3/lerp":276,"mat4-decompose":447,"mat4-recompose":450,"quat-slerp":498}],450:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.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}},{"gl-mat4/create":177,"gl-mat4/fromRotationTranslation":180,"gl-mat4/identity":181,"gl-mat4/multiply":184,"gl-mat4/scale":190,"gl-mat4/translate":191}],451:[function(t,e,r){"use strict";function n(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]}var i=t("binary-search-bounds"),a=t("mat4-interpolate"),o=t("gl-mat4/invert"),s=t("gl-mat4/rotateX"),l=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),h=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];e.exports=function(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=n.prototype;p.recalcMatrix=function(t){var e=this._time,r=i.le(e,t),n=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=s[l++];else{var u=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)h[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&h[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)n[c]=h[c];else a(n,h,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],f(m,m);var g=this.computedInverse;o(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)b[c]=v[c]-n[2+4*c]*x}},p.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,f=(i=0,o.length);i0;--d)r[h++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":517}],453:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==m.alt,m.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==m.shift,m.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==m.control,m.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==m.meta,m.meta=!!t.metaKey),e}function i(t,i){var a=n.x(i),o=n.y(i);"buttons"in i&&(t=0|i.buttons),(t!==f||a!==d||o!==p||r(i))&&(f=0|t,d=a||0,p=o||0,e&&e(f,d,p,m))}function a(t){i(0,t)}function o(){(f||d||p||m.shift||m.alt||m.meta||m.control)&&(d=p=0,f=0,m.shift=m.alt=m.control=m.meta=!1,e&&e(0,0,0,m))}function s(t){r(t)&&e&&e(f,d,p,m)}function l(t){0===n.buttons(t)?i(0,t):i(f,t)}function c(t){i(f|n.buttons(t),t)}function u(t){i(f&~n.buttons(t),t)}function h(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var f=0,d=0,p=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;h();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return g},set:function(e){e?h():g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))},enumerable:!0},buttons:{get:function(){return f},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":455}],454:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-o.left,r[1]=a-o.top,r}},{}],455:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.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;k=k-1&m)x.push(_+"["+T+"+"+g(k)+"]");for(x.push(v(0)),k=0;k=0;--e)L(e,0);var r=[];for(e=0;e0){",f(S[t]),"=1;"),P(t-1,e|1<0&&H.push(s(N,S[B-1])+"*"+o(S[B-1])),R.push(d(N,S[B])+"=("+H.join("-")+")|0")}for(N=0;N=0;--N)q.push(o(S[N]));R.push(k+"=("+q.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",T+"=0"),R.push(p(0)+"=0");for(B=1;B<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 a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)};var _="V",w="P",M="N",k="Q",T="X",A="T"},{"typedarray-pool":550}],458:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":114}],459:[function(t,e,r){"use strict";function n(t){if(t in o)return o[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){for(a.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");for(a.push("){grad",r,"(src.pick(",s.join(),")",c),l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",h,",src.pick(",f.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",h,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",h,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join();if(v=s[r])return v;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],l=0;l<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:o,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":111}],463:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":464,ndarray:468}],464:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":111}],465:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[a.mallocUint8,a.freeUint8];case"uint16":return[a.mallocUint16,a.freeUint16];case"uint32":return[a.mallocUint32,a.freeUint32];case"int8":return[a.mallocInt8,a.freeInt8];case"int16":return[a.mallocInt16,a.freeInt16];case"int32":return[a.mallocInt32,a.freeInt32];case"float32":return[a.mallocFloat,a.freeFloat];case"float64":return[a.mallocDouble,a.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",h,"*n",h].join("")):s.push(["d",d,"=s",d].join("")),h=d);var p;0!=(p=t.length-1-l)&&(f>0?s.push(["e",p,"=s",p,"-e",f,"*n",f,",f",p,"=",c[p],"-f",f,"*n",f].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),f=p)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",o,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+a);var g=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var h=[],f=1;f1){for(o.push("dptr=0;sptr=ptr"),f=t.length-1;f>=0;--f)0!==(d=t[f])&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");for(o.push("dptr=cptr;sptr=cptr-s0"),f=t.length-1;f>=0;--f)0!==(d=t[f])&&o.push(["for(i",d,"=0;i",d,"=0;--f)0!==(d=t[f])&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));return o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c?new Function("malloc","free",o.join("\n"))(c[0],c[1]):new Function(o.join("\n"))()}(t,e);return g(v,function(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function s(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function l(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function c(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i)0!==(o=t[i])&&_.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++T;u(o,[n,i],!1,["comp=",s("ptr0"),"-",s("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else _.push(["if(",s(a(n)),">",s(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?c([e,r],!1,l("ptr0",s("ptr1"))):_.push(l(a(e),s(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++T;u(i,[r],!0,[e,"=",s("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",s(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?c([e,r],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(c([e,r,n],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?c([e,r],!0,[l("ptr0",s("ptr1")),"\n",l("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(l(a(e),s(a(r))),l(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",o,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++T,":while(true){"].join("")),c([e],!0,["if(",s("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",T,"}"].join("")),_.push(n,"}")):_.push(["while(",s(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),T=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var A=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?c(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",s("ptr1"),"\n","pivot2[pivot_ptr]=",s("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",s("ptr0"),"\n","y=",s("ptr2"),"\n","z=",s("ptr4"),"\n",l("ptr5","x"),"\n",l("ptr6","y"),"\n",l("ptr7","z")].join("")):_.push(["pivot1=",s(a("el2")),"\n","pivot2=",s(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",s(a("el1")),"\n","y=",s(a("el3")),"\n","z=",s(a("el5")),"\n",l(a("index1"),"x"),"\n",l(a("index3"),"y"),"\n",l(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k?new Function("insertionSort","malloc","free",_.join("\n"))(r,k[0],k[1]):new Function("insertionSort",_.join("\n"))(r)}(t,e,v))}},{"typedarray-pool":550}],466:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.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}},{"./lib/compile_sort.js":465}],467:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":114,"ndarray-linear-interpolate":461}],468:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");return new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],i)}var o=t("iota-array"),s=t("is-buffer"),l="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var o=i-1,u=1;o>=0;--o)r[o]=u,u*=e[o]}if(void 0===n)for(n=0,o=0;o>>0;e.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)}},{"double-bits":125}],470:[function(t,e,r){r.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 x=i[c],_=1/Math.sqrt(g*y);for(b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(v[w]*m[M]-v[M]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return i},r.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;for(c=0;c<3;++c)f[c]*=d;i[o]=f}return i}},{}],471:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;lr;)i-=e;return n=i,[r/e,n/e]}(p.subarray(a,a+4*m),4))[0]!==h[1]){for(b||(b=r),x=r,e=h[0];ew&&(w=h[1]),k[r]=h}for(o=0,l=0,s=0,r=0;rM&&(M=d);return{center:[c,u],bounds:[_,b,w,x+1],radius:Math.sqrt(M)}}(r)}function i(t,e){return t*t+e*e}e.exports=n;var a=document.createElement("canvas"),o=a.getContext("2d");a.width=200,a.height=200,n.canvas=a},{}],473:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,c);h=Math.sqrt(2*f-u+1),e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},{}],474:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=s([r]),this.center=s(e),this.rotation=s(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)}e.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),a(r=[].slice.call(r,0,4),r);var i=new o(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 s=t("filtered-vector"),l=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),u=t("gl-mat4/invert"),h=t("./lib/quatFromFrame"),f=o.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(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,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},f.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},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],h=a[4],f=a[8],d=u*o+h*s+f*l,p=n(u-=o*d,h-=s*d,f-=l*d);u/=p,h/=p,f/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,b=m*u+g*h+v*f,x=n(m-=y*o+b*u,g-=y*s+b*h,v-=y*l+b*f);m/=x,g/=x,v/=x;var _=u*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},f.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*u,v=e*l+r*h,y=e*c+r*f,b=-(p*y-m*v),x=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var k=this.computedRotation,T=k[0],A=k[1],S=k[2],E=k[3],L=T*w+E*b+A*_-S*x,C=A*w+E*x+S*b-T*_,I=S*w+E*_+T*x-A*b,P=E*w-T*b-A*x-S*_;if(a){b=d,x=p,_=m;var D=Math.sin(a)/n(b,x,_);b*=D,x*=D,_*=D,P=P*(w=Math.cos(e))-(L=L*w+P*b+C*_-I*x)*b-(C=C*w+P*x+I*b-L*_)*x-(I=I*w+P*_+L*x-C*b)*_}var z=i(L,C,I,P);z>1e-6?(L/=z,C/=z,I/=z,P/=z):(L=C=I=0,P=1),this.rotation.set(t,L,C,I,P)},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;l(i,e,r,n);var o=this.computedRotation;h(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,c=0;c<3;++c)s+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e){var r=this.computedRotation;h(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;u(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.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},f.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])]},f.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]}},f.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)}},{"./lib/quatFromFrame":473,"filtered-vector":134,"gl-mat4/fromQuat":179,"gl-mat4/invert":182,"gl-mat4/lookAt":183}],475:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":509}],476:[function(t,e,r){e.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}},{}],477:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:function(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?function(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=d.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&function(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,i,e)},writePackedSVarint:function(t,e){this.writeMessage(t,a,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,o,e)},writePackedDouble:function(t,e){this.writeMessage(t,s,e)},writePackedFixed32:function(t,e){this.writeMessage(t,c,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,u,e)},writePackedFixed64:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,f,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":478}],480:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":293,"typedarray-pool":550}],482:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t,e){var r=c[e][t[e]];r.splice(r.indexOf(t),1)}function i(t,i,a){for(var o,s,l,u=0;u<2;++u)if(c[u][i].length>0){o=c[u][i][0],l=u;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=c[h][i],d=0;d0&&(o=p,s=m,l=h)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=i(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],h=t,f=s[1],d=i(u,h,!0);if(n(e[u],e[h],e[f],e[d])<0)break;s.push(t),l=i(u,h)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;u0;){c[0][u].length;var m=a(u,d);o(0,m)?p.push.apply(p,m):(p.length>0&&f.push(p),p=m)}p.length>0&&f.push(p)}return f};var n=t("compare-angle")},{"compare-angle":101}],483:[function(t,e,r){"use strict";e.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 c=r[d];for(s=0;s0})).length,g=new Array(m),v=new Array(m);for(d=0;d0;){var j=O.pop(),N=E[j];c(N,function(t,e){return t-e});var B,U=N.length,V=F[j];for(0===V&&(B=[q=p[j]]),d=0;d=0)&&(F[H]=1^V,O.push(H),0===V)){var q;r(q=p[H])||(q.reverse(),B.push(q))}}0===V&&R.push(B)}return R};var i=t("edges-to-adjacency-list"),a=t("planar-dual"),o=t("point-in-big-polygon"),s=t("two-product"),l=t("robust-sum"),c=t("uniq"),u=t("./lib/trim-leaves")},{"./lib/trim-leaves":483,"edges-to-adjacency-list":128,"planar-dual":482,"point-in-big-polygon":486,"robust-sum":522,"two-product":548,uniq:552}],485:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],486:[function(t,e,r){function n(){return!0}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var s=i.key,l=o(r,s[0],s[1]);if(s[0][0]0))return 0;a=-1,i=i.right}else if(l>0)i=i.left;else{if(!(l<0))return 0;a=1,i=i.right}}return a}}(g.slabs,g.coordinates);return 0===n.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(i(n),v)};var o=t("robust-orientation")[3],s=t("slab-decomposition"),l=t("interval-tree-1d"),c=t("binary-search-bounds")},{"binary-search-bounds":67,"interval-tree-1d":292,"robust-orientation":517,"slab-decomposition":534}],487:[function(t,e,r){function n(t,e,r){var n=i.segments(t),a=i.segments(e),o=r(i.combine(n,a));return i.polygon(o)}var i,a=t("./lib/build-log"),o=t("./lib/epsilon"),s=t("./lib/intersecter"),l=t("./lib/segment-chainer"),c=t("./lib/segment-selector"),u=t("./lib/geojson"),h=!1,f=o();i={buildLog:function(t){return!0===t?h=a():!1===t&&(h=!1),!1!==h&&h.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=s(!0,f,h);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:s(!1,f,h).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:c.union(t.combined,h),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:c.intersect(t.combined,h),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:c.difference(t.combined,h),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:c.differenceRev(t.combined,h),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:c.xor(t.combined,h),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,h),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(i,t)},polygonToGeoJSON:function(t){return u.fromPolygon(i,f,t)},union:function(t,e){return n(t,e,i.selectUnion)},intersect:function(t,e){return n(t,e,i.selectIntersect)},difference:function(t,e){return n(t,e,i.selectDifference)},differenceRev:function(t,e){return n(t,e,i.selectDifferenceRev)},xor:function(t,e){return n(t,e,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),e.exports=i},{"./lib/build-log":488,"./lib/epsilon":489,"./lib/geojson":490,"./lib/intersecter":491,"./lib/segment-chainer":493,"./lib/segment-selector":494}],488:[function(t,e,r){e.exports=function(){function t(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}var e,r=0,n=!1;return e={list:[],segmentId:function(){return r++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,n){return t("temp_status",{seg:e,above:r,below:n})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,n){return t("status",{seg:e,above:r,below:n})},vert:function(r){return r===n?e:(n=r,t("vert",{x:r}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}}}},{}],489:[function(t,e,r){e.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-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],490:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}if(e.length<=0)return t.segments({inverted:!1,regions:[]});for(var n=r(e[0]),i=1;i0})}function s(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var h=e.linesIntersect(o,s,c,u);if(!1===h){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var f=e.pointsSame(o,c),d=e.pointsSame(s,u);if(f&&d)return n;var p=!f&&e.pointBetween(o,c,u),m=!d&&e.pointBetween(s,c,u);if(f)return m?l(n,s):l(t,u),n;p&&(d||(m?l(n,s):l(t,u)),l(n,o))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(n,o):0===h.alongA?l(n,h.pt):1===h.alongA&&l(n,s));return!1}for(var c=n.create(),h=[];!u.isEmpty();){var f=u.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var d=o(f),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(f.seg,!!p&&p.seg,!!m&&m.seg);var g=function(){if(p){var t=s(f,p);if(t)return t}return!!m&&s(f,m)}();if(g&&(t?(v=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=f.seg.myFill,r&&r.segmentUpdate(g.seg),f.other.remove(),f.remove()),u.getHead()!==f){r&&r.rewind(f.seg);continue}if(t){var v;v=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:i,f.seg.myFill.above=v?!f.seg.myFill.below:f.seg.myFill.below}else if(null===f.seg.otherFill){var y;y=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?a:i,f.seg.otherFill={above:y,below:y}}r&&r.status(f.seg,!!p&&p.seg,!!m&&m.seg),f.other.status=d.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(c.exists(b.prev)&&c.exists(b.next)&&s(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var x=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=x}h.push(f.seg)}u.getHead().remove()}return r&&r.done(),h}var u=n.create();return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=c?(x=1,y=c+2*f+p):y=f*(x=-f/c)+p):(x=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):y=d*(_=-d/h)+p);else if(_<0)_=0,f>=0?(x=0,y=p):-f>=c?(x=1,y=c+2*f+p):y=f*(x=-f/c)+p;else{var w=1/b;y=(x*=w)*(c*x+u*(_*=w)+2*f)+_*(u*x+h*_+2*d)+p}else{var M,k,T,A;x<0?(k=h+d)>(M=u+f)?(T=k-M)>=(A=c-2*u+h)?(x=1,_=0,y=c+2*f+p):y=(x=T/A)*(c*x+u*(_=1-x)+2*f)+_*(u*x+h*_+2*d)+p:(x=0,k<=0?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):y=d*(_=-d/h)+p):_<0?(k=c+f)>(M=u+d)?(T=k-M)>=(A=c-2*u+h)?(_=1,x=0,y=h+2*d+p):y=(x=1-(_=T/A))*(c*x+u*_+2*f)+_*(u*x+h*_+2*d)+p:(_=0,k<=0?(x=1,y=c+2*f+p):f>=0?(x=0,y=p):y=f*(x=-f/c)+p):(T=h+d-u-f)<=0?(x=0,_=1,y=h+2*d+p):T>=(A=c-2*u+h)?(x=1,_=0,y=c+2*f+p):y=(x=T/A)*(c*x+u*(_=1-x)+2*f)+_*(u*x+h*_+2*d)+p}var S=1-x-_;for(l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]);return n+a((t=t.replace(C,".")).split("."),e).join(".")}function s(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(e+=z((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=z(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:x}function u(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function h(t,e,r){var n=0;for(t=r?D(t/k):t>>1,t+=D(t/e);t>P*w>>1;n+=x)t=D(t/P);return D(n+(P+1)*t/(t+M))}function f(t){var e,r,n,a,o,s,u,f,d,p,m=[],g=t.length,v=0,y=A,M=T;for((r=t.lastIndexOf(S))<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a=g&&i("invalid-input"),((f=c(t.charCodeAt(a++)))>=x||f>D((b-v)/s))&&i("overflow"),v+=f*s,d=u<=M?_:u>=M+w?w:u-M,!(fD(b/(p=x-d))&&i("overflow"),s*=p;M=h(v-o,e=m.length+1,0==o),D(v/e)>b-y&&i("overflow"),y+=D(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,c,f,d,p,m,g,v,y,M,k=[];for(g=(t=s(t)).length,e=A,r=0,o=T,l=0;l=e&&mD((b-r)/(v=n+1))&&i("overflow"),r+=(c-e)*v,e=c,l=0;lb&&i("overflow"),m==e){for(f=r,d=x;p=d<=o?_:d>=o+w?w:d-o,!(f= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=x-_,D=Math.floor,z=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:f,encode:d,toASCII:function(t){return o(t,function(t){return L.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return o(t,function(t){return E.test(t)?f(t.slice(4).toLowerCase()):t})}},p&&m)if(e.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],498:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":232}],499:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(h=m.substr(0,g),f=m.substr(g+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],500:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne?1:0};a>r;){if(a-r>600){var s=a-r+1,l=e-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-l*u/s+h)),Math.min(a,Math.floor(e+(s-l)*u/s+h)),o)}var f=t[e],d=r,p=a;for(i(t,r,e),o(t[a],f)>0&&i(t,r,a);d0;)p--}0===o(t[r],f)?i(t,r,p):i(t,++p,a),p<=e&&(r=p+1),e<=p&&(a=p-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],503:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":86,"compare-cell":102,"compare-oriented-cell":103}],508:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?": "+t:""}function i(t,r,i){r.indexOf(t)<0&&e("invalid value"+n(i)+". must be one of: "+r)}function a(t,e){for(t+="";t.length1&&e===r&&('"'===e||"'"===e))return['"'+y(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return b(t.substr(0,n.index)).concat(b(n[1])).concat(b(t.substr(n.index+n[0].length)));var i=t.split(".");if(1===i.length)return['"'+y(t)+'"'];for(var a=[],o=0;o0,"invalid pixel ratio")):n=(i=a).canvas:e=a:Mt.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){Mt("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=function(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();e=a.right-a.left,n=a.bottom-a.top}i.width=r*e,i.height=r*n,ct(i.style,{width:e+"px",height:n+"px"})}var i=document.createElement("canvas");return ct(i.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(i),t===document.body&&(i.style.position="absolute",ct(t.style,{margin:0,padding:0})),window.addEventListener("resize",n,!1),n(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",n),t.removeChild(i)}}}(r||document.body,0,c);if(!d)return null;n=d.canvas,f=d.onDestroy}i=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:c,profile:u,onDone:h,onDestroy:f}:(f(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function k(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||lt(t.data))}function T(t,e){for(var r=Array(t),n=0;n65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function S(t){var e=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(t),r=jt[A(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function E(t){jt[A(t.byteLength)>>2].push(t)}function L(t,e,r,n,i,a){for(var o=a,s=0;s>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function O(t){return Array.isArray(t)||lt(t)}function F(t){return"[object "+t+"]"}function R(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function j(t){if(!Array.isArray(t))return!1;return!(0===t.length||!O(t[0]))}function N(t){return Object.prototype.toString.call(t)}function B(t){return N(t)===wr}function U(t){if(!t)return!1;var e=N(t);return Ar.indexOf(e)>=0||(R(t)||j(t)||k(t))}function V(t){return 0|st[Object.prototype.toString.call(t)]}function H(t,e){return Nt.allocType(t.type===Pe?Xe:t.type,e)}function q(t,e){t.type===Pe?(t.data=z(e),Nt.freeType(e)):t.data=e}function G(t,e,r,n,i,a){var o;if(o=void 0!==Er[t]?Er[t]:_r[t]*Sr[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function Y(t,e,r,n,i,a,o){function s(){this.internalformat=ge,this.format=ge,this.type=Ge,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function c(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(Mt.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(Mt.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(Mt.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(Mt.parameter(n.colorSpace,F,"invalid colorSpace"),t.colorSpace=F[n.colorSpace]),"type"in n){var i=n.type;Mt(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),Mt(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Mt(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Mt.parameter(i,Y,"invalid texture type"),t.type=Y[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(Mt(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],Mt(s>0&&s<=4,"invalid number of channels"),l=!0),Mt(a>=0&&a<=r.maxTextureSize,"invalid width"),Mt(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,Mt(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,Mt(a>=0&&a<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,Mt(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,Mt(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var c=!1;if("format"in n){var u=n.format;Mt(e.webgl_depth_texture||!("depth"===u||"depth stencil"===u),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Mt.parameter(u,W,"invalid texture format");var h=t.internalformat=W[u];t.format=rt[h],u in Y&&("type"in n||(t.type=Y[u])),u in X&&(t.compressed=!0),c=!0}!l&&c?t.channels=_r[t.format]:l&&!c?t.channels!==xr[t.format]&&(t.format=t.internalformat=xr[t.channels]):c&&l&&Mt(t.channels===_r[t.format],"number of channels inconsistent with specified format")}}function u(e){t.pixelStorei(pr,e.flipY),t.pixelStorei(mr,e.premultiplyAlpha),t.pixelStorei(gr,e.colorSpace),t.pixelStorei(dr,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var n=null;if(U(e)?n=e:e&&(Mt.type(e,"object","invalid pixel data type"),c(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),U(e.data)&&(n=e.data)),Mt(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){Mt(!n,"can not specify copy and data field for the same texture");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,Mt(t.xOffset>=0&&t.xOffset=0&&t.yOffset0&&t.width<=a&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(lt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==Ge||(t.type=V(n));else if(R(n))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case Ge:case Ye:case We:case Xe:var n=Nt.allocType(t.type,r);n.set(e),t.data=n;break;case Pe:t.data=z(e);break;default:Mt.raise("unsupported texture type, must specify a typed array")}}(t,n),t.alignment=1,t.needsFree=!0;else if(k(n)){var s=n.data;Array.isArray(s)||t.type!==Ge||(t.type=V(s));var l,u,h,f,d,p,m=n.shape,g=n.stride;3===m.length?(h=m[2],p=g[2]):(Mt(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),l=m[0],u=m[1],f=g[0],d=g[1],t.alignment=1,t.width=l,t.height=u,t.channels=h,t.format=t.internalformat=xr[h],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=H(t,o*s*l),u=0,h=0;h=0,"oes_texture_float extension not enabled"):t.type===Pe&&Mt(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,c=e.type,h=e.width,f=e.height;u(e),a?t.texImage2D(r,i,l,l,c,a):e.compressed?t.compressedTexImage2D(r,i,s,h,f,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(r,i,l,h,f,0,l,c,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,c=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;u(e),s?t.texSubImage2D(r,o,i,a,h,f,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,c,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,h,f,l)}function m(){return nt.pop()||new h}function g(t){t.needsFree&&Nt.freeType(t.data),h.call(t),nt.push(t)}function v(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function y(t,e){var r=null;if(U(e))l(r=t.images[0]=m(),t),f(r,e),t.mipmask=1;else if(c(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;Mt.parameter(i,P),t.magFilter=P[i]}var a=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(Mt.parameter(s,I),a=o=I[s]):Array.isArray(s)&&(Mt.parameter(s[0],I),Mt.parameter(s[1],I),a=I[s[0]],o=I[s[1]])}else{if("wrapS"in e){var l=e.wrapS;Mt.parameter(l,I),a=I[l]}if("wrapT"in e){var c=e.wrapT;Mt.parameter(c,I),o=I[c]}}if(t.wrapS=a,t.wrapT=o,"anisotropic"in e){var u=e.anisotropic;Mt("number"==typeof u&&u>=1&&u<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var h=!1;switch(typeof e.mipmap){case"string":Mt.parameter(e.mipmap,C,"invalid mipmap hint"),t.mipmapHint=C[e.mipmap],t.genMipmaps=!0,h=!0;break;case"boolean":h=t.genMipmaps=e.mipmap;break;case"object":Mt(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,h=!0;break;default:Mt.raise("invalid mipmap type")}!h||"min"in e||(t.minFilter=ir)}}function T(r,n){t.texParameteri(n,er,r.minFilter),t.texParameteri(n,tr,r.magFilter),t.texParameteri(n,Ze,r.wrapS),t.texParameteri(n,Je,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,fr,r.anisotropic),r.genMipmaps&&(t.hint(lr,r.mipmapHint),t.generateMipmap(n))}function A(e){s.call(this),this.mipmask=0,this.internalformat=ge,this.id=at++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new w,o.profile&&(this.stats={size:0})}function S(e){t.activeTexture(yr),t.bindTexture(e.target,e.texture)}function E(){var e=ut[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(de,null)}function L(e){var r=e.texture;Mt(r,"must not double destroy texture");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(yr+n),t.bindTexture(i,null),ut[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete ot[e.id],a.textureCount--}var C={"don't care":cr,"dont care":cr,nice:hr,fast:ur},I={repeat:Ke,clamp:Qe,mirror:$e},P={nearest:rr,linear:nr},D=ct({mipmap:sr,"nearest mipmap nearest":ir,"linear mipmap nearest":ar,"nearest mipmap linear":or,"linear mipmap linear":sr},P),F={none:0,browser:vr},Y={uint8:Ge,rgba4:ke,rgb565:Ae,"rgb5 a1":Te},W={alpha:ve,luminance:be,"luminance alpha":xe,rgb:ye,rgba:ge,rgba4:_e,"rgb5 a1":we,rgb565:Me},X={};e.ext_srgb&&(W.srgb=Ce,W.srgba=Ie),e.oes_texture_float&&(Y.float32=Y.float=Xe),e.oes_texture_half_float&&(Y.float16=Y["half float"]=Pe),e.webgl_depth_texture&&(ct(W,{depth:Ee,"depth stencil":Le}),ct(Y,{uint16:Ye,uint32:We,"depth stencil":Se})),e.webgl_compressed_texture_s3tc&&ct(X,{"rgb s3tc dxt1":De,"rgba s3tc dxt1":ze,"rgba s3tc dxt3":Oe,"rgba s3tc dxt5":Fe}),e.webgl_compressed_texture_atc&&ct(X,{"rgb atc":Re,"rgba atc explicit alpha":je,"rgba atc interpolated alpha":Ne}),e.webgl_compressed_texture_pvrtc&&ct(X,{"rgb pvrtc 4bppv1":Be,"rgb pvrtc 2bppv1":Ue,"rgba pvrtc 4bppv1":Ve,"rgba pvrtc 2bppv1":He}),e.webgl_compressed_texture_etc1&&(X["rgb etc1"]=qe);var Z=Array.prototype.slice.call(t.getParameter(fe));Object.keys(X).forEach(function(t){var e=X[t];Z.indexOf(e)>=0&&(W[t]=e)});var J=Object.keys(W);r.textureFormats=J;var K=[];Object.keys(W).forEach(function(t){var e=W[t];K[e]=t});var Q=[];Object.keys(Y).forEach(function(t){var e=Y[t];Q[e]=t});var $=[];Object.keys(P).forEach(function(t){var e=P[t];$[e]=t});var tt=[];Object.keys(D).forEach(function(t){var e=D[t];tt[e]=t});var et=[];Object.keys(I).forEach(function(t){var e=I[t];et[e]=t});var rt=J.reduce(function(t,e){var r=W[e];return r===be||r===ve||r===be||r===xe||r===Ee||r===Le?t[r]=r:r===we||e.indexOf("rgba")>=0?t[r]=ge:t[r]=ye,t},{}),nt=[],it=[],at=0,ot={},st=r.maxTextureUnits,ut=Array(st).map(function(){return null});return ct(A.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(e<0){for(var r=0;r0)continue;n.unit=-1}ut[r]=this,e=r;break}e>=st&&Mt.raise("insufficient number of texture units"),o.profile&&a.maxTextureUnits>c)-a,u.height=u.height||(s.height>>c)-o,Mt(s.type===u.type&&s.format===u.format&&s.internalformat===u.internalformat,"incompatible format for texture.subimage"),Mt(a>=0&&o>=0&&a+u.width<=s.width&&o+u.height<=s.height,"texture.subimage write out of bounds"),Mt(s.mipmask&1<>l;++l)t.texImage2D(de,l,s.format,n>>l,a>>l,0,s.format,s.type,null);return E(),o.profile&&(s.stats.size=G(s.internalformat,s.type,n,a,!1,!1)),i},i._reglType="texture2d",i._texture=s,o.profile&&(i.stats=s.stats),i.destroy=function(){s.decRef()},i},createCube:function(e,n,i,s,u,h){function d(t,e,n,i,a,s){var u,h=k.texInfo;for(w.call(h),u=0;u<6;++u)L[u]=x();if("number"!=typeof t&&t)if("object"==typeof t)if(e)y(L[0],t),y(L[1],e),y(L[2],n),y(L[3],i),y(L[4],a),y(L[5],s);else if(M(h,t),c(k,t),"faces"in t){var f=t.faces;for(Mt(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),u=0;u<6;++u)Mt("object"==typeof f[u]&&!!f[u],"invalid input for cube map face"),l(L[u],k),y(L[u],f[u])}else for(u=0;u<6;++u)y(L[u],t);else Mt.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)v(L[u],p,p)}for(l(k,L[0]),h.genMipmaps?k.mipmask=(L[0].width<<1)-1:k.mipmask=L[0].mipmask,Mt.textureCube(k,h,L,r),k.internalformat=L[0].internalformat,d.width=L[0].width,d.height=L[0].height,S(k),u=0;u<6;++u)b(L[u],me+u);for(T(h,pe),E(),o.profile&&(k.stats.size=G(k.internalformat,k.type,d.width,d.height,h.genMipmaps,!0)),d.format=K[k.internalformat],d.type=Q[k.type],d.mag=$[h.magFilter],d.min=tt[h.minFilter],d.wrapS=et[h.wrapS],d.wrapT=et[h.wrapT],u=0;u<6;++u)_(L[u]);return d}var k=new A(pe);ot[k.id]=k,a.cubeCount++;var L=new Array(6);return d(e,n,i,s,u,h),d.subimage=function(t,e,r,n,i){Mt(!!e,"must specify image data"),Mt("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var a=0|r,o=0|n,s=0|i,c=m();return l(c,k),c.width=0,c.height=0,f(c,e),c.width=c.width||(k.width>>s)-a,c.height=c.height||(k.height>>s)-o,Mt(k.type===c.type&&k.format===c.format&&k.internalformat===c.internalformat,"incompatible format for texture.subimage"),Mt(a>=0&&o>=0&&a+c.width<=k.width&&o+c.height<=k.height,"texture.subimage write out of bounds"),Mt(k.mipmask&1<>i;++i)t.texImage2D(me+n,i,k.format,r>>i,r>>i,0,k.format,k.type,null);return E(),o.profile&&(k.stats.size=G(k.internalformat,k.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=k,o.profile&&(d.stats=k.stats),d.destroy=function(){k.decRef()},d},clear:function(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(me+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);T(e.texInfo,e.target)})}}}function W(t,e,r){return Ir[t]*e*r}function X(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Kr,this.offset=0,this.stride=0,this.divisor=0}function Z(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;r1)for(var m=0;mt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);Ct(l).forEach(e),l={},Ct(c).forEach(e),c={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,u={},r.shaderCount=0},program:function(t,e,i){Mt.command(t>=0,"missing vertex shader",i),Mt.command(e>=0,"missing fragment shader",i);var a=u[e];a||(a=u[e]={});var o=a[t];return o||(o=new function(t,e){this.id=f++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(e,t),r.shaderCount++,s(o,i),a[t]=o,h.push(o)),o},restore:function(){l={},c={};for(var t=0;t=0&&l=0&&c0&&u+l<=n.framebufferWidth,"invalid width for read pixels"),Mt(h>0&&h+c<=n.framebufferHeight,"invalid height for read pixels"),r();var d=u*h*4;return f||(s===nn?f=new Uint8Array(d):s===on&&(f=f||new Float32Array(d))),Mt.isTypedArray(f,"data buffer for regl.read() must be a typedarray"),Mt(f.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(an,4),t.readPixels(l,c,u,h,rn,s,f),f}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}(t):o(t)}}function K(t){return Array.prototype.slice.call(t)}function Q(t){return K(t).join("")}function $(t){return Array.isArray(t)||lt(t)||k(t)}function tt(t){return t.sort(function(t,e){return t===Vn?-1:e===Vn?1:t=1,n>=2,e)}if(r===mn){var i=t.data;return new et(i.thisDep,i.contextDep,i.propDep,e)}return new et(r===pn,r===dn,r===fn,e)}function at(t,e,r,n,i,a,o,s,l,c,u,h,f,d,p){function m(t){return t.replace(".","_")}function g(t,e,r){var n=m(t);V.push(t),U[n]=B[n]=!!r,H[n]=e}function v(t,e,r){var n=m(t);V.push(t),Array.isArray(r)?(B[n]=r.slice(),U[n]=r.slice()):B[n]=U[n]=r,q[n]=e}function y(){var t=function(){function t(){var t=[],e=[];return ct(function(){t.push.apply(t,K(arguments))},{def:function(){var n="v"+r++;return e.push(n),arguments.length>0&&(t.push(n,"="),t.push.apply(t,K(arguments)),t.push(";")),n},toString:function(){return Q([e.length>0?"var "+e+";":"",Q(t)])}})}function e(){function e(t,e){n(t,e,"=",r.def(t,e),";")}var r=t(),n=t(),i=r.toString,a=n.toString;return ct(function(){r.apply(r,K(arguments))},{def:r.def,entry:r,exit:n,save:e,set:function(t,n,i){e(t,n),r(t,n,"=",i,";")},toString:function(){return i()+a()}})}var r=0,n=[],i=[],a=t(),o={};return{global:a,link:function(t){for(var e=0;e=0,'unknown parameter "'+t+'"',c.commandStr)})}var e=[qn,Gn,Yn,Wn,Xn,Jn,Zn,Kn,Hn].concat(V);t(f),t(d)});var p=function(t,e){var r=t.static,n=t.dynamic;if(qn in r){var i=r[qn];return i?(i=s.getFramebuffer(i),Mt.command(i,"invalid framebuffer object"),nt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,".next",r);var a=n.context;return e.set(a,"."+Qn,r+".width"),e.set(a,"."+$n,r+".height"),r})):nt(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Qn,n+"."+ri),e.set(n,"."+$n,n+"."+ni),"null"})}if(qn in n){var a=n[qn];return it(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,".getFramebuffer(",r,")");Mt.optional(function(){t.assert(e,"!"+r+"||"+o,"invalid framebuffer object")}),e.set(i,".next",o);var s=n.context;return e.set(s,"."+Qn,o+"?"+o+".width:"+s+"."+ri),e.set(s,"."+$n,o+"?"+o+".height:"+s+"."+ni),o})}return null}(t),g=function(t,e,r){function n(t){if(t in i){var n=i[t];Mt.commandType(n,"object","invalid "+t,r.commandStr);var o,s,l=!0,c=0|n.x,u=0|n.y;return"width"in n?(o=0|n.width,Mt.command(o>=0,"invalid "+t,r.commandStr)):l=!1,"height"in n?(s=0|n.height,Mt.command(s>=0,"invalid "+t,r.commandStr)):l=!1,new et(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var r=t.shared.context,i=o;"width"in n||(i=e.def(r,".",Qn,"-",c));var a=s;return"height"in n||(a=e.def(r,".",$n,"-",u)),[c,u,i,a]})}if(t in a){var h=a[t],f=it(h,function(e,r){var n=e.invoke(r,h);Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,a=r.def(n,".x|0"),o=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Qn,"-",a,")"),l=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",$n,"-",o,")");return Mt.optional(function(){e.assert(r,s+">=0&&"+l+">=0","invalid "+t)}),[a,o,s,l]});return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new et(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Qn),e.def(r,".",$n)]}):null}var i=t.static,a=t.dynamic,o=n(Vn);if(o){var s=o;o=new et(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+ti,r[2]),e.set(n,"."+ei,r[3]),r})}return{viewport:o,scissor_box:n(Un)}}(t,p,c),v=function(t,e){function r(t,r){if(t in n){var a=0|n[t];return Mt.command(!r||a>=0,"invalid "+t,e.commandStr),nt(function(t,e){return r&&(t.OFFSET=a),a})}if(t in i){var s=i[t];return it(s,function(e,n){var i=e.invoke(n,s);return r&&(e.OFFSET=i,Mt.optional(function(){e.assert(n,i+">=0","invalid "+t)})),i})}return r&&o?nt(function(t,e){return t.OFFSET="0",0}):null}var n=t.static,i=t.dynamic,o=function(){if(Wn in n){var t=n[Wn];$(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),Mt.command(t,"invalid elements",e.commandStr));var r=nt(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return r.value=t,r}if(Wn in i){var o=i[Wn];return it(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),l=e.def(n,"(",a,")"),c=t.cond(l).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return Mt.optional(function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")}),e.entry(c),e.exit(t.cond(l).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}(),s=r(Jn,!0);return{elements:o,primitive:function(){if(Xn in n){var t=n[Xn];return Mt.commandParameter(t,Jt,"invalid primitve",e.commandStr),nt(function(e,r){return Jt[t]})}if(Xn in i){var r=i[Xn];return it(r,function(t,e){var n=t.constants.primTypes,i=t.invoke(e,r);return Mt.optional(function(){t.assert(e,i+" in "+n,"invalid primitive, must be one of "+Object.keys(Jt))}),e.def(n,"[",i,"]")})}return o?rt(o)?o.value?nt(function(t,e){return e.def(t.ELEMENTS,".primType")}):nt(function(){return Oi}):new et(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",Oi)}):null}(),count:function(){if(Zn in n){var t=0|n[Zn];return Mt.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),nt(function(){return t})}if(Zn in i){var r=i[Zn];return it(r,function(t,e){var n=t.invoke(e,r);return Mt.optional(function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")}),n})}if(o){if(rt(o)){if(o)return s?new et(s.thisDep,s.contextDep,s.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return Mt.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):nt(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var a=nt(function(){return-1});return Mt.optional(function(){a.MISSING=!0}),a}var l=new et(o.thisDep||s.thisDep,o.contextDep||s.contextDep,o.propDep||s.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return Mt.optional(function(){l.DYNAMIC=!0}),l}return null}(),instances:r(Kn,!1),offset:s}}(t,c),y=function(t,e){var r=t.static,i=t.dynamic,a={};return V.forEach(function(t){function o(e,n){if(t in r){var o=e(r[t]);a[s]=nt(function(){return o})}else if(t in i){var l=i[t];a[s]=it(l,function(t,e){return n(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case An:case vn:case gn:case On:case _n:case Bn:case Cn:case Pn:case Dn:case kn:return o(function(r){return Mt.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return Mt.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case wn:return o(function(r){return Mt.commandParameter(r,Qi,"invalid "+t,e.commandStr),Qi[r]},function(e,r,n){var i=e.constants.compareFuncs;return Mt.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Qi))}),r.def(i,"[",n,"]")});case Mn:return o(function(t){return Mt.command(O(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return Mt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case xn:return o(function(t){Mt.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,a="dstAlpha"in t?t.dstAlpha:t.dst;return Mt.commandParameter(r,Ji,s+".srcRGB",e.commandStr),Mt.commandParameter(n,Ji,s+".srcAlpha",e.commandStr),Mt.commandParameter(i,Ji,s+".dstRGB",e.commandStr),Mt.commandParameter(a,Ji,s+".dstAlpha",e.commandStr),Mt.command(-1===Ki.indexOf(r+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ji[r],Ji[i],Ji[n],Ji[a]]},function(e,r,n){function i(i,o){var s=r.def('"',i,o,'" in ',n,"?",n,".",i,o,":",n,".",i);return Mt.optional(function(){e.assert(r,s+" in "+a,"invalid "+t+"."+i+o+", must be one of "+Object.keys(Ji))}),s}var a=e.constants.blendFuncs;Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var o=i("src","RGB"),s=i("dst","RGB");Mt.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+o+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var l=r.def(a,"[",o,"]"),c=r.def(a,"[",i("src","Alpha"),"]");return[l,r.def(a,"[",s,"]"),c,r.def(a,"[",i("dst","Alpha"),"]")]});case bn:return o(function(r){return"string"==typeof r?(Mt.commandParameter(r,R,"invalid "+t,e.commandStr),[R[r],R[r]]):"object"==typeof r?(Mt.commandParameter(r.rgb,R,t+".rgb",e.commandStr),Mt.commandParameter(r.alpha,R,t+".alpha",e.commandStr),[R[r.rgb],R[r.alpha]]):void Mt.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,a=r.def(),o=r.def(),s=e.cond("typeof ",n,'==="string"');return Mt.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(R))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(a,"=",o,"=",i,"[",n,"];"),s.else(a,"=",i,"[",n,".rgb];",o,"=",i,"[",n,".alpha];"),r(s),[a,o]});case yn:return o(function(t){return Mt.command(O(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),T(4,function(e){return+t[e]})},function(t,e,r){return Mt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),T(4,function(t){return e.def("+",r,"[",t,"]")})});case Fn:return o(function(t){return Mt.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return Mt.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Rn:return o(function(r){Mt.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,a="mask"in r?r.mask:-1;return Mt.commandParameter(n,Qi,t+".cmp",e.commandStr),Mt.commandType(i,"number",t+".ref",e.commandStr),Mt.commandType(a,"number",t+".mask",e.commandStr),[Qi[n],i,a]},function(t,e,r){var n=t.constants.compareFuncs;return Mt.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Hi),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case jn:case Nn:return o(function(r){Mt.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",a=r.zpass||"keep";return Mt.commandParameter(n,$i,t+".fail",e.commandStr),Mt.commandParameter(i,$i,t+".zfail",e.commandStr),Mt.commandParameter(a,$i,t+".zpass",e.commandStr),[t===Nn?Ri:Fi,$i[n],$i[i],$i[a]]},function(e,r,n){function i(i){return Mt.optional(function(){e.assert(r,'!("'+i+'" in '+n+")||("+n+"."+i+" in "+a+")","invalid "+t+"."+i+", must be one of "+Object.keys($i))}),r.def('"',i,'" in ',n,"?",a,"[",n,".",i,"]:",Hi)}var a=e.constants.stencilOps;return Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Nn?Ri:Fi,i("fail"),i("zfail"),i("zpass")]});case In:return o(function(t){Mt.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return Mt.commandType(r,"number",s+".factor",e.commandStr),Mt.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case Sn:return o(function(t){var r=0;return"front"===t?r=Fi:"back"===t&&(r=Ri),Mt.command(!!r,s,e.commandStr),r},function(t,e,r){return Mt.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Fi,":",Ri)});case Ln:return o(function(t){return Mt.command("number"==typeof t&&t>=n.lineWidthDims[0]&&t<=n.lineWidthDims[1],"invalid line width, must positive number between "+n.lineWidthDims[0]+" and "+n.lineWidthDims[1],e.commandStr),t},function(t,e,r){return Mt.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+n.lineWidthDims[0]+"&&"+r+"<="+n.lineWidthDims[1],"invalid line width")}),r});case En:return o(function(t){return Mt.commandParameter(t,ea,s,e.commandStr),ea[t]},function(t,e,r){return Mt.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+ji+":"+Ni)});case Tn:return o(function(t){return Mt.command(O(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return Mt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),T(4,function(t){return"!!"+r+"["+t+"]"})});case zn:return o(function(t){Mt.command("object"==typeof t&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return Mt.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return Mt.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),a}(t,c),b=function(t){function r(t){if(t in i){var r=e.id(i[t]);Mt.optional(function(){u.shader(ta[t],r,Mt.guessCommand())});var n=nt(function(){return r});return n.id=r,n}if(t in a){var o=a[t];return it(o,function(e,r){var n=e.invoke(r,o),i=r.def(e.shared.strings,".id(",n,")");return Mt.optional(function(){r(e.shared.shader,".shader(",ta[t],",",i,",",e.command,");")}),i})}return null}var n,i=t.static,a=t.dynamic,o=r(Yn),s=r(Gn),l=null;return rt(o)&&rt(s)?(l=u.program(s.id,o.id),n=nt(function(t,e){return t.link(l)})):n=new et(o&&o.thisDep||s&&s.thisDep,o&&o.contextDep||s&&s.contextDep,o&&o.propDep||s&&s.propDep,function(t,e){var r,n=t.shared.shader;r=o?o.append(t,e):e.def(n,".",Yn);var i=n+".program("+(s?s.append(t,e):e.def(n,".",Gn))+","+r;return Mt.optional(function(){i+=","+t.command}),e.def(i+")")}),{frag:o,vert:s,progVar:n,program:l}}(t);h(Vn),h(m(Un));var x=Object.keys(y).length>0,_={framebuffer:p,draw:v,shader:b,state:y,dirty:x};return _.profile=function(t){var e,r=t.static,n=t.dynamic;if(Hn in r){var i=!!r[Hn];(e=nt(function(t,e){return i})).enable=i}else if(Hn in n){var a=n[Hn];e=it(a,function(t,e){return t.invoke(e,a)})}return e}(t),_.uniforms=function(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,a=r[t];if("number"==typeof a||"boolean"==typeof a)n=nt(function(){return a});else if("function"==typeof a){var o=a._reglType;"texture2d"===o||"textureCube"===o?n=nt(function(t){return t.link(a)}):"framebuffer"===o||"framebufferCube"===o?(Mt.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=nt(function(t){return t.link(a.color[0])})):Mt.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else O(a)?n=nt(function(e){return e.global.def("[",T(a.length,function(r){return Mt.command("number"==typeof a[r]||"boolean"==typeof a[r],"invalid uniform "+t,e.commandStr),a[r]}),"]")}):Mt.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=a,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=it(e,function(t,r){return t.invoke(r,e)})}),i}(o,c),_.attributes=function(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var a=n[t],s=e.id(t),l=new F;if($(a))l.state=cn,l.buffer=i.getBuffer(i.create(a,ai,!1,!0)),l.type=0;else{var c=i.getBuffer(a);if(c)l.state=cn,l.buffer=c,l.type=0;else if(Mt.command("object"==typeof a&&a,"invalid data for attribute "+t,r.commandStr),a.constant){var u=a.constant;l.buffer="null",l.state=un,"number"==typeof u?l.x=u:(Mt.command(O(u)&&u.length>0&&u.length<=4,"invalid constant for attribute "+t,r.commandStr),sn.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',r.commandStr);var f=0|a.stride;Mt.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',r.commandStr);var d=0|a.size;Mt.command(!("size"in a)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',r.commandStr);var p=!!a.normalized,m=0;"type"in a&&(Mt.commandParameter(a.type,Ut,"invalid type for attribute "+t,r.commandStr),m=Ut[a.type]);var g=0|a.divisor;"divisor"in a&&(Mt.command(0===g||j,'cannot specify divisor for attribute "'+t+'", instancing not supported',r.commandStr),Mt.command(g>=0,'invalid divisor for attribute "'+t+'"',r.commandStr)),Mt.optional(function(){var e=r.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(a).forEach(function(r){Mt.command(n.indexOf(r)>=0,'unknown parameter "'+r+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",e)})}),l.buffer=c,l.state=cn,l.size=d,l.normalized=p,l.type=m||c.dtype,l.offset=h,l.stride=f,l.divisor=g}}o[t]=nt(function(t,e){var r=t.attribCache;if(s in r)return r[s];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[s]=n,n})}),Object.keys(a).forEach(function(t){var e=a[t];o[t]=it(e,function(r,n){function i(t){n(c[t],"=",a,".",t,"|0;")}var a=r.invoke(n,e),o=r.shared,s=o.isBufferArgs,l=o.buffer;Mt.optional(function(){r.assert(n,a+"&&(typeof "+a+'==="object"||typeof '+a+'==="function")&&('+s+"("+a+")||"+l+".getBuffer("+a+")||"+l+".getBuffer("+a+".buffer)||"+s+"("+a+'.buffer)||("constant" in '+a+"&&(typeof "+a+'.constant==="number"||'+o.isArrayLike+"("+a+".constant))))",'invalid dynamic attribute "'+t+'"')});var c={isStream:n.def(!1)},u=new F;u.state=cn,Object.keys(u).forEach(function(t){c[t]=n.def(""+u[t])});var h=c.buffer,f=c.type;return n("if(",s,"(",a,")){",c.isStream,"=true;",h,"=",l,".createStream(",ai,",",a,");",f,"=",h,".dtype;","}else{",h,"=",l,".getBuffer(",a,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',a,"){",c.state,"=",un,";","if(typeof "+a+'.constant === "number"){',c[sn[0]],"=",a,".constant;",sn.slice(1).map(function(t){return c[t]}).join("="),"=0;","}else{",sn.map(function(t,e){return c[t]+"="+a+".constant.length>="+e+"?"+a+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",a,".buffer)){",h,"=",l,".createStream(",ai,",",a,".buffer);","}else{",h,"=",l,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",h,".dtype;",c.normalized,"=!!",a,".normalized;"),i("size"),i("offset"),i("stride"),i("divisor"),n("}}"),n.exit("if(",c.isStream,"){",l,".destroyStream(",h,");","}"),c})}),o}(r,c),_.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=nt(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=it(e,function(t,r){return t.invoke(r,e)})}),n}(l),_}function x(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a);var o=r[a];i(n,".",a,"=",o.append(t,e),";")}),e(i)}function _(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;N&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,c=t.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",Xi,",",l,".framebuffer);"),N&&e(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",Xi,",null);"),N&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function w(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");V.forEach(function(e){var n=m(e);if(!(n in r.state)){var u,h;if(n in o){u=o[n],h=a[n];var f=T(B[n].length,function(t){return c.def(u,"[",t,"]")});c(t.cond(f.map(function(t,e){return t+"!=="+h+"["+e+"]"}).join("||")).then(i,".",q[n],"(",f,");",f.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";"))}else{u=c.def(l,".",n);var d=t.cond(u,"!==",s,".",n);c(d),n in H?d(t.cond(u).then(i,".enable(",H[n],");").else(i,".disable(",H[n],");"),s,".",n,"=",u,";"):d(i,".",q[n],"(",u,");",s,".",n,"=",u,";")}}}),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function M(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;tt(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(H[i]){var u=H[i];rt(l)?e(s,c?".enable(":".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(O(c)){var h=a[i];e(s,".",q[i],"(",c,");",c.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";")}else e(s,".",q[i],"(",c,");",o,".",i,"=",c,";")}})}function k(t,e){j&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function A(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(p,".count+=",i,";"):t(p,".count++;"),d&&(n?t(u=e.def(),"=",g,".getNumPendingQueries();"):t(g,".beginQuery(",p,");"))}function s(t){t(p,".cpuTime+=",a(),"-",c,";"),d&&(n?t(g,".pushScopeStats(",u,",",g,".getNumPendingQueries(),",p,");"):t(g,".endQuery();"))}function l(t){var r=e.def(m,".profile");e(m,".profile=",t,";"),e.exit(m,".profile=",r,";")}var c,u,h,f=t.shared,p=t.stats,m=f.current,g=f.timer,v=r.profile;if(v){if(rt(v))return void(v.enable?(o(e),s(e.exit),l("true")):l("false"));l(h=v.append(t,e))}else h=e.def(m,".profile");var y=t.block();o(y),e("if(",h,"){",y,"}");var b=t.block();s(b),e.exit("if(",h,"){",b,"}")}function S(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(ra))return;var c=t.scopeAttrib(s);Mt.optional(function(){t.assert(e,c+".state","missing attribute "+s)}),o={},Object.keys(new F).forEach(function(t){o[t]=e.def(c,".",t)})}!function(r,n,i){function o(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",p.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",ai,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",p.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),j){var o=i.divisor;e("if(",u,".divisor!==",o,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,o],");",u,".divisor=",o,";}")}}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",sn.map(function(t,e){return u+"."+t+"!=="+d[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",d,");",sn.map(function(t,e){return u+"."+t+"="+d[e]+";"}).join(""),"}")}var l=a.gl,c=e.def(r,".location"),u=e.def(a.attributes,"[",c,"]"),h=i.state,f=i.buffer,d=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];h===cn?o():h===un?s():(e("if(",h,"===",cn,"){"),o(),e("}else{"),s(),e("}"))}(t.link(n),function(t){switch(t){case bi:case Mi:case Si:return 2;case xi:case ki:case Ei:return 3;case _i:case Ti:case Li:return 4;default:return 1}}(n.info.type),o)})}function E(t,r,n,i,a){for(var o,s=t.shared,l=s.gl,c=0;c1?T(x,function(t){return u+"["+t+"]"}):u);r(");")}}function L(t,e,r,n){function i(i){var a=u[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(c,".",i)}function a(){function t(){r(g,".drawElementsInstancedANGLE(",[f,p,v,d+"<<(("+v+"-"+ln+")>>1)",m],");")}function e(){r(g,".drawArraysInstancedANGLE(",[f,d,p,m],");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[f,p,v,d+"<<(("+v+"-"+ln+")>>1)"]+");")}function e(){r(l+".drawArrays("+[f,d,p]+");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,h=function(){var i,a=u.elements,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(c,".",Wn),i&&o("if("+i+")"+l+".bindBuffer("+oi+","+i+".buffer.buffer);"),i}(),f=i(Xn),d=i(Jn),p=function(){var i,a=u.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),Mt.optional(function(){a.MISSING&&t.assert(e,"false","missing vertex count"),a.DYNAMIC&&t.assert(o,i+">=0","missing vertex count")})):(i=o.def(c,".",Zn),Mt.optional(function(){t.assert(o,i+">=0","missing vertex count")})),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,g;j&&(m=i(Kn),g=t.instancing);var v=h+".type",y=u.elements&&rt(u.elements);j&&("number"!=typeof m||m>=0)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function C(t,e,r,n,i){var a=y(),o=a.proc("body",i);return Mt.optional(function(){a.commandStr=e.commandStr,a.command=a.link(e.commandStr)}),j&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function I(t,e,r,n){k(t,e),S(t,e,r,n.attributes,function(){return!0}),E(t,e,r,n.uniforms,function(){return!0}),L(t,e,e,r)}function P(t,e,r,n){function i(){return!0}t.batchId="a1",k(t,e),S(t,e,r,n.attributes,i),E(t,e,r,n.uniforms,i),L(t,e,e,r)}function D(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}k(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();if(e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&x(t,u,r.context),r.needsFramebuffer&&_(t,u,r.framebuffer),M(t,u,r.state,i),r.profile&&i(r.profile)&&A(t,u,r,!1,!0),n)S(t,c,r,n.attributes,a),S(t,u,r,n.attributes,i),E(t,c,r,n.uniforms,a),E(t,u,r,n.uniforms,i),L(t,c,u,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,u),d=u.def(f,".id"),p=u.def(h,"[",d,"]");u(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link(function(e){return C(P,t,r,e,2)}),"(",f,");}",p,".call(this,a0[",s,"],",s,");")}}function z(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!O(t)){for(var e=Object.keys(t),r=0;r0&&r(t.shared.current,".dirty=true;")}(o,s),function(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;x(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),tt(Object.keys(r.state)).forEach(function(e){var n=r.state[e].append(t,i);O(n)?n.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,n)}),A(t,i,r,!0,!0),[Wn,Jn,Zn,Kn,Xn].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new F).forEach(function(t){i.set(a,"."+t,n[t])})}),n(Gn),n(Yn),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}(o,s),function(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",k(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(x(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||_(t,n,o)):_(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),w(t,n,e),M(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||A(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)D(t,n,e,null);else{var c=l.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)D(t,n,e,e.shader.program);else{var u=t.global.def("{}"),h=n.def(c,".id"),f=n.def(u,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",t.link(function(r){return C(D,t,e,r,2)}),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(o,s),o.compile()}}}function ot(t,e){for(var r=0;r=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")},oneOf:i,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),c=i===t.FRAGMENT_SHADER?"fragment":"vertex";p(n,"string",c+" shader source must be a string",o);var u=h(n,o),f=function(t){var e=[];return t.split("\n").forEach(function(t){if(!(t.length<5)){var r=/^ERROR\:\s+(\d+)\:(\d+)\:\s*(.*)$/.exec(t);r?e.push(new l(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new l("unknown",0,t))}}),e}(s);!function(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}(u,f),Object.keys(u).forEach(function(t){function e(t,e){n.push(t),i.push(e||"")}var r=u[t];if(r.hasErrors){var n=[""],i=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(a(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var i=n.message,o=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(o){var s=o[1];switch(i=o[2],s){case"assign":s="="}r=Math.max(t.line.indexOf(s,r),0)}else r=0;e(a("| ",6)),e(a("^^^",r+3)+"\n","font-weight:bold"),e(a("| ",6)),e(i+"\n","font-weight:bold")}),e(a("| ",6)+"\n")}else e(a(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=n.join("%c"),console.log.apply(console,i)):console.log(n.join(""))}}),r.raise("Error compiling "+c+" shader, "+u[0].name)}},linkError:function(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=h(n,a),l='Error linking program with vertex shader, "'+h(i,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+l+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(l+"\n"+o),r.raise(l)}},callSite:u,saveCommandRef:f,saveDrawInfo:function(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}f(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,r){t.texture?i(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):i(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")},guessCommand:c,texture2D:function(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ht&&t.wrapT===ht||r(g(a)&&g(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==dt&&t.minFilter!==mt&&t.minFilter!==pt&&t.minFilter!==gt,"min filter requires mipmap"):(r(g(a)&&g(o),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),e.type===vt&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===ft&&t.magFilter===ft,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var c=a>>i,u=o>>i;r(e.mipmask&1<0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(e.wrapS===ht&&e.wrapT===ht,"wrap mode not supported by cube map");for(var l=0;l>h,p=o>>h;r(c.mipmask&1<=2,"invalid renderbuffer shape"),a=0|d[0],o=0|d[1]}else"radius"in f&&(a=o=0|f.radius),"width"in f&&(a=0|f.width),"height"in f&&(o=0|f.height);"format"in f&&(Mt.parameter(f.format,s,"invalid renderbuffer format"),u=s[f.format])}else"number"==typeof e?(a=0|e,o="number"==typeof n?0|n:a):e?Mt.raise("invalid arguments to renderbuffer constructor"):a=o=1;if(Mt(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),a!==h.width||o!==h.height||u!==h.format)return c.width=h.width=a,c.height=h.height=o,h.format=u,t.bindRenderbuffer(Lr,h.renderbuffer),t.renderbufferStorage(Lr,u,a,o),i.profile&&(h.stats.size=W(h.format,h.width,h.height)),c.format=l[h.format],c}var h=new a(t.createRenderbuffer());return u[h.id]=h,n.renderbufferCount++,c(e,o),c.resize=function(e,n){var a=0|e,o=0|n||a;return a===h.width&&o===h.height?c:(Mt(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),c.width=h.width=a,c.height=h.height=o,t.bindRenderbuffer(Lr,h.renderbuffer),t.renderbufferStorage(Lr,h.format,a,o),i.profile&&(h.stats.size=W(h.format,h.width,h.height)),c)},c._reglType="renderbuffer",c._renderbuffer=h,i.profile&&(c.stats=h.stats),c.destroy=function(){h.decRef()},c},clear:function(){Ct(u).forEach(o)},restore:function(){Ct(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(Lr,e.renderbuffer),t.renderbufferStorage(Lr,e.format,e.width,e.height)}),t.bindRenderbuffer(Lr,null)}}},Dr=36160,zr=36161,Or=3553,Fr=34069,Rr=36064,jr=36096,Nr=36128,Br=33306,Ur=36053,Vr=6402,Hr=[6408],qr=[];qr[6408]=4;var Gr=[];Gr[5121]=1,Gr[5126]=4,Gr[36193]=2;var Yr=33189,Wr=36168,Xr=34041,Zr=[32854,32855,36194,35907,34842,34843,34836],Jr={};Jr[Ur]="complete",Jr[36054]="incomplete attachment",Jr[36057]="incomplete dimensions",Jr[36055]="incomplete, missing attachment",Jr[36061]="unsupported";var Kr=5126,Qr=35632,$r=35633,tn=35718,en=35721,rn=6408,nn=5121,an=3333,on=5126,sn="xyzw".split(""),ln=5121,cn=1,un=2,hn=0,fn=1,dn=2,pn=3,mn=4,gn="dither",vn="blend.enable",yn="blend.color",bn="blend.equation",xn="blend.func",_n="depth.enable",wn="depth.func",Mn="depth.range",kn="depth.mask",Tn="colorMask",An="cull.enable",Sn="cull.face",En="frontFace",Ln="lineWidth",Cn="polygonOffset.enable",In="polygonOffset.offset",Pn="sample.alpha",Dn="sample.enable",zn="sample.coverage",On="stencil.enable",Fn="stencil.mask",Rn="stencil.func",jn="stencil.opFront",Nn="stencil.opBack",Bn="scissor.enable",Un="scissor.box",Vn="viewport",Hn="profile",qn="framebuffer",Gn="vert",Yn="frag",Wn="elements",Xn="primitive",Zn="count",Jn="offset",Kn="instances",Qn=qn+"Width",$n=qn+"Height",ti=Vn+"Width",ei=Vn+"Height",ri="drawingBufferWidth",ni="drawingBufferHeight",ii=[xn,bn,Rn,jn,Nn,zn,Vn,Un,In],ai=34962,oi=34963,si=3553,li=34067,ci=2884,ui=3042,hi=3024,fi=2960,di=2929,pi=3089,mi=32823,gi=32926,vi=32928,yi=5126,bi=35664,xi=35665,_i=35666,wi=5124,Mi=35667,ki=35668,Ti=35669,Ai=35670,Si=35671,Ei=35672,Li=35673,Ci=35674,Ii=35675,Pi=35676,Di=35678,zi=35680,Oi=4,Fi=1028,Ri=1029,ji=2304,Ni=2305,Bi=32775,Ui=32776,Vi=519,Hi=7680,qi=0,Gi=1,Yi=32774,Wi=513,Xi=36160,Zi=36064,Ji={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ki=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Qi={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},$i={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ta={frag:35632,vert:35633},ea={cw:ji,ccw:Ni},ra=new et(!1,!1,!1,function(){}),na=34918,ia=34919,aa=35007,oa=function(t,e){function r(t){o.push(t)}function n(t){l.push(t)}function i(t,e,r){var n=l.pop()||new function(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null};n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,c.push(n)}var a=e.ext_disjoint_timer_query;if(!a)return null;var o=[],s=[],l=[],c=[],u=[],h=[];return{beginQuery:function(t){var e=o.pop()||a.createQueryEXT();a.beginQueryEXT(aa,e),s.push(e),i(s.length-1,s.length,t)},endQuery:function(){a.endQueryEXT(aa)},pushScopeStats:i,update:function(){var t,e,i=s.length;if(0!==i){h.length=Math.max(h.length,i+1),u.length=Math.max(u.length,i+1),u[0]=0,h[0]=0;var o=0;for(t=0,e=0;e=0;--t){var r=H[t];r&&r(S,null,0)}p.flush(),_&&_.update()}function r(){!K&&H.length>0&&(K=St.next(e))}function n(){K&&(St.cancel(e),K=null)}function i(t){t.preventDefault(),g=!0,n(),q.forEach(function(t){t()})}function a(t){p.getError(),g=!1,v.restore(),O.restore(),L.restore(),F.restore(),R.restore(),j.restore(),_&&_.restore(),N.procs.refresh(),r(),G.forEach(function(t){t()})}function o(t){function e(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];At.isDynamic(i)?r[n]=At.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}Mt(!!t,"invalid args to regl({...})"),Mt.type(t,"object","invalid args to regl({...})");var r=e(t.context||{}),n=e(t.uniforms||{}),i=e(t.attributes||{}),a=e(function(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}var r=ct({},t);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),r}(t)),o={gpuTime:0,cpuTime:0,count:0},s=N.compile(a,i,n,r,o),l=s.draw,c=s.batch,u=s.scope,h=[];return ct(function(t,e){var r;if(g&&Mt.raise("context lost"),"function"==typeof t)return u.call(this,null,t,0);if("function"==typeof e){if("number"==typeof t){for(r=0;r0)return c.call(this,function(t){for(;h.length=0,"cannot cancel a frame twice"),H[r]=e}}}function c(){var t=U.viewport,e=U.scissor_box;t[0]=t[1]=e[0]=e[1]=0,S.viewportWidth=S.framebufferWidth=S.drawingBufferWidth=t[2]=e[2]=p.drawingBufferWidth,S.viewportHeight=S.framebufferHeight=S.drawingBufferHeight=t[3]=e[3]=p.drawingBufferHeight}function u(){S.tick+=1,S.time=f(),c(),N.procs.poll()}function h(){c(),N.procs.refresh(),_&&_.update()}function f(){return(Et()-w)/1e3}var d=M(t);if(!d)return null;var p=d.gl,m=p.getContextAttributes(),g=p.isContextLost(),v=function(t,e){function r(e){Mt.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var n={},i=0;i0){var l;if(Array.isArray(e[0])){s=qt(e);for(var c=1,u=1;u0)if("number"==typeof t[0]){var i=Nt.allocType(d.dtype,t.length);P(i,t),f(i,n),Nt.freeType(i)}else if(Array.isArray(t[0])||lt(t[0])){r=qt(t);var a=Ht(t,r,d.dtype);f(a,n),Nt.freeType(a)}else Mt.raise("invalid buffer data")}else if(lt(t))f(t,n);else if(k(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length?(s=r[0],l=r[1],c=o[0],u=o[1]):Mt.raise("invalid shape");var p=Array.isArray(t.data)?d.dtype:I(t.data),m=Nt.allocType(p,s*l);D(m,t.data,s,l,c,u,t.offset),f(m,n),Nt.freeType(m)}else Mt.raise("invalid data for buffer subdata");return h},r.profile&&(h.stats=d.stats),h.destroy=function(){o(d)},h},createStream:function(t,e){var r=c.pop();return r||(r=new n(t)),r.bind(),a(r,e,Yt,0,1,!1),r},destroyStream:function(t){c.push(t)},clear:function(){Ct(l).forEach(o),c.forEach(o)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:function(){Ct(l).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})},_initBuffer:a}}(p,b,d),C=function(t,e,r,n){function i(t){this.id=l++,s[this.id]=this,this.buffer=t,this.primType=$t,this.vertCount=0,this.type=0}function a(n,i,a,o,s,l,c){if(n.buffer.bind(),i){var u=c;c||lt(i)&&(!k(i)||lt(i.data))||(u=e.oes_element_index_uint?ae:ne),r._initBuffer(n.buffer,i,a,u,3)}else t.bufferData(oe,l,a),n.buffer.dtype=h||ee,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var h=c;if(!c){switch(n.buffer.dtype){case ee:case te:h=ee;break;case ne:case re:h=ne;break;case ae:case ie:h=ae;break;default:Mt.raise("unsupported type for element array")}n.buffer.dtype=h}n.type=h,Mt(h!==ae||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=s;f<0&&(f=n.buffer.byteLength,h===ne?f>>=1:h===ae&&(f>>=2)),n.vertCount=f;var d=o;if(o<0){d=$t;var p=n.buffer.dimension;1===p&&(d=Kt),2===p&&(d=Qt),3===p&&(d=$t)}n.primType=d}function o(t){n.elementsCount--,Mt(null!==t.buffer,"must not double destroy elements"),delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},l=0,c={uint8:ee,uint16:ne};e.oes_element_index_uint&&(c.uint32=ae),i.prototype.bind=function(){this.buffer.bind()};var u=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)l(t),u.primType=$t,u.vertCount=0|t,u.type=ee;else{var e=null,r=le,n=-1,i=-1,o=0,h=0;Array.isArray(t)||lt(t)||k(t)?e=t:(Mt.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,Mt(Array.isArray(e)||lt(e)||k(e),"invalid data for element buffer")),"usage"in t&&(Mt.parameter(t.usage,Vt,"invalid element buffer usage"),r=Vt[t.usage]),"primitive"in t&&(Mt.parameter(t.primitive,Jt,"invalid element buffer primitive"),n=Jt[t.primitive]),"count"in t&&(Mt("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(Mt.parameter(t.type,c,"invalid buffer type"),h=c[t.type]),"length"in t?o=0|t.length:(o=i,h===ne||h===re?o*=2:h!==ae&&h!==ie||(o*=4))),a(u,e,r,n,i,o,h)}else l(),u.primType=$t,u.vertCount=0,u.type=ee;return s}var l=r.create(null,oe,!0),u=new i(l._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=u,s.subdata=function(t,e){return l.subdata(t,e),s},s.destroy=function(){o(u)},s},createStream:function(t){var e=u.pop();return e||(e=new i(r.create(null,oe,!0,!1)._buffer)),a(e,t,se,-1,-1,0,0),e},destroyStream:function(t){u.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){Ct(s).forEach(o)}}}(p,x,L,b),z=function(t,e,r,n,i){for(var a=r.maxAttributes,o=new Array(a),s=0;s=Fr&&e=2,"invalid shape for framebuffer"),c=P[0],d=P[1]}else"radius"in I&&(c=d=I.radius),"width"in I&&(c=I.width),"height"in I&&(d=I.height);("color"in I||"colors"in I)&&(y=I.color||I.colors,Array.isArray(y)&&Mt(1===y.length||s,"multiple render targets not supported")),y||("colorCount"in I&&(A=0|I.colorCount,Mt(A>0,"invalid color buffer count")),"colorTexture"in I&&(M=!!I.colorTexture,k="rgba4"),"colorType"in I&&(T=I.colorType,M?(Mt(e.oes_texture_float||!("float"===T||"float32"===T),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Mt(e.oes_texture_half_float||!("half float"===T||"float16"===T),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===T||"float16"===T?(Mt(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),k="rgba16f"):"float"!==T&&"float32"!==T||(Mt(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),k="rgba32f"),Mt.oneOf(T,w,"invalid color type")),"colorFormat"in I&&(k=I.colorFormat,x.indexOf(k)>=0?M=!0:_.indexOf(k)>=0?M=!1:M?Mt.oneOf(I.colorFormat,x,"invalid color format for texture"):Mt.oneOf(I.colorFormat,_,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(C=!(!I.depthTexture&&!I.depthStencilTexture),Mt(!C||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?p=I.depth:(S=I.depth,g=!1)),"stencil"in I&&("boolean"==typeof I.stencil?g=I.stencil:(E=I.stencil,p=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?p=g=I.depthStencil:(L=I.depthStencil,p=!1,g=!1))}else c=d=1;var D=null,z=null,O=null,F=null;if(Array.isArray(y))D=y.map(u);else if(y)D=[u(y)];else for(D=new Array(A),a=0;a=0||D[a].renderbuffer&&Zr.indexOf(D[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),D[a]&&D[a].texture){var j=qr[D[a].texture._texture.format]*Gr[D[a].texture._texture.type];null===R?R=j:Mt(R===j,"all color attachments much have the same number of bits per pixel.")}return l(z,c,d),Mt(!z||z.texture&&z.texture._texture.format===Vr||z.renderbuffer&&z.renderbuffer._renderbuffer.format===Yr,"invalid depth attachment for framebuffer object"),l(O,c,d),Mt(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===Wr,"invalid stencil attachment for framebuffer object"),l(F,c,d),Mt(!F||F.texture&&F.texture._texture.format===Xr||F.renderbuffer&&F.renderbuffer._renderbuffer.format===Xr,"invalid depth-stencil attachment for framebuffer object"),m(o),o.width=c,o.height=d,o.colorAttachments=D,o.depthAttachment=z,o.stencilAttachment=O,o.depthStencilAttachment=F,i.color=D.map(f),i.depth=f(z),i.stencil=f(O),i.depthStencil=f(F),i.width=o.width,i.height=o.height,v(o),i}var o=new p;return a.framebufferCount++,i(t,n),ct(i,{resize:function(t,e){Mt(b.next!==o,"can not resize a framebuffer which is currently in use");var r=0|t,n=0|e||r;if(r===o.width&&n===o.height)return i;for(var a=o.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),Mt(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&Mt(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(c=d.color||d.colors,Array.isArray(c)&&Mt(1===c.length||o,"multiple render targets not supported")),c||("colorCount"in d&&(f=0|d.colorCount,Mt(f>0,"invalid color buffer count")),"colorType"in d&&(Mt.oneOf(d.colorType,w,"invalid color type"),h=d.colorType),"colorFormat"in d&&(u=d.colorFormat,Mt.oneOf(d.colorFormat,x,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(c)if(Array.isArray(c))for(m=[],r=0;r0&&(s.depth=a[0].depth,s.stencil=a[0].stencil,s.depthStencil=a[0].depthStencil),a[r]?a[r](s):a[r]=y(s)}return ct(i,{width:l,height:l,color:m})}var a=Array(6);return i(t),ct(i,{faces:a,resize:function(t){var e,n=0|t;if(Mt(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===i.width)return i;var o=i.color;for(e=0;e=0},read:B,destroy:function(){H.length=0,n(),V&&(V.removeEventListener(ha,i),V.removeEventListener(fa,a)),O.clear(),j.clear(),R.clear(),F.clear(),C.clear(),L.clear(),_&&_.clear(),W.forEach(function(t){t()})},_gl:p,_refresh:h,poll:function(){u(),_&&_.update()},now:f,stats:b});return d.onDone(null,$),$}})},{}],509:[function(t,e,r){"use strict";var n,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,r)}},{}],510:[function(t,e,r){!function(t,n){"object"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",i(t.slice(0,e)),",",i(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function o(t){return!0&t?"-":""}function s(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===n?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?i[t]:i)}var i=t("robust-determinant"),a=6,o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:d(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],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,b=a*s,x=u*(d-m)+h*(g-v)+f*(y-b),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(b))*Math.abs(f));return x>_||-x>_?x:p(t,e,r,n)}];!function(){for(;m.length<=f;)m.push(s(m.length));for(var t=[],r=["slow"],n=0;n<=f;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=f;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&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),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=f,(c+=1)=n?(i=f,(c+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(h=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(h,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],524:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],525:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":70,"reduce-simplicial-complex":507}],526:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,a=new Array(t+1);a[0]=[[]];for(var o=1;o<=t;++o)for(var s=a[o]=i(o),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--o){o>1,s=n(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(i=o-1)}return a}function l(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==n(t[g],o)););}return r}function c(t,e){if(e<0)return[];for(var r=[],n=(1<>>u&1&&c.push(i[u]);e.push(c)}return a(e)},r.skeleton=c,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=l(t);if(!(r>=0&&e0){var t=T[0];return o(0,S-1),S-=1,c(0),t}return-1}function f(t,e){var r=T[t];return b[r]===e?t:(b[r]=-1/0,u(t),h(),b[r]=e,S+=1,u(S-1))}function d(t){if(!x[t]){x[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),A[e]>=0&&f(A[e],a(e)),A[r]>=0&&f(A[r],a(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||i<0||i===n)break;if(n=i,i=t[n],!x[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),b=new Array(m),x=new Array(m),_=0;_>1;_>=0;--_)c(_);for(;;){var E=h();if(E<0||b[E]>r)break;d(E)}var L=[];for(_=0;_=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":517,"simplicial-complex":530}],533:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var a=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?a-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],a=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=i(r,a,s),c=i(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=i(s,o,a),c=i(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var i=t("robust-orientation")},{"robust-orientation":517}],534:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=a(t.right,e))return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}e.exports=function(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?h(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var c=this.horizontal[e];if(c.length>0){var f=l.ge(c,t[1],i);if(f=c.length)return n;d=c[f]}}if(d.start)if(o){var p=u(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":533,"binary-search-bounds":67,"functional-red-black-tree":136,"robust-orientation":517}],535:[function(t,e,r){"use strict";function n(t,e){var r=o(a(t,e),[e[e.length-1]]);return r[r.length-1]}function i(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||o>0&&u<0){var h=i(s,u,l,o);r.push(h),a.push(h.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}},e.exports.positive=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r},e.exports.negative=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}},{"robust-dot-product":514,"robust-sum":522}],536:[function(t,e,r){!function(){"use strict";function t(e){return function(e,r){var i,a,o,s,l,c,u,h,f,d=1,p=e.length,m="";for(a=0;a=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}n.json.test(s[8])?m+=i:(!n.number.test(s[8])||h&&!s[3]?f="":(f=h?"+":"-",i=i.toString().replace(n.sign,"")),c=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",u=s[6]-(f+i).length,l=s[6]&&u>0?c.repeat(u):"",m+=s[5]?f+i+l:"0"===c?f+l+i:l+f+i)}return m}(function(t){if(i[t])return i[t];var e,r=t,a=[],o=0;for(;r;){if(null!==(e=n.text.exec(r)))a.push(e[0]);else if(null!==(e=n.modulo.exec(r)))a.push("%");else{if(null===(e=n.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],l=e[2],c=[];if(null===(c=n.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=n.key_access.exec(l)))s.push(c[1]);else{if(null===(c=n.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(e)}r=r.substring(e[0].length)}return i[t]=a}(e),arguments)}function e(e,r){return t.apply(null,[e].concat(r||[]))}var n={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:/^[\+\-]/},i=Object.create(null);void 0!==r&&(r.sprintf=t,r.vsprintf=e),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},{}],537:[function(t,e,r){"use strict";e.exports=function(t){function e(e){var r=[e],c=[e];for(n[e]=i[e]=u,a[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(o[e]=0&&l[e].push(s[m])}o[e]=p}else{if(i[e]===n[e]){var g=[],v=[],y=0;for(p=r.length-1;p>=0;--p){var b=r[p];if(a[b]=!1,g.push(b),v.push(l[b]),y+=l[b].length,s[b]=h.length,b===e){r.length=p;break}}h.push(g);var x=new Array(y);for(p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function u(t){return t.x}function h(t){return t.y}var f=t("kdbush");e.exports=function(t){return new n(t)},n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(i);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var o=+Date.now();this.trees[a+1]=f(n,u,h,this.options.nodeSize,Float32Array),n=this._cluster(n,a),e&&console.log("z%d: %d clusters in %dms",a,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=f(n,u,h,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(s(t[0]),l(t[3]),s(t[2]),l(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){h.length>0&&f.push("}}");var d="vExtra"+h.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),f=["function ",d,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,b=0;bb)&&!(c&1<<_)!=!(c&1<0&&(T="+"+g[x]+"*c");var A=p[x].length/y*.5,S=.5+v[x]/y*.5;k.push("d"+x+"-"+S+"-"+A+"*("+p[x].join("+")+T+")/("+m[x].join("+")+")")}f.push("a.push([",k.join(),"]);","break;")}a.push("}},"),h.length>0&&f.push("}}");var E=[];for(c=0;c<1<0&&(h+=.02);var d=new Float32Array(u),p=0,m=-.5*h;for(f=0;f=0?1.2:1))}function i(t,e,r,n,i,o,s){for(var l=0;l1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;t=_(t,360),e=_(e,100),r=_(r,100);if(0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(e.h,i,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=x(n),{ok:s,format:e.format||l,r:D(255,z(r.r,0)),g:D(255,z(r.g,0)),b:D(255,z(r.b,0)),a:n}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=P(100*this._a)/100,this._format=n.format||i.format,this._gradientType=n.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=i.ok,this._tc_id=I++}function n(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n,i,a=z(t,e,r),o=D(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;)i.h=(i.h+a)%360,o.push(r(i));return o}function b(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function x(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=D(r,z(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function w(t){return D(1,z(0,t))}function M(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function T(t){return t<=1&&(t=100*t+"%"),t}function A(e){return t.round(255*parseFloat(e)).toString(16)}function S(t){return M(t)/255}function E(t){return!!j.CSS_UNIT.exec(t)}var L=/^\s+/,C=/\s+$/,I=0,P=t.round,D=t.min,z=t.max,O=t.random;r.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 e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=x(t),this._roundA=P(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=P(360*t.h),r=P(100*t.s),n=P(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=P(360*t.h),r=P(100*t.s),i=P(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return a(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=[k(P(t).toString(16)),k(P(e).toString(16)),k(P(r).toString(16)),k(A(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:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(100*_(this._r,255))+"%",g:P(100*_(this._g,255))+"%",b:P(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+P(100*_(this._r,255))+"%, "+P(100*_(this._g,255))+"%, "+P(100*_(this._b,255))+"%)":"rgba("+P(100*_(this._r,255))+"%, "+P(100*_(this._g,255))+"%, "+P(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+o(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},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 r(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(u,arguments)},brighten:function(){return this._applyModification(h,arguments)},darken:function(){return this._applyModification(f,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:T(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:O(),g:O(),b:O()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=function(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(n)).level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,c=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=r(e[u]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var F=r.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"},R=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(F),j=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],544:[function(t,e,r){"use strict";function n(t,e){var r=a(getComputedStyle(t).getPropertyValue(e));return r[0]*i(r[1],t)}function i(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return o;case"cm":return o/2.54;case"mm":return o/25.4;case"pt":return o/72;case"pc":return o/6}return 1}var a=t("parse-unit");e.exports=i;var o=96},{"parse-unit":476}],545:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.topojson=t.topojson||{})}(this,function(t){"use strict";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:"Feature",properties:a,geometry:o}:null==i?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=h[t<0?~t:t],n=0,i=r.length;n1)n=function(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(o);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":!function(t){t.forEach(a)}(t.arcs)}}var s,l=[],c=[];return o(e),c.forEach(null==r?function(t){l.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var i,s,l=1,u=a(n[0]);lu&&(s=n[0],n[0]=n[l],n[l]=s,u=i);return n})}}var a=function(t){return t},o=function(t){if(null==(e=t.transform))return a;var e,r,n,i=e.scale[0],o=e.scale[1],s=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+s,t[1]=(n+=t[1])*o+l,t}},s=function(t){function e(t){l[0]=t[0],l[1]=t[1],s(l),l[0]h&&(h=l[0]),l[1]f&&(f=l[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,s=o(t),l=new Array(2),c=1/0,u=c,h=-c,f=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++eh&&(h=l[0]),l[1]f&&(f=l[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,h,f]}return n},l=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},c=function(t,e){function r(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}var n={},i={},a={},o=[],s=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++s],e[s]=r,e[n]=i)}),e.forEach(function(e){var r,n,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,n=i[l]){delete i[n.start];var c=n===r?r:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[r.start]=a[r.end]=r;else if(r=i[l])if(delete i[r.start],r.unshift(e),r.start=s,n=a[s]){delete a[n.end];var u=n===r?r:n.concat(r);i[u.start=n.start]=a[u.end=r.end]=u}else i[r.start]=a[r.end]=r;else i[(r=[e]).start=s]=a[r.end=l]=r}),r(a,i),r(i,a),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=s(t),o=a[0],l=(a[2]-o)/(e-1)||1,c=a[1],u=(a[3]-c)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,s=t.length,h=t[0],f=h[0]=Math.round((h[0]-o)/l),d=h[1]=Math.round((h[1]-c)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return h(i,i),i}function o(t,e,r,n,i,a,o,l){this.center=s(r),this.up=s(n),this.right=s(i),this.radius=s([a]),this.angle=s([o,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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),h(r,r),i=[].slice.call(i,0,3),h(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];u(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):h(i,i),s=n(p[0],p[1],p[2]);var m=f(r,p)/s,g=f(i,p)/s;c=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)};var s=t("filtered-vector"),l=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),u=t("gl-vec3/cross"),h=t("gl-vec3/normalize"),f=t("gl-vec3/dot"),d=o.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,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];var s=Math.sqrt(i),l=0;for(o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;var c=Math.sqrt(l);for(o=0;o<3;++o)r[o]/=c;var f=this.computedToward;u(f,e,r),h(f,f);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=g*y,w=v*y,M=b,k=-g*b,T=-v*b,A=y,S=this.computedEye,E=this.computedMatrix;for(o=0;o<3;++o){var L=_*r[o]+w*f[o]+M*e[o];E[4*o+1]=k*r[o]+T*f[o]+A*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],I=E[5],P=E[9],D=E[2],z=E[6],O=E[10],F=I*O-P*z,R=P*D-C*O,j=C*z-I*D,N=n(F,R,j);F/=N,R/=N,j/=N,E[0]=F,E[4]=R,E[8]=j;for(o=0;o<3;++o)S[o]=x[o]+E[2+4*o]*d;for(o=0;o<3;++o){l=0;for(var B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[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 a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,p);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],h=a[4],f=a[8],d=u*o+h*s+f*l,p=n(u-=o*d,h-=s*d,f-=l*d),m=(u/=p)*e+o*r,g=(h/=p)*e+s*r,v=(f/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),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,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var c=e[o],u=e[o+4],h=e[o+8];if(a){var f=Math.abs(c),d=Math.abs(u),p=Math.abs(h),m=Math.max(f,d,p);f===m?(c=c<0?-1:1,u=h=0):p===m?(h=h<0?-1:1,c=u=0):(u=u<0?-1:1,c=h=0)}else{var g=n(c,u,h);c/=g,u/=g,h/=g}var v=e[s],y=e[s+4],b=e[s+8],x=v*c+y*u+b*h,_=n(v-=c*x,y-=u*x,b-=h*x),w=u*(b/=_)-h*(y/=_),M=h*(v/=_)-c*b,k=c*y-u*v,T=n(w,M,k);w/=T,M/=T,k/=T,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,c,u,h),this.right.jump(t,v,y,b);var A,S;if(2===o){var E=e[1],L=e[5],C=e[9],I=E*v+L*y+C*b,P=E*w+L*M+C*k;A=F<0?-Math.PI/2:Math.PI/2,S=Math.atan2(P,I)}else{var D=e[2],z=e[6],O=e[10],F=D*c+z*u+O*h,R=D*v+z*y+O*b,j=D*w+z*M+O*k;A=Math.asin(i(F)),S=Math.atan2(j,R)}this.angle.jump(t,S,A),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*W,G-B*W,Y-U*W)},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,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(u,h,f);if(!(d<1e-6)){u/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,b=n(m-=y*o,g-=y*s,v-=y*l);if(!(b<.01&&(m=s*f-l*h,g=l*u-o*f,v=o*h-s*u,(b=n(m,g,v))<1e-6))){m/=b,g/=b,v/=b,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(x,_,w),k=o*u+s*h+l*f,T=m*u+g*h+v*f,A=(x/=M)*u+(_/=M)*h+(w/=M)*f,S=Math.asin(i(k)),E=Math.atan2(A,T),L=this.angle._state,C=L[L.length-1],I=L[L.length-2];C%=2*Math.PI;var P=Math.abs(C+2*Math.PI-E),D=Math.abs(C-E),z=Math.abs(C-2*Math.PI-E);P0?r.pop():new ArrayBuffer(t)}function o(t){return new Uint8Array(a(t),0,t)}function s(t){return new Uint16Array(a(2*t),0,t)}function l(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function u(t){return new Int16Array(a(2*t),0,t)}function h(t){return new Int32Array(a(4*t),0,t)}function f(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function p(t){return b?new Uint8ClampedArray(a(t),0,t):o(t)}function m(t){return new DataView(a(t),0,t)}function g(t){t=v.nextPow2(t);var e=v.log2(t),r=w[e];return r.length>0?r.pop():new n(t)}var v=t("bit-twiddle"),y=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var b="undefined"!=typeof Uint8ClampedArray,x=e.__TYPEDARRAY_POOL;x.UINT8C||(x.UINT8C=y([32,0])),x.BUFFER||(x.BUFFER=y([32,0]));var _=x.DATA,w=x.BUFFER;r.free=function(t){if(n.isBuffer(t))w[v.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|v.log2(e);_[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){i(t.buffer)},r.freeArrayBuffer=i,r.freeBuffer=function(t){w[v.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return o(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return c(t);case"int16":return u(t);case"int32":return h(t);case"float":case"float32":return f(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return g(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=o,r.mallocUint16=s,r.mallocUint32=l,r.mallocInt8=c,r.mallocInt16=u,r.mallocInt32=h,r.mallocFloat32=r.mallocFloat=f,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=p,r.mallocDataView=m,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)x.UINT8[t].length=0,x.UINT16[t].length=0,x.UINT32[t].length=0,x.INT8[t].length=0,x.INT16[t].length=0,x.INT32[t].length=0,x.FLOAT[t].length=0,x.DOUBLE[t].length=0,x.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":68,buffer:78,dup:126}],551:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],554:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&o.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}var a=t("punycode"),o=t("./util");r.parse=i,r.resolve=function(t,e){return i(t,!1,!0).resolve(e)},r.resolveObject=function(t,e){return t?i(t,!1,!0).resolveObject(e):e},r.format=function(t){return o.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)},r.Url=n;var s=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(u),f=["%","/","?",";","#"].concat(h),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=t("querystring");n.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?D+="x":D+=P[z];if(!D.match(p)){var F=C.slice(0,T),R=C.slice(T+1),j=P.match(m);j&&(F.push(j[1]),R.unshift(j[2])),R.length&&(u="/"+R.join(".")+u),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=a.toASCII(this.hostname));var N=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+N,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[w])for(T=0,I=h.length;T0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=M.slice(-1)[0],A=(r.host||t.host||M.length>1)&&("."===T||".."===T)||""===T,S=0,E=M.length;E>=0;E--)"."===(T=M[E])?M.splice(E,1):".."===T?(M.splice(E,1),S++):S&&(M.splice(E,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),A&&"/"!==M.join("/").substr(-1)&&M.push("");var L=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=L?"":M.length?M.shift():"";var C;(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(_=_||r.host&&M.length)&&!L&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":555,punycode:497,querystring:501}],555:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],556:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],557:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],558:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&x(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return p(i)||(i=s(t,i,n)),i}var a=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(h(e))return t.stylize(""+e,"boolean");if(f(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),v=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),b(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(x(e)){var _=e.name?": "+e.name:"";return t.stylize("[Function"+_+"]","special")}if(g(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(y(e))return t.stylize(Date.prototype.toString.call(e),"date");if(b(e))return l(e)}var w="",k=!1,T=["{","}"];if(u(e)&&(k=!0,T=["[","]"]),x(e)){w=" [Function"+(e.name?": "+e.name:"")+"]"}if(g(e)&&(w=" "+RegExp.prototype.toString.call(e)),y(e)&&(w=" "+Date.prototype.toUTCString.call(e)),b(e)&&(w=" "+l(e)),0===o.length&&(!k||0==e.length))return T[0]+w+T[1];if(n<0)return g(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var A;return A=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(A,w,T)}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),l||(t.seen.indexOf(c.value)<0?(l=f(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+l.split("\n").map(function(t){return" "+t}).join("\n")):l=t.stylize("[Circular]","special")),m(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+l}function u(t){return Array.isArray(t)}function h(t){return"boolean"==typeof t}function f(t){return null===t}function d(t){return"number"==typeof t}function p(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return v(t)&&"[object RegExp]"===_(t)}function v(t){return"object"==typeof t&&null!==t}function y(t){return v(t)&&"[object Date]"===_(t)}function b(t){return v(t)&&("[object Error]"===_(t)||t instanceof Error)}function x(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!p(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":561}],563:[function(t,e,r){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":564}],564:[function(t,e,r){"use strict";function n(t,e,r,n){var i=function(t,e){var r=a(t,128);return e?s(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,n),o=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;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}var o=t("pbf"),s=t("./vector-tile-pb"),l=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new l(t[r].features),e[r].name=r;return n({layers:e})},e.exports.GeoJSONWrapper=l},{"./lib/geojson_wrapper":566,"./vector-tile-pb":567,pbf:479}],566:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e=0?e[o]:a})},has___:{value:i(function(e){var i=n(e);return i?r in i:t.indexOf(e)>=0})},set___:{value:i(function(i,a){var o,s=n(i);return s?s[r]=a:(o=t.indexOf(i))>=0?e[o]=a:(o=t.length,e[o]=a,t[o]=i),this})},delete___:{value:i(function(i){var a,o,s=n(i);return s?r in s&&delete s[r]:!((a=t.indexOf(i))<0||(o=t.length-1,t[a]=void 0,e[a]=e[o],t[a]=t[o],t.length=o,e.length=o,0))})}})};x.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 s?function(){function r(){this instanceof x||a();var e,r=new s,n=void 0,l=!1;return e=o?function(t,e){return r.set(t,e),r.has(t)||(n||(n=new x),n.set(t,e)),this}:function(t,e){if(l)try{r.set(t,e)}catch(r){n||(n=new x),n.set___(t,e)}else r.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(function(t,e){return n?r.has(t)?r.get(t):n.get___(t,e):r.get(t,e)})},has___:{value:i(function(t){return r.has(t)||!!n&&n.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!r.delete(t);return n?n.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],569:[function(t,e,r){var n=t("./hidden-store.js");e.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)}}},{"./hidden-store.js":570}],570:[function(t,e,r){e.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}},{}],571:[function(t,e,r){var n=t("./create-store.js");e.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}}}},{"./create-store.js":569}],572:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":148}],573:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,a=this._validateYear(t,i.local.invalidyear),s=f[a-f[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(n=o.newDate(l,c,u)).add(4-(n.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(h/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=h[t-h[0]];if(e>(r>>13?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,i.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var a=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{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");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=h[o.year-h[0]],d=u>>13;c=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var p=0;p>9&4095,v=m>>5&15,y=31&m,b=new Date(g,v-1,y+l);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}(t,s,r,a);return o.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=o.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=n||{}}var o=f[i.year-f[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1;var l,c=(o=f[a.year-f[0]])>>9&4095,u=o>>5&15,d=31&o,p=new Date(c,u-1,d),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-p)/864e5);var g,v=h[a.year-h[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l>13;return!b||g=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:a[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var a={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":590,"object-assign":471}],579:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":590,"object-assign":471}],580:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main");t("object-assign")(n.prototype=new a.baseCalendar,{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,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.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,a.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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+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)}}),a.calendars.hebrew=n},{"../main":590,"object-assign":471}],581:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":590,"object-assign":471}],582:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),i.calendars.julian=n},{"../main":590,"object-assign":471}],583:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main");t("object-assign")(n.prototype=new o.baseCalendar,{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,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);t%=400,t+=t<0?400:0;return 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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":590,"object-assign":471}],584:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.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)}}),i.calendars.nanakshahi=n},{"../main":590,"object-assign":471}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),r=e.year(),n=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;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,c)},_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,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/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=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":590,"object-assign":471}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.taiwan=n},{"../main":590,"object-assign":471}],588:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.thai=n},{"../main":590,"object-assign":471}],589:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth).toJD()-24e5+.5,n=0,o=0;or)return a[n]-a[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),o=12*(n.year()-1)+n.month()-15292;return n.day()+a[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,o=Math.floor((i-1)/12),s=o+1,l=i-12*o,c=e-a[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var a=[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]},{"../main":590,"object-assign":471}],590:[function(t,e,r){function n(){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 i(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.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]}}}),l(i.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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,c.local.invalidDate||c.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),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":471}],591:[function(t,e,r){var n=t("object-assign"),i=t("./main");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=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;b+n1}),u=function(t,e,r,n){var i=""+e;if(c(t,n))for(;i.length1},b=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(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(T));return T+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=m;for(var E=this.daysInMonth(f,d);p>E;E=this.daysInMonth(f,d))d++,p-=E}return h>-1?this.fromJD(h):this.newDate(f,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,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":590,"object-assign":471}],592:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":111}],593:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":592}],594:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),h=c("clicktoshow");if(!u&&!h)return e;a(t,e,r,c);for(var f=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},g=0;g<2;g++){var v=d[g],y=i.coerceRef(t,e,m,v,"","paper");if(i.coercePosition(e,m,c,y,v,.5),f){var b="a"+v,x=i.coerceRef(t,e,m,b,"pixel");"pixel"!==x&&x!==y&&(x=e[b]="pixel");var _="pixel"===x?p[g]:.4;i.coercePosition(e,m,c,x,b,_)}c(v+"anchor"),c(v+"shift")}if(n.noneOrAll(t,e,["x","y"]),f&&n.noneOrAll(t,e,["ax","ay"]),h){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":738,"../../plots/cartesian/axes":785,"./attributes":596,"./common_defaults":599}],595:[function(t,e,r){"use strict";e.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}]},{}],596:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},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:"calcIfAutorange"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":790,"../../plots/font_attributes":810,"./arrow_paths":595}],597:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,s=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=1,s[t.yref]=1});for(var l in s){var c=a.getFromId(t,l);if(c&&c.autorange)return i.syncOrAsync([o,n],t)}}}},{"../../lib":738,"../../plots/cartesian/axes":785,"./draw":602}],598:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s,l,c,u=t._fullLayout.annotations,h=[],f=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,i=n(t,e),o=i.on,s=i.off.concat(i.explicitOff),l={};if(o.length||s.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var a=j.selectAll("a");if(1===a.size()&&a.text()===j.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(z.node())}var c=C.select(".annotation-text-math-group"),f=!c.empty(),v=h.bBox((f?c:j).node()),y=v.width,L=v.height,P=e.width||y,R=e.height||L,N=Math.round(P+2*D),B=Math.round(R+2*D);e._w=P,e._h=R;for(var U=!1,V=["x","y"],H=0;H1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;q=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],q=_.l+_.w*Y):(Y=1-e[Z],q=_.t+_.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=q;var st=e["a"+Z];X=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=q+st,G=X+st),at.text=at.tail+X;var lt=x["x"===Z?"width":"height"];if("paper"===J&&(at.head=l.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*r(W,nt),at.text=q+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)C.remove();else{var ht=0,ft=0;if("left"!==e.align&&(ht=(P-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ft=(R-L)*("middle"===e.valign?.5:1)),f)c.select("svg").attr({x:D+ht-1,y:D+ft}).call(h.setClipUrl,O?M:null);else{var dt=D+ft-v.top,pt=D+ht-v.left;j.call(d.positionText,pt,dt).call(h.setClipUrl,O?M:null)}F.select("rect").call(h.setRect,D,D,P,R),z.call(h.setRect,I/2,I/2,N-I,B-I),C.call(h.setTranslate,Math.round(k.x.text-N/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+T+","+k.x.text+","+k.y.text+")"});var mt=function(r,a){A.selectAll(".annotation-arrow-g").remove();var c=k.x.head,f=k.y.head,d=k.x.tail+r,p=k.y.tail+a,v=k.x.text+r,y=k.y.text+a,x=l.rotationXYMatrix(T,v,y),M=l.apply2DTransform(x),E=l.apply2DTransform2(x),L=+z.attr("width"),I=+z.attr("height"),P=v-.5*L,D=P+L,O=y-.5*I,F=O+I,R=[[P,O,P,F],[P,F,D,F],[D,F,D,O],[D,O,P,O]].map(E);if(!R.reduce(function(t,e){return t^!!l.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=l.segmentsIntersect(d,p,c,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var j=e.arrowwidth,N=e.arrowcolor,B=e.arrowside,U=A.append("g").style({opacity:u.opacity(N)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+f).style("stroke-width",j+"px").call(u.stroke,u.rgb(N));if(g(V,B,e),w.annotationPosition&&V.node().parentNode&&!n){var H=c,q=f;if(e.standoff){var G=Math.sqrt(Math.pow(c-d,2)+Math.pow(f-p,2));H+=e.standoff*(d-c)/G,q+=e.standoff*(p-f)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-H)+","+(p-q),transform:"translate("+H+","+q+")"}).style("stroke-width",j+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),gd:t,prepFn:function(){var t=h.getTranslate(C);W=t.x,X=t.y,Y={},i&&i.autorange&&(Y[i._name+".autorange"]=!0),s&&s.autorange&&(Y[s._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(W,X),a=n[0]+t,o=n[1]+r;C.call(h.setTranslate,a,o),Y[b+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,Y[b+".y"]=s?s.p2r(s.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(Y[b+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[b+".ay"]=s.p2r(s.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+T+","+a+","+o+")"})},doneFn:function(){o.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),E){var gt,vt;m.init({element:C.node(),gd:t,prepFn:function(){vt=S.attr("transform"),gt={}},moveFn:function(t,r){var a="pointer";if(e.showarrow)e.axref===e.xref?gt[b+".ax"]=i.p2r(i.r2p(e.ax)+t):gt[b+".ax"]=e.ax+t,e.ayref===e.yref?gt[b+".ay"]=s.p2r(s.r2p(e.ay)+r):gt[b+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)gt[b+".x"]=e.x+t/i._m;else{var o=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-o/2;gt[b+".x"]=m.align(l+t/_.w,o,0,1,e.xanchor)}if(s)gt[b+".y"]=e.y+r/s._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;gt[b+".y"]=m.align(u-r/_.h,c,0,1,e.yanchor)}i&&s||(a=m.getCursor(i?.5:gt[b+".x"],s?.5:gt[b+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+vt}),p(C,a)},doneFn:function(){p(C),o.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}var y,b,x=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,b=n+".annotations["+r+"]"):(y="annotation",b="annotations["+r+"]"),x._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+x._uid+"_ann"+r;if(e._input&&!1!==e.visible){var k={x:{},y:{}},T=+e.textangle||0,A=x._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=A.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:a.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();f.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:t})}).on("mouseout",function(){f.loneUnhover(x._hoverlayer.node())});var I=e.borderwidth,P=e.borderpad,D=I+P,z=C.append("rect").attr("class","bg").style("stroke-width",I+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),O=e.width||e.height,F=x._topclips.selectAll("#"+M).data(O?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),F.exit().remove();var R=e.font,j=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?j.call(d.makeEditable,{delegate:C,gd:t}).call(c).on("edit",function(r){e.text=r,this.call(c);var n={};n[b+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),s&&s.autorange&&(n[s._name+".autorange"]=!0),o.relayout(t,n)}):j.call(c)}else a.selectAll("#"+M).remove()}var a=t("d3"),o=t("../../plotly"),s=t("../../plots/plots"),l=t("../../lib"),c=t("../../plots/cartesian/axes"),u=t("../color"),h=t("../drawing"),f=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,b=d.backoff*m+r.standoff,x=p.backoff*g+r.startstandoff;if("line"===f.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var _=l.x-c.x,w=l.y-c.y;if(u=Math.atan2(w,_),h=u+Math.PI,b&&x&&b+x>Math.sqrt(_*_+w*w))return void o();if(b){if(b*b>_*_+w*w)return void o();var M=b*Math.cos(u),k=b*Math.sin(u);c.x+=M,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(x){if(x*x>_*_+w*w)return void o();var T=x*Math.cos(u),A=x*Math.sin(u);l.x-=T,l.y-=A,t.attr({x1:l.x,y1:l.y})}}else if("path"===f.nodeName){var S=f.getTotalLength(),E="";if(S1){c=!0;break}}c?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))}}},{"../../plots/gl3d/project":835,"../annotations/draw":602}],609:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);1!==n.getAlpha()&&(n=i(o.combine(t,c)));return(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e0?E>=O:E<=O));L++)E>R&&E0?E>=O:E<=O));L++)E>C[0]&&E1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[K+X,K+G-X],et.setScale();var st=A._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");et._axislayer=st.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ut,ht=S.l+(k.x+Y)*S.w,ft=et.titlefont.size;ut="top"===k.titleside?(1-(K+G-X))*S.h+S.t+3+.75*ft:(1-(K+X))*S.h+S.t-3-.25*ft,T(et._id+"title",{attributes:{x:ht,y:ut,"text-anchor":"start"}})}var dt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),a=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+et._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=parseInt(r.node().style.fontSize,10)*v),o?(ct=d.bBox(o).height)>s&&(a[1]-=(ct-s)/2):r.node()&&!r.classed(w.jsPlaceholder)&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===k.titleside)et.domain[1]-=ct/S.h,a[1]*=-1;else{et.domain[0]+=ct/S.h;var c=g.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(S.h*(1-et.domain[1]))+")"),et._axislayer.attr("transform","translate(0,"+Math.round(-S.t)+")");var h=st.select(".cbfills").selectAll("rect.cbfill").data(P);h.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var r=[0===e?C[0]:(P[e]+P[e-1])/2,e===P.length-1?C[1]:(P[e]+P[e+1])/2].map(et.c2p).map(Math.round);e!==P.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=z(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var f=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?I:[]);return f.enter().append("path").classed(w.cbline,!0),f.exit().remove(),f.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+k.line.width/2%1)+"h"+V).call(d.lineGroupStyle,k.line.width,D(t),k.line.dash)}),et._axislayer.selectAll("g."+et._id+"tick,path").remove(),et._pos=Z+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),et.side="right",u.syncOrAsync([function(){return l.doTicks(t,et,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=et.titlefont.size,r=et._offset+et._length/2,i=S.l+(et.position||0)*S.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));T("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:k.titleside,offsetLeft:S.l,offsetTop:0,maxShift:A.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var r=V+k.outlinewidth/2+d.bBox(et._axislayer.node()).width;if((N=lt.select("text")).node()&&!N.classed(w.jsPlaceholder)){var n,i=lt.select(".h"+et._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(k.titleside)?d.bBox(i).width:d.bBox(lt.node()).right-Z-S.l,r=Math.max(r,n)}var a=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,s=Q-$;st.select(".cbbg").attr({x:Z-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:$-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:$+k.ypad+("top"===k.titleside?ct:0),width:Math.max(V,2),height:Math.max(s-2*k.ypad-ct,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var l=({center:.5,right:1}[k.xanchor]||0)*a;st.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:a*({right:1,center:.5}[k.xanchor]||0),r:a*({left:1,center:.5}[k.xanchor]||0),t:s*({bottom:1,middle:.5}[k.yanchor]||0),b:s*({top:1,middle:.5}[k.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition){var pt,mt,gt;c.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),f(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),mt=c.align(J+t/S.w,H,0,1,k.xanchor),gt=c.align(K-e/S.h,G,0,1,k.yanchor);var r=c.getCursor(mt,gt,k.xanchor,k.yanchor);f(st,r)},doneFn:function(){f(st),void 0!==mt&&void 0!==gt&&a.restyle(t,{"colorbar.x":mt,"colorbar.y":gt},M().index)}})}return dt}A._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":738,"./flip_scale":625,"./scales":632}],621:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":727,"./attributes":619,"./scales.js":632}],622:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":632}],623:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var h=u.prefix,f=u.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,g=p[f+"min"],v=p[f+"max"],y=p.colorscale;c(h+f+"auto",!(n(g)&&n(v)&&g=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],626:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":622,"./is_valid_scale_array":630,"./scales":632}],627:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],634:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.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]}},{"../../lib":738}],635:[function(t,e,r){"use strict";function n(){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 i(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t("mouse-event-offset"),o=t("has-hover"),s=t("../../plotly"),l=t("../../lib"),c=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),h=e.exports={};h.align=t("./align"),h.getCursor=t("./cursor");var f=t("./unhover");h.unhover=f.wrapped,h.unhoverRaw=f.raw,h.init=function(t){function e(e){x._dragged=!1,x._dragging=!0;var s=i(e);return f=s[0],d=s[1],y=e.target,v=e,b=e.buttons&&2===e.buttons||e.ctrlKey,(p=(new Date).getTime())-x._mouseDownTimew&&(_=Math.max(_-1,1)),x._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(_,v),!b){var n;try{n=new MouseEvent("click",e)}catch(t){var c=i(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,c[0],c[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}y.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&s.plot(t)}(x),x._dragged=!1,l.pauseEvent(e)}x._dragged=!1}var f,d,p,m,g,v,y,b,x=t.gd,_=1,w=u.DBLCLICKDELAY,M=t.element;x._mouseDownTime||(x._mouseDownTime=0),M.style.pointerEvents="all",M.onmousedown=e,M.ontouchstart=e},h.coverSlip=n},{"../../constants/interactions":716,"../../lib":738,"../../plotly":780,"../../plots/cartesian/constants":790,"./align":633,"./cursor":634,"./unhover":636,"has-hover":289,"mouse-event-offset":454}],636:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){t=a(t),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&&!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}))}},{"../../lib/events":726,"../../lib/get_graph_div":733,"../../lib/throttle":762,"../fx/constants":650}],637:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],638:[function(t,e,r){"use strict";function n(t,e){var r=t%100;return _.symbolFuncs[r](e)+(t>=200?k:"")}function i(t,e,r,n){var i=l.select(t.node().parentNode),a=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",o=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=n?n/.8+1:0,c=(m.lineCount(t)-1)*v+1,u=S[o]*s,h=.75*r+S[a]*s+(S[a]-1)*c*r/2;t.attr("text-anchor",o),i.attr("transform","translate("+u+","+h+")")}function a(t,e){var r=t.ts||e.textfont.size;return c(r)&&r>0?r:0}function o(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],c=Math.pow(i*i+a*a,E/2),u=Math.pow(o*o+s*s,E/2),h=(u*u*i-c*c*o)*n,f=(u*u*a-c*c*s)*n,d=3*u*(c+u),p=3*c*(c+u);return[[l.round(e[0]+(d&&h/d),2),l.round(e[1]+(d&&f/d),2)],[l.round(e[0]-(p&&h/p),2),l.round(e[1]-(p&&f/p),2)]]}function s(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var l=t("d3"),c=t("fast-isnumeric"),u=t("tinycolor2"),h=t("../../registry"),f=t("../color"),d=t("../colorscale"),p=t("../../lib"),m=t("../../lib/svg_text_utils"),g=t("../../constants/xmlns_namespaces"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../constants/interactions").DESELECTDIM,b=t("../../traces/scatter/subtypes"),x=t("../../traces/scatter/make_bubble_size_func"),_=e.exports={};_.font=function(t,e,r,n){p.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(f.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,i){t.call(_.setPosition,e,r).call(_.setSize,n,i)},_.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(c(i)&&c(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},_.translatePoints=function(t,e,r){t.each(function(t){var n=l.select(this);_.translatePoint(t,n,e,r)})},_.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(e){var i=e[0].trace,a=i.xcalendar,o=i.ycalendar;t.selectAll(".point,.textpoint").each(function(t){_.hideOutsideRangePoint(t,l.select(this),r,n,a,o)})})}},_.crispRound=function(t,e,r){return e&&c(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";f.stroke(e,n||a.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,o=n||i.dash||"";l.select(this).call(f.stroke,r||i.color).call(_.dashLine,o,a)})},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.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},_.singleFillStyle=function(t){var e=(((l.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(f.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=l.select(this);try{r.call(f.fill,e[0].trace.fillcolor)}catch(e){p.error(e,t),r.remove()}})};var w=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolList=[],Object.keys(w).forEach(function(t){var e=w[t];_.symbolList=_.symbolList.concat([e.n,t,e.n+100,t+"-open"]),_.symbolNames[e.n]=t,_.symbolFuncs[e.n]=e.f,e.needLine&&(_.symbolNeedLines[e.n]=!0),e.noDot?_.symbolNoDot[e.n]=!0:_.symbolList=_.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var M=_.symbolNames.length,k="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";_.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=M||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},A={x1:0,x2:0,y1:1,y2:0};_.gradient=function(t,e,r,n,i,a){var o=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],p.identity);o.exit().remove(),o.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=l.select(this);"horizontal"===n?t.attr(T):"vertical"===n&&t.attr(A),t.attr("id",r);var e=u(i),o=u(a);t.append("stop").attr({offset:"0%","stop-color":f.tinyRGB(o),"stop-opacity":o.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":f.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},_.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},_.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;!function(t,e,r,i,a,o,s,l){if(h.traceIs(r,"symbols")){var c=x(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:b.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var i=_.symbolNumber(t.mx||o.symbol)||0;return t.om=i%200>=100,n(i,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var u,d,p,m=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,u=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?f.defaultLine:s.color,Array.isArray(o.color)&&(u=f.defaultLine,m=!0),u="mc"in t?t.mcc=i(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(f.stroke,u).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=o.gradient,v=t.mgt;if(v?m=!0:v=g&&g.type,v&&"none"!==v){var y=t.mgc;y?m=!0:y=g.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(_.gradient,l,w,v,u,y)}else e.call(f.fill,u);p&&e.call(f.stroke,d)}}(t,e,r,i,a,s,s.line,o)},_.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=_.tryColorscale(n,""),a=_.tryColorscale(n,"line");t.each(function(t){_.singlePointStyle(t,l.select(this),e,i,a,r)})}},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},s=i.marker||{},c=a.opacity,u=o.opacity,d=s.opacity,p=void 0!==u,m=void 0!==d;t.each(function(t){var e,r=l.select(this),n=t.mo,i=void 0!==n;(i||p||m)&&(t.selected?p&&(e=u):e=m?d:y*(i?n:c)),void 0!==e&&r.style("opacity",e)});var g=o.color,v=s.color;(g||v)&&t.each(function(t){var e,r=l.select(this);t.selected?g&&(e=g):v&&(e=v),e&&f.fill(r,e)});var b=o.size,x=s.size,w=void 0!==b,M=void 0!==x;h.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=l.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?b/2:i:M?x/2:i,r.attr("d",n(_.symbolNumber(o),e)),t.mrc2=e})}},_.tryColorscale=function(t,e){var r=e?p.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?d.makeColorScaleFunc(d.extractScale(n,r.cmin,r.cmax)):p.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};_.textPointStyle=function(t,e,r){t.each(function(t){var n=l.select(this),o=p.extractOption(t,e,"tx","text");if(o){var s=t.tp||e.textposition,c=a(t,e);n.call(_.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).text(o).call(m.convertToTspans,r).call(i,s,c,t.mrc)}else n.remove()})},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},n=e.unselected||{};t.each(function(t){var o,s=l.select(this),c=t.tc||e.textfont.color,u=t.tp||e.textposition,h=a(t,e),d=(r.textfont||{}).color,p=(n.textfont||{}).color;t.selected?d&&(o=d):p?o=p:d||(o=f.addOpacity(c,y)),o&&f.fill(s,o),i(s,u,h,t.mrc2||t.mrc)})}};var E=.5;_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(_.savedBBoxes={},C=0),r&&(_.savedBBoxes[r]=v),C++,p.extendFlat({},v)},_.setClipUrl=function(t,e){if(e){var r="#"+e,n=l.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},_.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}},_.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+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.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}},_.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+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var I=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=l.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),o=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(I);t=1===e&&1===r?[]:["translate("+a+","+o+")","scale("+e+","+r+")","translate("+-a+","+-o+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":711,"../../constants/interactions":716,"../../constants/xmlns_namespaces":719,"../../lib":738,"../../lib/svg_text_utils":761,"../../registry":861,"../../traces/scatter/make_bubble_size_func":1071,"../../traces/scatter/subtypes":1076,"../color":613,"../colorscale":628,"./symbol_defs":639,d3:123,"fast-isnumeric":132,tinycolor2:543}],639:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:123}],640:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],641:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=[];if(a.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(a),u=0;u0;t.each(function(t){var u,h=t[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(u=function(t){return t.id});var p=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,u);if(m.exit().remove(),t.length){f.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(m,e.layerClipId),m.each(function(t){var e=n.select(this),a=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,s,l);if(!p||t.vis){var o;if(d.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var u=d.width;o="M"+(a.x-u)+","+a.yh+"h"+2*u+"m-"+u+",0V"+a.ys,a.noYS||(o+="m-"+u+",0h"+2*u);var h=e.select("path.yerror");!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(h=h.transition().duration(r.duration).ease(r.easing)),h.attr("d",o)}if(f.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var m=(f.copy_ystyle?d:f).width;o="M"+a.xh+","+(a.y-m)+"v"+2*m+"m0,-"+m+"H"+a.xs,a.noXS||(o+="m0,-"+m+"v"+2*m);var g=e.select("path.xerror");!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1076,"../drawing":638,d3:123,"fast-isnumeric":132}],646:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.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)})}},{"../color":613,d3:123}],647:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":810}],648:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||i.identity,Array.isArray(t)&&(e[0][r]=n(t))}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){function e(t){return function(e){return i.coerceHoverinfo({hoverinfo:e},{_module:t._module},o)}}for(var r=t.calcdata,o=t._fullLayout,s=0;s=0&&r.indexK.width||J<0||J>K.height)return g.unhoverRaw(t,e)}if(z="xval"in e?b.flat(f,e.xval):b.p2c(S,Z),O="yval"in e?b.flat(f,e.yval):b.p2c(E,J),!l(z[0])||!l(O[0]))return u.warn("Fx.hover failed",e,t),g.unhoverRaw(t,e)}var Q=1/0;for(R=0;RY&&(W.splice(0,Y),Q=W[0].distance)}if(0===W.length)return g.unhoverRaw(t,e);W.sort(function(t,e){return t.distance-e.distance});var nt=t._hoverdata,it=[];for(F=0;F1,st=i(W,{hovermode:D,rotateLabels:ot,bgColor:m.combine(_.plot_bgcolor||m.background,_.paper_bgcolor),container:_._hoverlayer,outerContainer:_._paperdiv,commonLabelOpts:_.hoverlabel},t);if(function(t,e,r){function n(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--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}var i,a,o,s,l,c,u,h=0,f=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?M:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});for(;!i&&h<=t.length;){for(h++,i=!0,s=0;s.01&&m.pmin===g.pmin&&m.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),f.splice(s+1,1),u=0,l=d.length-1;l>=0;l--)u+=d[l].dp;for(o=u/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;i=!1}else s++}f.forEach(n)}for(s=f.length-1;s>=0;s--){var v=f[s];for(l=v.length-1;l>=0;l--){var y=v[l],b=t[y.i];b.offset=y.dp,b.del=y.del}}}(W,ot?"xa":"ya",_),a(st,ot),e.target&&e.target.tagName){var lt=y.getComponentMethod("annotations","hasClickToShow")(t,it);d(s.select(e.target),lt?"pointer":"")}e.target&&!n&&o(t,e,nt)&&(nt&&t.emit("plotly_unhover",{event:e,points:nt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:z,yvals:O}))}function i(t,e,r){var n,i=e.hovermode,a=e.rotateLabels,o=e.bgColor,l=e.container,c=e.outerContainer,u=e.commonLabelOpts||{},h=e.fontFamily||x.HOVERFONT,d=e.fontSize||x.HOVERFONTSIZE,g=t[0],v=g.xa,y=g.ya,b="y"===i?"yLabel":"xLabel",w=g[b],M=(String(w)||"").split(" ")[0],k=c.node().getBoundingClientRect(),T=k.top,E=k.width,L=k.height,C=g.distance<=x.MAXDIST&&("x"===i||"y"===i);for(n=0;n-1&&n.length>v&&(n=v>3?n.substr(0,v-3)+"...":n.substr(0,v))}void 0!==t.extraText&&(l+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),l+=(l?"z: ":"")+t.zLabel):C&&t[i+"Label"]===w?l=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(l+=(l?"
":"")+t.text),""===l&&(""===n&&e.remove(),l=n);var y=e.select("text.nums").call(p.font,t.fontFamily||h,t.fontSize||d,t.fontColor||g).text(l).attr("data-notex",1).call(f.positionText,0,0).call(f.convertToTspans,r),b=e.select("text.name"),x=0;n&&n!==l?(b.call(p.font,t.fontFamily||h,t.fontSize||d,u).text(n).attr("data-notex",1).call(f.positionText,0,0).call(f.convertToTspans,r),x=b.node().getBoundingClientRect().width+2*S):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:g});var M,k,I=y.node().getBoundingClientRect(),P=t.xa._offset+(t.x0+t.x1)/2,D=t.ya._offset+(t.y0+t.y1)/2,z=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),F=I.width+A+S+x;t.ty0=T-I.top,t.bx=I.width+2*S,t.by=I.height+2*S,t.anchor="start",t.txwidth=I.width,t.tx2width=x,t.offset=0,a?(t.pos=P,M=D+O/2+F<=L,k=D-O/2-F>=0,"top"!==t.idealAlign&&M||!k?M?(D+=O/2,t.anchor="start"):t.anchor="middle":(D-=O/2,t.anchor="end")):(t.pos=D,M=P+z/2+F<=E,k=P-z/2-F>=0,"left"!==t.idealAlign&&M||!k?M?(P+=z/2,t.anchor="start"):t.anchor="middle":(P-=z/2,t.anchor="end")),y.attr("text-anchor",t.anchor),x&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+P+","+D+")"+(a?"rotate("+_+")":""))}),D}function a(t,e){t.each(function(t){var r=s.select(this);if(t.del)r.remove();else{var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(A+S),l=o+a*(t.txwidth+S),c=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,l-=t.tx2width/2),e&&(u*=-T,c=t.offset*k),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*A+c)+","+(A+u)+"v"+(t.by/2-A)+"h"+n*t.bx+"v-"+t.by+"H"+(n*A+c)+"V"+(u-A)+"Z"),i.call(f.positionText,o+c,u+t.ty0-t.by/2+S),t.tx2width&&(r.select("text.name").call(f.positionText,l+a*S+c,u+t.ty0-t.by/2+S),r.select("rect").call(p.setRect,l+(a-1)*t.tx2width/2+c,u-t.by/2-1,t.tx2width,t.by+2))}})}function o(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var s=t("d3"),l=t("fast-isnumeric"),c=t("tinycolor2"),u=t("../../lib"),h=t("../../lib/events"),f=t("../../lib/svg_text_utils"),d=t("../../lib/override_cursor"),p=t("../drawing"),m=t("../color"),g=t("../dragelement"),v=t("../../plots/cartesian/axes"),y=t("../../registry"),b=t("./helpers"),x=t("./constants"),_=x.YANGLE,w=Math.PI*_/180,M=1/Math.sin(w),k=Math.cos(w),T=Math.sin(w),A=x.HOVERARROWSIZE,S=x.HOVERTEXTPAD;r.hover=function(t,e,r,i){t=u.getGraphDiv(t),u.throttle(t._fullLayout._uid+x.HOVERID,x.HOVERMINTIME,function(){n(t,e,r,i)})},r.loneHover=function(t,e){var r={color:t.color||m.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=s.select(e.container),o=e.outerContainer?s.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||m.background,container:n,outerContainer:o},c=i([r],l,e.gd);return a(c,l.rotateLabels),c.node()}},{"../../lib":738,"../../lib/events":726,"../../lib/override_cursor":749,"../../lib/svg_text_utils":761,"../../plots/cartesian/axes":785,"../../registry":861,"../color":613,"../dragelement":635,"../drawing":638,"./constants":650,"./helpers":652,d3:123,"fast-isnumeric":132,tinycolor2:543}],654:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){r("hoverlabel.bgcolor",(i=i||{}).bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":738}],655:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),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:t("./hover").hover,unhover:a.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":738,"../dragelement":635,"./attributes":647,"./calc":648,"./click":649,"./constants":650,"./defaults":651,"./helpers":652,"./hover":653,"./layout_attributes":656,"./layout_defaults":657,"./layout_global_defaults":658,d3:123}],656:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":810,"./constants":650}],657:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("dragmode");var o;e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,r=0;r=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],665:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":810,"../color/attributes":612}],666:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],667:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,h,f,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(c=0,h="left",u=1.1,f="bottom"):(c=0,h="left",u=-.1,f="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",h),l("y",u),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":738,"../../plots/layout_attributes":837,"../../registry":861,"./attributes":665,"./helpers":671}],668:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*b;if(o){var l=d.bBox(o);n=l.height,i=l.width,d.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),u=m.lineCount(c),h=c.node();n=s*u,i=h?d.bBox(h).width:0;var f=s*(.3+(1-u)/2);m.positionText(c,40,f)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,o=h.traceIs(a,"pie"),s=a.index,u=o?n.label:a.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.edits.legendText&&!o?f.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(o.type))u[(a=n.trace.transforms)[a.length-1].direction+".name"]=t;else if(h.hasTransform(o,"groupby")){var f=h.getTransformIndices(o,"groupby"),d=f[f.length-1],p=c.keyedContainer(o,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),u=p.constructUpdate()}else u.name=t;return l.restyle(e,u,s)}):f.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(p.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){g(t,e,n)},k):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,g(t,e,n))}})}function a(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=w.isGrouped(i),l=0;if(i.width=0,i.height=0,w.isVertical(i))o&&e.each(function(t,e){d.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;d.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),l=40;else if(o){for(var c=[i.width],u=e.data(),h=0,f=u.length;ha+_-M,r.each(function(t){var e=t[0],r=g?40+t[0].width:b;a+x+M+r>n.width-(n.margin.r+n.margin.l)&&(x=0,v+=y,i.height=i.height+y,y=0),d.setTranslate(this,a+x,5+a+e.height/2+v),i.width+=M+r,i.height=Math.max(i.height,e.height),x+=M+r,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];s.select(this).select(".legendtoggle").call(d.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+l,r.height)})}function o(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center");var n="top";M.isBottomAnchor(e)?n="bottom":M.isMiddleAnchor(e)&&(n="middle"),u.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/plots"),h=t("../../registry"),f=t("../dragelement"),d=t("../drawing"),p=t("../color"),m=t("../../lib/svg_text_utils"),g=t("./handle_click"),v=t("./constants"),y=t("../../constants/interactions"),b=t("../../constants/alignment").LINE_SPACING,x=t("./get_legend_data"),_=t("./style"),w=t("./helpers"),M=t("./anchor_utils"),k=y.DBLCLICKDELAY;e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(d.setTranslate,0,e),L.call(d.setRect,j,t,v.scrollBarWidth,v.scrollBarHeight),A.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,m="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&x(t.calcdata,y),w=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+m).remove(),void u.autoMargin(t,"legend");var T=r._infolayer.selectAll("g.legend").data([0]);T.enter().append("g").attr({class:"legend","pointer-events":"all"});var A=r._topdefs.selectAll("#"+m).data([0]);A.enter().append("clipPath").attr("id",m).append("rect");var S=T.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(p.stroke,y.bordercolor),S.call(p.fill,y.bgcolor),S.style("stroke-width",y.borderwidth+"px");var E=T.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var L=T.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(p.fill,"#808BA4");var C=E.selectAll("g.groups").data(b);C.enter().append("g").attr("class","groups"),C.exit().remove();var I=C.selectAll("g.traces").data(c.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.call(_,t).style("opacity",function(t){var e=t[0].trace;return h.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){s.select(this).call(n,t).call(i,t)});var P=0!==T.enter().size();P&&(a(t,C,I),o(t));var D=r.width,z=r.height;a(t,C,I),y.height>z?function(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center"),u.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}(t):o(t);var O=r._size,F=O.l+O.w*y.x,R=O.t+O.h*(1-y.y);M.isRightAnchor(y)?F-=y.width:M.isCenterAnchor(y)&&(F-=y.width/2),M.isBottomAnchor(y)?R-=y.height:M.isMiddleAnchor(y)&&(R-=y.height/2);var j=y.width,N=O.w;j>N?(F=O.l,j=N):(F+j>D&&(F=D-j),F<0&&(F=0),j=Math.min(D-F,y.width));var B=y.height,U=O.h;B>U?(R=O.t,B=U):(R+B>z&&(R=z-B),R<0&&(R=0),B=Math.min(z-R,y.height)),d.setTranslate(T,F,R);var V,H,q=B-v.scrollBarHeight-2*v.scrollBarMargin,G=y.height-B;if(y.height<=B||t._context.staticPlot)S.attr({width:j-y.borderwidth,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),d.setTranslate(E,0,0),A.select("rect").attr({width:j-2*y.borderwidth,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),E.call(d.setClipUrl,m);else{V=v.scrollBarMargin,H=E.attr("data-scroll")||0,S.attr({width:j-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),A.select("rect").attr({width:j-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-H}),E.call(d.setClipUrl,m),P&&e(V,H),T.on("wheel",null),T.on("wheel",function(){H=c.constrain(E.attr("data-scroll")-s.event.deltaY/q*G,-G,0),e(V=v.scrollBarMargin-H/G*q,H),0!==H&&H!==-G&&s.event.preventDefault()}),L.on(".drag",null),E.on(".drag",null);var Y=s.behavior.drag().on("drag",function(){V=c.constrain(s.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+q),H=-(V-v.scrollBarMargin)/q*G,e(V,H)});L.call(Y),E.call(Y)}if(t._context.edits.legendPosition){var W,X,Z,J;T.classed("cursor-move",!0),f.init({element:T.node(),gd:t,prepFn:function(){var t=d.getTranslate(T);Z=t.x,J=t.y},moveFn:function(t,e){var r=Z+t,n=J+e;d.setTranslate(T,r,n),W=f.align(r,0,O.l,O.l+O.w,y.xanchor),X=f.align(n,0,O.t+O.h,O.t,y.yanchor)},doneFn:function(){void 0!==W&&void 0!==X&&l.relayout(t,{"legend.x":W,"legend.y":X})},clickFn:function(e,n){var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===e?T._clickTimeout=setTimeout(function(){g(i,t,e)},k):2===e&&(T._clickTimeout&&clearTimeout(T._clickTimeout),g(i,t,e)))}})}}}},{"../../constants/alignment":711,"../../constants/interactions":716,"../../lib":738,"../../lib/svg_text_utils":761,"../../plotly":780,"../../plots/plots":846,"../../registry":861,"../color":613,"../dragelement":635,"../drawing":638,"./anchor_utils":664,"./constants":666,"./get_legend_data":669,"./handle_click":670,"./helpers":671,"./style":673,d3:123}],669:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],c=!1,u={},h=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],h=u.trace,f=l.hasMarkers(h),d=l.hasText(h),p=l.hasLines(h);if(f||d||p){var m={},g={};f&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(h,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(f?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),f&&(s[0].mrc=3);var b=v.selectAll("g.pointtext").data(d?s:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,c,e)})}},{"../../lib":738,"../../registry":861,"../../traces/pie/style_one":1040,"../../traces/scatter/subtypes":1076,"../color":613,"../drawing":638,d3:123}],674:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=f.list(t,null,!0),h="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),i(y,r);f&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var b=function(t){for(var e=a.list({_fullLayout:t},null,!0),r=0;r0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;ad&&(d=h)));return d>=f?[f,d]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sq&&n>G&&!t.shiftKey?h.getCursor(i/r,1-a/n):"move";f(e,o),H=o.split("-")[0]}function c(n,o){if("path"===r.type){var s=function(t){return U(N(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};j&&"date"===j.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else d[b]=r.x0=U(m+n),d[x]=r.y0=V(g+o),d[_]=r.x1=U(v+n),d[w]=r.y1=V(y+o);e.attr("d",i(t,r))}function u(n,o){if("path"===r.type){var s=function(t){return U(N(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};j&&"date"===j.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else{var c=~H.indexOf("n")?M+o:M,u=~H.indexOf("s")?k+o:k,h=~H.indexOf("w")?T+n:T,f=~H.indexOf("e")?A+n:A;u-c>G&&(d[S]=r[I]=V(c),d[E]=r[P]=V(u)),f-h>q&&(d[L]=r[D]=U(h),d[C]=r[z]=U(f))}e.attr("d",i(t,r))}var d,m,g,v,y,b,x,_,w,M,k,T,A,S,E,L,C,I,P,D,z,O,F,R,j,N,B,U,V,H,q=10,G=10,Y={element:e.node(),gd:t,prepFn:function(e){R=l.getFromId(t,r.xref),j=l.getFromId(t,r.yref),N=p.getDataToPixel(t,R),B=p.getDataToPixel(t,j,!0),U=p.getPixelToData(t,R),V=p.getPixelToData(t,j,!0);var i="shapes["+n+"]";"path"===r.type?(O=r.path,F=i+".path"):(m=N(r.x0),g=B(r.y0),v=N(r.x1),y=B(r.y1),b=i+".x0",x=i+".y0",_=i+".x1",w=i+".y1");ml&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),s.log("Ignoring extra params in segment "+t)),i+c})}(e.path,n,a);var f=n(e.x0),m=n(e.x1),g=a(e.y0),v=a(e.y1);if("line"===o)return"M"+f+","+g+"L"+m+","+v;if("rect"===o)return"M"+f+","+g+"H"+m+"V"+v+"H"+f+"Z";var y=(f+m)/2,b=(g+v)/2,x=Math.abs(y-f),_=Math.abs(b-g),w="A"+x+","+_,M=y+x+","+b;return"M"+M+w+" 0 1,1 "+(y+","+(b-_))+w+" 0 0,1 "+M+"Z"}function a(t,e,r){return t.replace(d.segmentRE,function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),h=t("../dragelement"),f=t("../../lib/setcursor"),d=t("./constants"),p=t("./helpers");e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r0)){n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font);n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.steps;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":738,"../../plots/array_container_defaults":782,"./attributes":699,"./constants":700}],702:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-M.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=M.currentValueInset,i="left"}a.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(x.font,e.currentvalue.font).text(o).call(_.convertToTspans,e.gd);var s=_.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*k;return _.positionText(a,n,l),a}}function a(t,e,r){var n=t.selectAll("rect."+M.gripRectClass).data([0]);n.enter().append("rect").classed(M.gripRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:M.gripWidth,height:M.gripHeight,rx:M.gripRadius,ry:M.gripRadius}).call(b.stroke,r.bordercolor).call(b.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function o(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(x.font,r.font).text(e.step.label).call(_.convertToTspans,r.gd),n}function s(t,e){var r=t.selectAll("g."+M.labelsClass).data([0]);r.enter().append("g").classed(M.labelsClass,!0);var n=r.selectAll("g."+M.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(M.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=v.select(this);r.call(o,t,e),x.setTranslate(r,d(e,t.fraction),M.tickOffset+e.ticklen+e.font.size*k+M.labelOffset+e.currentValueTotalHeight)})}function l(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&c(t,e,r,a,!0,i)}function c(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(f,r,r.active/(r.steps.length-1),o),e.call(i,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&y.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function u(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=v.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+M.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),o.call(b.fill,t.activebgcolor);var s=p(t,v.mouse(i)[0]);l(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=p(t,v.mouse(i)[0]);l(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(b.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+M.tickRectClass).data(e.steps);r.enter().append("rect").classed(M.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=v.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(b.fill,e.tickcolor),x.setTranslate(i,d(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?M.tickOffset:M.minorTickOffset)+e.currentValueTotalHeight)})}function f(t,e,r,n){var i=t.select("rect."+M.gripRectClass),a=d(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*M.gripWidth)+","+e.currentValueTotalHeight+")")}}function d(t,e){return t.inputAreaStart+M.stepInset+(t.inputAreaLength-2*M.stepInset)*Math.min(1,Math.max(0,e))}function p(t,e){return Math.min(1,Math.max(0,(e-M.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*M.stepInset-2*t.inputAreaStart)))}function m(t,e,r){var n=t.selectAll("rect."+M.railTouchRectClass).data([0]);n.enter().append("rect").classed(M.railTouchRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,M.tickOffset+r.ticklen+r.labelHeight)}).call(b.fill,r.bgcolor).attr("opacity",0),x.setTranslate(n,0,r.currentValueTotalHeight)}function g(t,e){var r=t.selectAll("rect."+M.railRectClass).data([0]);r.enter().append("rect").classed(M.railRectClass,!0);var n=e.inputAreaLength-2*M.railInset;r.attr({width:n,height:M.railWidth,rx:M.railRadius,ry:M.railRadius,"shape-rendering":"crispEdges"}).call(b.stroke,e.bordercolor).call(b.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),x.setTranslate(r,M.railInset,.5*(e.inputAreaWidth-M.railWidth)+e.currentValueTotalHeight)}var v=t("d3"),y=t("../../plots/plots"),b=t("../color"),x=t("../drawing"),_=t("../../lib/svg_text_utils"),w=t("../legend/anchor_utils"),M=t("./constants"),k=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[M.name],n=[],i=0;i0?[0]:[]);if(l.enter().append("g").classed(M.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0),e.call(i,r).call(g,r).call(s,r).call(h,r).call(m,t,r).call(a,t,r),x.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(f,r,r.active/(r.steps.length-1),!1),e.call(i,r)}(t,v.select(this),e)}})}}},{"../../constants/alignment":711,"../../lib/svg_text_utils":761,"../../plots/plots":846,"../color":613,"../drawing":638,"../legend/anchor_utils":664,"./constants":700,d3:123}],703:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":699,"./constants":700,"./defaults":701,"./draw":702}],704:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),h=t("../../constants/interactions"),f=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){function d(t){s.syncOrAsync([p,m],t)}function p(e){return e.attr("transform",M?"rotate("+[M.rotate,w.x,w.y]+") translate(0, "+M.offset+")":null),e.style({"font-family":A,"font-size":n.round(S,2)+"px",fill:c.rgb(E),opacity:L*c.opacity(E),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&I){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=i(_.pad)?_.pad:2,u=l.bBox(e.node()),h={left:0,top:0,right:T.width,bottom:T.height},f=_.maxShift||(h[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(f<0)r=f;else{var d=_.offsetLeft||0,p=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[a])+c))}),r=Math.min(f,r)}if(r>0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,b=r.placeholder,x=r.traceIndex,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,T=t._fullLayout,A=v.titlefont.family,S=v.titlefont.size,E=v.titlefont.color,L=1,C=!1,I=v.title.trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var P=t._context.edits[g];""===I?L=0:I.replace(f," % ")===b.replace(f," % ")&&(L=.2,C=!0,P||(I=""));var D=I||P;k||(k=T._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var z=k.selectAll("text").data(D?[0]:[]);z.enter().append("text"),z.text(I).attr("class",e),z.exit().remove(),D&&(z.call(d),P&&(I?z.on(".opacity",null):(L=0,C=!0,z.text(b).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)})),z.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?a.restyle(t,y,e,x):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),z.classed("js-placeholder",C))}},{"../../constants/interactions":716,"../../lib":738,"../../lib/svg_text_utils":761,"../../plotly":780,"../../plots/plots":846,"../color":613,"../drawing":638,d3:123,"fast-isnumeric":132}],705:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"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:{_isLinkedToArray:"button",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",dflt:""},execute:{valType:"boolean",dflt:!0}},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,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":727,"../../plot_api/edit_types":769,"../../plots/font_attributes":810,"../../plots/pad_attributes":845,"../color/attributes":612}],706:[function(t,e,r){"use strict";e.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:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],707:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,o,r,n)}n("visible",function(t,e){function r(t,e){return i.coerce(n,a,l,t,e)}var n,a,o=t.buttons||[],s=e.buttons=[];for(var c=0;c0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.buttons;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":738,"../../plots/array_container_defaults":782,"./attributes":705,"./constants":706}],708:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e){return+t.attr(M.menuIndexAttrName)===e._index}function a(t,e,r,n,i,a,l,c){e._input.active=e.active=l,"buttons"===e.type?s(t,n,null,null,e):"dropdown"===e.type&&(i.attr(M.menuIndexAttrName,"-1"),o(t,n,i,a,e),c||s(t,n,i,a,e))}function o(t,e,r,n,a){var o=e.selectAll("g."+M.headerClassName).data([0]);o.enter().append("g").classed(M.headerClassName,!0).style("pointer-events","all");var c=a.active,u=a.buttons[c]||M.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},g={width:a.headerWidth,height:a.headerHeight};o.call(l,a,u,t).call(p,a,h,g);var v=e.selectAll("text."+M.headerArrowClassName).data([0]);v.enter().append("text").classed(M.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(b.font,a.font).text(M.arrowSymbol[a.direction]),v.attr({x:a.headerWidth-M.arrowOffsetX+a.pad.l,y:a.headerHeight/2+M.textOffsetY+a.pad.t}),o.on("click",function(){r.call(m),r.attr(M.menuIndexAttrName,i(r,a)?-1:String(a._index)),s(t,e,r,n,a)}),o.on("mouseover",function(){o.call(f)}),o.on("mouseout",function(){o.call(d,a)}),b.setTranslate(e,a.lx,a.ly)}function s(t,e,r,n,i){r||(r=e).attr("pointer-events","all");var o=function(t){return-1==+t.attr(M.menuIndexAttrName)}(r)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?M.dropdownButtonClassName:M.buttonClassName,c=r.selectAll("g."+s).data(o),u=c.enter().append("g").classed(s,!0),m=c.exit();"dropdown"===i.type?(u.attr("opacity","0").transition().attr("opacity","1"),m.transition().attr("opacity","0").remove()):m.remove();var y=0,b=0,x=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(x?b=i.headerHeight+M.gapButtonHeader:y=i.headerWidth+M.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(b=-M.gapButtonHeader+M.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-M.gapButtonHeader+M.gapButton-i.openWidth);var _={x:i.lx+y+i.pad.l,y:i.ly+b+i.pad.t,yPad:M.gapButton,xPad:M.gapButton,index:0},w={l:_.x+i.borderwidth,t:_.y+i.borderwidth};c.each(function(o,s){var u=g.select(this);u.call(l,i,o,t).call(p,i,_),u.on("click",function(){g.event.defaultPrevented||(a(t,i,0,e,r,n,s),o.execute&&v.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:i,button:o,active:i.active}))}),u.on("mouseover",function(){u.call(f)}),u.on("mouseout",function(){u.call(d,i),c.call(h,i)})}),c.call(h,i),x?(w.w=Math.max(i.openWidth,i.headerWidth),w.h=_.y-w.t):(w.w=_.x-w.l,w.h=Math.max(i.openHeight,i.headerHeight)),w.direction=i.direction,n&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(c.enter().append("g").classed(M.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,T=n.barLength+2*n.barPad,A=n.barWidth+2*n.barPad,S=p,E=g+v;E+A>c&&(E=c-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=L.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:E,width:T,height:A}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>M,I=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,D=p+m,z=g;D+I>l&&(D=l-I);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),C?(this.vbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:D,y:z,width:I,height:P}),this._vbarYMin=z+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=u-.5,j=C?h+I+.5:h+.5,N=f-.5,B=k?d+A+.5:d+.5,U=s._topdefs.selectAll("#"+F).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(R),y:Math.floor(N),width:Math.ceil(j)-Math.floor(R),height:Math.ceil(B)-Math.floor(N)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||C){var V=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":738,"../color":613,"../drawing":638,d3:123}],711:[function(t,e,r){"use strict";e.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},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],712:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],713:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,i={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},a={},o=Object.keys(i),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],719:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],720:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.32.0",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":604,"./components/annotations3d":609,"./components/fx":655,"./components/images":663,"./components/legend":672,"./components/rangeselector":684,"./components/rangeslider":690,"./components/shapes":697,"./components/sliders":703,"./components/updatemenus":709,"./fonts/mathjax_config":721,"./lib/queue":752,"./locale-en":767,"./locale-en-us":766,"./plot_api/plot_schema":774,"./plot_api/register":775,"./plot_api/set_plot_config":776,"./plot_api/to_image":778,"./plot_api/validate":779,"./plotly":780,"./snapshot":866,"./snapshot/download":863,"./traces/scatter":1066,d3:123,"es6-promise":129}],721:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],722:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":717,"fast-isnumeric":132}],723:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):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){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(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}function s(t){return t.formatDate("yyyy")}var l=t("d3"),c=t("fast-isnumeric"),u=t("./loggers"),h=t("./mod"),f=t("../constants/numerical"),d=f.BADNUM,p=f.ONEDAY,m=f.ONEHOUR,g=f.ONEMIN,v=f.ONESEC,y=f.EPOCHJD,b=t("../registry"),x=l.time.format.utc,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,w=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,M=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?b.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:b.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?b.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var k,T;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*g)>=k&&t<=T?t:d;if("string"!=typeof t&&"number"!=typeof t)return d;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?w:_);if(!s)return d;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),x=Number(s[11]||0);if(i){if(2===l.length)return d;l=Number(l);var A;try{var S=b.getComponentMethod("calendars","getCal")(e);if(o){var E="i"===c.charAt(c.length-1);c=parseInt(c,10),A=S.newDate(l,S.toMonthIndex(l,c,E),u)}else A=S.newDate(l,Number(c),u)}catch(t){return d}return A?(A.toJD()-y)*p+h*m+f*g+x*v:d}l=2===l.length?(Number(l)+2e3-M)%100+M:Number(l),c-=1;var L=new Date(Date.UTC(2e3,c,u,h,f));return L.setUTCFullYear(l),L.getUTCMonth()!==c?d:L.getUTCDate()!==u?d:L.getTime()+x*v},k=r.MIN_MS=r.dateTime2ms("-9999"),T=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==d};var A=90*p,S=3*m,E=5*g;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=k&&t<=T))return d;e||(e=0);var i,o,s,l,c,u,f=Math.floor(10*h(t+.05,1)),_=Math.round(t-f/10);if(n(r)){var w=Math.floor(_/p)+y,M=Math.floor(h(t,p));try{i=b.getComponentMethod("calendars","getCal")(r).fromJD(w).formatDate("yyyy-mm-dd")}catch(t){i=x("G%Y-%m-%d")(new Date(_))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=k+p&&t<=T-p))return d;var e=Math.floor(10*h(t+.05,1)),r=new Date(Math.round(t-e/10));return a(l.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return u.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return u.error("unrecognized date",t),e;return t};var L=/%\d?f/g,C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,i,a){var l,c;if(a=n(a)&&a,e)return function(t,e,r,i){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 a=new Date(Math.floor(e+.05));if(n(i))try{t=b.getComponentMethod("calendars","worldCalFmt")(t,e,i)}catch(t){return"Invalid"}return r(t)(a)}(e,t,i,a);if(a)try{var u=Math.floor((t+.05)/p)+y,h=b.getComponentMethod("calendars","getCal")(a).fromJD(u);"y"===r?c=s(h):"m"===r?c=function(t){return t.formatDate("M yyyy")}(h):"d"===r?(l=s(h),c=function(t){return t.formatDate("M d")}(h)):(l=function(t){return t.formatDate("M d, yyyy")}(h),c=o(t,r))}catch(t){return"Invalid"}else{var f=new Date(Math.floor(t+.05));"y"===r?c=i("%Y")(f):"m"===r?c=i("%b %Y")(f):"d"===r?(l=i("%Y")(f),c=i("%b %-d")(f)):(l=i("%b %-d, %Y")(f),c=o(t,r))}return c+(l?"\n"+l:"")};var I=3*p;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=h(t,p);if(t=Math.round(t-i),r)try{var a=Math.round(t/p)+y,o=b.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-y)*p+i}catch(e){u.error("invalid ms "+t+" in calendar "+r)}var l=new Date(t+I);return l.setUTCMonth(l.getUTCMonth()+e)+i-I},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&b.getComponentMethod("calendars","getCal")(e),h=0;h0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function i(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}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,h=a-e,f=l-o,d=c-s,p=u*u+h*h,m=f*f+d*d,g=Math.min(i(u,h,p,o-t,s-e),i(u,h,p,l-t,c-e),i(f,d,m,t-o,e-s),i(f,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),h=t.getPointAtLength(a(r,e)),f={x:(4*h.x+i.x+c.x)/6,y:(4*h.y+i.y+c.y)/6,theta:u};return o[r]=f,f},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===h&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,h=t.getTotalLength(),f=h,d=n(u);d;){if((u+=d+r)>f)return;d=n(u)}for(d=n(f);d;){if(f-=d+r,u>f)return;d=n(f)}return{min:u,max:f,len:f-u,total:h,isClosed:0===u&&f===h&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,d=s;h0?d=i:f=i,h++}return a}},{"./mod":745}],733:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],734:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(o(t))return u;var e=s(t);return e.length?e:u}function a(t){return o(t)?t:h}var o=t("fast-isnumeric"),s=t("color-rgba"),l=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,u=s(c),h=1;e.exports=function(t,e,r){var o,c,f,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,c=g?function(t,e){return void 0===t[e]?u:s(o(t[e]))}:i,f=v?function(t,e){return void 0===t[e]?h:a(t[e])}:a,g||v)for(var b=0;b=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}(t))))}},{"../constants/string_mappings":718,"superscript-text":539}],737:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],738:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var h=t("./search");l.findBin=h.findBin,l.sorterAsc=h.sorterAsc,l.sorterDes=h.sorterDes,l.distinctVals=h.distinctVals,l.roundUp=h.roundUp;var f=t("./stats");l.aggNums=f.aggNums,l.len=f.len,l.mean=f.mean,l.variance=f.variance,l.stdev=f.stdev,l.interp=f.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./geometry2d");l.segmentsIntersect=p.segmentsIntersect,l.segmentDistance=p.segmentDistance,l.getTextLocation=p.getTextLocation,l.clearLocationCache=p.clearLocationCache,l.getVisibleSegment=p.getVisibleSegment,l.findPointOnPath=p.findPointOnPath;var m=t("./extend");l.extendFlat=m.extendFlat,l.extendDeep=m.extendDeep,l.extendDeepAll=m.extendDeepAll,l.extendDeepNoArrays=m.extendDeepNoArrays;var g=t("./loggers");l.log=g.log,l.warn=g.warn,l.error=g.error;var v=t("./regex");l.counterRegex=v.counter;var y=t("./throttle");l.throttle=y.throttle,l.throttleDone=y.done,l.clearThrottle=y.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.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,c=new Array(l),u=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]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n=0&&t%1==0}function a(e){return void 0!==e&&e1?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};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n}},{"../constants/numerical":717,"./clean_number":722,"./coerce":723,"./dates":724,"./ensure_array":725,"./extend":727,"./filter_unique":728,"./filter_visible":729,"./geometry2d":732,"./get_graph_div":733,"./identity":737,"./is_array":739,"./is_plain_object":740,"./keyed_container":741,"./localize":742,"./loggers":743,"./matrix":744,"./mod":745,"./nested_property":746,"./noop":747,"./notifier":748,"./push_unique":751,"./regex":753,"./relative_attr":754,"./relink_private":755,"./search":756,"./stats":759,"./throttle":762,"./to_log_range":763,d3:123,"fast-isnumeric":132}],739:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],740:[function(t,e,r){"use strict";e.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)===Object.prototype}},{}],741:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],h.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,c(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}(d)):h[e[u]]=n}}function o(t,e){var r=e;return l(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}var l=t("fast-isnumeric"),c=t("./is_array"),u=t("./is_plain_object"),h=t("../plot_api/container_array_match");e.exports=function(t,e){if(l(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),s=0;so||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,h,f,d,p,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(h,g)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":717,"./matrix":744}],751:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else 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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,h=0,f=e.length,d=0,p=f>1?(e[f-1]-e[0])/(f-1):1;for(u=p>=0?r?n:i:r?o:a,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);h90&&l.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":132}],760:[function(t,e,r){"use strict";var n=t("color-rgba");e.exports=function(t){var e=n(t);return e.length?e:[0,0,0,1]}},{"color-rgba":96}],761:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t,e,r){var n="math-output-"+c.randstr([],64),i=l.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(function(t){return t.replace(p,"\\lt ").replace(m,"\\gt ")}(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=l.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function a(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function o(t,e){function r(){p++;var e=document.createElementNS(u.svg,"tspan");l.select(e).attr({class:"line",dy:p*f+"em"}),t.appendChild(e),s=e;var r=d;if(d=[{node:e}],r.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),s=d[d.length-1].node}else c.log("Ignoring unexpected end tag .",e)}e=function(t){return function(t,e){if(!t)return"";for(var r=0;r|>|>)/g,g={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},v={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},b="\u200b",x=["http:","https:","mailto:","",void 0,":"],_=new RegExp("]*)?/?>","g"),w=Object.keys(h.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:h.entityToUnicode[t]}}),M=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,T=/<(\/?)([^ >]*)(\s+(.*))?>/i,A=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,E=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,I=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(_," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=l.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){!function(){var r=l.select(i).select(".svg-container"),a=r.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12);a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(s(t,r,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=l.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;l.select(this).transition().duration(0).remove(),l.select(document).on("mouseup",null),o.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,l.select(document).on("mouseup",function(){if(l.event.target===t)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===l.event.which?(i._editing=!1,t.style({opacity:1}),l.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),l.select(this).call(s(t,r,e)))}).on("keydown",function(){13===l.event.which&&this.blur()}).call(n)}(),t.style({opacity:0});var r,a=c.attr("class");(r=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(r).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}var i=e.gd,a=e.delegate,o=l.dispatch("edit","input","cancel"),c=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():c.on("click",r),l.rebind(t,o,"on")}},{"../constants/alignment":711,"../constants/string_mappings":718,"../constants/xmlns_namespaces":719,"../lib":738,d3:123}],762:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e?a():o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],763:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.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}},{"fast-isnumeric":132}],764:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":812,"topojson-client":545}],765:[function(t,e,r){"use strict";e.exports=function(t,e){if(t instanceof Float32Array)return function(t,e){for(var r=new Float32Array(e),n=0;n0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),h=t("../plots/plots"),f=t("../plots/cartesian/axis_ids"),d=f.cleanId,p=f.getFromTrace,m=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;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 i=(h.subplotsRegistry.cartesian||{}).attrRegex,o=(h.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(A.x=1.02,A.xanchor="left"):A.x<-2&&(A.x=-.02,A.xanchor="right"),A.y>3?(A.y=1.02,A.yanchor="bottom"):A.y<-2&&(A.y=-.02,A.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),m.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s1&&o.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!m&&(f(g,v),d(t),!0)}var b,x,_,w,M,k,T,A=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,h).get(),C=[],I=-1,P=E.length;for(b=0;bE.length-(T?0:1))o.warn("index out of range",h,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",h,_),u(k)?C.push(_):T?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",h,_,k),-1===I&&(I=_);else for(x=0;x=0;b--)E.splice(C[b],1),L&&L.splice(C[b],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(f(g,v),p!==a){var D;if(-1===I)D=A;else{for(P=Math.max(E.length,P),D=[],b=0;b=I);b++)D.push(_);for(b=I;b=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 s(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]),o(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&o(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function l(t,e,r,n,i,s){!function(t,e,r,n){var i=v.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!v.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");o(t,r,"indices");for(var a in 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,c,u,h=function(t,e,r,n){var i,o,s,l,c,u=v.isPlainObject(n),h=[];Array.isArray(r)||(r=[r]),r=a(r,t.data.length-1);for(var f in e)for(var d=0;d=0&&uY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(N+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(N+".range[0]",Math.log(Z)/Math.LN10),r(N+".range[1]",Math.log(J)/Math.LN10)):(r(N+".range[0]",Math.pow(10,Z)),r(N+".range[1]",Math.pow(10,J)))}else r(N+".autorange",!0);x.getComponentMethod("annotations","convertCoords")(t,U,L,r),x.getComponentMethod("images","convertCoords")(t,U,L,r)}else r(N+".autorange",!0),r(N+".range",null);v.nestedProperty(u,N+"._inputRange").set(null)}else if(F.match(z.AX_NAME_PATTERN)){var K=v.nestedProperty(u,S).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),x.getComponentMethod("annotations","convertCoords")(t,K,Q,r),x.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=C.containerArrayMatch(S);if($){a=$.array,o=$.index;var tt=$.property,et=(v.nestedProperty(l,a)||[])[o]||{},rt=et,nt=H||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===o?(it?M.calc=!0:D.update(M,nt),it=!1):""===tt&&(rt=L,C.isAddVal(L)?T[S]=null:C.isRemoveVal(L)?(T[S]=et,rt=et):v.warn("unrecognized full object value",e)),it&&(n(rt,"x")||n(rt,"y"))?M.calc=!0:D.update(M,nt),d[a]||(d[a]={});var at=d[a][o];at||(at=d[a][o]={}),at[tt]=L,delete e[S]}else"reverse"===F?(B.range?B.range.reverse():(r(N+".autorange",!0),B.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):((!u._has("gl2d")&&!u._has("regl")||"dragmode"!==S||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&H?D.update(M,H):M.calc=!0,E.set(L))}}for(a in d){C.applyContainerArrayChanges(t,v.nestedProperty(l,a),d[a],M)||(M.plot=!0)}var ot=u._axisConstraintGroups||[];for(b in A)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=v.getGraphDiv(t),!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=w.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(e){if(0!==e.length){for(var s=0;so._timeToNext&&function(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,w.transition(t,e.frame.data,e.frame.layout,I.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(o._animationRaf),o._animationRaf=null}()};e()}()}}function h(t){return Array.isArray(s)?p>=s.length?t.transitionOpts=s[p]:t.transitionOpts=s[0]:t.transitionOpts=s,p++,t}var f,d,p=0,m=[],g=void 0===e||null===e,y=Array.isArray(e);if(!g&&!y&&v.isPlainObject(e))m.push({type:"object",data:h(v.extendFlat({},e))});else if(g||-1!==["string","number"].indexOf(typeof e))for(f=0;f0&&__)&&M.push(d);m=M}}m.length>0?u(m):(t.emit("plotly_animated"),l())})},g.addFrames=function(t,e,r){t=v.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=l.length+2*e.length,h=[];for(i=e.length-1;i>=0;i--)if(v.isPlainObject(e[i])){var f=(c[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&c[f]&&(n++,v.warn('addFrames: overwriting frame "'+c[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&v.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:w.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(a=h[i].frame).name&&v.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=w.modifyFrames,l=w.modifyFrames,c=[t,o],u=[t,a];return b&&b.add(t,s,c,l,u),w.modifyFrames(t,a)},g.purge=function(t){var e=(t=v.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return w.cleanPlot([],{},r,e),w.purge(t),y.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":613,"../components/drawing":638,"../components/errorbars":644,"../constants/xmlns_namespaces":719,"../lib":738,"../lib/events":726,"../lib/queue":752,"../lib/svg_text_utils":761,"../plotly":780,"../plots/cartesian/axis_ids":788,"../plots/cartesian/constants":790,"../plots/cartesian/constraints":792,"../plots/cartesian/graph_interact":794,"../plots/plots":846,"../plots/polar":849,"../registry":861,"./edit_types":769,"./helpers":770,"./manage_arrays":771,"./plot_schema":774,"./subroutines":777,d3:123,"fast-isnumeric":132,"has-hover":289}],773:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],774:[function(t,e,r){"use strict";function n(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function a(){var t,e,r={};b(r,f);for(t in c.subplotsRegistry)if((e=c.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)s(r,e,"xaxis"),s(r,e,"yaxis");else{s(r,e,"subplot"===e.attr?e.name:e.attr)}r=function(t){return y(t,{radialaxis:g.radialaxis,angularaxis:g.angularaxis}),y(t,g.layout),t}(r);for(t in c.componentsRegistry){var n=(e=c.componentsRegistry[t]).schema;if(n&&(n.subplots||n.layout)){var i=n.subplots;if(i&&i.xaxis&&!i.yaxis)for(var a in i.xaxis)delete r.yaxis[a]}else e.layoutAttributes&&l(r,e.layoutAttributes,e.name)}return{layoutAttributes:o(r)}}function o(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):u.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[_];if(!n)return;delete t[_],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function s(t,e,r){var n=u.nestedProperty(t,r),i=b({},e.layoutAttributes);i[x]=!0,n.set(i)}function l(t,e,r){var n=u.nestedProperty(t,r);n.set(b(n.get()||{},e))}var c=t("../registry"),u=t("../lib"),h=t("../plots/attributes"),f=t("../plots/layout_attributes"),d=t("../plots/frame_attributes"),p=t("../plots/animation_attributes"),m=t("../plots/polar/area_attributes"),g=t("../plots/polar/axis_attributes"),v=t("./edit_types"),y=u.extendFlat,b=u.extendDeepAll,x="_isSubplotObj",_="_isLinkedToArray",w=[x,_,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=x,r.IS_LINKED_TO_ARRAY=_,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=w,r.get=function(){var t={};c.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:m},r={}):r=(e=c.modules[t]._module).basePlotModule;var n={};n.type=null,b(n,h),b(n,e.attributes),r.attributes&&b(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:o(n)};if(e.layoutAttributes){var a={};b(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}(e)});var e={};return Object.keys(c.transformsRegistry).forEach(function(t){e[t]=function(t){var e=c.transformsRegistry[t],r=b({},e.attributes);return Object.keys(c.componentsRegistry).forEach(function(e){var n=c.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){l(r,n.schema.transforms[t][e],e)})}),{attributes:o(r)}}(t)}),{defs:{valObjects:u.valObjectMeta,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:v.traces,layout:v.layout},impliedEdits:{}},traces:t,layout:a(),transforms:e,frames:function(){var t={frames:u.extendDeepAll({},d)};return o(t),t.frames}(),animation:o(p)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===w.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||u.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,a,o){i=i.slice(0,o).concat([r]);if(e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[o-1]&&("ticktext"===r||"tickvals"===r))){var s=function(t){return t.join(".")}(i),l=u.nestedProperty(t,s).get();Array.isArray(l)&&n.push(s)}}var n=[],i=[];if(r.crawl(h,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,o=0;o=t.transforms.length)return!1;a=(r=(c.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=m[o];else{var u=t._module;if(u||(u=(c.modules[t.type||h.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(a=r&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=h[o])}return n(a,e,s)},r.getLayoutValObject=function(t,e){return n(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var a=e.plotgroup.selectAll(".bg").data(i);a.enter().append("rect").classed("bg",!0),a.exit().remove(),a.each(function(){e.bg=a;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=l._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){l._plots[t].bg=o.select(this)}),x.each(function(t){function r(t){return"M"+k+","+t+"H"+T}function o(t){return"M"+y._offset+","+t+"h"+y._length}function s(t){return"M"+t+","+I+"V"+C}function c(t){return"M"+t+","+b._offset+"v"+b._length}function p(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}var v=l._plots[t],y=v.xaxis,b=v.yaxis;v.bg&&m&&v.bg.call(f.setRect,y._offset-u,b._offset-u,y._length+2*u,b._length+2*u).call(h.fill,l.plot_bgcolor).style("stroke-width",0),v.clipId="clip"+l._uid+t+"plot";var x=l._clips.selectAll("#"+v.clipId).data([0]);x.enter().append("clipPath").attr({class:"plotclip",id:v.clipId}).append("rect"),x.selectAll("rect").attr({width:y._length,height:b._length}),f.setTranslate(v.plot,y._offset,b._offset);var _,w;for(v._hasClipOnAxisFalse?(_=null,w=v.clipId):(_=v.clipId,w=null),f.setClipUrl(v.plot,_),i=0;i1&&d.push(a("object","layout"))),l.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&i<=10||e>=15*T)t._tickround="d";else if(e>=S&&i<=16||e>=A)t._tickround="M";else if(e>=E&&i<=19||e>=S)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(p(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);p(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),u=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(u)>3&&(l(t.exponentformat)&&!c(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function s(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t){return"SI"===t||"B"===t}function c(t){return t>14||t<-15}function u(t,e,r,n){var i=t<0,a=e._tickround,s=r||e.exponentformat||"B",u=e._tickexponent,h=P.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:p(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(d),a=(Number(d._tickround)||0)+4,u=d._tickexponent,e.hoverformat&&(h=e.hoverformat)}if(h)return e._numFormat(h)(t).replace(/-/g,L);var m=Math.pow(10,-a)/2;if("none"===s&&(u=0),(t=Math.abs(t))"+b+"":"B"===s&&9===u?t+="B":l(s)&&(t+=V[u/3+5])}return i?L+t:t}function h(t,e){for(var r=0;r2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},P.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&h/u>f&&(l=o,c=s,f=h/u);if(n===i){var m=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,v)]:[m,v]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),f=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-f*l.pad,c.val+f*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),g.simpleMap(r,t.l2r||Number)},P.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=P.getAutoRange(t),t._r=t.range.slice(),t._rl=g.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},P.saveRangeInitial=function(t,e){for(var r=P.list(t,"",!0),n=!1,i=0;i=f?d=!1:s.val>=c&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:x&&0===c?0:f})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=h?d=!1:s.val<=u&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:x&&0===u?0:h})}}}if((t.autorange||!!g.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,h,f,d,m,v,y=e.length,b=r.padded?.05*t._length:0,x=r.tozero&&("linear"===t.type||"-"===t.type);b&&"domain"===t.constrain&&t._inputDomain&&(b*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var _=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),T=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=y-1;a>5;a--)i(a)}},P.autoBin=function(t,e,r,n,i){var a=g.aggNums(Math.min,null,t),o=g.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:a-.5,end:o+.5,size:1,_count:o-a+1};var s;if(r)s=(o-a)/r;else{var l=g.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*g.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*g.stdev(t)/Math.pow(t.length,n?.25:.4)),p(s)||(s=1)}var h;h="log"===e.type?{type:"linear",range:[a,o]}:{type:e.type,range:g.simpleMap([a,o],e.c2r,0,i),calendar:i},P.setConvert(h),P.autoTicks(h,s);var f,d,m=P.tickIncrement(P.tickFirst(h),h.dtick,"reverse",i);if("number"==typeof h.dtick)f=(m=function(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,c=0,u=0;u.3*h||a(n)||a(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=P.tickIncrement(t,"M6","reverse")+1.5*T:a.exactMonths>.8?t=P.tickIncrement(t,"M1","reverse")+15.5*T:t-=T/2;var s=P.tickIncrement(t,r);if(s<=n)return s}return t}(m,t,h.dtick,a,i)),f=m,d=0;f<=o;)f=P.tickIncrement(f,h.dtick,!1,i),d++;return{start:e.c2r(m,0,i),end:e.c2r(f,0,i),size:h.dtick,_count:d}},P.calcTicks=function(t){var e=g.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=g.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),P.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),o(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=g.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),h=Math.max(l,c),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e=l:h<=l)&&!(a.length>u||h===c);h=P.tickIncrement(h,t.dtick,i,t.calendar))c=h,a.push(h);t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(a.length),d=0;dM?(e/=M,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*a(e,r,F)):n>k?(e/=k,t.dtick="M"+a(e,1,R)):n>T?(t.dtick=a(e,T,N),t.tick0=g.dateTick0(t.calendar,!0)):n>A?t.dtick=a(e,A,R):n>S?t.dtick=a(e,S,j):n>E?t.dtick=a(e,E,j):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,r,F))}else if("log"===t.type){t.tick0=0;var i=g.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var o=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/o,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+a(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,r,F));if(0===t.dtick&&(t.dtick=1),!p(t.dtick)&&"string"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(s)}},P.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(p(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return g.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?U:B,l=t+.01*i,c=g.roundUp(g.mod(l,1),s,r);return Math.floor(l)+Math.log(d.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},P.tickFirst=function(t){var e=t.r2l||Number,r=g.simpleMap(t.range,e),n=r[1]"+o,t._prevDateHead=o)),e.text=s}(t,o,r,f):"log"===t.type?function(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=u(Math.pow(10,o),t,i,n);else if(p(a)||"D"===a.charAt(0)&&g.mod(o+.01,1)<.1){var h=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||l(t.exponentformat)&&c(h)?(e.text=0===h?1:1===h?"10":h>1?"10"+h+"":"10"+L+-h+"",e.fontSize*=1.25):(e.text=u(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,g.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("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*(o<0?.5:.25)))}}(t,o,0,f,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=u(e.x,t,i,n)}(t,o,0,f,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o},P.hoverLabelText=function(t,e,r){if(r!==C&&r!==e)return P.hoverLabelText(t,e)+" - "+P.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=P.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":L+i:i};var V=["f","p","n","\u03bc","m","","k","M","G","T"];P.getTickFormat=function(t){function e(t){return"string"!=typeof t?t:Number(t.replace("M",""))*k}function r(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function n(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function i(t,e){var n=null===e[0],i=null===e[1],a=r(t,e[0])>=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}var a,o;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(a=0;a1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":861,"./constants":790}],789:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],790:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":738}],791:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;oo*v)||_)for(r=0;rI&&DL&&(L=D);h/=(L-E)/(2*C),E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=T.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}(at,dt,X,Z,pt="M0,0H"+J+"V"+K+"H0V0"),yt=function(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:g.background,stroke:g.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}(at,X,Z),o(at)}function j(e,r){function n(){gt="",ft.r=ft.l,ft.t=ft.b,yt.attr("d","M0,0Z")}if(t._transitioningWithDuration)return!1;var i=Math.max(0,Math.min(J,e+ut)),a=Math.max(0,Math.min(K,r+ht)),o=Math.abs(i-ut),s=Math.abs(a-ht);ft.l=Math.min(ut,i),ft.r=Math.max(ut,i),ft.t=Math.min(ht,a),ft.b=Math.max(ht,a),et?o>L||s>L?(gt="xy",o/J>s/K?(s=o*K/J,ht>a?ft.t=ht-s:ft.b=ht+s):(o=s*J/K,ut>i?ft.l=ut-o:ft.r=ut+o),yt.attr("d",c(ft))):n():!$||s.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}(vt,yt,ft,pt,mt,dt),mt=!0}function N(){if(Math.min(ft.h,ft.w)<2*E)return s(t);"xy"!==gt&&"x"!==gt||i(Y,ft.l/J,ft.r/J,bt,rt),"xy"!==gt&&"y"!==gt||i(W,(K-ft.b)/K,(K-ft.t)/K,bt,nt),s(t),H(),C&&t.data&&t._context.showTips&&(p.notifier(p._(t,"Double-click to zoom back out"),"long"),C=!1)}function B(e){function r(t,e,r){if(!t.fixedrange){var n=p.simpleMap(t.range,t.r2l),i=n[0]+(n[1]-n[0])*e;t.range=n.map(function(e){return t.l2r(i+(e-i)*r)})}}if(t._context.scrollZoom||it._enablescrollzoom){if(t._transitioningWithDuration)return p.pauseEvent(e);var n=t.querySelector(".plotly");if(F(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(_t);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=Mt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(O||et){for(O||(l=.5),a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(F(),"ew"===Q||"ns"===$)return Q&&a(Y,e),$&&a(W,r),q([Q?-e:0,$?-r:0,J,K]),void V($,Q);if(et&&Q&&$){var i="w"===Q==("n"===$)?1:-1,o=(e/J+i*r/K)/2;e=o*J,r=i*o*K}"w"===Q?e=n(Y,0,e):"e"===Q?e=n(Y,1,-e):Q||(e=0),"n"===$?r=n(W,1,r):"s"===$?r=n(W,0,-r):$||(r=0);var s="w"===Q?e:0,l="n"===$?r:0;if(et){var c;if(!Q&&1===$.length){for(c=0;c rect").call(v.setTranslate,s,l).call(v.setScale,a,o);var E=g.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");g.plot.call(v.setTranslate,T,S).call(v.setScale,1/a,1/o),E.selectAll(".point").call(v.setPointGroupScale,a,o),E.selectAll(".textpoint").call(v.setTextPointsScale,a,o),E.call(v.hideOutsideRangePoints,g)}}}var G,Y,W,X,Z,J,K,Q,$,tt,et,rt,nt,it=t._fullLayout,at=t._fullLayout._zoomlayer,ot=z+O==="nsew",st=1===(z+O).length;F();var lt=function(t,e,r,n,i,a,o){var s=t.draglayer.selectAll("."+e).data([0]);return s.enter().append("rect").classed("drag",!0).classed(e,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),s.call(v.setRect,n,i,a,o).call(b,r),s.node()}(e,z+O+"drag",tt,r,I,P,D);if(!$&&!Q&&!l(it.dragmode))return lt.onmousedown=null,lt.style.pointerEvents=ot?"all":"none",lt;var ct={element:lt,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;ot?e.shiftKey?"pan"===i?i="zoom":l(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan",ct.minDrag="lasso"===i?1:void 0,"zoom"===i?(ct.moveFn=j,ct.doneFn=N,ct.minDrag=1,R(0,r,n)):"pan"===i?(ct.moveFn=U,ct.doneFn=H,o(at)):l(i)&&(ct.xaxes=Y,ct.yaxes=W,T(e,r,n,ct,i))},clickFn:function(r,n){if(s(t),2!==r||st||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(Q?Y:[]).concat($?W:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;ru[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":738,"fast-isnumeric":132}],801:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.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)]}},{"../../constants/alignment":711}],802:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function h(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(h(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),i&&2===i.length)for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}else o.nestedProperty(t,e).set(n)},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:i.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:i.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":717,"../../lib":738,"./axis_ids":788,"./constants":790,d3:123,"fast-isnumeric":132}],804:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);r("tickprefix")&&r("showtickprefix",s);r("ticksuffix")&&r("showticksuffix",s);if(r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){function r(t,e){return n.coerce(s,l,i.tickformatstops,t,e)}var a=t.tickformatstops,o=e.tickformatstops=[];if(Array.isArray(a))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var h=u.charAt(0),f=u.substr(1);((f=n(f)?Number(f):0)<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":717,"../../lib":738,"fast-isnumeric":132}],807:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(t){var e=t.xaxis,r=t.yaxis;d._defs.select("#"+t.clipId+"> 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 h(e,r){var n,i,l,c=m[e.xaxis._id],u=m[e.yaxis._id],h=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,h[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var f=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],h[2]=e.xaxis._length*(1-r+r*p/f)}else h[0]=0,h[2]=e.xaxis._length;if(u){i=(n=t._fullLayout[u.axisName])._r,l=u.to,h[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var g=i[1]-i[0],v=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],h[3]=e.yaxis._length*(1-r+r*v/g)}else h[1]=0,h[3]=e.yaxis._length;!function(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,k,T).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,E,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}function f(){x=Date.now();for(var e=Math.min(1,(x-b)/r.duration),n=w(e),a=0;ar.duration?(!function(){for(var e={},r=0;r0?".":"")+i;l.isPlainObject(a)?o(a,e,s,n+1):e(s,i,a)}})}var s=t("../plotly"),l=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(c)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(c){n(t,c,o.cache),o.check=function(){if(s){var e=n(t,c,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;hn*Math.PI/180}return!1},r.getPath=function(){return i.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(m.precision),n&&r.clipAngle(n-m.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var h=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],f=e.lonaxis,d=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(f.range,d.range);u.fitExtent(h,p);var g=this.bounds=u.getBounds(p),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var b=this.graphDiv,x=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!c){var T=u?o.projRotate:[k,0,0];M=r("projection.rotation.lon",T[0]),r("projection.rotation.lat",T[1]),r("projection.rotation.roll",T[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}var A,S;if(c?(A=-96.6,S=38.7):(A=u?k:M,S=(x[0]+x[1])/2),r("center.lon",A),r("center.lat",S),h){r("projection.parallels",o.projParallels||[0,60])}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":853,"../constants":812,"./layout_attributes":817}],817:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("../../../plot_api/edit_types").overrideAll,o={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=a({domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:o,lataxis:o},"plot","from-root")},{"../../../components/color/attributes":612,"../../../plot_api/edit_types":769,"../constants":812}],818:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!M.hasOwnProperty(e.type))return null;var i=M[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){return t>1?S:t<-1?-S:Math.asin(t)}function a(t){return t>1?0:t<-1?A:Math.acos(t)}function o(t,e){var r=(2+S)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>k;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(A*(4+A))*t*(1+Math.cos(e)),2*Math.sqrt(A/(4+A))*Math.sin(e)]}function s(t,e){function r(r,n){var i=P(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?P:e===1/0?l:(r.invert=function(r,n){var i=P.invert(r/t,n);return i[0]*=e,i},r)}function l(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function c(t,e){return[3*t/(2*A)*Math.sqrt(A*A/3-e*e),e]}function u(t,e){return[t,1.25*Math.log(Math.tan(A/4+.4*e))]}function h(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>k&&--i>0);return e/2}}function f(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function d(t,e){var r,n=Math.min(18,36*Math.abs(e)/A),i=Math.floor(n),a=n-i,o=(r=z[i])[0],s=r[1],l=(r=z[++i])[0],c=r[1],u=(r=z[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?S:-S)*(c+a*(h-s)/2+a*a*(h-2*c+s)/2)]}function p(t,e){return[t*Math.cos(e),e]}function m(t,e){var r=Math.cos(e),n=function(t){return t?t/Math.sin(t):1}(a(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function g(t,e){var r=m(t,e);return[(r[0]+t/S)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&v.hasOwnProperty(t.type)?v[t.type]:r)(t,n)};var v={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},y=[],b=[],x={point:function(t,e){y.push([t,e])},result:function(){var t=y.length?y.length<2?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y}:null;return y=[],t}},_={lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){y.length&&(b.push(y),y=[])},result:function(){var t=b.length?b.length<2?{type:"LineString",coordinates:b[0]}:{type:"MultiLineString",coordinates:b}:null;return b=[],t}},w={polygonStart:n,lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){var t=y.length;if(t){do{y.push(y[0].slice())}while(++t<4);b.push(y),y=[]}},polygonEnd:n,result:function(){if(!b.length)return null;var t=[],e=[];return b.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(f-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),b=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},M={Point:x,MultiPoint:x,LineString:_,MultiLineString:_,Polygon:w,MultiPolygon:w,Sphere:w},k=1e-6,T=k*k,A=Math.PI,S=A/2,E=(Math.sqrt(A),A/180),L=180/A,C=t.geo.projection,I=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=a[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],l}function n(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a=0;--r){var h;o=180*(h=a[1][r])[0][0]/A,s=180*h[0][1]/A,l=180*h[1][1]/A,c=180*h[2][0]/A,u=180*h[2][1]/A,e.push(n([[c-1e-6,u-1e-6],[c-1e-6,l+1e-6],[o+1e-6,l+1e-6],[o+1e-6,s-1e-6]],30))}return{type:"Polygon",coordinates:[t.merge(e)]}}(),l)},i},o.lobes=function(t){return arguments.length?(a=t.map(function(t){return t.map(function(t){return[[t[0][0]*A/180,t[0][1]*A/180],[t[1][0]*A/180,t[1][1]*A/180],[t[2][0]*A/180,t[2][1]*A/180]]})}),i=a.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),o):a.map(function(t){return t.map(function(t){return[[180*t[0][0]/A,180*t[0][1]/A],[180*t[1][0]/A,180*t[1][1]/A],[180*t[2][0]/A,180*t[2][1]/A]]})})},o},o.invert=function(t,e){var r=.5*e*Math.sqrt((4+A)/A),n=i(r),a=Math.cos(n);return[t/(2/Math.sqrt(A*(4+A))*(1+a)),i((n+r*(a+2))/(2+S))]},(t.geo.eckert4=function(){return C(o)}).raw=o;var P=t.geo.azimuthalEqualArea.raw;l.invert=function(t,e){var r=2*i(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=I(s),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=s,c.invert=function(t,e){return[2/3*A*t/Math.sqrt(A*A/3-e*e),e]},(t.geo.kavrayskiy7=function(){return C(c)}).raw=c,u.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*A]},(t.geo.miller=function(){return C(u)}).raw=u,h(A);var D=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=a(n)),e*Math.sin(n)]}var a=h(r);return n.invert=function(n,a){var o=i(a/e);return[n/(t*Math.cos(o)),i((2*o+Math.sin(2*o))/r)]},n}(Math.SQRT2/S,Math.SQRT2,A);(t.geo.mollweide=function(){return C(D)}).raw=D,f.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>k&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return C(f)}).raw=f;var z=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];z.forEach(function(t){t[1]*=1.0144}),d.invert=function(t,e){var r=e/S,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=z[a][1],s=z[a+1][1],l=z[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,h=2*(Math.abs(r)-s)/c,f=u/c,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=z[a][1],s=z[a+1][1],l=z[Math.min(19,a+2)][1],n-=(p=(e>=0?S:-S)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*L}while(Math.abs(p)>T&&--m>0);break}}while(--a>=0);var g=z[a][0],v=z[a+1][0],y=z[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*E]},(t.geo.robinson=function(){return C(d)}).raw=d,p.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return C(p)}).raw=p,m.invert=function(t,e){if(!(t*t+4*e*e>A*A+k)){var r=t,n=e,i=25;do{var o,s=Math.sin(r),l=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=u*u,p=h*h,m=l*l,g=1-p*c*c,v=g?a(h*c)*Math.sqrt(o=1/g):o=0,y=2*v*h*l-t,b=v*u-e,x=o*(p*m+v*h*c*d),_=o*(.5*s*f-2*v*u*l),w=.25*o*(f*l-v*u*p*s),M=o*(d*c+v*m*h),T=_*w-M*x;if(!T)break;var S=(b*_-y*M)/T,E=(y*w-b*x)/T;r-=S,n-=E}while((Math.abs(S)>k||Math.abs(E)>k)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return C(m)}).raw=m,g.invert=function(t,e){var r=t,n=e,i=25;do{var o,s=Math.cos(n),l=Math.sin(n),c=Math.sin(2*n),u=l*l,h=s*s,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-h*d*d,v=g?a(s*d)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*s*p+r/S)-t,b=.5*(v*l+n)-e,x=.5*o*(h*m+v*s*d*u)+.5/S,_=o*(f*c/4-v*l*p),w=.125*o*(c*p-v*l*h*f),M=.5*o*(u*d+v*m*s)+.5,T=_*w-M*x,A=(b*_-y*M)/T,E=(y*w-b*x)/T;r-=A,n-=E}while((Math.abs(A)>k||Math.abs(E)>k)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return C(g)}).raw=g}},{}],819:[function(t,e,r){"use strict";function n(t,e){return d.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,r){function n(t,e){var r=p.nestedProperty(s,t);r.get()!==e&&(r.set(e),p.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function a(t,e){function r(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}var a=n(0,e);return a.on("zoomstart",function(){d.select(this).style(v)}).on("zoom",function(){e.scale(d.event.scale).translate(d.event.translate),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,r)}),a}function o(t,e){function r(t){return e.invert(t)}function a(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var o,s,l,c,u,h,f,p,m=n(0,e),g=2;return m.on("zoomstart",function(){d.select(this).style(v),o=d.mouse(this),s=e.rotate(),l=e.translate(),c=s,u=r(o)}).on("zoom",function(){if(h=d.mouse(this),function(t){var n=e(r(t));return Math.abs(n[0]-t[0])>g||Math.abs(n[1]-t[1])>g}(o))return m.scale(e.scale()),void m.translate(e.translate());e.scale(d.event.scale),e.translate([l[0],d.event.translate[1]]),u?r(h)&&(p=r(h),f=[c[0]+(p[0]-u[0]),s[1],s[2]],e.rotate(f),c=f):u=r(o=h),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,a)}),m}function s(t,e){function r(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var a,o={r:e.rotate(),k:e.scale()},s=n(0,e),u=function(t){var e=0,r=arguments.length,n=[];for(;++em?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/m)*g-p,i=Math.sqrt(m*m-f*f));var v=180-a-2*p,y=(Math.atan2(d,u)-Math.atan2(l,i))*g,b=(Math.atan2(d,u)-Math.atan2(l,-i))*g,x=c(r[0],r[1],a,y),_=c(r[0],r[1],v,b);return x<=_?[a,y,r[2]]:[v,b,r[2]]}(v,a,n);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=n),e.rotate(b),n=b}}else a=l(e,t=s);!function(t){t({type:"zoom"})}(u.of(this,arguments))}),function(t){p++||t({type:"zoomstart"})}(u.of(this,arguments))}).on("zoomend",function(){d.select(this).style(y),b.call(s,"zoom",null),function(t){--p||t({type:"zoomend"})}(u.of(this,arguments)),i(t,e,r)}).on("zoom.redraw",function(){t.render()}),d.rebind(s,u,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*m,r=t[1]*m,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function c(t,e,r,n){var i=u(r-t),a=u(n-e);return Math.sqrt(i*i+a*a)}function u(t){return(t%360+540)%360-180}function h(t,e,r){var n=r*m,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function f(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(s)*_*(u>=0?1:-1),c.boxEnd[1]h[3]&&(c.boxEnd[1]=h[3],c.boxEnd[0]=c.boxStart[0]+(h[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(u)/_*(s>=0?1:-1),c.boxEnd[0]h[2]&&(c.boxEnd[0]=h[2],c.boxEnd[1]=c.boxStart[1]+(h[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(s=c.boxStart[0]!==c.boxEnd[0],u=c.boxStart[1]!==c.boxEnd[1],s||u?(s&&(a(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,r?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)f[p+2]&&(f[p]=-1,f[p+2]=1),(d=this[x[p]])._length=o.viewBox[p+2]-o.viewBox[p],s.doAutoRange(d),d.setScale();y(l),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":38,"mouse-change":453,"mouse-event-offset":454,"mouse-wheel":456,"right-now":511}],826:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return i.validate(t[e],c[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":613,"../../../lib":738,"../../../registry":861,"../../subplot_defaults":853,"./axis_defaults":829,"./layout_attributes":832}],832:[function(t,e,r){"use strict";function n(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"}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{}),editType:"camera"},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},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:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":738,"../../../lib/extend":727,"./axis_attributes":828}],833:[function(t,e,r){"use strict";function n(){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]}var i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=i(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new n;return e.merge(t),e}},{"../../../lib/str2rgbarray":760}],834:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var h=l[o[u]];if(h._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(h._length)===1/0)c[u]=[];else{h.range[0]=r[u].lo/t.dataScale[u],h.range[1]=r[u].hi/t.dataScale[u],h._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),h.range[0]===h.range[1]&&(h.range[0]-=1,h.range[1]+=1);var f=h.tickmode;if("auto"===h.tickmode){h.tickmode="linear";var d=h.nticks||i.constrain(h._length/40,4,9);n.autoTicks(h,Math.abs(h.range[1]-h.range[0])/d)}for(var p=n.calcTicks(h),m=0;mf[1][s]?d[s]=1:f[1][s]===f[0][s]?d[s]=1:d[s]=1/(f[1][s]-f[0][s]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var A=m[1][a]-m[0][a];m[0][a]-=A/32,m[1][a]+=A/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){var L=y[c=(l=u[k[a]]).type];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=E;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=u.aspectratio;C=[I.x,I.y,I.z]}u.aspectratio.x=h.aspectratio.x=C[0],u.aspectratio.y=h.aspectratio.y=C[1],u.aspectratio.z=h.aspectratio.z=C[2],this.glplot.aspect=C;var P=u.domain||null,D=e._size||null;if(P&&D){var z=this.container.style;z.position="absolute",z.left=D.l+P.x[0]*D.w+"px",z.top=D.t+(1-P.y[1])*D.h+"px",z.width=D.w*(P.x[1]-P.x[0])+"px",z.height=D.h*(P.y[1]-P.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),s(this.glplot.camera)},M.setCamera=function(t){this.glplot.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(t))},M.saveCamera=function(t){function e(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 r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}var a=t("../../lib"),o=t("./convert_text_opts"),s=n.prototype;s.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},s.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},s.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":a.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":a.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":a.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=o(n.textposition,n.iconsize);a.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),a.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},s.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":738,"./convert_text_opts":839}],842:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition,s=t("../../plot_api/edit_types").overrideAll,l=a({});l.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=s({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:l,textposition:n.extendFlat({},o,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":613,"../../lib":738,"../../plot_api/edit_types":769,"../../traces/scatter/attributes":1054,"../font_attributes":810}],843:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){function r(t,e){return i.coerce(n,a,o.layers,t,e)}var n,a,s=t.layers||[],l=e.layers=[];for(var c=0;c=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(){p.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()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=i.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],f=t.data||[];t._transitionData||p.createTransitionData(t),n._dfltTitle={plot:h(t,"Click to enter Plot title"),x:h(t,"Click to enter X axis title"),y:h(t,"Click to enter Y axis title"),colorbar:h(t,"Click to enter Colorscale title")},n._traceWord=h(t,"trace");var d=function(t){function e(t){for(var e=!0,r=0;r=0)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),h=c.left+c.right,f=c.bottom+c.top,d=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(m.width-h)),i=Math.round(d*(m.height-f))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var v=p.layoutAttributes.width.min,y=p.layoutAttributes.height.min;n1,x=!e.height&&Math.abs(r.height-i)>1;(x||b)&&(b&&(r.width=n),x&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand){u.base={l:{val:0,size:i},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}};for(var h in u){var f=u[h].l||{},d=u[h].b||{},p=f.val,m=f.size,g=d.val,v=d.size;for(var y in u){if(a(m)&&u[y].r){var b=u[y].r.val,x=u[y].r.size;if(b>p){var _=(m*b+(x-e.width)*p)/(b-p),w=(x*(1-p)+(m-e.width)*(1-b))/(b-p);_>=0&&w>=0&&_+w>i+s&&(i=_,s=w)}}if(a(v)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>g){var T=(v*M+(k-e.height)*g)/(M-g),A=(k*(1-g)+(v-e.height)*(1-M))/(M-g);T>=0&&A>=0&&T+A>c+l&&(c=T,l=A)}}}}}if(r.l=Math.round(i),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(u.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var s,l,c=0,h=0,p=t._fullLayout._basePlotModules,m=!1;if(r)for(l=0;l=0;o--)if(x[o].enabled){r._indexToPoints=x[o]._indexToPoints;break}i&&i.calc&&(b=i.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:d,y:d}]),b[0].t||(b[0].t={}),b[0].trace=r,p[a]=b}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r){function n(t){for(var e=[],r=0;r=0?f.angularAxis.domain:n.extent(M),E=Math.abs(M[1]-M[0]);T&&!k&&(E=0);var L=S.slice();A&&k&&(L[1]+=E);var C=f.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),f.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var I=f.angularAxis.ticksStep||(L[1]-L[0])/(C*(f.minorTicks+1));w&&(I=Math.max(Math.round(I),1)),L[2]||(L[2]=I);var P=n.range.apply(this,L);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=A?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var D=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),z=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));t=n.select(z)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,F=t.select(".chart-group"),R={fill:"none",stroke:f.tickColor},j={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[b,f.margin.top]+")"}).style({display:"block"});var N=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:N,reverseOrder:f.legend.reverseOrder})})();var B=O.node().getBBox();b=Math.min(f.width-B.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,b=Math.max(10,b),_=[f.margin.left+b,f.margin.top+b],r.range([0,b]),u.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(f.width-(f.margin.left+f.margin.right+2*b+(B?B.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),f.title){var V=t.select("g.title-group text").style(j).text(f.title),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var q=t.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(R),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:b}).style(R);var Y=t.select("circle.background-circle").attr({r:b}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(W).attr({transform:"rotate("+f.radialAxis.orientation+")"}),q.selectAll(".domain").style(R),q.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(j).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,j["font-size"]]+")":"translate("+[0,j["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(P),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+c(t)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(R),Z.selectAll(".minor").style({stroke:f.minorTickColor}),X.select("line.grid-line").attr({x1:f.tickLength?b-f.tickLength:0,x2:b}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(j);var J=X.select("text.axis-text").attr({x:b+f.labelOffset,dy:a+"em",transform:function(t,e){var r=c(t),n=b+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(j);f.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[b+K,f.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(p);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),p[0]||Q){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!k){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ct.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);ot.text(o.util.round(rt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(Y).radius);var i=o.util.convertToCartesian(n,f.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,h=this.getBoundingClientRect(),f=t.node().getBoundingClientRect(),d=[h.left+h.width/2-U[0]-f.left,h.top+h.height/2-U[1]-f.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},f.getLiveConfig=function(){return u},f.getinputConfig=function(){return c},f.radialScale=function(t){return r},f.angularScale=function(t){return s},f.svg=function(){return t},n.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var h=t.angularScale.range(),f=Math.abs(h[1]-h[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-f/2}).endAngle(function(t){return f/2}).innerRadius(function(e){return t.radialScale(l+(e[2]||0))}).outerRadius(function(e){return t.radialScale(l+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(e,r){return"rotate("+(t.orientation+s(e[0])+90)+")"}})};var p={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(p).each(c[t.geometryType]),g.exit().remove(),m.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],o.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=u?r.height:c*o.length,f=s.classed("legend-group",!0).selectAll("svg").data([0]),d=f.enter().append("svg").attr({width:300,height:h+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),g=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,h]);if(u){var v=f.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),f.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var y=f.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){return function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()}(t.symbol,c)},fill:function(t,e){return m(e)}}),y.exit().remove()}var b=n.svg.axis().scale(g).orient("right"),x=f.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),x.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",h=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(h);var f=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*f+l,g=d.height+2*f;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*f]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../constants/alignment":711,"../../lib":738,d3:123}],851:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(h),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":613,"../../lib":738,"./micropolar":850,"./undo_manager":852,d3:123}],852:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":613,"../../subplot_defaults":853,"./axis_defaults":857,"./layout_attributes":859}],859:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes"),a=t("../../../plot_api/edit_types").overrideAll;e.exports=a({domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i},"plot","from-root")},{"../../../components/color/attributes":612,"../../../plot_api/edit_types":769,"./axis_attributes":856}],860:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=l._,u=t("../../components/color"),h=t("../../components/drawing"),f=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),m=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),b=t("../cartesian/select"),x=t("../cartesian/constants");e.exports=n;var _=n.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*b?i=(a=b)*w:a=(i=y)/w,o=g*i/y,s=v*a/b,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=x,l.xaxis={type:"linear",range:[_+2*k-x,x-_-2*M],domain:[p-o/2,p+o/2],_id:"x"},f(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[_,x-M-k],domain:[m-s/2,m+s/2],_id:"y"},f(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var T=l.yaxis.domain[0],A=l.aaxis=d({},t.aaxis,{visible:!0,range:[_,x-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+s*w],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});f(A,l.graphDiv._fullLayout),A.setScale();var S=l.baxis=d({},t.baxis,{visible:!0,range:[x-_-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});f(S,l.graphDiv._fullLayout),S.setScale(),A._counteraxis=S;var E=l.caxis=d({},t.caxis,{visible:!0,range:[x-_-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+s*w],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});f(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var I="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),l.clipDefRelative.select("path").attr("transform",null);var P="translate("+(r-S._offset)+","+(n+a)+")";l.layers.baxis.attr("transform",P),l.layers.bgrid.attr("transform",P);var D="translate("+(r+i/2)+","+n+")rotate(30)translate(0,-"+A._offset+")";l.layers.aaxis.attr("transform",D),l.layers.agrid.attr("transform",D);var z="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,-"+E._offset+")";l.layers.caxis.attr("transform",z),l.layers.cgrid.attr("transform",z),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),h.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(m.doTicks(e,n,!0),m.doTicks(e,i,!0),m.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));y.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:c(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var s=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;y.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:c(e,"Click to enter Component B title"),attributes:{x:this.x0-s,y:this.y0+this.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),y.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:c(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+s,y:this.y0+this.h+.83*a.titlefont.size+s,"text-anchor":"middle"}})}};var M=x.MINZOOM/2+.87,k="m-0.87,.5h"+M+"v3h-"+(M+5.2)+"l"+(M/2+2.6)+",-"+(.87*M+4.5)+"l2.6,1.5l-"+M/2+","+.87*M+"Z",T="m0.87,.5h-"+M+"v3h"+(M+5.2)+"l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-2.6,1.5l"+M/2+","+.87*M+"Z",A="m0,1l"+M/2+","+.87*M+"l2.6,-1.5l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-"+(M/2+2.6)+","+(.87*M+4.5)+"l2.6,1.5l"+M/2+",-"+.87*M+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;_.initInteractions=function(){function t(t,e){return 1-e/O.h}function e(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function r(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function n(n,i){var a=m+n,o=y+i,s=Math.max(0,Math.min(1,t(0,y),t(0,o))),l=Math.max(0,Math.min(1,e(m,y),e(a,o))),c=Math.max(0,Math.min(1,r(m,y),r(a,o))),u=(s/2+c)*O.w,h=(1-s/2-l)*O.w,f=(u+h)/2,d=h-u,p=(1-s)*O.h,g=p-d/w;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),z.transition().style("opacity",1).duration(200),P=!0)}function a(){if(i(R),L!==_){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t),E&&R.data&&R._context.showTips&&(l.notifier(c(R,"Double-click to zoom back out"),"long"),E=!1)}}function f(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m,i=[(L={a:_.a-n,b:_.b+(r+n)/2,c:_.c-(r-n)/2}).a,L.b,L.c].sort(),a=i.indexOf(L.a),o=i.indexOf(L.b),s=i.indexOf(L.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),L={a:i[a],b:i[o],c:i[s]},e=(_.a-L.a)*O.yaxis._m,t=(_.c-L.c-_.b+L.b)*O.xaxis._m);var l="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",l);var c="translate("+-t+","+-e+")";O.clipDefRelative.select("path").attr("transform",c),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(h.hideOutsideRangePoints,O)}function d(){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t)}function p(){j.selectAll(".select-outline").remove()}var m,y,_,M,L,C,I,P,D,z,O=this,F=O.layers.plotbg.select("path").node(),R=O.graphDiv,j=R._fullLayout._zoomlayer,N={element:F,gd:R,plotinfo:{xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(t,e,r){N.xaxes=[O.xaxis],N.yaxes=[O.yaxis];var i=R._fullLayout.dragmode;t.shiftKey&&(i="pan"===i?"zoom":"pan"),N.minDrag="lasso"===i?1:void 0,"zoom"===i?(N.moveFn=n,N.doneFn=a,function(t,e,r){var n=F.getBoundingClientRect();m=e-n.left,y=r-n.top,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,M=O.aaxis.range[1]-_.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),I="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",P=!1,D=j.append("path").attr("class","zoombox").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",I),z=j.append("path").attr("class","zoombox-corners").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}(0,e,r)):"pan"===i?(N.moveFn=f,N.doneFn=d,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,p()):"select"!==i&&"lasso"!==i||b(t,e,r,N,i)},clickFn:function(t,e){if(i(R),2===t){var r={};r[O.id+".aaxis.min"]=0,r[O.id+".baxis.min"]=0,r[O.id+".caxis.min"]=0,R.emit("plotly_doubleclick",null),s.relayout(R,r)}v.click(R,e,O.id)}};F.onmousemove=function(t){v.hover(R,t,O.id),R._fullLayout._lasthover=F,R._fullLayout._hoversubplot=O.id},F.onmouseout=function(t){R._dragging||g.unhover(R,t)},g.init(N)}},{"../../components/color":613,"../../components/dragelement":635,"../../components/drawing":638,"../../components/fx":655,"../../components/titles":704,"../../lib":738,"../../lib/extend":727,"../../plotly":780,"../cartesian/axes":785,"../cartesian/constants":790,"../cartesian/select":802,"../cartesian/set_convert":803,"../plots":846,d3:123,tinycolor2:543}],861:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=a.extendFlat,s=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,l=t.layout,c=s([],a),u=s({},l,n(e.tileClass)),h=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var f=Object.keys(u);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(w),w=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}(w),w=w.replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},{"../components/color":613,"../components/drawing":638,"../constants/xmlns_namespaces":719,"../lib":738,d3:123}],870:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&E>0&&(S<=F&&E<=R||S<=R&&E<=F||("h"===M?F>=S*(R/E):R>=E*(F/S)))?m="inside":(m="outside",T.remove(),T=null)}else m="inside";if(!T&&(T=d(e,k,"outside"===m?I:C),A=p.bBox(T.node()),S=A.width,E=A.height,S<=0||E<=0))T.remove();else{var j;j="outside"===m?function(t,e,r,n,a,o,s){var l,c="h"===o?Math.abs(n-r):Math.abs(e-t);c>2*w&&(l=w);var u=1;s&&(u="h"===o?Math.min(1,c/a.height):Math.min(1,c/a.width));var h,f,d,p,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2;h=u*a.width,f=u*a.height,"h"===o?er?(d=(t+e)/2,p=n+l+f/2):(d=(t+e)/2,p=n-l-f/2);return i(m,g,d,p,u,!1)}(l,c,u,h,A,M,"both"===g.constraintext||"outside"===g.constraintext):function(t,e,r,n,a,o,s){var l,c,u,h,f,d=a.width,p=a.height,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*w&&y>2*w?(v-=2*(f=w),y-=2*f):f=0;var b,x;d<=v&&p<=y?(b=!1,x=1):d<=y&&p<=v?(b=!0,x=1):dr?(u=(t+e)/2,h=n-f-c/2):(u=(t+e)/2,h=n+f+c/2);return i(m,g,u,h,x,b)}(l,c,u,h,A,M,"both"===g.constraintext||"inside"===g.constraintext),T.attr("transform",j)}}}function i(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");return"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function a(t,e,r,n){var i=o((e=e||{}).family,r),a=o(e.size,r),l=o(e.color,r);return{family:s(t.family,i,n.family),size:function(t,e,r){if(c(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&ei;if(!a)return e}return void 0!==r?r:t.dflt}(t.size,a,n.size),color:function(t,e,r){return u(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function o(t,e){var r;return Array.isArray(t)?e=2?h(t):t>e?Math.ceil(t):Math.floor(t)}var g,v,y,b,x=r.p+(p?f[s]:f),_=x+r.w,w=r.b,M=w+r.s;if("h"===u.orientation?(y=a.c2p(x,!0),b=a.c2p(_,!0),g=i.c2p(w,!0),v=i.c2p(M,!0),r.ct=[v,(y+b)/2]):(g=i.c2p(x,!0),v=i.c2p(_,!0),y=a.c2p(w,!0),b=a.c2p(M,!0),r.ct=[(g+v)/2,b]),c(g)&&c(v)&&c(y)&&c(b)&&g!==v&&y!==b){var k=(r.mlw+1||u.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,T=l.round(k/2%1,2);if(!t._context.staticPlot){var A=d.opacity(r.mc||u.marker.color)<1||k>.01?h:m;v=A(v,g=A(g,v)),b=A(b,y=A(y,b))}var S=l.select(this);S.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+g+","+y+"V"+b+"H"+v+"V"+y+"Z"),n(t,S,e,s,g,v,y,b)}else l.select(this).remove()})}),s.call(m.plot,e)}},{"../../components/color":613,"../../components/drawing":638,"../../components/errorbars":644,"../../lib":738,"../../lib/svg_text_utils":761,"./attributes":871,d3:123,"fast-isnumeric":132,tinycolor2:543}],879:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;ru+s||!p(l))&&(f=!0,c(h,t))}for(var i=r.traces,a=d(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,h=[l,u],f=!1,g=0;g1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){function e(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}var r,a=n.select(this);a.classed("bartext-inside")?r=s.insidetextfont:a.classed("bartext-outside")&&(r=s.outsidetextfont),r||(r=s.textfont),i.font(a,e("family"),e("size"),e("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":638,"../../components/errorbars":644,d3:123}],883:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":613,"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627}],884:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":612,"../../lib/extend":727,"../scatter/attributes":1054}],885:[function(t,e,r){"use strict";function n(t,e){return t.v-e.v}function i(t){return t.v}var a=t("fast-isnumeric"),o=t("../../lib"),s=o._,l=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,c,u,h,f,d=t._fullLayout,p=l.getFromId(t,e.xaxis||"x"),m=l.getFromId(t,e.yaxis||"y"),g=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=p,u="x",h=m,f="y"):(c=m,u="y",h=p,f="x");var y=c.makeCalcdata(e,u),b=function(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||a(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;var l=r.d2c(s,0,t[e+"calendar"]);return n.map(function(){return l})}(e,f,h,y,d[v]),x=o.distinctVals(b),_=x.vals,w=x.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var C=A[r].sort(n),I=C.map(i),P=I.length,D={pos:_[r],pts:C};D.min=I[0],D.max=I[P-1],D.mean=o.mean(I,P),D.sd=o.stdev(I,P,D.mean),D.q1=o.interp(I,.25),D.med=o.interp(I,.5),D.q3=o.interp(I,.75),D.lf=Math.min(D.q1,I[Math.min(o.findBin(2.5*D.q1-1.5*D.q3,I,!0)+1,P-1)]),D.uf=Math.max(D.q3,I[Math.max(o.findBin(2.5*D.q3-1.5*D.q1,I),0)]),D.lo=4*D.q1-3*D.q3,D.uo=4*D.q3-3*D.q1,g.push(D)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r0?(g[0].t={num:d[v],dPos:w,posLetter:f,valLetter:u,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},d[v]++,g):[{t:{empty:!0}}]}},{"../../lib":738,"../../plots/cartesian/axes":785,"fast-isnumeric":132}],886:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a=r("y"),s=r("x");if(a&&a.length)i="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",r("y0")}o.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function i(t,e,r,n){var i=n.prefix,o=a.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",o||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),a.coerceSelectionMarkerOpacity(e,r)}var a=t("../../lib"),o=t("../../registry"),s=t("../../components/color"),l=t("./attributes");e.exports={supplyDefaults:function(t,e,r,o){function c(r,n){return a.coerce(t,e,l,r,n)}n(t,e,c,o),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",s.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),i(t,e,c,{prefix:"box"}))},handleSampleDefaults:n,handlePointsDefaults:i}},{"../../components/color":613,"../../lib":738,"../../registry":861,"./attributes":884}],887:[function(t,e,r){"use strict";function n(t,e,r,n){var i,c,u,h,f,d,p,m,g,v=t.cd,y=t.xa,b=t.ya,x=v[0].trace,_=v[0].t,w="violin"===x.type,M=[],k="closest"!==n||w?_.bdPos:2.5*_.bdPos,T=function(t){return t.pos+_.bPos-d};w&&"both"!==x.side?("positive"===x.side&&(g=function(t){var e=T(t);return s.inbox(e,e+k)}),"negative"===x.side&&(g=function(t){var e=T(t);return s.inbox(e-k,e)})):g=function(t){var e=T(t);return s.inbox(e-k,e+k)};var A;A=w?function(t){return s.inbox(t.span[0]-f,t.span[1]-f)}:function(t){return s.inbox(t.min-f,t.max-f)},"h"===x.orientation?(f=e,d=r,p=A,m=g,i="y",u=b,c="x",h=y):(f=r,d=e,p=g,m=A,i="x",u=y,c="y",h=b);var S=s.getDistanceFunction(n,p,m);if(s.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],L=x.line.color,C=(x.marker||{}).color;l.opacity(L)&&x.line.width?t.color=L:l.opacity(C)&&x.boxpoints?t.color=C:t.color=x.fillcolor,t[i+"0"]=u.c2p(E.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(E.pos+_.bPos+_.bdPos,!0),a.tickText(u,u.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var I={},P=["med","min","q1","q3","max"];(x.boxmean||(x.meanline||{}).visible)&&P.push("mean"),(x.boxpoints||x.points)&&P.push("lf","uf");for(var D=0;Dt.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*o,u=o*f,m=[],g=0;if(r.jitter){if(0===o)for(g=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(c.translatePoints,a,o)}function o(t,e,r,n){var i,a,o=e.pos,c=e.val,u=n.bPos,h=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(l.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+u,!0)+h,n=o.c2p(t.pos+u-i,!0)+h,l=o.c2p(t.pos+u+a,!0)+h,f=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?s.select(this).attr("d","M"+f+","+n+"V"+l+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+f+","+n+"L"+p+","+e+"Z":"")):s.select(this).attr("d","M"+n+","+f+"H"+l+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+f+"L"+e+","+p+"Z":""))})}var s=t("d3"),l=t("../../lib"),c=t("../../components/drawing"),u=2e9,h=5,f=.01;e.exports={plot:function(t,e,r){var n=t._fullLayout,l=e.xaxis,c=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e=t[0],r=e.t,u=e.trace,h=e.node3=s.select(this),f=n._numBoxes,d="group"===n.boxmode&&f>1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?f:1),m=d?2*r.dPos*((r.num+.5)/f-.5)*(1-n.boxgap):0,g=p*u.whiskerwidth;if(!0!==u.visible||r.empty)s.select(this).remove();else{var v,y;"h"===u.orientation?(v=c,y=l):(v=l,y=c),r.bPos=m,r.bdPos=p,r.wdPos=g,i(h,{pos:v,val:y},u,r),u.boxpoints&&a(h,{x:l,y:c},u,r),u.boxmean&&o(h,{pos:v,val:y},u,r)}})},plotBoxAndWhiskers:i,plotPoints:a,plotBoxMean:o}},{"../../components/drawing":638,"../../lib":738,d3:123}],892:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,I=E>0?Math.ceil:Math.floor,P=E>0?Math.min:Math.max,D=E>0?Math.max:Math.min,z=C(A+L),O=I(S-L),F=[[u=T(A)]];for(i=z;i*E=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],907:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,h,f,d,p,g,v=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(z-2,i))),s=i-o,b.length=z,b.crossLength=D,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(f=t.dxydi([],n-1,o,0,s),v.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(D-2,n))),u=n-c,b.length=D,b.crossLength=z,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],c,i-1,u,1),v.push(h[0]-g[0]/3),y.push(h[1]-g[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return b.axisLetter=r,b.axis=M,b.crossAxis=E,b.value=e,b.constvar=a,b.index=m,b.x=v,b.y=y,b.smoothing=E.smoothing,b}function s(e){var n,i,o,s,l,c=[],u=[],h={};if(h.length=w.length,h.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(z-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(b=w[u],x=w[y],l=0;lw[w.length-1]||T.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,d=(f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}))[0],p=f[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||T.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":727,"../../plots/cartesian/axes":785}],908:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],924:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],l=r[0].trace,c=e.xaxis,f=e.yaxis,d=l.aaxis,p=l.baxis,m=t._fullLayout,g=e.plot.selectAll(".carpetlayer"),v=m._clips,y=n(g,"g","carpet"+l.uid).classed("trace",!0),b=n(y,"g","minorlayer"),x=n(y,"g","majorlayer"),_=n(y,"g","boundarylayer"),w=n(y,"g","labellayer");y.style("opacity",l.opacity),a(c,f,x,d,"a",d._gridlines),a(c,f,x,p,"b",p._gridlines),a(c,f,b,d,"a",d._minorgridlines),a(c,f,b,p,"b",p._minorgridlines),a(c,f,_,d,"a-boundary",d._boundarylines),a(c,f,_,p,"b-boundary",p._boundarylines);!function(t,e,r,n,i,a,o,l){var c,u,h,f;c=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],h=r.ab2xy(c,u,!0),f=r.dxyda_rough(c,u),s(t,e,r,n,h,f,r.aaxis,i,a,o,"a-title"),c=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),h=r.ab2xy(c,u,!0),f=r.dxydb_rough(c,u),s(t,e,r,n,h,f,r.baxis,i,a,l,"b-title")}(t,w,l,i,c,f,o(t,c,f,l,i,w,d._labels,"a-label"),o(t,c,f,l,i,w,p._labels,"b-label")),function(t,e,r,i,a){var o,s,l,c,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var d=n(f,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(c.font,i.font).text(i.text).call(d.convertToTspans,t),p=c.bBox(this);u.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*p.height+")"),h=Math.max(h,p.width+i.axis.labelpadding)}),u.exit().remove(),h}function s(t,e,r,n,i,a,o,s,u,h,p){var m=[];o.title&&m.push(o.title);var g=e.selectAll("text."+p).data(m);g.enter().append("text").classed(p,!0),g.each(function(){var e=f(r,s,u,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(h=0),h+=o.titlefont.size+o.titleoffset;l.select(this).text(o.title||"").call(d.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+h+")").classed("user-select-none",!0).attr("text-anchor","middle").call(c.font,o.titlefont)}),g.exit().remove()}var l=t("d3"),c=t("../../components/drawing"),u=t("./map_1d_array"),h=t("./makepath"),f=t("./orient_text"),d=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,h.smoothing,f.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,d,p,m=0,g=0,v=[];ne[c-1]?(h=c-2,f=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):f=o-(h=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(d=u-2,p=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,h,d,f,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,h,d,f,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":756,"./compute_control_points":911,"./constants":912,"./create_i_derivative_evaluator":913,"./create_j_derivative_evaluator":914,"./create_spline_evaluator":915}],926:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){function i(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&o0&&a1e-5);return n.log("Smoother converged to",k,"after",T,"iterations"),t}},{"../../lib":738}],927:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":969,"./has_columns":917}],928:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":614,"../../components/colorscale/attributes":619,"../../lib/extend":727,"../../plots/attributes":783,"../scattergeo/attributes":1093}],929:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;cl&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":623,"../../lib":738,"./attributes":928}],931:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],932:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,h=u[0].trace,f=t.subplot;for(s=0;s")}(t,h,o,f.mockAxis),[t]}},{"../../plots/cartesian/axes":785,"../scatter/fill_hover_text":1062,"./attributes":928}],933:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":814,"../heatmap/colorbar":968,"./attributes":928,"./calc":929,"./defaults":930,"./event_data":931,"./hover":932,"./plot":934,"./select":935,"./style":936}],934:[function(t,e,r){"use strict";function n(t,e){for(var r=t[0].trace,n=t.length,i=s(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,s=t.geometry,l=s.coordinates,c=t.id,u=[];r="RUS"===c||"FJI"===c?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var s=o.tester(n);s.pts.pop(),u.push(s)}:function(t){u.push(o.tester(t))};switch(s.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,h=e._input.contours;if(c>u&&(s.start=h.start=u,u=s.end=h.end=c,c=s.start),!(s.size>0)){var f;f=c===u?1:n(c,u,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":738,"../../plots/cartesian/axes":785,"../heatmap/calc":966}],939:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,h=c.size||1,f=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:h}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":617,"../../plots/plots":846,"./end_plus":943,"./make_color_map":947}],940:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],941:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,"contours.start"),o=n.coerce2(t,e,i,"contours.end"),s=!1===a||!1===o,l=r("contours.size");!(s?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{"../../lib":738,"./attributes":937}],942:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)):e.visible=!1}},{"../../lib":738,"../heatmap/has_columns":972,"../heatmap/xyz_defaults":981,"./attributes":937,"./contours_defaults":941,"./style_defaults":951}],943:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],944:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==l.BOTTOMSTART.indexOf(t)?i=1:-1!==l.LEFTSTART.indexOf(t)?n=1:-1!==l.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),g=[o(t,e,[-m[0],-m[1]])],v=m.join(","),y=t.z.length,b=t.z[0].length;for(h=0;h<1e4;h++){if(p>20?(p=l.CHOOSESADDLE[p][(m[0]||m[1])<0?0:1],t.crossings[d]=l.SADDLEREMAINDER[p]):delete t.crossings[d],!(m=l.NEWDELTA[p])){s.log("Found bad marching index:",p,e,t.level);break}g.push(o(t,e,m)),e[0]+=m[0],e[1]+=m[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),d=e.join(",");var x=m[0]&&(e[0]<0||e[0]>b-2)||m[1]&&(e[1]<0||e[1]>y-2);if(d===f&&m.join(",")===v||r&&x)break;p=t.crossings[d]}1e4===h&&s.log("Infinite loop in contour?");var _,w,M,k,T,A,S,E,L,C,I,P=n(g[0],g[g.length-1],a,c),D=0,z=.2*t.smoothing,O=[],F=0;for(h=1;h=F;h--)if((_=O[h])=F&&_+O[w]E&&L--,t.edgepaths[L]=I.concat(g,C));break}N||(t.edgepaths[E]=g.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r)return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208;return 15===r?0:r}((c=t[u]).level,s))&&(c.crossings[o]=l,-1!==i.indexOf(l)&&(c.starts.push([e,r]),p&&-1!==i.indexOf(l,i.indexOf(l)+1)&&c.starts.push([e,r])))}},{"./constants":940}],949:[function(t,e,r){"use strict";function n(t,e,n){var l=n[0].trace,c=n[0].x,u=n[0].y,g=l.contours,v=l.uid,y=e.xaxis,b=e.yaxis,x=t._fullLayout,_="contour"+v,w=function(t,e,r){for(var n=t.size,i=[],a=p(t),s=t.start;s1e3){o.warn("Too many contours, clipping at 1000",t);break}return i}(g,e,n[0]);if(!0!==l.visible)return x._paper.selectAll("."+_+",.hm"+v).remove(),void x._infolayer.selectAll(".cb"+v).remove();"heatmap"===g.coloring?(l.zauto&&!1===l.autocontour&&(l._input.zmin=l.zmin=g.start-g.size/2,l._input.zmax=l.zmax=l.zmin+w.length*g.size),h(t,e,[n])):(x._paper.selectAll(".hm"+v).remove(),x._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+v).remove()),f(w),d(w);var M=y.c2p(c[0],!0),k=y.c2p(c[c.length-1],!0),T=b.c2p(u[0],!0),A=b.c2p(u[u.length-1],!0),S=[[M,A],[k,A],[k,T],[M,T]],E=r.makeContourGroup(e,n,_);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(E,S,g),function(t,e,r,n){var o=t.selectAll("g.contourfill").data([0]);o.enter().append("g").classed("contourfill",!0);var s=o.selectAll("path").data("fill"===n.coloring?e:[]);s.enter().append("path"),s.exit().remove(),s.each(function(t){var e=i(t,r);e?a.select(this).attr("d",e).style("stroke","none"):a.select(this).remove()})}(E,w,S,g),function(t,e,n,i,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var h=!1!==l.showlines,f=l.showlabels,d=h&&f,p=r.createLines(u,h||f,e),g=r.createLineClip(u,d,n._fullLayout._clips,i.trace.uid),v=t.selectAll("g.contourlabels").data(f?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),f){var y=[c],b=[];o.clearLocationCache();var x=r.labelFormatter(l,i.t.cb,n._fullLayout),_=s.tester.append("text").attr("data-notex",1).call(s.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var T=Math.sqrt(w*w+M*M),A=m.LABELDISTANCE*T/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,x,_,n);a.select(this).selectAll("path").each(function(){var t=o.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/A),m.LABELMAX),i=0;i=0&&(c=b,h=f):Math.abs(l[1]-c[1])<.01?Math.abs(l[1]-b[1])<.01&&(b[0]-l[0])*(c[0]-b[0])>=0&&(c=b,h=f):o.log("endpt to newendpt is not vert. or horz.",l,c,b)}if(l=c,h>=0)break;m+="L"+c}if(h===t.edgepaths.length){o.log("unclosed perimeter path");break}g=h,(y=-1===v.indexOf(g))&&(g=v[0],m+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*a)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(c)*a);if(f<1||d<1)return 1/0;var p=g.EDGECOST*(1/(f-1)+1/(d-1));p+=g.ANGLECOST*c*c;for(var m=s-u,v=l-h,y=s+u,b=l+h,x=0;x2*g.MAXCOST)break;d&&(s/=2),l=(a=c-s/2)+1.5*s}if(f<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),h=i*u,f=a*c,d=i*c,p=-a*u,m=[[o-h-f,s-d-p],[o+h-f,s+d-p],[o+h+f,s+d+p],[o-h+f,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;a.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(l.convertToTspans,r)}),i){for(var s="",c=0;cb.end&&(b.start=b.end=(b.start+b.end)/2),e._input.contours=a({},b)}else{var _=b.start,w=b.end,M=e._input.contours;if(_>w&&(b.start=M.start=w,w=b.end=M.end=_,_=b.start),!(b.size>0)){var k;k=_===w?1:n(_,w,e.ncontours).dtick,M.size=b.size=k}}return y}}},{"../../components/colorscale/calc":620,"../../lib":738,"../../plots/cartesian/axes":785,"../carpet/lookup_carpetid":919,"../heatmap/clean_2d_array":967,"../heatmap/convert_column_xyz":969,"../heatmap/find_empties":971,"../heatmap/has_columns":972,"../heatmap/interp2d":975,"../heatmap/make_bound_array":976,"../heatmap/max_row_length":977,"./defaults":959}],954:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-1/0,h=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],955:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],956:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":955,"fast-isnumeric":132}],957:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":956,"fast-isnumeric":132}],958:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":738}],961:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":796,"../contour/colorbar":939,"../contour/style":950,"./attributes":952,"./calc":953,"./defaults":959,"./plot":964}],962:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function h(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,x=_):Math.abs(v[1]-y[1])=0&&(y=L,x=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(x>=0)break;M+=m(v,y),v=y}if(x===e.edgepaths.length){a.log("unclosed perimeter path");break}g=x,(T=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;U--)j=k.clipsegments[U],N=l([],j.x,L.c2p),B=l([],j.y,C.c2p),N.reverse(),B.reverse(),H.push(c(N,B,j.bicubic));var q="M"+H.join("L")+"Z";!function(t,e,r,n,i,a){var o,s,u,h,f=t.selectAll("g.contourbg").data([0]);f.enter().append("g").classed("contourbg",!0);var d=f.selectAll("path").data("fill"!==a||i?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(h=0;hb&&(n.max=b);n.len=n.max-n.min}(this,r,t,n,f,e.height),!(n.len<(e.width+e.height)*m.LABELMIN)))for(var s=Math.min(Math.ceil(n.len/P),m.LABELMAX),l=0;lI){r("x scale is not linear");break}}if(y.length&&"fast"===L){var P=(y[y.length-1]-y[0])/(y.length-1),D=Math.abs(P/100);for(w=0;wD){r("y scale is not linear");break}}}var z=u(_),O="scaled"===e.xtype?"":m,F=p(e,O,g,v,z,k),R="scaled"===e.ytype?"":y,j=p(e,R,b,x,_.length,T);E||(a.expand(k,F),a.expand(T,j));var N={x:F,y:j,z:_,text:e.text};if(S&&(N.xRanges=M.xRanges,N.yRanges=M.yRanges,N.pts=M.pts),s(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,g,v,z,k),N.yfill=p(B,R,b,x,_.length,T)}return[N]}},{"../../components/colorscale/calc":620,"../../lib":738,"../../plots/cartesian/axes":785,"../../registry":861,"../histogram2d/calc":998,"./clean_2d_array":967,"./convert_column_xyz":969,"./find_empties":971,"./has_columns":972,"./interp2d":975,"./make_bound_array":976,"./max_row_length":977}],967:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,c;if(e){for(i=0,l=0;l=0;o--)(s=((h[[(r=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":977}],972:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],973:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=x[0].length||d<0||d>x.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-b[0],r-b[b.length-1])>o)return;if(c){var A;for(k=[2*y[0]-y[1]],A=1;Am&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":738}],976:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)x=m.c2p(A[k]),k--;for(x0;)M=g.c2p(S[k]),k--;if(M0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c){var l=a(e,i,o),u=a(r,i,o),h=t===s?0:1;return l[h]!==u[h]}return Math.floor(r/t)-Math.floor(e/t)>.1}(f,t,e,l,r,n))break;u=f}return u}function i(t,e){return e&&t>f?t>c?t>1.1*s?s:t>1.1*l?l:c:t>u?u:t>h?h:f:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r){var n=e.c2d(t,s,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var o=t("../../constants/numerical"),s=o.ONEAVGYEAR,l=o.ONEAVGMONTH,c=o.ONEDAY,u=o.ONEHOUR,h=o.ONEMIN,f=o.ONESEC,d=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,l,u=-1.1*e,h=-.1*e,f=t-h,p=r[0],m=r[1],g=Math.min(n(p+h,p+f,i,a),n(m+h,m+f,i,a)),v=Math.min(n(p+u,p+h,i,a),n(m+u,m+h,i,a));if(g>v&&vc){var y=o===s?1:6,b=o===s?"M12":"M1";return function(e,r){var n=i.c2d(e,s,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cp.size/1.9?p.size:p.size/Math.ceil(p.size/x);var A=p.start+(p.size-x)/2;_=A-x*Math.ceil((A-_)/x)}for(h=0;h=0&&w=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}(a,b.direction,b.currentbin);var Z=Math.min(i.length,a.length),J=[],K=0,Q=Z-1;for(r=0;r=K;r--)if(a[r]){Q=r;break}for(r=K;r<=Q;r++)if(o(i[r])&&o(a[r])){var $={p:i[r],s:a[r],b:0};b.enabled||($.pts=I[r],H?$.p0=$.p1=I[r].length?T[I[r][0]]:i[r]:($.p0=X(S[r]),$.p1=X(S[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=l.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),c(J,e),Array.isArray(e.selectedpoints)&&s.tagSelected(J,e,Y),J}}},{"../../constants/numerical":717,"../../lib":738,"../../plots/cartesian/axes":785,"../bar/arrays_to_calcdata":870,"./average":986,"./bin_functions":988,"./bin_label_vals":989,"./clean_bins":991,"./norm_functions":996,"fast-isnumeric":132}],991:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var h="date"===a?o:1,f=c.size;if(n(f))c.size=f>0?Number(f):h;else if("string"!=typeof f)c.size=h;else{var d=f.charAt(0),p=f.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":717,"../../lib":738,"fast-isnumeric":132}],992:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function h(r,n){return i.coerce(t,e,c,r,n)}var f=h("x"),d=h("y");h("cumulative.enabled")&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var p=h("orientation",d&&!f?"h":"v"),m=e["v"===p?"x":"y"];if(m&&m.length){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u);e["h"===p?"x":"y"]&&h("histfunc");o(t,e,h,"h"===p?["y"]:["x"]),s(t,e,h,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1}},{"../../components/color":613,"../../components/errorbars/defaults":643,"../../lib":738,"../../registry":861,"../bar/style_defaults":883,"./attributes":985,"./bin_defaults":987}],993:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;t.pointNumbers=a,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex;var o;if(r._indexToPoints){o=[];for(var s=0;sT&&g.splice(T,g.length-T),y.length>T&&y.splice(T,y.length-T),n(e,"x",g,m,_,M,b),n(e,"y",y,v,w,k,x);var A=[],S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,I=[],P=[],D=L?I:e.xbins,z=C?P:e.ybins,O=0,F=[],R=[],j=e.histnorm,N=e.histfunc,B=-1!==j.indexOf("density"),U="max"===N||"min"===N?null:0,V=c.count,H=u[j],q=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==N&&(q="avg"===N,V=c[N]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-l.tickIncrement(Z,X.size,!1,b))/1e6;for(r=Z;r=0&&d=0&&p0)o=c(t.alphahull,f);else{var d=["x","y","z"].indexOf(t.delaunayaxis);o=l(f.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:f,cells:o,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:h(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=function(t){return t.map(function(t){var e=t[0],r=s(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=i(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=i(t.facecolor)):(this.color=t.color,p.meshColor=h(t.color)),this.mesh.update(p)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=o({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":760,"alpha-shape":44,"convex-hull":104,"delaunay-triangulate":124,"gl-mesh3d":206,tinycolor2:543}],1010:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),h=c(["i","j","k"]);if(u){h&&h.forEach(function(t){for(var e=0;ei?r=!0:e1)){var h=a.simpleMap(u.x,e.d2c,0,r.xcalendar),f=a.distinctVals(h).minDiff;o=Math.min(o,f)}}for(o===1/0&&(o=1),c=0;c");S.push(o,o,o,o,o,o,null)},R=0;Rs&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),c.splice(s)),l=0;l0)&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),h=Math.min(h,o.values.length)),o._index=l,u.push(o));if(isFinite(h))for(l=0;lh&&(o.values=o.values.slice(0,h));return u}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var h={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",h),n.coerceFont(c,"tickfont",h),n.coerceFont(c,"rangefont",h)}},{"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627,"../../lib":738,"./attributes":1019,"./constants":1023}],1025:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1019,"./base_plot":1020,"./calc":1021,"./colorbar":1022,"./defaults":1024,"./plot":1028}],1026:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function i(t,e,r,i,a,o){function s(c){var u;u=Math.min(i,a-c*i),o.offset=f*c*i,o.count=f*u,0===c&&(window.cancelAnimationFrame(r.currentRafs[l]),delete r.currentRafs[l],n(t,o.scissorX,o.scissorY,o.scissorWidth,o.viewBoxSize[1])),r.clearOnly||(e(o),c*i+u>>8*e)%256/255}function s(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i=h-4?o(s,h-2-l):.5);return i}(E,S,A,C),O=s(E,z),F=e.regl,R=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?p:a).concat(r))}return n}(w,M,Math.round(255*(M?I:1)))}),j=F({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:k?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:R,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),N=[0,1],B=[];return{setColorDomain:function(t){N[0]=t[0],N[1]=t[1]},render:function(t,e,a){var o,s,l,c=1/0,h=-1/0;for(o=0;oh&&(h=t[o].dim2.canvasX,l=o),t[o].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t){return d.scale.linear().domain(i(t))}function s(t,e,r){var i=v(e),a=i.trace,s=i.lineColor,l=i.cscale,c=a.line,u=a.domain,p=a.dimensions,m=t.width,g=a.labelfont,y=a.tickfont,b=a.rangefont,x=f.extendDeep({},c,{color:s.map(o({values:s,range:[c.cmin,c.cmax]})),blockLineCount:h.blockLineCount,canvasOverdrag:h.overdrag*h.canvasPixelRatio}),_=Math.floor(m*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,T=w;return{key:r,colCount:p.filter(n).length,dimensions:p,tickDistance:h.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return d.rgb(t)}),n="rgb".split("").map(function(t){return d.scale.linear().clamp(!0).domain(e).range(r.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return n.map(function(e){return e(t)})}}(l),lines:x,labelFont:g,tickFont:y,rangeFont:b,layoutWidth:m,layoutHeight:t.height,domain:u,translateX:u.x[0]*m,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*h.canvasPixelRatio+2*x.canvasOverdrag,canvasHeight:T*h.canvasPixelRatio,width:k,height:T,canvasPixelRatio:h.canvasPixelRatio}}function l(t){var e=t.width,r=t.height,a=t.dimensions,s=t.canvasPixelRatio,l=function(r){return e*r/Math.max(1,t.colCount-1)},c=h.verticalPadding/(r*s),u=1-2*c,f=function(t){return c+u*t},p={key:t.key,xScale:l,model:t},m={};return p.dimensions=a.filter(n).map(function(e,n){var a=o(e),c=m[e.label];m[e.label]=(c||0)+1;return{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:h.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(f),xScale:l,x:l(n),canvasX:l(n)*s,unitScale:function(t,e){return d.scale.linear().range([t-e,e])}(r,h.verticalPadding),domainScale:function(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?d.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(d.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):d.scale.linear().domain(n).range([t-e,e])}(r,h.verticalPadding,e),ordinalScale:function(t){var e=i(t);return t.tickvals&&d.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function c(t){t.classed(h.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var u=t("./lines"),h=t("./constants"),f=t("../../lib"),d=t("d3"),p=t("../../components/drawing"),m=t("../../lib/gup").keyFun,g=t("../../lib/gup").repeat,v=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i,o){function y(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function b(t,e){return(h.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,h={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==L&&(c?o.hover(h):o.unhover&&o.unhover(h),L=u)}}),S.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var C=e.selectAll("."+h.cn.parcoords).data(A,m);C.exit().remove(),C.enter().append("g").classed(h.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(g,m);e.enter().append("defs");var r=e.selectAll("#"+h.id.filterBarPattern).data(g,m);r.enter().append("pattern").attr("id",h.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-h.bar.width).attr("width",h.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(g,m);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",h.bar.width).attr("x",h.bar.width/2).attr("fill",h.bar.fillcolor).attr("fill-opacity",h.bar.fillopacity).attr("stroke",h.bar.strokecolor).attr("stroke-opacity",h.bar.strokeopacity).attr("stroke-width",h.bar.strokewidth)}),C.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var I=C.selectAll("."+h.cn.parcoordsControlView).data(g,m);I.enter().append("g").classed(h.cn.parcoordsControlView,!0).style("box-sizing","content-box"),I.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var P=I.selectAll("."+h.cn.yAxis).data(function(t){return t.dimensions},m);P.enter().append("g").classed(h.cn.yAxis,!0).each(function(t){E.dimensions.push(t)}),I.each(function(t){b(P,t)}),S.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=u(this,t,h.scatter),t.viewModel[t.key]=t.lineLayer,E.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),P.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),P.call(d.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;T=!1,k||(t.x=Math.max(-h.overdrag,Math.min(t.model.width+h.overdrag,d.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,P.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),b(P,e),P.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),d.select(this).attr("transform","translate("+t.x+", 0)"),P.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;k?"ending"===k&&(k=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,b(P,e),d.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),T=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),P.exit().remove();var D=P.selectAll("."+h.cn.axisOverlays).data(g,m);D.enter().append("g").classed(h.cn.axisOverlays,!0),D.selectAll("."+h.cn.axis).remove();var z=D.selectAll("."+h.cn.axis).data(g,m);z.enter().append("g").classed(h.cn.axis,!0),z.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),p.font(z.selectAll("text"),t.model.tickFont)}),z.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),z.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var O=D.selectAll("."+h.cn.axisHeading).data(g,m);O.enter().append("g").classed(h.cn.axisHeading,!0);var F=O.selectAll("."+h.cn.axisTitle).data(g,m);F.enter().append("text").classed(h.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-h.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){p.font(F,t.model.labelFont)});var R=D.selectAll("."+h.cn.axisExtent).data(g,m);R.enter().append("g").classed(h.cn.axisExtent,!0);var j=R.selectAll("."+h.cn.axisExtentTop).data(g,m);j.enter().append("g").classed(h.cn.axisExtentTop,!0),j.attr("transform","translate(0,"+-h.axisExtentOffset+")");var N=j.selectAll("."+h.cn.axisExtentTopText).data(g,m);N.enter().append("text").classed(h.cn.axisExtentTopText,!0).call(c),N.text(function(t){return x(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){p.font(N,t.model.rangeFont)});var B=R.selectAll("."+h.cn.axisExtentBottom).data(g,m);B.enter().append("g").classed(h.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+h.axisExtentOffset)+")"});var U=B.selectAll("."+h.cn.axisExtentBottomText).data(g,m);U.enter().append("text").classed(h.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(c),U.text(function(t){return x(t)(t.domainScale.domain()[0])}).each(function(t){p.font(U,t.model.rangeFont)});var V=D.selectAll("."+h.cn.axisBrush).data(g,m),H=V.enter().append("g").classed(h.cn.axisBrush,!0);V.each(function(t){t.brush||(t.brush=d.svg.brush().y(t.unitScale).on("brushstart",_).on("brush",w).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),d.select(this).call(t.brush))}),H.selectAll("rect").attr("x",-h.bar.capturewidth/2).attr("width",h.bar.capturewidth),H.selectAll("rect.extent").attr("fill","url(#"+h.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),H.selectAll(".resize rect").attr("height",h.bar.handleheight).attr("opacity",0).style("visibility","visible"),H.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",h.bar.handleoverlap-h.bar.handleheight),H.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",h.bar.handleoverlap);var q=!1,G=!1;return E}},{"../../components/drawing":638,"../../lib":738,"../../lib/gup":735,"./constants":1023,"./lines":1026,d3:123}],1028:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},h=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1027,regl:508}],1029:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,s=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},s,{}),insidetextfont:o({},s,{}),outsidetextfont:o({},s,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":612,"../../lib/extend":727,"../../plots/attributes":783,"../../plots/font_attributes":810}],1030:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n")}}return y};var l},{"../../components/color":613,"./helpers":1034,"fast-isnumeric":132,tinycolor2:543}],1032:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),f=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hovertext"),f&&"none"!==f){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":738,"./attributes":1029}],1033:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":652}],1034:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}var a=t("d3"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./helpers"),h=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,h=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===h.indexOf(s.scalegroup)&&h.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}(e),f.each(function(){var f=a.select(this).selectAll("g.slice").data(e);f.enter().append("g").classed("slice",!0),f.exit().remove();var m=[[[],[]],[[],[]]],g=!1;f.each(function(e){function s(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)a.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var f=d.cx,v=d.cy,y=a.select(this),b=y.selectAll("path.surface").data([e]),x=!1,_=!1;if(b.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==i.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=o.castHoverinfo({hoverinfo:[u.castOption(l,e.pts)],_module:p._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var c=n(e,d),m=f+e.pxmid[0]*(1-c),g=v+e.pxmid[1]*(1-c),y=r.separators,b=[];if(-1!==l.indexOf("label")&&b.push(e.label),-1!==l.indexOf("text")){var w=u.castOption(s.hovertext||s.text,e.pts);w&&b.push(w)}-1!==l.indexOf("value")&&b.push(u.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&b.push(u.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;o.loneHover({x0:m-c*d.r,x1:m+c*d.r,y:g,text:b.join("
"),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:u.castOption(M.bgcolor,e.pts)||e.color,borderColor:u.castOption(M.bordercolor,e.pts),fontFamily:u.castOption(k.family,e.pts),fontSize:u.castOption(k.size,e.pts),fontColor:u.castOption(k.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),x=!0}t.emit("plotly_hover",{points:[h(e,s)],event:a.event}),_=!0}}).on("mouseout",function(r){var n=t._fullLayout,i=t._fullData[p.index];_&&(r.originalEvent=a.event,t.emit("plotly_unhover",{points:[h(e,i)],event:a.event}),_=!1),x&&(o.loneUnhover(n._hoverlayer.node()),x=!1)}).on("click",function(){var r=t._fullLayout,n=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[h(e,n)],o.click(t,a.event))}),p.pull){var w=+u.castOption(p.pull,e.pts)||0;w>0&&(f+=w*e.pxmid[0],v+=w*e.pxmid[1])}e.cxFinal=f,e.cyFinal=v;var M=p.hole;if(e.v===d.vTotal){var k="M"+(f+e.px0[0])+","+(v+e.px0[1])+s(e.px0,e.pxmid,!0,1)+s(e.pxmid,e.px0,!0,1)+"Z";M?b.attr("d","M"+(f+M*e.px0[0])+","+(v+M*e.px0[1])+s(e.px0,e.pxmid,!1,M)+s(e.pxmid,e.px0,!1,M)+"Z"+k):b.attr("d",k)}else{var T=s(e.px0,e.px1,!0,1);if(M){var A=1-M;b.attr("d","M"+(f+M*e.px1[0])+","+(v+M*e.px1[1])+s(e.px1,e.px0,!1,M)+"l"+A*e.px0[0]+","+A*e.px0[1]+T+"Z")}else b.attr("d","M"+f+","+v+"l"+e.px0[0]+","+e.px0[1]+T+"Z")}var S=u.castOption(p.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=a.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,"outside"===S?p.outsidetextfont:p.insidetextfont).call(c.convertToTspans,t);var o,s=l.bBox(r.node());"outside"===S?o=i(s,e):(o=function(t,e,r){var i=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=n(e,r),c={scale:l*r.r*2/i,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return c.scale<1&&v.scale>c.scale?v:c}(s,e,d),"auto"===S&&o.scale<1&&(r.call(l.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(s=l.bBox(r.node())),o=i(s,e)));var u=f+e.pxmid[0]*o.rCenter+(o.x||0),h=v+e.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(e.yLabelMin=h-s.height/2,e.yLabelMid=h,e.yLabelMax=h+s.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+u+","+h+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}}),g&&function(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,d=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),p=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,v=t.cyFinal+c(t.px0[1],t.px1[1]),y=d-p;if(y*f>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(i=0;i=(u.castOption(e.pull,a.pts)||0)||((t.pxmid[1]-a.pxmid[1])*f>0?(y=a.cyFinal+c(a.px0[1],a.px1[1])-p-t.labelExtraY)*f>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*f>0&&(n=3*h*Math.abs(i-m.indexOf(t)),(s=a.cxFinal+l(a.px0[0],a.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*h>0&&(t.labelExtraX+=s)))}var a,o,s,l,c,h,f,d,p,m,g,v,y;for(o=0;o<2;o++)for(s=o?r:n,c=o?Math.max:Math.min,f=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,h=a?1:-1,(d=t[o][a]).sort(s),p=t[1-o][a],m=p.concat(d),v=[],g=0;gMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(s.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){f.selectAll("tspan").each(function(){var t=a.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":613,"../../components/drawing":638,"../../components/fx":655,"../../lib/svg_text_utils":761,"./event_data":1033,"./helpers":1034,d3:123}],1039:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1040,d3:123}],1040:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":613,"./helpers":1034}],1041:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scattergl/attributes":1102}],1042:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),o=t("../scatter/get_trace_color"),s=["xaxis","yaxis"],l=n.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,i,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);if(f)r=f;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=a(t.marker.color),m=a(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[s[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new n(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":760,"../scatter/get_trace_color":1064,"gl-pointcloud2d":231}],1043:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":738,"./attributes":1041}],1044:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":823,"../scatter3d/calc":1080,"./attributes":1041,"./convert":1042,"./defaults":1043}],1045:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;e.exports=l({hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":612,"../../components/fx/attributes":647,"../../lib/extend":727,"../../plot_api/edit_types":769,"../../plots/attributes":783,"../../plots/font_attributes":810}],1046:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":656,"../../plot_api/edit_types":769,"../../plots/get_data":820,"./plot":1051}],1047:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":738,"../../lib/gup":735,"strongly-connected-components":537}],1048:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1049:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}c("node.label"),c("node.pad"),c("node.thickness"),c("node.line.color"),c("node.line.width");c("node.color",e.node.label.map(function(t,e){return o.addOpacity(function(t){return a[t%a.length]}(e),.8)})),c("link.label"),c("link.source"),c("link.target"),c("link.value"),c("link.line.color"),c("link.line.width"),c("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),c("domain.x"),c("domain.y"),c("orientation"),c("valueformat"),c("valuesuffix"),c("arrangement"),n.coerceFont(c,"textfont",n.extendFlat({},l.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":613,"../../components/color/attributes":612,"../../lib":738,"./attributes":1045,tinycolor2:543}],1050:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1045,"./base_plot":1046,"./calc":1047,"./defaults":1049,"./plot":1051}],1051:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+b.sankeyNode).filter(l(t)).call(c)}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(b.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),b=t("./constants").cn,x=y._;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=x(t,"source:")+" ",y=x(t,"target:")+" ",_=x(t,"incoming flow count:")+" ",w=x(t,"outgoing flow count:")+" ";m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,r,n){p.select(e).call(h.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,c=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),h=u.left+u.width/2,f=u.top+u.height/2,m=g.loneHover({x:h-c.left,y:f-c.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",l+i.link.source.label,y+i.link.target.label].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},unhover:function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())},select:function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(u,r,n),g.click(t,{target:!0})}}})}},{"../../components/color":613,"../../components/fx":655,"../../lib":738,"./constants":1048,"./render":1052,d3:123}],1052:[function(t,e,r){"use strict";function n(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function i(t){return function(e){return e.node.originalX===t.node.originalX}}function a(t){for(var e=0;e1||t.linkLineWidth>0}function f(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function d(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function p(t){return w.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+_.nodeTextOffsetHorizontal:_.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-_.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-_.nodeTextOffsetHorizontal,0]])}function m(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function g(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function v(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function y(t){return t.horizontal&&t.left?"100%":"0%"}function b(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function x(t,e,r){var a=w.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(E.raiseToTop(this),a.interactionState.dragInProgress=a.node,n(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+Math.floor(a.node.originalX);a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=S.forceSimulation(n).alphaDecay(0).force("collide",S.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(_.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}(0,e,n,r)).stop()}(0,o,a),function(t,e,r,n){window.requestAnimationFrame(function a(){for(var o=0;o<_.forceTicksPerFrame;o++)r.forceLayouts[n].tick();r.sankey.relayout(),c(t.filter(i(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,a,o)}}).on("drag",function(r){if("fixed"!==r.arrangement){var a=w.event.x,o=w.event.y;"snap"===r.arrangement?(r.node.x=a,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=a),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),n(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),c(t.filter(i(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}var _=t("./constants"),w=t("d3"),M=t("tinycolor2"),k=t("../../components/color"),T=t("../../components/drawing"),A=t("@plotly/d3-sankey").sankey,S=t("d3-force"),E=t("../../lib"),L=t("../../lib/gup").keyFun,C=t("../../lib/gup").repeat,I=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n){var i=t.selectAll("."+_.cn.sankey).data(e.filter(function(t){return I(t).trace.visible}).map(function(t,e,r){for(var n,i=I(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,u="h"===i.orientation,h=i.node.pad,f=i.node.thickness,d=i.node.line.color,p=i.node.line.width,m=i.link.line.color,g=i.link.line.width,v=i.valueformat,y=i.valuesuffix,b=i.textfont,x=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{pointNumber:e,label:t,color:E.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{pointNumber:e,label:l.label[e],color:E.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),T=A().size(u?[x,w]:[w,x]).nodeWidth(f).nodePadding(h).nodes(M).links(k).layout(_.sankeyIterations),S=T.nodes(),L=0;L5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),R.transition().ease(_.ease).duration(_.duration).attr("startOffset",y).style("fill",v)}},{"../../components/color":613,"../../components/drawing":638,"../../lib":738,"../../lib/gup":735,"./constants":1048,"@plotly/d3-sankey":39,d3:123,"d3-force":119,tinycolor2:543}],1053:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&p.splice(g,p.length-g),m.length>g&&m.splice(g,m.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var b={type:"linear"};i.setConvert(b),(u=b.makeCalcdata(e.marker,"size")).length>g&&u.splice(g,u.length-g)}var x,_=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/_),3)}:function(t){return Math.max((t||0)/_,3)},v.ppad=y.ppad=Array.isArray(u)?u.map(x):x(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&m[0]===m[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&m[0]===m[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,i.expand(f,p,v),i.expand(d,m,y);var w=new Array(g);for(h=0;h=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1058:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,u)),n(f)||(f=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":617,"../../components/colorscale":628,"../../lib":738,"../../plots/plots":846,"fast-isnumeric":132}],1059:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":620,"../../components/colorscale/has_colorscale":627,"./subtypes":1076}],1060:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1061:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=(O=I[L][1])>=H&&(P=(D=I[L-1][0])+(I[L][0]-D)*(H-z)/(O-z),N=Math.min(N,P),B=Math.max(B,P));N=Math.max(N,0),B=Math.min(B,d._length);var q=s.defaultLine;return s.opacity(f.fillcolor)?q=f.fillcolor:s.opacity((f.line||{}).color)&&(q=f.line.color),n.extendFlat(t,{distance:c+10,x0:N,x1:B,y0:H,y1:H,color:q}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":613,"../../components/errorbars":644,"../../components/fx":655,"../../lib":738,"./fill_hover_text":1062,"./get_trace_color":1064}],1066:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":796,"./arrays_to_calcdata":1053,"./attributes":1054,"./calc":1055,"./clean_data":1057,"./colorbar":1058,"./defaults":1061,"./hover":1065,"./plot":1073,"./select":1074,"./style":1075,"./subtypes":1076}],1067:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627}],1068:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=z.c2p(t[e].x),i=O.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function l(t){var e=t[0]/z._length,r=t[1]/O._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=nt[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)tt||t[1]rt)return[o(t[0],$,tt),o(t[1],et,rt)]}function f(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function d(t,e){var r=[],n=h(t),i=h(e);return n&&i&&f(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=h(n),s=h(a),l=[];if(o&&s&&f(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){(o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c}return l}}function m(t){var e=t[0],r=t[1],n=e===H[q-1][0],i=r===H[q-1][1];if(!n||!i)if(q>1){var a=e===H[q-2][0],o=r===H[q-2][1];n&&(e===$||e===tt)&&a?o?q--:H[q-1]=t:i&&(r===et||r===rt)&&o?a?q--:H[q-1]=t:H[q++]=t}else H[q++]=t}function g(t){H[q-1][0]!==t[0]&&H[q-1][1]!==t[1]&&m([W,X]),m(t),Z=null,W=X=0}function v(t){if(G=t[0]<$?$:t[0]>tt?tt:0,Y=t[1]rt?rt:0,G||Y){if(q)if(Z){var e=K(Z,t);e.length>1&&(g(e[0]),H[q++]=e[1])}else J=K(H[q-1],t)[0],H[q++]=J;else H[q++]=[G||t[0],Y||t[1]];var r=H[q-1];G&&Y&&(r[0]!==G||r[1]!==Y)?(Z&&(W!==G&&X!==Y?m(W&&X?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?$:tt,rt]:[n>0?tt:$,et]}(Z,t):[W||G,X||Y]):W&&X&&m([W,X])),m([G,Y])):W-G&&X-Y&&m([G||W,Y||X]),Z=t,W=G,X=Y}else Z&&g(K(Z,t)[0]),H[q++]=t}var y,b,x,_,w,M,k,T,A,S,E,L,C,I,P,D,z=e.xaxis,O=e.yaxis,F=e.simplify,R=e.connectGaps,j=e.baseTolerance,N=e.shape,B="linear"===N,U=[],V=s.minTolerance,H=new Array(t.length),q=0;F||(j=V=-1);var G,Y,W,X,Z,J,K,Q=s.maxScreensAway,$=-z._length*Q,tt=z._length*(1+Q),et=-O._length*Q,rt=O._length*(1+Q),nt=[[$,et,tt,et],[tt,et,tt,rt],[tt,rt,$,rt],[$,rt,$,et]];for("linear"===N||"spline"===N?K=u:"hv"===N||"vh"===N?K=d:"hvh"===N?K=p(0,$,tt):"vhv"===N&&(K=p(1,et,rt)),y=0;yl(M))break;x=M,(C=A[0]*T[0]+A[1]*T[1])>E?(E=C,_=M,k=!1):C=t.length||!M)break;v(M),b=M}}else v(_)}Z&&m([W||Z[0],X||Z[1]]),U.push(H.slice(0,q))}return U}},{"../../constants/numerical":717,"../../lib":738,"./constants":1060}],1069:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1070:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i=null,a=0;a0?Math.max(e,i):0}}},{"fast-isnumeric":132}],1072:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),h=(t.line||{}).color;if(c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":613,"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627,"./subtypes":1076}],1073:[function(t,e,r){"use strict";function n(t,e,r,n,u,f,d){function p(t){return _?t.transition():t}function m(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function v(){return!1}function y(e){var n,s=e[0].trace,c=i.select(this),u=l.hasMarkers(s),h=l.hasText(s),f=function(t){if(t.ids)return g}(s),d=v,y=v;u&&(d=s.marker.maxdisplayed||s._needsCull?m:a.identity),h&&(y=s.marker.maxdisplayed||s._needsCull?m:a.identity);var b=(n=c.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);_&&b.call(o.pointStyle,s,t).call(o.translatePoints,w,M).style("opacity",0).transition().style("opacity",1);var x=u&&o.tryColorscale(s.marker,""),k=u&&o.tryColorscale(s.marker,"line");n.order(),n.each(function(e){var n=i.select(this),a=p(n);o.translatePoint(e,a,w,M)?(o.singlePointStyle(e,a,s,x,k,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,w,M,s.xcalendar,s.ycalendar),s.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),_?n.exit().transition().style("opacity",0).remove():n.exit().remove(),(n=c.selectAll("g").data(y,f)).enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=i.select(this),n=p(e.select("text"));o.translatePoint(t,n,w,M)?r.layerClipId&&o.hideOutsideRangePoint(t,e,w,M,s.xcalendar,s.ycalendar):e.remove()}),n.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=w.c2p(t.x),r=M.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){p(i.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var b,x;!function(t,e,r,n,o){var s=r.xaxis,c=r.yaxis,u=i.extent(a.simpleMap(s.range,s.r2c)),h=i.extent(a.simpleMap(c.range,c.r2c)),f=n[0].trace;if(!l.hasMarkers(f))return;var d=f.marker.maxdisplayed;if(0===d)return;var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0,w=r.xaxis,M=r.yaxis,k=n[0].trace,T=k.line,A=i.select(f);if(A.call(s.plot,r,d),!0===k.visible){p(A).style("opacity",k.opacity);var S,E,L=k.fill.charAt(k.fill.length-1);"x"!==L&&"y"!==L&&(L=""),n[0].node3=A;var C="",I=[],P=k._prevtrace;P&&(C=P._prevRevpath||"",E=P._nextFill,I=P._polygons);var D,z,O,F,R,j,N,B,U,V="",H="",q=[],G=a.noop;if(S=k._ownFill,l.hasLines(k)||"none"!==k.fill){for(E&&E.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(O=o.steps(T.shape),F=o.steps(T.shape.split("").reverse().join(""))):O=F="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),T.smoothing):o.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},R=function(t){return F(t.reverse())},q=c(n,{xaxis:w,yaxis:M,connectGaps:k.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,simplify:T.simplify}),U=k._polygons=new Array(q.length),x=0;x1){var r=i.select(this);if(r.datum(n),t)p(r.style("opacity",0).attr("d",D).call(o.lineGroupStyle)).style("opacity",1);else{var a=p(r);a.attr("d",D),o.singleLineStyle(n,a)}}}}}var Y=A.selectAll(".js-line").data(q);p(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(G(!0)),o.setClipUrl(Y,r.layerClipId),q.length&&(S?j&&B&&(L?("y"===L?j[1]=B[1]=M.c2p(0,!0):"x"===L&&(j[0]=B[0]=w.c2p(0,!0)),p(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(o.singleFillStyle)):p(S).attr("d",V+"Z").call(o.singleFillStyle)):"tonext"===k.fill.substr(0,6)&&V&&C&&("tonext"===k.fill?p(E).attr("d",V+"Z"+C+"Z").call(o.singleFillStyle):p(E).attr("d",V+"L"+C.substr(1)+"Z").call(o.singleFillStyle),k._polygons=k._polygons.concat(I)),k._prevRevpath=H,k._prevPolygons=U);var W=A.selectAll(".points");b=W.data([n]),W.each(y),b.enter().append("g").classed("points",!0).each(y),b.exit().remove(),b.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(i.select(this),e?null:r.layerClipId)})}}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./line_points"),u=t("./link_traces"),h=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,c,h,f,d=e.plot.select("g.scatterlayer"),p=!a,m=!!a&&a.duration>0;for((h=d.selectAll("g.trace").data(r,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),u(t,e,r),function(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=i.select(this);if((n=t[0].trace)._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,d,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),m){s&&(f=s());i.transition().duration(a.duration).ease(a.easing).each("end",function(){f&&f()}).each("interrupt",function(){f&&f()}).each(function(){d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)})})}else d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)});p&&h.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":638,"../../components/errorbars":644,"../../lib":738,"../../lib/polygon":750,"./line_points":1068,"./link_traces":1070,"./subtypes":1076,d3:123}],1074:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}(e.textposition),r.textColor=g(e.textfont,1,S),r.textSize=o(e.textfont.size,S,p.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var D=e.projection[P[n]];(r.project[n]=D.show)&&(r.projectOpacity[n]=D.opacity,r.projectScale[n]=D.scale)}r.errorBounds=x(e,d);var z=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=m(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=z.color,r.errorLineWidth=z.lineWidth,r.errorCapSize=z.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=m(e.surfacecolor),r}function l(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}var c=t("gl-line3d"),u=t("gl-scatter3d"),h=t("gl-error3d"),f=t("gl-mesh3d"),d=t("delaunay-triangulate"),p=t("../../lib"),m=t("../../lib/str2rgbarray"),g=t("../../lib/gl_format_color"),v=t("../scatter/make_bubble_size_func"),y=t("../../constants/gl3d_dashes"),b=t("../../constants/gl3d_markers"),x=t("./calc_errors"),_=n.prototype;_.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},_.update=function(t){var e,r,n,i,a=this.scene.glplot.gl,o=y.solid;this.data=t;var p=s(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in y&&(o=y[p.lineDashes]),this.color=l(p.scatterColor)||l(p.lineColor),this.dataPoints=p.position,e={gl:a,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:o[0],dashScale:o[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=c(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var m=t.opacity;if(t.marker&&t.marker.opacity&&(m*=t.marker.opacity),r={gl:a,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:m,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=u(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),i={gl:a,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(i):(this.textMarkers=u(i),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=h(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n=0&&f("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":643,"../../lib":738,"../../registry":861,"../scatter/line_defaults":1067,"../scatter/marker_defaults":1072,"../scatter/subtypes":1076,"../scatter/text_defaults":1077,"./attributes":1079}],1084:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":715,"../../plots/gl3d":826,"../scatter/colorbar":1058,"./attributes":1079,"./calc":1080,"./convert":1082,"./defaults":1083}],1085:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":614,"../../components/colorscale/color_attributes":621,"../../lib/extend":727,"../../plots/attributes":783,"../scatter/attributes":1054}],1086:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../scatter/calc_selection"),c=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=c(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var h,f,d=e.a.length,p=new Array(d),m=!1;for(u=0;ud&&b.splice(d,b.length-d)}return o(e),s(p,e),l(p,e),p}}},{"../../plots/cartesian/axes":785,"../carpet/lookup_carpetid":919,"../scatter/arrays_to_calcdata":1053,"../scatter/calc_selection":1056,"../scatter/colorscale_calc":1059,"../scatter/subtypes":1076,"fast-isnumeric":132}],1087:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),g=d("b");if(p=Math.min(m.length,g.length)){m&&p0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,h=c-u;return s.x0=Math.max(Math.min(s.x0,h),u),s.x1=Math.max(Math.min(s.x1,h),u),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(f.hi||d.hoverinfo).split("+"),g=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,f.a),-1!==m.indexOf("b")&&a(p.baxis,f.b);var v=p.ab2ij([f.a,f.b]),y=Math.floor(v[0]),b=v[0]-y,x=Math.floor(v[1]),_=v[1]-x,w=p.evalxy([],y,x,b,_);return g.push("y: "+w[1].toFixed(3)),s.extraText=g.join("
"),o}}},{"../scatter/hover":1065}],1090:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":796,"../scatter/colorbar":1058,"../scatter/select":1074,"./attributes":1085,"./calc":1086,"./defaults":1087,"./event_data":1088,"./hover":1089,"./plot":1091,"./style":1092}],1091:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}(u,g,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":655,"../../constants/numerical":717,"../../plots/cartesian/axes":785,"../scatter/fill_hover_text":1062,"../scatter/get_trace_color":1064,"./attributes":1093}],1098:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":814,"../scatter/colorbar":1058,"./attributes":1093,"./calc":1094,"./defaults":1095,"./event_data":1096,"./hover":1097,"./plot":1099,"./select":1100,"./style":1101}],1099:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");e.exports=function(t,e){function r(t,e){t.lonlat[0]===a&&n.select(e).remove()}for(var h=0;h=e.length?t(i):t(e[a]);return n}function o(t,e,r){return l(D(t,r),P(e,r),r)}function s(t,e,r,n){var i=w(t,e,n);return i=Array.isArray(i[0])?i:a(g.identity,[i],n),l(i,P(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;iZ?X-Z:0),!q||H.noBorder||H.noFill?u(this.scatter.options.colors,Y,f,B,G):u(this.scatter.options.colors,C,f,0),u(this.scatter.options.borderColors,W,f,B,G);N?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=T):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,h,j)},I.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),f=e-h;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([f,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+h,p[1]],g=c.c2p(m),v=u.c2p(m),y=d.mrc||1;return t.x0=g-y,t.x1=g+y,t.y0=v-y,t.y1=v+y,t.color=i(l,d),t.extraText=function(t,e,r){function n(t){return t+"\xb0"}var i=(e.hi||t.hoverinfo).split("+"),o=-1!==i.indexOf("all"),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),c=e.lonlat,u=[];return o||s&&l?u.push("("+n(c[0])+", "+n(c[1])+")"):s?u.push(r.lon+n(c[0])):l&&u.push(r.lat+n(c[1])),(o||-1!==i.indexOf("text"))&&a(e,t,u),u.join("
")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":655,"../../constants/numerical":717,"../scatter/fill_hover_text":1062,"../scatter/get_trace_color":1064}],1113:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){if(e){e[0].trace._glTrace.update(e)}},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":840,"../scatter/colorbar":1058,"../scattergeo/calc":1094,"./attributes":1108,"./defaults":1110,"./event_data":1111,"./hover":1112,"./plot":1114,"./select":1115}],1114:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1109}],1115:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,h=[],f=l[0].trace;if(!n.hasMarkers(f))return[];if(!1===e)for(s=0;sk&&S.splice(k,S.length-k)}return o(e),s(T,e),l(T,e),T}},{"../../plots/cartesian/axes":785,"../scatter/arrays_to_calcdata":1053,"../scatter/calc_selection":1056,"../scatter/colorscale_calc":1059,"../scatter/subtypes":1076,"fast-isnumeric":132}],1118:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),g=d("b"),v=d("c");if(m?(p=m.length,g?(p=Math.min(p,g.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):g&&v&&(p=Math.min(g.length,v.length)),p){m&&p"),s}}},{"../../plots/cartesian/axes":785,"../scatter/hover":1065}],1121:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":854,"../scatter/colorbar":1058,"../scatter/select":1074,"./attributes":1116,"./calc":1117,"./defaults":1118,"./event_data":1119,"./hover":1120,"./plot":1122,"./style":1123}],1122:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},a=0;a",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1134:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}var o=t("./constants"),s=t("../../lib/extend").extendFlat,l=t("fast-isnumeric");e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),c=e.cells.values,u=e.domain,h=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),f=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),d=r.length?r[0].map(function(){return e.header.height}):[],p=c.length?c[0].map(function(){return e.cells.height}):[],m=d.reduce(function(t,e){return t+e},0),g=a(p,f-m+o.uplift),v=i(a(d,m),[]),y=i(g,v),b={},x=e._fullInput.columnorder,_=r.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return l(n)?Number(n):1}),w=_.reduce(function(t,e){return t+e},0);_=_.map(function(t){return t/w*h});var M={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:h,height:f,columnOrder:x,groupHeight:f,rowBlocks:y,headerRowBlocks:v,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=b[t];b[t]=(r||0)+1;return{key:t+"__"+b[t],label:t,specIndex:e,xIndex:x[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:_[e]}})};return M.columns.forEach(function(t){t.calcdata=M,t.x=n(t)}),M}},{"../../lib/extend":727,"./constants":1133,"fast-isnumeric":132}],1135:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":727}],1136:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=function(t){return"string"==typeof t&&t.match(T.latexCheck)}(n);t.latex=s;var l,h=s?"":u(t.calcdata.cells.prefix,e,r)||"",f=s?"":u(t.calcdata.cells.suffix,e,r)||"",d=s?null:u(t.calcdata.cells.format,e,r)||null,p=h+(d?A.format(d)(t.value):t.value)+f;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=c(p)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?c(p):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var m;if(t.wrappingNeeded){var g=(" "===T.wrapSplitCharacter?p.replace(/
i&&n.push(a),i+=l}return n}(i,u,c);1===h.length&&(h[0]===i.length-1?h.unshift(h[0]-1):h.push(h[0]+1)),h[0]%2&&h.reverse(),e.each(function(t,e){t.page=h[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(w(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(v(t,r,e,h,n.prevPages,n,0),v(t,r,e,h,n.prevPages,n,1),o(r,t))}}function g(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*A.event.dy:n;var l=o.selectAll("."+T.cn.yColumn).selectAll("."+T.cn.columnBlock).filter(f);m(t,l,o)}}function v(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function y(t,e,r){return function(){var n=A.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,c=t.column.columnWidth-2*T.cellPad;for(t.value="";o.length;)l+(i=(r=o.shift()).width+a)>c&&(t.value+=s.join(T.wrapSpacer)+T.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(T.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),l(n.select("."+T.cn.cellText),r,t),A.select(e.parentNode.parentNode).call(_)}}function b(t,e,r,n,i){return function(){if(!i.settledY){var a=A.select(e.parentNode),s=k(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*T.cellPad:c,h=Math.max(u,c);h-s.rows[l].rowHeight&&(s.rows[l].rowHeight=h,t.selectAll("."+T.cn.columnCell).call(_),m(null,t.filter(f),0),o(r,n,!0)),a.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),e=A.select(this.parentNode).select("."+T.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),n=e.top-t.top+(r?r.matrix.f:T.cellPad);return"translate("+x(i,A.select(this.parentNode).select("."+T.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+n+")"}),i.settledY=!0}}}function x(t,e){switch(t.align){case"left":return T.cellPad;case"right":return t.column.columnWidth-(e||0)-T.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return T.cellPad}}function _(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+M(e,1/0)},0);return"translate(0 "+(M(k(t),t.key)+e)+")"}).selectAll("."+T.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(k(t),t.key).rowHeight})}function w(t,e){for(var r=0,n=e-1;n>=0;n--)r+=function(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n0){var y,b,x,_,w,M=t.xa,k=t.ya;"h"===f.orientation?(w=e,y="y",x=k,b="x",_=M):(w=r,y="x",x=M,b="y",_=k);var T=h[t.index];if(w>=T.span[0]&&w<=T.span[1]){var A=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(T,f,w),L=o.getPositionOnKdePath(T,f,S),C=x._offset,I=x._length;A[y+"0"]=L[0],A[y+"1"]=L[1],A[b+"0"]=A[b+"1"]=S,A[b+"Label"]=b+": "+i.hoverLabelText(_,w)+", "+h[0].t.labels.kde+" "+E.toFixed(3),g.push(A),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+I),u[y+"2"]=n.constrain(C+L[1],C,C+I),u[b+"1"]=u[b+"2"]=_._offset+S}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var P=l.selectAll(".violinline-"+f.uid).data(u?[0]:[]);return P.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":738,"../../plots/cartesian/axes":785,"../box/hover":887,"./helpers":1142}],1144:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":796,"../box/select":892,"./attributes":1139,"./calc":1140,"./defaults":1141,"./hover":1143,"./layout_attributes":1145,"./layout_defaults":1146,"./plot":1147,"./set_positions":1148,"./style":1149}],1145:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":738,"../box/layout_attributes":889}],1146:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":738,"../box/layout_defaults":890,"./layout_attributes":1145}],1147:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:h,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,h=e.xaxis,f=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,g=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),v=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-u.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],b=e[a.posLetter+"axis"],x="both"===s.side,_=x||"positive"===s.side,w=x||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,T=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+v,u=b.c2p(l);switch(s.scalemode){case"width":e=T.maxWidth/g;break;case"count":e=T.maxWidth/g*(T.maxCount/t.pts.length)}var h,f,d,p,m,M,k;if(_){for(M=new Array(o),p=0;pi&&(i=c,a=l)}}return i?s(a):h};case"rms":return function(t,e){for(var r=0,i=0,a=0;a=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,i){return n.coerce(t,a,r.attributes,e,i)}var a={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,a,"valuecalendar",null),o(t,a,"targetcalendar",null)}return a},r.calcTransform=function(t,e,r){function i(t,r){for(var i=0;i":return function(t){return f(t)>i};case">=":return function(t){return f(t)>=i};case"[]":return function(t){var e=f(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=f(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=f(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=f(t);return ei[1]};case"](":return function(t){var e=f(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=f(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(f(t))};case"}{":return function(t){return-1===i.indexOf(f(t))}}}(r,a.getDataToCoordFunc(t,e,h,u),d),b={},x={},_=0;r.preservegaps?(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},v=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=b[t.astr][e];t.get().push(r)}),i(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;o Date: Thu, 11 Jan 2018 11:17:06 -0600 Subject: [PATCH 02/15] enable linked brushing (as the comment says) in ggplotly example --- R/ggplotly.R | 9 +++++---- man/ggplotly.Rd | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/R/ggplotly.R b/R/ggplotly.R index 5711e31495..1339a973e7 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -46,10 +46,11 @@ #' # linked scatterplot brushing #' library(crosstalk) #' d <- SharedData$new(mtcars) -#' subplot( -#' qplot(data = d, x = mpg, y = wt), -#' qplot(data = d, x = mpg, y = vs) -#' ) +#' qplot(data = d, x = mpg, y = wt) %>% +#' subplot(qplot(data = d, x = mpg, y = vs)) %>% +#' layout(title = "Click and drag to select points") %>% +#' highlight("plotly_selected") +#' #' #' # more brushing (i.e. highlighting) examples #' demo("crosstalk-highlight-ggplotly", package = "plotly") diff --git a/man/ggplotly.Rd b/man/ggplotly.Rd index ba95f7c1ab..6bee1ef5a1 100644 --- a/man/ggplotly.Rd +++ b/man/ggplotly.Rd @@ -63,10 +63,11 @@ ggplotly(viz, tooltip = c("text", "size")) # linked scatterplot brushing library(crosstalk) d <- SharedData$new(mtcars) -subplot( - qplot(data = d, x = mpg, y = wt), - qplot(data = d, x = mpg, y = vs) -) +qplot(data = d, x = mpg, y = wt) \%>\% + subplot(qplot(data = d, x = mpg, y = vs)) \%>\% + layout(title = "Click and drag to select points") \%>\% + highlight("plotly_selected") + # more brushing (i.e. highlighting) examples demo("crosstalk-highlight-ggplotly", package = "plotly") From 3e78f68e848d5c1524690c02ecff2367f1c6603d Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Thu, 11 Jan 2018 11:35:53 -0600 Subject: [PATCH 03/15] another doc fix --- R/ggplotly.R | 3 ++- man/ggplotly.Rd | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/ggplotly.R b/R/ggplotly.R index 1339a973e7..a6d4b07478 100644 --- a/R/ggplotly.R +++ b/R/ggplotly.R @@ -58,7 +58,8 @@ #' # client-side linked brushing in a scatterplot matrix #' SharedData$new(iris) %>% #' GGally::ggpairs(aes(colour = Species), columns = 1:4) %>% -#' ggplotly(tooltip = c("x", "y", "colour")) +#' ggplotly(tooltip = c("x", "y", "colour")) %>% +#' highlight("plotly_selected") #' } #' ggplotly <- function(p = ggplot2::last_plot(), width = NULL, height = NULL, diff --git a/man/ggplotly.Rd b/man/ggplotly.Rd index 6bee1ef5a1..4323cd252b 100644 --- a/man/ggplotly.Rd +++ b/man/ggplotly.Rd @@ -75,7 +75,8 @@ demo("crosstalk-highlight-ggplotly", package = "plotly") # client-side linked brushing in a scatterplot matrix SharedData$new(iris) \%>\% GGally::ggpairs(aes(colour = Species), columns = 1:4) \%>\% - ggplotly(tooltip = c("x", "y", "colour")) + ggplotly(tooltip = c("x", "y", "colour")) \%>\% + highlight("plotly_selected") } } From 5d763defe713f2f3cb06258a4a6d798f8df29fca Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Fri, 19 Jan 2018 11:31:44 -0500 Subject: [PATCH 04/15] upgrade to plotly.js v1.33.0 --- R/plotly.R | 2 +- R/sysdata.rda | Bin 70911 -> 74275 bytes .../lib/plotlyjs/plotly-latest.min.js | 4 ++-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/R/plotly.R b/R/plotly.R index 33fedc5d0f..e354749c9f 100644 --- a/R/plotly.R +++ b/R/plotly.R @@ -373,7 +373,7 @@ typedArrayPolyfill <- function() { # and bundle size at print time. plotlyMainBundle <- function() { htmltools::htmlDependency( - "plotlyjs", "1.32.0", + "plotlyjs", "1.33.0", src = depPath("plotlyjs"), script = "plotly-latest.min.js", stylesheet = "plotly-htmlwidgets.css" diff --git a/R/sysdata.rda b/R/sysdata.rda index c362e7d583cbb9c396505d4309694c40996686bb..45c347aa4d925ca961d8bd22e186503b91d8e0da 100644 GIT binary patch literal 74275 zcmcF~)ms}(&@XLYDnLsq?rkX=EV$E_0>zyKFD}8|p#l^y5(r)hQrs;BXn_O>RtUkR z5Zpa@PrvV6oWJ1A#mw%rb2Gd1%t$EMvlM#OSk`5{4d|H zclz6NiU|$dyY$z+vY-Al(Rpu!r|exk!`*PAd}jwDqGxyB=<|f9l@`1%YHWP>u=F*J z4Mx9d)^be&=<*KFM2?J1s+b zv`I*)z7sv-Db)QGL-b8I{C>E|9o=_SR9wW`MR(Y#s9(Hz{oluz;S_h?73P=SpPHB= zdi#>-yJ5p`p)W)_#thHClTg1dMiVvNdwoZdQT=I*%J+Dpr<8Yu7?k2te&@pAjz78; zWf`0TMNU%22U8rzWKuXwGbpwKImTTyL_};(MTWHWC?8^<&LmQeZaExky%o$YAiAGH zWMd^HLc~C1Gg|!dJJCP-?U%RNX861Qh96#AGi2T$| zdiwlzyoh@EL+o3t+zgHHq9Q24l9)h8vHX%BL=N}E12bJT{_$`kqWj_Z#vL9L5jp;4 z>$%W&*B=5XGc~#i)(Q5g#OZM@JBncFgerstQMN!ZN)QH9S68o#OC3Mg4m&Hq8I+Qy zoGLwd2djliotwKJ2m2O7(-yB zkrB9?x9$U)JIvq zR^M13_uA#{-)Q*?A%X3CH`v>IX>%ge4HuGU%r;wj`=cLyI=7O3F6iW7jjb{alm5O~ zo>v+_JQ;q1^TbZmZTxYc@w{CRlo%)w4Ku7WfRfQw(De{n!S=eIY-4+Y5Tx zpW5S@nQ1Jnlv!e}Y%Ffj(Q2QlU_-Uoz5z~lGkOb_yD}=< zzoR80DQh-0JAYOyJBuw8&leq7t8_7cj}letC~}^uW3*P%Q|!#QpzglK=38vLSoDVq zY}Cf3IYMC#5zrW`yjKkabifLf9W2&}(b1rsM#ZxBBu%xi0YY8oX2_a*#T_YRnfC>Z z<+`jur8ye=vCLq>6B(7FN)-b@%dQU&XvW&EHFr;#l~=Ky1TMi~O$y#s{vwgemY&KS z;H%nI^>?p@XXa;(5iP}shPtOhB&rItXIEZSut$~|8VW6EnI`?_;gR>WXb}_Mpc7;a z!AkDkC3adaAJhs2N@!5~s#9)pKF>1~82!t6IN4HtQmfTGF54ke9;t4X$4r0dSRwQY zt5_sblOa!28Fidzd$suF@cQgBH}Kpm7>dc=F^tWY`>%b34ct?dKAg&6~}srbn*! z;zkQ^C{a8Cj1xQ^P!lRK%;nz}Eo$C!D`%lsPSd(zw_;{8re8FQC|svBfpZrQ0UmQW zRoJ3S(Yd1dqW)-Xe$1^aGP^`W-_OQ^*t#^fzM$>UBY99T8)7gy2syu%;y2XnkK{1S zu*|NRv4f3exfuIc$5vJ9MR=6(!iI!e`2E`AdR?5l@aK(9r)nWS1kd==W=Rcil#^Ah zuLi(W1m_tKEw7IV>)z~H7mo1rcR$DNO5Gf7%2=yTG}I5ZIk`O16SZ#66eTUc7ahr| zpgLv;1VbxK`eusxy~ji*Qh1Hj!@<8tVUCs5s>5ROP(oTI$sh%9-OEAF$V>J{D}R_% z8gcBp+SOYD)-TuKFayaFp%P~Uw?LZ4Qqf8ttcEJ1;TxoqoAyK_d!-Y@MB!+;P9;P` zl%d?fk-O4CL*zHZL=hiE)v&Qtsj*C3PHsAAQ3o$4S83cYVoj%RnL3C{xhaM9a{l7y zTG_z$kGyk440h*>nk7yB{xe8di3K#zRdLPuYF0ucF8C{~>9)nnnp0;xAuG~K8txoL z5d8&fKEccY4L7rqs8M@ENx-DRzDzn7wcBFqloGA z%;cjvjklp^j~hhK;L_?1?5w#3Q4&fJ#tDM4AzcNgHU@p)s#eb^PLF>&6C1E-*`#C# zjHH8QwK`Q;B1>ZiF+ziSK(L*iI7G>5RKvE|j!nY}Em{t=7S{Bnf!jbNKrJ(h~VwR(5q2Ss#LJsy|GkE`k_*xD6QzNZZ;^0rn8Ktk4vH9-WQy) zjLzQ+J{G38pR96>!78XJU&8od0RONIs2N@PX$^!vCX{gKXwmp9lR@yNLSbHAM^?Y9 zp2Ma;?VmmM6p^-c6*?gem;g&$a;}i>MumxxW(!T*Mp#bbk=GvM1B4;_&{vSFu&$9s zL{agxsx#^Z!CB7S=?vR6tT*| zO@4D}dt-gAiqs=zqgIQ(>&3i&-7~8+>x)~dh$Ab`>GY+uO{SH%Uw(h^YJWs-&zw*4 zLjT1yMc^Hlr_p{rupie2iXsJ>H4$>0Sjy4HH|R%{^l$oXRJFnuCJ+`31Aw|tmS`PVPt!O&X2r60OD70cPR-?nqTMvtz=eGHJzm(4QWu zr9i>-)Hh>38vo54aGSw9=u?1_rs_r#DQ6IRJs!7Y;J1@F=+zW5wJRNr`ZcR_=uo+WPOtt4I3i$Z-T+sT-6G}35pkU9rYpEN@;}orn>;-B! zUW{=iM+96Y<$uwrt?pkV@Khbk^GPEqjdU($|x|Pt(8PQbr)LF8KXUqNf#=@%O zCr;JiffJDZm7vX!PQyoB&B+D^gjx59AxqvgHbRMi-XYv!K{iKr^33pXgrysGGvLpF z2LAq8EbUGj5%KA4C4EUtXk>zj}rYhdQ{{)1o#MHSH2eTd>u}$4`>L1!^Qu z19ipf%fd;{6J$+{Pb(N8i`#{P0kYI*e)C+n$EhyxCDhc?3HuEY>ex+ zM+cFiZDD`cL1z?0BrbQv#l@@A3obZ8&{(w#7BpEZEfdldD0y&=}ka>={mN880V zat-$BV_hP#i&c|tYR(UXlLo8F$tPM05$6FyC9$ja^*-+EU^LgDok0q{4O(ar+zvTTSJ>4H+W5_2t&J)MlSIE&z`0>)qg1H6$FagZc0w}}9?ks5 z!?uwng53&nrqnSgpnHW&e5C?&O=X2{x%dPeHtqy`&_U?c9rdPeI^?E(^D(tYU@6H* z%SOBlbKuhQoDrqls$XRGsMabz(msCjc3_e8kY!X%P9_=1o?oQI0HdhtG8HIn)-FwAkcQEb@E>^M@A|6P% zkjN_YJxX9ZQ9s;dCeIDA5PvnBD1(`qh`9i5bEgKW9BE3l)*7ANNdCB(e}oQxRP9}4 zM`1$T=3-RdN}Ta?Gl7_LDExib2heLXT9unu%M!YhwbbSVBl-qzWumky4fD<=7zR(g#e=2g-feIA~%r_-PlIq)c8gF$pICi+c>)I(09Q}0Y>LoGU z{Yo#g|4rvAr^98*N^X6Z+Zg5mF!Cyt9ucY^AR9+WA3SXzCa5=54fmqDE9FVVqzrIb zX1tGd0a7Y}ucm7si5-K-i6l&)Wg55Fy4Df%IO$GXabW7=C7k(6Lq6x)ln0_9X9KQMn0*%3 z7=Ls#VJWoXFwiB_{mTAM*I)`=hJ}knh@5c61zRD;3TW_U5XNl^{nlXg3Z|D9DnGq} ztN)4y!n*ekyW`Dj+JuGq_8cwhu7@wTGe&~9e0=am!)4nYIi}6+K8(V=SQ=HlPT9iv zIu%NcPwv(Oc;A{H!0`|8{L6Wd?Mmayfokvj87$}etgPI`mELvL3sn>=h!#LhCU6?H zX-bvCYC>v2B*%dr&tOqjis^pbY`oKiPK6`GgdN*`=oenz1dMHyih@WsmfFJyT^|<(s5w{xQltBw&qqeYTGA7oE|Avf zc)ZR*;xA(X>4kvd29L?BT-nf&hs+)z{a-ZLs@wi^&XS>JbxxVmMa+cJTpmIz7ZMq~ zjbl-3%C*px?K}3sH0&PrE(ZkO#A#+AN3z%AtEQP~l)refP&BwOPFRF9ln8U=Q~x%f z$XUun+$R?K!vED0$Mhuv2)+~UdN2L474@g+DXTe}a4IsI4e6JZf9$^z>-1_@ygf=# zjm-Am)L!Cwx=2U!c9q8Gehgiio?oyV6}M&Dp3sv!UlblrRVy5rhR`O2GW+@LYP_0w zH-_QP;1#B1kL2Lct}yxtb*iUVuUC6%X{p3x1N@4jLkW_7XrNbh{F-}a8)s*01amC2 zer%(%-(#vKXvaoX*7FYx3Ex*z2~bk{apfth+mkRF7gtgzx3l=m{}5OG5GR}FChNJr zf~>VifvabbIP3Sjj|pl-d-0zg#whBUSt(L3-Aut6)@u9iZ+>92C{bUZjD1v4qK{Ck zSYq69j=k`(cV~Pqa^w+#eO*os4xJC6Nl%_Rvhe$t1(TP8CPtk7a@L`%(pry>0xpI* zDZ5;gkDVNuL7xuV_^K7JWI=Tsh^k53HRQx-<4OY?6xs+S3NzM)YBj065Q-&%eJV>E z{Z?4A+CzeV{?gINKvR%9EP}V_*7gI_gzixV=k=MQ^Sfd$mC)dK`h#~W-bOGx7rwRT z)-gcP&;VXq0l|j)>Oa3*)l!nFFdw8D>Azq^y}f6|TUToIWk9e_PcW9Q2>NLd0C*%1 z{T67c4@JHZ2CD0Eq2hSeZH=ID004C=m|oqE;v32eJV<7lDhTI}!2s#Vmkdd-$T-yv z_{m}bG;f8u2JZnLWzZ+vy|ZJF!*pSO3BSz9fT4^&#lfE`sq2DKLN!Jaz;E@G+~`VM zUS4Q)IQ3@|v_YgH(9X&Rt!@d?(@CK*Bom^K%dm}52hvs0)zJ+I{wqzT0R>TDTkbDC z;Qy&?{UZ(zZfk~#e0BJ98nXZNgxKR^284vjJ{Xig#B$qF1BC8TN3+AqGCuLzBpbzW zb(YfEy>v?!IQ68gHHi4ae_yx4mPew2ix$g|GJ_n{W$ zT(_F9u7M*9%eW-lqz|`NAmBy1t-LQczPoe%Zw0zz?uo)l%eqA^zLnE3bFTlFv56a zVs!nmuiuPjuCH$)>Bj{Z0sTAeFj>AlaSL9_l7uWZReHZ$APz^5JBj-{?Xxf~(D)`K zRhl+->-Z$FBfXeLJEa{bp*VNM+D8k;>?#Hz{xinlR z9sqTy9HGW0KF0h19Cu^z>Q&_jV1&^FAJ$zLTsaMdGTlJ}v@+!*ynp46_UB_(W@Ik2 zD*a~RG5*;2$wHZgmMZBfnQVZPsj*`{!oAmojk!v87t70AQ`dEkJOtobYWHt&6UuSb znnw%W^@C%ppwHY^xc_L9Men4-dLMhgdBqH~dcqoIwr}P;7-H)W3z4bj+iupPnR912 zQ#QB=f;398rBk1QYSvJVN&W*s?_6(>S*>B!zFeYf$Zxt8m#?pr|KEofm z^i+1|IMHj{$a4j^&FOnQHij3!-NHmp!S`%_%)XlCi4^+r*SJUX+i-g*d1$a~>-s35 zEE6laZd0K;%nk%ld7S%2-N-3K4Loa;r8sXb_#=;oZl3g1pL3h(HbDE;RWTM`=cgP% zAULt@OC=CMq1+Bu2k@{hsvkv-THId~T#Z$Wd8(nZS9?CmKVHTax;? zUd{)c9B~QJ64fRK-nPu-^6Wt}NdxeQV3*kK>vWmZ z@`#xWD$`1;_x)jlwf{CVTLzypct$K9u7meKq;`+Zlu26B*w!49&}a`thzGVpI+$Z= zw)X9E>;izf(sl@h;k2~Kq41|IEa2<-!f^SM4#VsH?0H&<;cUGqL`GyC*nP7fmF+2x z4_Q8(HkX>e$_*@+I4TJZR?mb-SP2gSR0*|o%hZE} z$8m9qJYtne%|c@EE+OU7rScxpi5-8AoOxWA$R-+xGumE>zwiW+jJ2JbOxqO|$LVz8bA%107!kITrRtv6=Qu^t!&X|R0{_FS5c`Il-E)1((%AafNH(411F zm9%g{Giq|aL6+{=vxQ}kYC}tVIB2XSQ#Ps4b|>MQt%SW7!Lsu zLUBIre|OF2HIITm(=lJV7=tpM6zX!X_yCV4w3PgOAj>5?N*~9nV|($OPzLgll}(?c zy+lLI4Cq0cuj78ZjMQa$5em1xwR2+TTDIP{Jevd8#mlgDinzuzDEBJWR3{@M0iPt? zR{_iMyCpl? zh62iQ;A#O4(Oo68gA0%KA!gt8?;^)b7Iwc%g)56fV!9e21}m zUA?4Df!_1T6;U6Zo;Zeuacn=Td?mqkR?%oMh{2j($jgmQIBcL^-^J}B0878><;9r5 zovS)+0kR5c`93*VTjp2{jS#s!TXZC6-$A~s`) zx@co}CpTWty%XoNkklP7fpuTkuyG4=7j%EZ^tjo*Re9t>CUW6+!tDoEb8DnF$ivFV zC)7Tr6bxHllV$hq;5R@Lq+~+&I4QMUnAFBk-1be4H%$2mmwz=^0^t+6sVINY(CR2J z_kh+b^oM3U*}1^oo_cZ!tNdfjYny7nj>HtXRa<6Y$(unL7-xTSmH+7wavplxJZ!q^ zzVn#f^|5IqHP`I7PDK=nn&89#IncnAL{pQ=m5M=vUBVJ+C zwo5FYpCf8Q) zUK@S})sl*{w@WrAQ+Qw^o35*03(;}E5MZ#3{??-NiVY8nYrJORYDa|uC*;a*o^i{^%do4@p?K8^oapEuQByTenr?sCl$uS(dNuTe8 zk`_sGr*17(*7LTr<^@e;1|aaXxOD5%(vFlug327dW^-BQR`FkIR>f*!Y}3*9Nk}&B z(COwhfvrsDcBBSYEs3)tAWO`tu90w+!|t7SonlsI1@EOFtE|jgL)o(2iIrv6j=Q~b3jC604jFSYYV81|;?8Q-Twc4q;kC(&7BzTv(X@oC89WaAzH29p}+$rO) zv&t$Uch*SoJ}nMW4FJ?NZTJ9zvNE`10$|EVk0Pc^8adlOg%+?EkS@aS_-%Wbf%Qrc zwg+d99gFW((mxR|=YtD)JECzI#wKzd3e_Xs3q#+KgV+**L!Ij2ZDw{*g|alqTmnu3{oQr4 ze*V|UM7c?ytE6%07_ZmC)qD$TakadC;E6^ZdI!ly(ZqvniOO0$S$C5)@JXl}Ph5S! zrj*}kgLuEDBg5@~cBV==#pMLVE0wf`ac%wz+G+E3k2km&gxNYWOCK*EO}d4*Y*h`L zy+frq;4E2Pm<^^`eB`zQh4$xzbEff5H_O4)N94kZN0kt&AOOfaDBEv#Qet_C$xo{M ziJNPh#DO1Ez}RTT1OvC`T0tD6tpM70YE;T=&EIp^i;H8X{% z4}c+z`1Sbg`5f|1LxGO$?Hb2{iG59n!AN}cbmYB6uR(G35-Y@|BXg-|Li$ui&V{dk zVji(Sh}$eppd!oN1)z@4Ut*dI{ksVVsn^ikC%7SrmRbA4sB;AMJI>q<&SZH z;YPIddRt(qx7SE=eU3vSLsVx~wiAE+2yC;L*USf0g2S;kcI+#=rOb^miD%)>Bm7jW zRC_#>wLDA$E(0+`o9%lUeOC3_6ZZ)R?t9nz{v|O|%m$+b01nKO&1jMmXuSU-G z;aF~}TH5eqfS*-oO;HtdZ2Wo~*W+&v_)!?{nW+KVjBZEe+H{pKDKJpp{^Em?|R z8r)kGaaIyaj@F!?YLIiLGSHJVKgq3)+TeCEcf&yZh$+I94l}74vnnx$%%Op~q;AD? z5E#6%PMBG?h9gIolrtZ4%?^iKawY8V-R~m`e>OMPs%<@Xk9#~y4BMylB2I17MCvQM zw@&d98;NoimQ4DAr3cCa$t`OvG@JnLfR#fhC;NsmbM><8k;kqFhFY=x!=@>M0X6Zm zpX1qh=Ll@`4PND&b*<3N&y#4_MBX8}fT%a;TklO~bEjZv+k(Ug$h4U~JbP*0{M0A; z+&U^w&Ob7Ut?8^0X)ZT0JKmnOoz&ySTGdlBM6cXCq&0HJHq?eMA1Aa$rOfu_-TSj? z9rf_H@Z13Wi!*BKNGY%$-iTEuu{=MQdSD9gUukGoep4x$k!fh}fS%jSs4O)3Fn)31 z4GQg>xq!3krNs+8GNVRJ^jFcxjoUZ@v0Te?;9Y~}2tFm(PtEururISUsD7!Je`u}w zihP&KEG6{B-X8YvCz!_;)Uw{4@;zz+$H^S}18_rov0+bUnilv`KQ@u^3o_!HfV^hm z!qpU~fxcW5GdJWIf_kdTx41&DY@1P;S^$tI zIz8h2AQ0c~rQ4*iI^NJ2eVIHFtCI5d__ym~kfF8Xl7;;*^Szu)wr7o_Mq7#eyWC&L zZPve+S+&e2FkoHj&}?%FD#qnbm$;ZQw72R3D3WgU94VJ=THb5mzqz`o%LUPRixxu?M77{Iu!}x*ho~8A9NU!-G1-1qgo5(4Cr5NTk!0_{E=Q8U)y|mx@u+~Z3fm#v~bO5laP=Gxu*HLcro6EHMsw2Pz#2zZ@j*q8U?iMf2r~noN zjSU&=7x0P7^DA4`s%%+HgyYd}yj`GZ+~;3=*m{|IhLNx`A4_!r)IeI=eOgA^+_hZ= z`*6O-$)L;wfCevQflUe{F5}| zUcO*WHOPKl`Iv3s`x!{f*!Wa!T_nW)5D9dVDoU9Z4ZL(hLicjDymA`0=c?K*Sb9Me zq~?@@7W!M8EJ=fbPHPu+5{X>9G`Z%X(&nt}%VxZ0^%Fh+(3tL7yIY-DYHMc$(bv(v>a;R60D;U+WckaiaqL)OU*q$@KF;2S zXV#(r&yp|b;a0UqpjcJaeCr|03==S)w2%67@0 z2v}Xr%A)A1Ioc}Tx3HCw4fY@0?@geOO8JD8?F>EM%?(`JoC4W88Z*)Hs%v@vbfYJQ zIvOi+k4u=Qe45uZD0v{jQ38j5935CHF)5wd)H0u!qTZFwH3(?qeIhAZCeeC!*a;mf z*bG>Z)|=Q2NPp>1u8Vj)&8fZAK^@`o@r$3RPh4|t5zf(dTlqiFw4uWR-_~u+*n|hB z^~plJOv?j$+<8REl0H1~g7oJ(YkLc#_1~M&5gDYT zZ-8+%8<5=v(p{BYngHK9X84^|E7NqqO z^w7P_%EpbJ*_!QZzW`kyjuD``Hehc;8wg~Czd#jT=+>*cW|sb8^qhfhf%wXe8<&U7 z;*E{%`A)adH&;Uk(604J_Y1Z!E??Ra8+I-2a$lg=uG{vvE9jT(d0V>AKD z=>6&$moiqGJBMdVrYjC}kMY_h1lBT{olPimaDNK8)rcMV7P%}BuYZT!)rON_nX zzLNwt|LenbW{1Osq@*M~qcV6|{9pCI2eJzH0Ui0qD?41UHB`V~TKlF>2s0SE@%Ra4 z8?ioXs4xUf59AAnC>W;HS04ziOsc-A)MCunwAa6q~9;PR+K-V6AIVyg!4<{ z3V4%GDq#^i;PH9V)ds!Isvn!D?7oLzPl9k&hSDR7jsYT7kINT#e|z-KMRNz$z5oZ8(JFteQ$Jk=>f@f?Cy1m`?3>6_tq*IE3@%n)&Cx$0O6HITO>*kQ*b4Lk5rto;FWUrrc^1 z{i=?PAF__;h(PGjFEER&g|0OBsR2ZWus>2+X3F0&A34vW#^yi>@iN?8540`x{^@hF zAD3sU_e4$NJG` zE_fsGti=7oy}BM=HjJ^7C73mbX#Oha?RZc4l1^l@E&Vav^%-w}xG5XZ!`AzLv(7>Z zskGGjex5CAOs*;>n2CY6!)YAlH(ktzXloin0PxLxZH;I4o&OB*Iv71~6K?|s%Bc8P zZJ*Q1T3A=-wqLHP?nV8UE|F(xv}N*#{x;=7(3CY!2*!^tF$?D{uCn}DE9$~<6RcXU z{oUNyI?ZH|CD0!W%2tTsI^(+aR~J&`_whdjZAWlbW{q(!H1c%2f%aJ6V;6> zsnFCQw(b2AEV3HTX=;c$7!9ba#GJ?^6+zB?JT$4s+7O6xrzIOZS?Z(N5OXOnM)Qqn z|2nf+o*Q$xHlafGe8D2Ua!xX5M*|BWTwy24W~wQ<{AQ(BC-!dxo1Ci(|M>7rm$^2>MTcipP~+b$%fxwfK8A7;md8URn9$GMkz+_Hk0e&ei97(#7HFc6W+fv513G^<9L}2l_8mS|tJt zMzO+sdW-W~S_YwO3yx+BZlgBdCxHHZyVy}c2Ywg^Y9JKdFGjNfsKE&NQjwp1i< z-245Mi)e}2_u$!%?{$eq)~hMEPFm&>9pu-=E~gQ!)qGa5gb2$8Kvnp znbYz95{{M&6xY9KZyb}ZA~`n=wh6NFO*-xyPpFf3Qtn7s%Dmbv?IYAOIZA7kP@ydN+Ewcmd*5g5|2AXSWnoTnw;B5^y?VwmVN=QPq zwl9e1q(^o%E6NgbTVfZP@oWVR)#&PX)eSkz%fFf^Wx?ll^%LSI9#k){LM zUS-c`puk93KW%$E9z}JBi>yx@V6W*+;;h&>X#4&qgPuYZoU(gm`w!+=A1S5TW?-e2 zSK{D=D+4E?1nMOPl9`sVw(cI8-Uh?L=@nuNX z0gnO1TG)MoiS^J{mhD#%wl0~Dub23)C9KHC%J{{?evY`xs1f#ikYf|jG$fB%$V|qo zJQ6CJG$y@yP)|KB`o#LxYQnsP|Jhm&cPhrOS50ZmN!l8-YD(SJs=5REh6dbI2akNJ zJ=vKgFExYiBQJKKqs(5us5rli^&tCR(3k2MfnVxue+)@>f$CZVl>h{f~?(#}&>%%R)d zzO^51lt$MpHvE_nfMAK-Jl!9n?`}3s`F9S8TAz(sBh73k@0sQ>ffZ^kzeGQ-6KqxE zqOX0uV^;v@yR9q@j+A8Q96d_P@vN2Y^HB3_`$&h=pegh@-aKn)%^n+MFMC#%W9~jL z(}*6jgt-OVN_YTcqq1@X*;pC8k1!n*PgvsQcYEFK&xDMC`aV@lQow!b)l7@lo zrS`{Mgn%x(+H+I0ZFL(VKB5xK;K<@i{Rbx@W2STHtxW%~zq&L!8sXLG1hW~yxp^aG z(vs$va3f61xb3uh+813%>%zQs1Fq{29^9vMY3fc4yEpb+sy8!b7VVtbc7!EjJB0C1g%oxVa9~2#dr?S5a^8%qFrh6K1yz zb7dfMF_X?4c*!<%H}SX@WeXAC89|wGyh+!L=+R<2@5sV@&0dQ?3op4`w&(HTv?-t< z`!EO)5$tamr6pZLkp-QZ>60owRQYF|%Q;t-ei+>V%4 zX=qQN8N6}Oi{4NpX!bp-r$b*QuaGEe-$Ov8qhjUA9EULhtoDL^*bFBM5n_dO&}0GLbUGAjQO@ ze^x?SsfQiG@*~RyrOvk)%q2YBhKDLw{KZ=VosP_a46_v%W?@GYH;v;$BLaLkQDU2M zu|VeKxO=rylMyY4&M$M>J1Cj2A^S~CsG>&CR2+}Idimta>9ItfCPHdTX!lwVUgGL^-&Qt{4&QwCw_Cp<>Sgd> zqMfLfl1sT2c^;O1yn>uVNIDahZ%IEh*J2i40yZS?*@3&1j|db%B5p||x|WaShMbB_HUd+n2%0 z8$8gkE3Jtwdc1ZVfZRj@bbjD8IVq!iwwbh-JtVR;@Qeuz3*?;y>mEK#sbj) z6c?PEnwr{tRy|uytJvkNWFU)IL)6y;8y&HAC+0MK)$CnM?oAEe#~R6#Va#TA>R# z1p-m+jBae4B9xQg))%aL2-);6IC+R=X8aqB6Jlyv?aw;%&eqFAzjUC^XfuyY`6~bQ zt`zl*k7N9myV(PV)+ZVMS9#h@#lmcK#YdKp5lXBIF{C)#EfdQCw&7 z=y7A}rBOOeb>gEYth$g6OC}PVYEUnEHZ&L;^9isQtt67{NTcEY`>X|GiNqRfzL~|E z$9l-|eE{Kb&~#{BSdXJv(@s-orBVh^*Y-=)+y4Mm^EY0n4-Q|3dLp6MTbCN_zRHF0r{~>Q z?qdmoo2=&( zU8@A;CVy#PTqaR4u7h)tk z6+5i?2mRcec#$||u7muc429i`Y7+8dUZ!7`TH2WRZY?-1)4NqFuOe@D8z3xsA+ke>>xxm-NVj=Ht# zsUidk{H{J>j<_8|;tu72BYt&t>|v{a?o8)Jub=fUQ4Nx=p8XEV)ympmp$ly;KfeYI zlCJj?ACUE?3cL?AO6=)cWLxJ3ySW7@cq@$3 z4wHXet2FaJB$5lK`+3gg&!Wpb!~EkCnXnsDv-N}(BVWVGdo%iE9TqeglHh$pcK_yq z>c`QL1&XkNVcZkc8Gn+Gc+{;CXV`+f{$-hJm0*1OR8#s}|>UbE8vl4QGm@Rgrpo%@Jzf*+%mZxI$N3C?w} z()&f5D&Q?ZW|@gm+nO_*q3pRna?bvpuCa%EuR2e&zS2mb=lA|4ZFJUd>X zv}B&ZEO;|SV3agAiB-XefiEwuF0*saX%K)_E+d36b z48Bb@~FU3+_ zH??~ag3z#*BK;a|K5f25#EXr%vzt2*>0OrT*M8y8i9g9d4$VXq5ZhZXs%RLzd@6KM zAz^P&!(VDt@Jz$_@h8}_jMxRL!OCpa2jRb3xar@N!}fM5I1Oi2b9b@hh4efAaN@BT zH|p3g>)z`lH?M;68re!_Y9L)au9E~ilPzUvRg8#T(&mT(+kW^_!9Qc!>4}KAyBXF? zD=tgDzc9MCvs(<%Vo)XuK`XAa-XyKD`FxO1e7~O)y!k`sdhfP1`vHs7`n}(hOrJZh z_I4*LF$h35hs#0jT&s?06E9MG@LR-K0iF8?nhpMENV;gxDub#UIW3LAx||_8SRNTHk(oq)bPd@$}hG!;>fVuXwMLOj=VY@W>u6R$Lv*4Ds>vzq#xXW6aLF$ zflTE)Mitgo1dIVj3eoUVP6w+*Y_wngs7kvm3YLVw@9OBWs;M+A`FqC_ZQyLAsgr7~ zEJXna)Ke;eH4I#mXm&FrQejDPJQ=);kIG*Fq4Z)EP`Hp~$~QdKo)3bVq^D1SchG>f z39TN|r3|)%sS=iv?Ea(Yuyz84MM|oj(!WNL4`3!LzD&z zp%hHhQ}j%+_=wVTrt}Y__*t5Y9zR&Nny_DOSwB(;2 z>i>;dyNqdw_s-78Tti4{X#PQ$8i8^LznG1`iCo^w!F1vg^0|yE74erGrOtK0Wi3|E z`9C`|iFOayDL*YpRr=twexO?h?Qq?Y7mbdlfZWYNPs4@;-*qAShB&N7X2RE0Igw^8 zwZ2J;%$*hJn)w*Azg4mci7ZL75(*Cxhi%ql9AGWLn zz&?(ydc)9|jmo3YK~N~JP>u#PlP%}nycOZ`V$I;>Ns&1E&^_f5;e_U}9b zR6Zqx%S-S{*!q*6t7w~yx_y03v2_^7Wd|N>bR5rc=<#Y*?p&C*IbO4PX*f5Uq4%!( z&K7h&*sz{m{A{829LKAi*v)mheavLd!N%h@!%{51z{HaS*7F1_@zm*`q5x%5S;6kr zqD4hv6cF_eGI7JFGjYX?hP77p#G*8?OuJ1-lX@<+O^VZ?1Iqqk<=2^d>eL>s7tAcJ z&t_e}*wY%BmN;>PqmF3GLKb41#@Z4_*w?TJoQlH;$y5-vXHy85g=L&NMXFuC0Ab_$ z)S!%G(MDmPHjlN3U+pAKzjK`??0dbiFz`~h{pDxeXX-c6?(ELa&hG5J`^WD0-ut>fSCC)GzmhKIe&$|gs`kB5 zNkVtIxc(`X5pA7hLnuf(uT@bPI?&kY!VUAd4SpX3fUBDSZ3aFZCFpw{diI`1t8+*+ zSiQ*%p43iaZ!4e6ZXP*O*)W&dc4O(NElspD0vLD&Ws~#2Re{yZnbK?!;=-1XP$)QU z6ibc;Z-2Afm5Ysgn&BtD)S9F+Gp+k3YqC%i{dgifMknN-irOwAK#Dc{>8UO783mir zn*QYbz!R(Lm=7COn5Ki8$pT9|Tt=wl}c>m4Z_ATt8J{G5R~&0|kU$I-IGxkN}bk%##6 z?`(9L74q-C;7M!c#fWz3kCiE>q7}R)Z{gNxlemnLMv2$;%`%}$akl<**FWN?E@$s! zWu3?p7^+wu(`3+L85Be-4h7QJ+k?Y6|L`tMrTuI{U#KH;lY!#AFRdP~Y6GG3Aj5c$ z*MB?~4i5NiLN3&&jf-T|om302_+`~ClnhqbQe-E$4oEI#-r*GCX{FF&Jr5=uOGy9g@P}=k$8$(~C zfb-EL;yYPbcu~H|jy12Zs4K5d7juCxG;AIWXcsOsV!+0V0hdTBx(0)Vj?RpoLaDu& z0L#{j^b9wtUa=m5>xE_a3wu`56saEiL>&QavB}?-_}1eZ|z<3zgJfu>;K!}>7!#oBAVYSD-&mp2Zlq-k^Ydx87z8AGJ>~_s3@NJR845YxK9f>cG0_2w-=Q^ zt&Mq=!C?sL_Vq0pt1$Mpeae<9Ax^P$LUM^FYR+QyRoENK*Uv8qL^zU~krLs`$ zASChL$T^WkXMpvQ-lbO{TwDx=L4tncUQzXaf{CCAkfCBV5tkd^E}zYC&i@nAw>1IN)r>nC(3oRM^p|$DuVGvPZ&EAz8ktXF;kVxGG2u> z=6}`4fD#V|VX_jKA0%-w8c(e21_VyN%yY)XCTKqH-G76M zzqHpjAdB`zW;^!CzOU>qnszoGHHU?h-4Z9va2!e%<;VVU_9QdB2Aua_P6rx3)S-Rv`yX=IG)iHWR0ixfs#~AOvrb{(N5}D-SpA6nVs3rU+X#I!XN7 zx*(IW7N>k~baeE5|BS9;(q1|<%3p4oZ_(^8u)$m7ZFj8mE-r_F-IMh5oG{vJD^3Qh zpu18pwdB8ot2Ko#DF6Km(!F@E*;6}jb1^fkYxZhy-2>(BHb{K@ZF4-I<%~a4pKZ9z zYR&j{k4fLb!4#az7YuZ%69e(KYw2dA4D0P5;LSK`m(*6H&`;IU4DtRb7p11-pXqt0 z`{g9GEk!!*U@zRQ8x@~)33%|2wS|xaA|9u7{OP=#QVh!1W*;WYwjesnZ)k&xZXPql zy=sMHI;_B@2}nsuLNX{pQf(6~eUZyyNqgxq0bG`f?+FahLImI@hap3|a3@O;J1CZv z3$>zPBp8xGaCqF+yVk%P-PQ&q2-At5)WA~zbCfK$!O@Tsa7!-AeJrmI?U9l?FyfWJ zZrBU?Qi=(SmG7OXu!n-JSi))bdLzK+PS1!N9O3G%h`IOx`u@q_2u+z0w74+~CJOLm zY@AE&X`GMy5C(cY6^_NRfW?__{OkwZt*$+mPjz+y>yNOs3u#f~D=1n{Q*zK0N|&l_ z{)@Q>pBa|kh|I{jIo;x@x`j!;wAqT~z4%^PfAg6dy1VaDaF#?s2QQkW-XJq03SOrjsZh0O1DYvaqR~N*>G#yy&4@Iw8&^O z^j-pT+T5C!%Rt;d?roo(kJQY4K+W>bbNsK%=c^BO8&?R^uXRyxH8q`_8{|lPFCkCD z`y>l_kSc4F?XGe|$O6x5UEohayVhGL#s6)g=~j(oNjs%z*6)bO ziB}8r^FOY&^XE4)MH{npaqe5V?yl5n!Ar>?3!iK+Al4yvBfTQp;p0+Yd0aNg*z3&! z$-bS*cDbSiRbOJW=jFuZzFVs%QqNLps^$l@uF(4-R2>uhW+(lSL+4+#>zqm5SxRK- z_qM5K?j4h0;nIkokq9qb>!lp&N6_X_j<4_BZ6nMZeV5|&Cek!d${ zTjy4My0f}HvAtfU-8WYl)yI9SaEIGb(@StI9U_3|c-(7M6gM5M*f0Tehp}@XaH@Ff zlP5=F#R}{IY1-5B+n3CV6%tI%4P^Rw7{ng^W_5;RifJ+G!hX_ZlS}AliLy^gMC>fI z&|#|)n&iHg7v#)6Vb3F~XbkgqG|>d^=f$Y8kG_smsanA9X!WJuG zYodt8NLFqlTvFf1xJTA`!(+1MkqO6-J6^d%1!g1N+=h$X_xpa>n))-|mLO(B%WjF_ zI-z_>*>{-3wvpjFMUUa+Z%Wf1&~a92Eb%BU5jeIfpk#*l&P*XhZ2^cPfKHL&TBzaj z`bu^RO1tQ1_r4fgv8gUmcsDq|#L-WoAoRN=Bz!wp;(2b06jFXD@@Q~OLO_R;&(&)v zvKHnKYYk0LA`pb#ysxLMnBO{xT3@Lsw0DD2XA@aIeKULP15j|V`B^-kF>TTnheB0j z?8kL8U@{iuB2$q%N3K`Looa?}oLnY?+G=3Nkvz?Vm*OC|!St*CsnD9e`YLWO3CZ^y zvjZ{I!Qx24fz7SKxy!*SwxA)~_cb>^9YV3TNODln|9-|^4p8BHhgU1=o=8Qo-3-FF z{Zw-ov`3PQdp5F0cREjH-@50_Iu{GMMxeXm_t8-bo8OGHdu2tcJO|yD z+;A!KMV)d1330b}MHfr(SdZOb+OWi;k)I)%R(?SL>FEdiji-CgA*2wA51qsIkXCew zq)WeHj_ba+`>*Y9*4G~l(0*_=1E01GN@M+-&jY zk?>-sa^_pAHh#`t<|2RgKZw-SuS=W%@ zdM!aGq!bVLk~D^j*Agt6vYCWRxEQ!v=D25?SR_EoomP^+FMRE*9PD}US(c#Hhy#)h*O8_*AtsiNOv>ojH+ljvYPI_kCsz#oWne@06_=oh%gA#_@5gRE<(vTOI4t@76DTNs*UYo%`%-v7R3n}7SBKM3b0r*EK% zb5y@xm8XBNswk|l)GvQ0qG|CP4sMG#f?#vS8SFImD*^rPN+pk&EBza=er?hrsNLh% zUMYLOyGT)KCR+~mI7wTCxu{doU*WYg6Zf^p_-E#@zgy*d|0e@s9zF*=L(3ZxjSD@64l&Y_BPW?5{&UaVCZrXF7 z7M`%Qr&$a4SbCpaScE|pvAdz(i=l2MJ(}>Zq85fLt`GU8`V~ccx~Hi=)5y8 z5B^8MQ;9m+QdeM`6#oX_(ok=8ud?@JpX@zy#*HJe>R4iU+ypmy&)DnLfno8Dvnkwy z2S_2lCoFJoY1vjzpXW;jtwRFEBg59Dt(t}ki))c>?cg=)NgHU03g0pJ$j!!?y&!D-dsOjFFL_FgxT9R z$}UQp!=c}{U1QH|a%FQ1n`xY9XgiRo#)zvh{mZ7t{eEVcQaiNSy4YJW)J9xJ58t*)Y*Mvu$Sy+}PQ0hY7~C>)YAv9pdtWO`p06W#~05s5);R ztj~T+jg$5va;;Rm*xi0&=r&W|2~Iz8VpL$=1tmPGbhme1UHhh%A!~2Sx@*|Ut(}ng z#5IYlij#=ch~ z?i=PRdw%)dOjVGORd3jzMbJ%0KWjNhiOk*leT!+2_H;LQG8!%OsI02}Y`IMbZ2?k%$~oA0MU()h=*xSrv*-@8C++Bz zbJqP=MH}ZSj2n-?!Ku7N4!)h)26lln20ML& zB8f&h!pHC_yETT7Wr>90Vl~x1(!nLsj#!|_7l%pF!qlK zH`V`-ch~2sV2BqV(*ND8a^*#%J@4FEp4B_tGB!TZP&u)_qonF(tD*5vwqJ{cZ*%kK zWw5r!1G$zBX#6h0L%}-nh#*VaMoPyq$pGyw%-*y!-$RxXpjj7REWf;k{Mpv9J;fSG z>2$v2y1tmW2%|qxo1U+I*i0g;o8+2HoGqJj44H=iBmj9ELV|cafj4aLlO^?M8DQ}e zXUYwOC1HnWd`bA^n;X5d%9+APm8RSou8%LOu8biIelz5tdtPr59wrC2l}D)Bx)38e6N2EI z;(+)?@&#yaZs#5U09($F$!n4#a8Fj-8fH=4N&;L|4rReZtR;)ulj1n^#SNrZeRQtS z(aF&)o7Br=-Nlgmx8_scv6B7oTA2H_94;ZnF$m#g+4Q%|dOsG_mVKE*)c*0)zu#1Q z++b*|YJCrS0-HPK5I@fwx2gOLWVJ{FL#-jC+p9>!_!grucuUd06bW`CK`c~UQ@9i{ zWQ~5)C!Cc6uSDIHJgq7y?Hnt^Zab=6z2aa8@9h(|ddsjc3mKH+m$3jP*_Q0|Q%R&5 z(UHZq&#tCcYv3Cz>BRPA0d3f5ljiBTcix`G`FBY|j`c%#B?uTLZuVkAsJgH>*y?Wi z4U+JGl;n6TBtaaEdT9NE0ZHh{g~wQ7zK~kkyN!~QlS2zh(0{}T@yQ>>!GdgaP6~w0 z6S|QYuNAl3TT+D}3_jkD6WGaj+vi{VOP~PlBab)9#|y8P=j2O?x+dfX0AW>><3wON zlcIwjJ{H|DzMRb7^V*9Rdu1Cx+=)s)OM-{@f!5{6klnsS66FjBeh3RbuFm4J=z7?jXQwEktlB zQf+acgQ+Xd`1kDw_Pj4W0PQYXZF)3+iU` zKDRv?a$nAI;DmA^V2yc#c9%iG^?!7(nW~Y*3s!hruz9wMy!|Ixq7{2f3&}c6Nu7e@ zb2=O^_F8pJZsK!kfppTj8k65gd4W*u2vZTZsyxuXLneMw3zd>$0O~-!Sh&uh-UCvB z;+2QrrEBuAy;v)Hwi;*j^7oJAomdmO5dA~3qJ#PU9%bVI{@%1DooM;=@B`L2u-F!_ zZz5nM^PBwzL_@U*?!lYBJ}DY93;{3s5sN)gla0Qo5R+9;D~&V2EyZh4(p`QOX?yl- z)fmhZi(bt&rlkBK*tT!$;}Wq$NA(X53w|_-cluPA(tXc^Oxag@cuR!XXuq>1I0sB|AbjD@LP*eZln4kpers#?M|BY;>H*AnG$h@g<>t};pB|D{1pfI?u@VDPR)JwHG6pJ;#6^87M zq%BPxu`qh$=h{>pmVC(6!o{N+8tVIFXq{{gZ}3klx$@h!Fio^GdRXmraI*&Y<>K1g zmIw`YwfB|K+){pZNnw2mU&XHb)V})j)hgj{1v{Qs(wt7pD{HLKM~nfb8<_Dr(SarU zrKN6O)2O5I@czX_7mx7zao84e43%J!KLV+#;HS)%gK(?_s_>@I-Jg7wOL%$uxd2QN zTSxlpeT!3cB+H7zH3>nhg~!%8qum|`&Bkko{tC#Qk|wRy!ZQxwHS6NrxR)m)nGFS= z5Ix_7Ria)6VQ;v$O@aDFKjE=wiyNF}Wq1fdwq(J4_^Wf=+^hsc4p(q4Ej-?x;gM4l zH<_%8cc3T^q|x2L5+GFVC~_gAtgEBy<-cMboxLWjQkwzLa*V8 z+~iofQ^N_`u@hd;5P1gOhvC|Mk_Z(}T(rmQd6rVd1F`Fs86n~oZr zXEJ%}ztu+b|7~yo{GaucW^3$kff|e0sLX1U0PGy#XnbU2`x@|l%X!?bW4lJ@Mdx_4iHP&T>T)2)(gxfh;pFpePFidzPkk-(kGS=2) zy(y`!7F*%ESS=J~^K0d&bYWkvyA1J2YZIvV6#VC!^j8y1$;Eb*D3C#6 zF>!+T4QiUTjziarohWI#YOzLsYw$mYbFs~ofUryc=2IZ<_g^~M*b7K&Trl(Pf`Av~ zU`VpKJ@0*nb}@>0H$}X+oZlkJnj>WV=8syxJKaZWOGSC;kBFp znUt6K-9Px_Aa6{pPN1E+^(0Rh%E$k(3vVZue%CxLXD`#Ne)q*dnX} zOmP~+L=JEj<0MKN8`o)vm}4gbyh*d=tj<*&%op2>D%Gdm{VTP)IFB) zi`&*^CsFm@Ve@t0s7A5^^L_JpRZnJf(}(8Kk1WEaOA_Z~$5c--5gHBpC%+hFb@O|> zDJckSF8vVh*%o``1hl#^uU7a6{p2Ot2h)*IZEURe?Z0R|OEMH8KLX-YpC(@Xa7YuWiD{3Q$uvM!KyJC> zKQ>I3y_>I9gQ<(^PH2yMoZnBuV<^j%a+!#h;z(j`hf{7X!U4sN<^pd;PS1-F?~Msh zX$ec{^Hq2|X1`^Q(0byj(d|}dVzOw0gMfu`@x&N1WAz_5WkS{V;7TjZ=*iybJa*c@ zRk9`~Z0E!Qt7uHB48n9;T&L*)ZUVX20P3-cznU}MF$KRT94yT4He+vJ;VJO|xGwXQ`S%LkLlCUXNcl7Hu%=imvBJr|W<2c`m2QUkK(NwbfzI zijH^z8!-I=?E*y6znQ4VCqD~Mg|XYcP_5wcM;n5*+>p=HEltDuhjCK`t;~N`%>yfp zF(NtWv@UE)VZTpL0XJ*n3U23ih$*7!X;)D7&CMwH9X3{bZYo^DF@nC1w%pfRTj8R&acstcY&xKi-PS6RNRykJ%q!fci)KLD2bc*X^3rkxz2(`*iuMANAMB9jy z100jU>^r@L;;=pisu;=xG)({q451VGWP^4_Kh33+*49L&35ypA&((%MUW8XBlrvS@ za9OiQI%>S1$u4U*GKvJ_L9x!^Lma|{oMN$hI1HL6Q#pI2m!<&Yz_MQ7Ywgs<#mKaqINe z#+3=|Q{{Lf-X6HEaY#J|9lqC@R?1q$#(c?D8Tyr3;LNDLl~EW@iKCN7=hDCZ<-^6@ zbxSu2A7ow8%4{>D_MI?{3GIynfpeVn|DB~73b$dHAZj9p2``5cgqT27Ik%l&kJi;! zJ^bqAsxrJ7Db6M2inAo4B2qH9fK>BYH>LqCLqtWO_5CJ8rA}>Az%rJQPFhV+um#j8 zyc15s5LWc{1?zAB!oPb0y}Z>lQ-H3>lN)^+qVHf!YNJF$Z=9V3&LwH};sUU%EV|_3 zA^Lb%*H_Tq%j+JB$@=yA!5`KaUOkm=6(mj#4a&!)SCky~UXIw(&gb!;uT2Jpu6E)b zx{+dEdn2hT1{HZ5A*8Cv(RvD)N1QsuQ55|_4z1gfHaR1>gM@y^sUiy(=((WIjZ&dh z8xjZ`;-znEo~xVRw3Gik=rCpl)_5+Udf&W6U9mKKKQYU93|2sbA|fR_?2Ifh7e>vG zF5j!2lum>s#a2>dU}wtYz}Ozr$COIO38P}RLx&iF++7fSObc>eR-?P<5N#U~Vc2ez z-B}~dg-ZG#Jq;tpns6G4FN?=mVQi}G#EHK;K>TB`CxTHTYIJC-c(G*eS860K?3?6N zcFx59`Z7XQvr7Zz821zWg$E3(w8H*vasExHrdbyqF;v8~Y~ zBJ$EHf=7#hOl82?!r*)6v=5Vmlol<3N9>k-0ipJJ43h-b@6ge5z~fO1b72cE^>9=S zD&FzBERiM9K8`6aEwGithFtY;K!Ny8h*0yVwsQKJ_x&nHz{ZVPsdt+3gwOBoZFr93 z{ZHlaoou2%vsM`9VBKH0B3muI3T%GrZ<}{EM+PJ`KR>>g(RJW$pYI>B=nvIFU)jX! znf*Ffe#_QszC0h&AsT;ZkU4IxOp4wyqLYr>cg?LGR{Sz4ESr$U`~!Op1WeHwkB@Ez zHz}h*8Zlp2Dki4to~XwO!^lMTRcJ*|5VBUqS3Mvf+a?=eW&>9E%)9vesj*tO+-L+P zv?KvmN4*bMw>BuhqYt-ZwLr8{ctG&{UVfmE1Ph3LL%|Fd9H# zA1|UCa{b2NhtMpaz0_bHr%}V5Z}|o&;HiZ|_^>Vsb~$|DcG_K{-7?e2*J%_gkL@Tp zdazh<0A)E*_D44x(8Vg!?KVlz;961=REA#p1--%VuxPUr@@>^WRw9)vk+Mb{{DPf! zoGerb^!sK0M~~^rpM9yBA!=)%sS+=$<9L$9 z-OjVm5 zMSf=phXoS~ZryhScr;NcE#w5$bHBfza2Gn;Dm`ZBuq;3X&RH6AsJ8M{_g{l|KcrcH0lFYYPN3y_zEHa6R znxax%ivFpA&9BDwk|MzRa79&AkXW~g8i_-zSMhN=He^&NU2~t$UbJIcj?$I0%T-wa zPBtsodjv!~_Ym1|kNzV+!5!bWJ|$(5-7Xki|3dQjn%=K^XdZjQ?T~!1L(x)rr!J=R z(l3T^NI5f%v4H0mwzPWVXgZP&+r6^k8m%UM5KRVF(T~1NfAp7Od;I{Qs;!pggDnP! zcPUn>{8f^Xt20t~TfA09yLiQjYMo23l9jZ|>3hH_%O0%Jz#TuRY^F6~G1$ez@6dGL zIA#^wc>ShX)MBhD$IA%zzRR!;1`|H6>hNr*8J(_Dh061}rX%SM|Vr zw0YRf!QjYty@byErQf~xv<2Qn^5Uy#bEMqphUW8&^Qd)VGnW4weNT9gXyEnUlJwYK z=mX4Maw0h03|{E`h|~o*&B=6d2SRcv0`AOkp-c;Kv!505tGmW#EYa}X9J?Rzd8SX` zhuR{z=S^Eu-|_nUukP{_P_*RER6UIEW_B8mfhpHvy>H|0fCv%$tq>1BA{-YU`< zZVI~1s&37+#L5J3@n~;2*!)DwJO&^K#EYx9@73Swz1% zG~#E0S99HOoFTIAdElM)18k*|8*emu<18VLf6WFTAm3aKZ_YNIKV>nU>(hfOWg=$P zeh3_1@OQGru*Aao^~zrKCY8#RX+g3M&>)|QVyPgfzp8E3@Ty2uLX91&iUn_tEi$x( zOO8m6B`4>WGsEBXa!7CleVKYkm3D}HF?N-f*3KXZpIuhS(BWah`n8h}Sp`jD)W3&L z&}&VOK_w^K^4ms&LvwAj%QUbR8RDNvv{qD4xJ zC6tB{Pg21IM!4o{s;+ zwYxs_Pw(f$S(j7WsPXxAG@Eip$%7K3`TJ+5aQjSbg+EPq9-&<`;JJCB;)?t#$vwBFm`YZjU~n1)mWTXU^GJ z2rgvAqXKC~wk69d`lUM@QYs?F?Kq|I)-ohJZ{geJ7IjGk>w|t_Dx#oWs4^aIEX5fK zkL|Z677&tdOoH`%;rdCqm_Mhf!|*7>I(z%dFgO*WF_u-x&nLxD5~E3G1q8;qvk;w# zn~lt3G6d)(*RZ(%wB7Ty@Q%z>Z*7(!2s}xww4(f_RlUoMxpLGSg~{e4aWZ#;(&& zM%aU0c-#jn)~8aR56i?fa)D>1iEBmz1}V-ieHxRnS`(WL&#Z=dH)v4K*wgBbT>KME zNMl^pdBNyzLP3{e%vO=1T+eL=6!(0JKuW_gcx!WLg1e|+v*77di!B97&mUSivitx{ z740mK1E`w-)s1p%8H_S&?LXF;bq_D^5M_sqv=nQ$2rv^h+DEGdJC>!;;dwi8p3!eI ztabZ2b~Zx@RFV88IiLY2Yz=Iyv-Eu%=mdMK0Em0EWFoi$$<=pBThWpit}F_E2W|ks zSo6otwcS@w(g+TYq}hcsHp*f5$owdt%W@XQMS8+6f=uMzmc!O?R&{R=??yeU zfv)h zx8eRYpii+v);w28g=|QkcK5&(IDD>6-Z5P}xxPzs`4_bl7*BwiP6M0CL*E1fiMzo= zBfSEupQh)z;cib;YD%3tNz~6$P3MwP`pn>+jc;*6^GR?xN?aDz)fvT7;TVjbOsWUm zmI!n=m7t5_;dI2HBc1EU8OF60&m5nk$gm(3kKC<_rQWhixs^*)lXIi%5;xAe4CtB8 z(wALlOCG5g(8?vvO2|cOV)F-{48@^)VmuuQ-Y;BujCW65_15YuywT&4=!N3lX`;g> z=fS*G<2O6sMu0scQnfM7aG(ht(#gKAAN1wKHvIeuOG>k5&=+HX8jAiD@iRL4b_r1a zxo|=<8A^MrJd`;#Ag4@SJMu0TnFzQ$UJ8Ogza1p{+js2@w(6qUJi5X{{M#>+dMU>n zvo(%feBa?a7L!BVS#z}nT3es=+7~G`uJxr_T(Z>d$2pR0rYs85W76b*N~HGghOZN% zez4uBC9rvm*BlGArP>2u*YZ}0L$OLWL%jdKizxd&6qbCwj(4v6bi_4repqmCn0d_r|nm{+8;D2IFCxTTS7*Ed`(;Bdlfk8 z2#xPzuukMcx4V=2l{owDl#U!_PuA9{`0q2du4U-|BGkDDt$M0d4W2*H+ySWzx#UWf zEKGU*RuIoMG81(a+0N6Fng1#CE2`+weH`to_Cl&|tsmLp{@*Y(E8?!_A8nQ{dh$CA ztfmGU-+bLSTG?Z1AhmxD9#ve!;HDlX=SXkQ9<}xKb&ZXfWUhUlgz<`RWs_m}WEq?Q zJ*+yaE+mPIOVygYpJrO^WS3u4>N)&2o@sUVaqRw$ji|v*M$65R+WR~H?0=r;*m9{Y zN9ms5{^k3bI_jxRb~O~v*f`x!SS_VJa22LZtaBz*|61g zHe1(Ue6!^4;_jL3Nzp{BDb?Q|HjIJIH+vHA?P@nK$iT1(11X=5SfVam;otjewBdX; z2>G|L)FXD%?9%_!&Ws!KBvqUe-3@y06KkmoF+KO z_LDCqd^piW*WENh7$Nl3_7UPDFAMizv^Vu$>@&rx8TePEDdZ_hL;j`b@?QYp~ z1N**u2vU2~d9LPVzOVdU1db|7!~Pm~wSqF!Z@VxJAqiF}LxBgCP ztp9|<#d|rtqS9@v+*AlDZxdnK1n6hxtM~H<$5B6}iHD|7p91|1O>@d~*K8~7U73bw zM|y_Wc=IxbI^34!h^J)l?Kyi!bnFHFh}FxYbd z{9Un_`#h(PoI6zXCd!t5!%aCxTXJ#B%k@`@B=NVS)O-r+qlEuogltyl@$S%qLvM&> zd~s)*cZm5vi~Fu%sj^XGL!EP{QzXuxA+kCWUI{mnp8{w1B*8^0xe$@K97i?#X%IGi zQuql!%PuC8*!=7rlvc2-*`jnzrSdYVRO6jg4xxt%Um(qns>KN= z#|dKw`i1IDj~d)oofe0mri*|vugLOGzAj&eUNy|wx52m`uYR59F`6!>F#khPcPub6 z!=_*@C>wDaBR6rF*)1t_YdtHLCN^0A&LcWL^1~0dhOZ~Lh@h0t#i~fp!W}QO?x}l~ zRVvfbP>3~sFNvX?A)C}EPGOohV!yqdoYd`)w;*r~qCa!5iz;hy!ySN!D(rPD&BD)CNKLh-5#XU6_~!L~qr=UU z0L}}Yp;O@85@WS3;q+Y!^g*lRzN|`k>SQDRF_wIXS%br13ie`WQ=vf@2pwf3ish=^7v#z zDg3-Ao`pchiSboqFgUX*4d9E#=$Af%c0$&`Ks4aU{MA`fr~F?FlOp=FylE%jsPLma zL*Ljv{hQrO^5b67ybMyfEDB6=jI>XkTYdStLyJn56`{X=UW_T-b|Z?}nn zhvW-QwnJf)Cu}!APVkg1-F|GtN&E5ZWyk4PSCUkuC4B7Z|F0y`42t;QJSSSrMpD*j zTD8^PDPz$Fr}Rc%|MO4NVnuY~c#g?Tk`7gLgd?Stl!pOR>kNkH5?HEOiahhyo1sB+ z9o6iKlBBcWcWX>pcLJ^oXw4xw`%E^_Dsfu(%0eS8ME6RoTJNsshD9-&a*I5`TO?bu z`O>;sW9{3`DB_)$*?<(v+SkLWwzh_sFJA zVPNzWcwvYVrVvn{d~3w__&k+zYESvAND_BCP0*>(?@b2|g;SnwR=H)|2)#W)-mf4u zaPvGuk(Y!_>*Wnp`b*Kv+K-$6Gt73NH>z6?{4|cR`)dSY$Jx)>(q@%6 zl|7iq;xJ}F5{B|iJapo~ikD)Sv7ekKrLL}$&m<+ROqC={Gr>Lq=KF`5r%ztkxC8ax z*!3O&Tk(ehaVuvRa~{9(9-dc)>B4QC9G41E?U@>AH!)f!kr*lXGq2K*QZQ~yj$76` zJk0z|P1(a`$(%hBdXgHmj#|07xsX)Hx4RO#Y+3R}1kBf|9eP_sJnL|&jmn7;yf;?4 zHdgtgB~x@ulg1`dY=nuR%-I~!R<)+*cvG1*A=4EdFQ?Ex18N%g>518qZ8VGld`*X2 z@*_zW@ZL9|cqF7C=#AxY>iGeQI4w>A)2fPw9RK!ze~L5tIV0-YasXa`@{W0+-%LyG zcfEX(`sbh7L}nO9ljjPTZ37YQjZ%`2JjE)vUw>})9DRb!|@M7M84 zL&D#?e&ZH8eeo9+mVs|9!rMq}R7jL`h-CNdo>TDp9EU|OR7oN@?0Cx|c)Lp(r{hvs z@kh%pRX9%z(W$a;I0qOc%h+tT+AFg3mYF`@nuLD7TV~w7$R(z@X3Erg1{5dUvNci@ zk+a@f9S0+Zp&hG+o!j%2E{%b!hjKMF)?u0;4m+MB{l*}ejZ~$h-1v?8xkUd&gZEls z+JoE)u2ov*KsT7#xIRlgKG~MadDX+?#XAX^YP(df1$Yc0x$5y4-+RKS>_Tv4di6I2 zoE)~Q`G@AalEGtTK$U*>@A`HypA!*5`()HEn5F5 z4*L~dT3MNxW&MqIOR8wwN3g#EiQVz%Wq}paXJQ4!P>SBMGuI6R@&r_F#L+%_o}iA= z$kh$U2?nW(#b9WKjFQe|!pTNb#_4Xc<*e34KghCMq35GBf07j!^v-`SP@)^fkDs5u z)$=(T0C(kMIju*L?#{+73MStM-NLel$n82luOW4 zyvOV0-sXkntRW*?PQ~iKfa`zv2)bH7*)f(ZZ;)hoc1(7|b!Yt#E%~X2R14uA5R6^m zZ_-ynoFL)%O#7XGJQf1}pRo7;vl(#l>ume)woJgEHIMn4oj~&j8n)h!*>n`O8eR5j zYc%gg38EG=ma#nlfku+OElBze%@sq_jPi&pUktUJ+l!CHXgXVHxW*l|TI*d1mFtSL zzmtxx*4-^Ey;gWPSpLd0nrn3r*9ukdTz@_;gwz328|w2xhfL>q&%nh zZMhBXS680P6gnD1b&ZcJ6-V;kG&H7-G`Cob`ztsPCOsr+BzXYFN~e$0h>{ZIN8 zEnNd1i(m4y(+yZ5nKw3HuBf`czFPI^MgPE}$QNcvKfi_~`;8B|RGdCKAz!cRood;L zn!fcF+6Y_dA=>G$ZL@;j*}c3m7Jl{XlYT)m6_(Z5 z=qz1%?HT|S?=}Fi$f+Bvkb3^nzThkUaFNzy95{F~2$-ABsQ39R&NS6{=EEoagMV!3 za+5jVq|h+a<^F^A#-MFaKk9TOG3%2R)q)h_$OUHH=l*YHL(@$& zXvJ(0bAu@q@Mtox0$?lIvz`&hteY2knW@Pr@z}$%PhB@mlDzQDHI#BRXSx&~{ zCvq^`6l6O@sz?X4?}7$LaOdbIf9&5 z8Nf^|u*A8dT*^_+L`;RSTx11r5l)8!r6XWX)nW?uNl$|GAfC@-S`|-Xh3fSQN50TK zs68j3BJ}o8Wb%rX=sHJI3t?YjeRcKg3+vNX8)Y->TCd9F)w;hR__EQ4B7gKr9sh{y&uHL$wTSKTN^b zy{8I#o%Z413oxI0S$NKFbmi@-ZyU$p<~(W@ixANWhJcbp#|b3QnT~cOK8YcJ!kMd;ae|x%T(K*o zVKIP8qJ~ksdh*O;oagWMmTZ5*R!fY#<`W6`D!$9o((o>hh2TnDj^T%2OF3L_F;kOk zYjG~bzM<54u)cDpOXnH?H~y6$V|6#D8%frq$$6}@^AifSwcPMDcko~U()JJ{6KmxA zR)#<3sUYxtEHV!f(3)W`mXFc8_ZP{dq}y#JwoSgz_dA~M_ilNs^%^@zlP=S7_B=YZ zzJ$0UohqngjY0+t9fxZPMTUzfQxfxUGWB?zIcfbu$E$l<_%4*n4ojg@06Gl^GT z!g)fIrstVz@+Ttlqt8iD&#-<$pfGUwOR9SxFI2Z%g6wPoNth{q!aHw_0p5Ps>M_3i zksf7GP9PzcX5{Q{Zc0{7Aj?36^g<9eAc25}G?WYwvdA?r;Wlp1i#m>-yK&Q=Uw?yg z$;mnevgEqUPs0r{_Fhlv|6^3;Txw;kyKK3Ow$iQ%o>U|EewUUPnyv<{K9!Vg9rkjc zJWi}Q)`u+g7??8rmh{d>R+{b6n`kzstq;Gin0a)18lwh{QM7#gNc!^lW3`p6r^6HK z!v8B1--XU}{a#n>llQNC)bG$am+vuA^2u{csQ%dut=-VhX_;D?np!lh(q)C~%jxcU zz7M(6rVm!-_oRE;j7xaNBtI=-KbrTtHrRc_k)f@05)uxU_vg zJbs&Sg2pb}v5?TeM${+!-M3k-(3IWrXYbtV6 zlTzklBda)ZjN`{z`F(tkr}pn;d}^i-fofP;iWA{C87zw!jB0Cn9p4PS&%e3c_)_@7 zWclbeXk_a(ajA;`TlD;{y(I8uPOk319}lPC_HXEU`=#b_!f-J60g(ae=ygpk{H~!6 zA|!AjsEbTxy(~EQ;CZrq@O~LJlkW0eybp=Vu)3IG!J&B=9z&2lyLwCM_8uM6PRyDr zy&F~uhEbMF3-WsIgs}W>v)f*u6bH zAGaQ@*?6UI!~5@udS!!4=KMVDkt_5eAh2}i9{~WGV?;N%nOD!GhYG=PI-aOD2l+x` zg9XNYXg`T-AY@ij7i2MxTY?7LVe~=^4i=_{mrd5j&Rev8$M-*0-7Z?qY?_%0!%Ct5_lOSEe-kGN=&FB zWEmhqC6!&u@>f?Vgfq*m5BrT7;IsqUx^${6OS4;99hXYVK}DA&CJ=}%2!$ZXP(>gZ zV_1Sq*bqfYlyd(yo@ByA{}ZPkh( zwo9TwfmvNQPQwKsVJa?FhFOI*0T2}`1lWRyB&Z20X)IlDyap5STI)6a#8g zs6{3dF%d3E8_nes1;rl}poBGxL5WI;YT-aLS+$TWz0%1t)HFb4!;57sQNXNmI7zT+ zZ>M{{8SZ(9S@d}wIL;jD!UcI%Xhndqtwx0)tcd}{+GjbKVM)VUcn6?kOrOXdy{N zss#cE1PuisEEmnp3NE*}aQer^V!J$ire);1KKW+X7%=_3jt3y=rR>L76H~wHRxcIS zRz?hZKU z4>dzpE3xNr?&_Oeb9zR0-S9sWdwlxmGmY|H=1(@vGcmL`!0&|R z=c`3*Xe2~{#7aznu)-S*G@{NQ^gnf5$&NoiGj?Mp9ZeI#mYmvY^)rCmObg0;^18{q z%FNWrdgVs&wKcZS!{fyB!scbnYBXVkYSh(hW>aX?Z^4Fgldvsj+YGI3z8%?FYBtfZ z!!sDoHf@_)@tRt6O(wRQ!qusawtPbMJj2bYrdcvGdnAzHnzOoSk_Ey4D&j$(WzODthJcen&`aKzBe_ghsSjBuA0U1rN*^m z<2$X}R>IA;+P1}ptYwbr&9Gy4y;ow-ExWqzbE{>}?$Ne(=M3&^J5llEzKh8=h31v` zzn6aP0Slw@8k~)$(rXK7Hj336nl%{K8rB;dA#GNbzb65b#*rf!lFpu;*PVpPwU)ET zS3GUCtlMmvKYnY6!s~}EcsXCg_;k78n`UL1S(?e9uX_mlzjlV#_-2>YuiIo8sqKbu#Z&ExgGkBRPdD6YQmCG^MHY4_%2%x2ntUHUlM zrMK#3NAGW~i)L~&FYau<7>%O(wauE?+L?`^{3N60qG-igDQ%ar2uo@tc|P&!^G}01 z?1#S(46Y6uSB~-vEJ9W?7m5rBFZRA`yZZ(()cX*~`)vKI5c3A6d5j-o!%ydFUduNh zZi6{Ibl!4sWrnSDc37-rnqv%E3`Yk}dS$V$e)z)akLq`;#ZTzOcFxRExv9E;4#z^k?`<-_~a)vs$KA<4f_f``Xs5)$OeJsn&|T ztu(>m_HVmslQm|nco_X3W8YVu+8)e4%!4%4o-YxZW)^odRMgU%}uhP}n$bWH(-r1t}8=kCTg;})f$wo5$Y^9^Fk?T8L8x1km*HQB0F>{NX zre8Ow9dX`ycz0ZR=<$kYS+1sH8m=w|*G<2jv^c<;!mfH|d^aBlhil)aFE2eeTx%M~ ztJODIE@LHUCaJrVO4QM>=)G#=ragQ;a=r2Ej{`onTTPi}W@Bl!Z8nGM-;jPLYc`|k zw3A|`Bg(7FRcQegT?v#zQpmlu7-=&r8kg)XgJ;g2RuQhCISZ}U%C~1BWQGidydRsh z*E3eAw;{+~-G0K`ZKZ;`z}=~PDM($lY;L8@tV#@B!L7n(IF-qxhMDkVHu70gv5k8Q zCa1k@UE{7?1JI@zJusi{-|pU&c6fGpelKsAx%a<~dwslg5mD=7!gAt?2i<5pfQFooLUNgF4+c0QbP>Ehg8CE6S1mk>#bkj0dTz&sC8o_szP zq|HTKym`ORTAvuQFM;$oc}s!OYurb)6esc5_(wT{Fwp zc+*WSYO^e9$90;?k2k)(k8{}DJBM|RyfX0G%$aX{k9OYp?|JWww~gCt$5)N*y=!~7 zHFLb@UKrblF=kh0>yGaW#dh;vWgU+@9dj(w?`6Wg&0(yx^5L^BVWzEHEsAQxa@Ehz z_4?%M$2#H1=2)K0-@t(`w$N*1^kK>D`l%$6La>CGFH_UZG&YlA_D(t6f+{{X0vYY)BQGf^Le%BO|Q$O z_d-6a0oa(dvq1gl9L5G1vb8p$d5JSrzSeW^$30E8Pl$N&;o?y+e%Ner_-rde@)OOiBT`up8 z^J;rpn&ilB9S-wXk=19{iQZ1w#%$j29u!@xR;_r`wX7TFx!SPM)Gv3|-O*nXsXRm= zd&hW@O(eQ{{~8hD&@I2>0R4WJ6{VD>ZLAuxq+;S_F7UX#cG{eNMvo^uo#z-h@?lIl zIchOXu=%Ac?R%al(tI}GS2SbZkE85@GxhdA6v^)-1oyPS`{PIKJ9F;i^ZGhEI1C%@ z;lLw3#=uLBmI9L>T`0uB(1&k@W)4m<2sB zhg3HDs4OeFF|Ea`_tnu>Yb7x3&ce;ey$wn)bDNodgt%4B(qURsI3_Z7a;y;_k4R7w`+Zny|0cWihZd z4`p9eF?@d`8d{cLZvo2I>sr>WW@-jVL?JYq6B=ZFmv5*KTYbai{8TI-a`&#FkSlI9 zi2P5EK5K9yS1Z~Xw>>wUk6dlXx2K4Do7o`Rlt;%u>YF)@~y z>4BoM^)$-huU#W2BE}l?vcI5SnK#mWGs|Z7J=`~5(2{O%`#Xy0;~#3Rx!WblpwDXiXLSa^-TFX{WoMv0R6WWPC+>_r;wA)h@XrXI{9? z@pyG4@M@T1n^UC9nAK%y!pQH2xJ0tJ&0int{-e!@Un7x|$hoh@&R)|*+DwV6q?OZ9 z#3;$6m{gjkbZHi64f}S>FTBbdTn2~%gJMG)2J4@GgGT)KzpwZm4$NMfO+z7=YRwsj zSkz!VYsG^#JYtJ9;@31yqsA+m^AhGoH{PvCmLgLHljEL(f*_$z?5I~vA=IdbN?c+s z;eo==ds;A5Uqxjrk!ZZ;&@yppy7@JED_7c*3nNsfU;7V8*1_T82iJvka`Qk@L>B%@NY>RN9`+CK$6UV~Z7L*_EWrS8mAKcJp3Z zMXL_YrOkPlHJBNeXrnyoHlA+_OK%uCUD&eWqgXzl&gY&>wMTS0jcnsHCmKG?>FYf4 zy04##y;pk#+hEdQ#A?dS)^yzWA?`_IzARw+1IRpsdOC>KKDb!b&(Z2S&Q zIbTDU_D|WzPOCBQYtXr5_o3x{-D|@wxhK^Rt54xPwq?oIcPjoCRI&PA9!`#a7`p6o z_Hn*iC3%<=Mt?i%J^#XS*UPu9HBH0X%Q)f9KboB{gV=<+iD>r(`Fn$OD;*Dp-ZnFI zErC)ONXb1q*sFo7^bGuO1# zOXLNvEF}QE(Q_==tHSK+ST`+ctFPDkI3LDw$!@Z;y{A@D!QXw(e;69bTGNu|Z)~)K z+LHjWA@PQK;PeY;?e=)mZ9_7qH7MGr+hWSl));1E8j)jEnKHSTHAuwOuxM$OnADon zVU{7a4lpjz+Nt!}tlLMKv|ekOLD>#|@w-j&YprWq*v!hzWP8aMTC!=ZVB0IY%}&!h z95Z&ORtA~zaJGKZyv*QfgO;jOVAGC zqFb(4fF21nvkbCu{=x1(Cqwd{?;U;z>N}pv_R9cyhu!%@Rac$52gV!+soa3-9Yet- zSs2zVGNpcZ!0vcEoO9@TeMY}m&b3|4x<_w|x?a#*dWS&r)zm*=Y!gL!gGa_n3pM0L z%X$Y$^g{FxAlxn)z5#{=zHPii=;sM6K72E`VD^W~bM}(oxL7fkibmo(ibiD$c(jw$ zJcF&$V7vpd>?Fd`!V^G9(%{N{Alp}02JWplmO(D)yF z)!g%*H>cy=^g51yVCXgu0D#~mI1fmA@tSp2eEyT{e)E9%WI7Kc!L!}(FS5PIsp@;r zGvC@h=hxEU=yW{J5`KvLc5PR?x#m322G4QQeZKRt)a-LR9*3c^v&hnU{4wr)*#BzV zjT+>m!IgG0q7ScqSltMF^e&oW-}S7wM#JBmYYTxn8O&xF@`cT z2HCbVGb*-hGb*;lq)zU~I;s`TGbE(iHc4$1+A3y2v?EweT2Y#7NmZJf%1dHwfS2>~ z)gKy)yt)@rsySgTRis*42{N%2E|p(8QJSW(O^K#Se_AyE0iTW&^fUKaSLn0$7#=j9 zwOF`VE$mBH18)zj?G?w*<@i_Q^1L;oYy1!8|4{eC3I3!p`|;)F?4Om1w^MQvZqqD7 z1MdL?xq8!+c^gQwdoKHSK4m6Gin z?sZ|+BXo2mbU!K|njR{bv}BL(@c%Cl2zo<=ROXCG+q*HC^>G!r$ubr(ie(=jb~ohk z@|NMC(h{}G8Wl}Z$EUig#smzy11Jj$ocDB&=OH~(5 zXxxHGLc!-j!W5e`$kK&F=!p$22Lg<IU=e?hJ%0pv zmz*D#V#dQjL=d!TuEY_6(KiUNBS_f_#Gzb5&lD*slrkCu5T^4jV%!(3Vj+@w^Q$tP zvc`QVzC*Wm-(b|of%A1&$ypD+9ZBgAFXEN+JPx#84|k;kb-*K8BFuEJMUR z^$%Ee)f&Yg=CMb&NOg;RwGO`fx!0twpAy#wL#}sMsp1{z;r7EJ#IhYB?MH>`|4GU6 zLx;Uy>Djfao#kgnQ~par)4m0m^4x23$CWWA$6hV$dFfI3Vi&vY^5{MznQP?to08b{ z)Pu^i#!**~0pY6(+Xa}*7k0!>^A(IkR$~x9 zNgZ{4IurTwer$()=8=TDOi_e!VU)Y8RjzHHQ$<$Uw(Zk2b$VEIbpaM%pmQV9|9 zkv{&jk3GzY^DHvMEX$cBFa=TwD7av-&tO3$lw+|4XlKA;HbzHi;U8FZcMOck?;SVP za3n&&qzD3l_hYGi48vq$*|wofpIrmAIfpRFctei3F@T_;fW!fSO3j=(a?=h=hq=z_b!hiPrQuxjoA9}! zN)W7&QUX;9QPWk|10sgmxbPl}q-=NK<>qbGr!wg6M^nh;?<!*8_CdR=)neBMbI+b4OTYyL#;Oa`Z^(2;-g2 zZk2+=1i@jTyj2Up)r4T^9tTHvbn=It9#AlLmxqSo+8GY&H@wQXWAJasraSZDBgDM? ziqS@ghmpg*H_{wSuS=6lbaU2@!qtRb$IM6d?wJcJvA+N@(do}f zuf`~G>>4%$*g!A}K@lieUjzk>SBdK2uX7wObe>FOc^<|WTPN3C7b>YAt9?GCI{>1V%fV-ML6>i(}^Lp46}u+N`dPKO(m-CC1OF^7Q2 zc+$G7M@E)Dry6@x&!1;y!*cMSbhI4jYVqIekAQw{g4P0VO^|pWpias(>c5d*Bg&KLNX9aQbRz^ z2th|fV9ofkKr|i3ho!`@(0O;4mo++FV}EOj)||_qdqp$3@_8ru`_5YEyCyKh!H@Th zg#p;Hv2=r~K+*{+z`yq&SjIh0B@9%g! z9Up+G5u(%x@Cr8q!Z3o_G-mxz;pc!x#hsEnq-#`i@v7FlIvgI(eZ8Ic+2fao3}fnt zx1HPL<>5N{nW0vxJs5fUo@YhSb1ChUSoyH<*2zT7)|oi`4) z+J^&ZZt`s-%A9KphSE6>8*U6UWW{RbscDXMOydlun&*RUhb>#1*7v(9g+$CGrdDtC z?=1I1D-B0f8A0N3QDnGUk`fI3avD6M_?FKukzfcwHDm{Z7beGmk15sj+4i4lqVs(`?A7(FvcHL6 zTD&}+@ttrZyb;tyAtwGFoy02fCmlnsb{KdVATl4u(ss_yuB2`0>1u}(Wn!|+C59JI zGb>MVkomekrz6r_jN??@tDa_ReQaJlt4q4)*Uu(vX|Icm`Dya>9H&9hWpu2r99?%c zmGFZQw3E9a=^-iTxPK+xD<$FFg`_UxBM4CdWuzmMrC8S!(?>VG^+n4c5&D~Y2tf0^ zEzN9L_^{o;#~%eD%0SO8pga75>buH8gJdhE$>gA_AY?KQKwe2?pH^)#J_G@_q0g9n zM*Ik36@y6|n(;X~6hj$5ERuIC$b+fmTvrv;1O=HFAW#X4b^xe?iY^c}fV3DWvBk~} z076|)A0FToeSe*3^DvH!uV7@#jO%`8H3v^1uJjiijFZ(0rOS_!8kOPFIE;?*?ccc$Pw*r**=R77Qif>BQlb!}Ol`+Y=#)j*BVoWIbhO z;f3?pr)gf=_DiHavDxU=F_mgr9fz*CSW78!r-pE>=^Udv(c+HYZ5Kvlyxk^;iZU{Q zHXyQvs`U^Xp)4DWr2TCR=F+(^mJ;oJY%ubiFw4{7D|Mn|b%skQ#95o$YuM}3^l@iV zw%%cvEttUdk3RMvi|Nba+A_9dRGL@a>LhzlBFv2R&u-_b*pC z%=6cKsb1r}yrE}oT1XEY#GSH@1`r_^NnKV_J2K|04!Zw+FOcY-oLe^R>KtNS+nids zco4}N7ed4($OAZG@9C6-0fRCUW-ohyWAx|`B!gT;I$1*b+#guF70?+#S7bI^I5m!v zqwt60)~|!39UkN1^3HrqmDQx%-L)Mk)gF{|I2qq1sy}CD^g9wiBr~(=*7U))9ekW& z(ZNm^TPrF`(E-@X^E8D?Aq>?9QPRbb?V+mh>b8;o`6CX=7<0y|`AaP~*tc6`VZS7g zdPee8J`gP=J`VIEP`Vt_7hFGhM+dOjB?)OD`E+M~z7lqj{To{$Ef~nQv6L@FAZ6MX z20A+X+Kz2~vFlEhbaMDLM^;1N)8)SAE<;vH>Qk7ml=N>U$#-j?dtmcO-5S0w%%ca( zBiEe+pIKYei_b&c$mO0H>nNpbRs_ICJ0jNsQuTediPT@jjA<`D&l}I; zRlH&C4pHg6my^D}PX-r|-$#sY)~<2)J_*s%j}__jFJ}iwN1A(Dy1o{Xu^87}X0 z(}$Z5a86yNt2-K}GTld%vKZm69fiFta^I$ z4>``YTzA?=*_x{*X&yZ^!%Xo9C8|%rkZ0SFELfn=ub#XsuZd~6c#uk3ZNZuuNkS3j+&W-IY-NBU zraKif&X#L)Ow=)*mS}9BZ*DnfC5MjuC>ru~GsEn*oHR43PkGY^vOO z0{MJ6yJ%5~;CoTBuyNL9g&r`jrxbPYk)d2Oq{l+K2WFb$4Pf{?FMP7668WA@7TcG1 zw5`0o?Yh2xIf9at|n zBQX~3pz;fcI3Wi@2tcCfP$As1M|$(ryuJ;x*KGDvg+vj-K{p%bXP`KEj)R7 zyq83BcJ4P!Exfc_P1}4IUMCNmxzOHmTI(j03w|L9bvAcPa|eBC3de#EAUum9TCA4s z30HIm5PEHqq^=x6+`vd33?0k}UCkI(>*46`tuE2|e+_(DEn|y%hLNQ3KEA#@>_;Va z7`aYHliljAJsQPZ$v?jw1Uf%6qVPeNe-b!x z@dDx!ta8QHN6#FjC<7;_na>%Elsx;2UcbA&C>&JwR-jL5~+Kmrr*NldS{Rn5& zIMO&$#Ias!0Y$9NlV27;hwG!impRRlYf3XStU zaTeg4WQCUvG|M$c_l(X^=d{t$U5nIqahnilAu5okeHWRo3S=&%hBI=xo!q&SP2&aH8|8p2mt;N3WNw^h0`d|eFU_2}vEdvoNG*^h!p zZFrYqica=*>ia29t+*W}k3N>4blKh+80)r=i#bT<)Oc{yUif^H^NgXU4MWI$mBfAB z&fjA`9gZo}a~lZn4Ed|sR!8mlzR+3M|E{^ay8BZBivI{8CB6pdtha}M(dm19o3 zP5B#k@a>D;(YMy`If?a0m%r+cBh-2EvI~`dHbSr+evVQ)@13?las;q7=0U-@uPvUj zbh2mG$i5Rgj2j<8=eJD=+25TK3=;%yGqOSa-k!fjrI74beN>RfoJ(i8?#41a9!E== zE^6xQyWYii1{~v>@YMH9db~Vpt@V`;A-YCKI+qV4ozD4BzaN?(cDx^T>hSavw?arf z=aA7|mBg^lQcPE|!W6>U3RV!NP_UE`gX_B_LHGd1-?$uI0X9NjE1 z()pDtU?^nJQ|j&+$sj1S3(JaGWJw73{`&{}Qm zEKG(V@qA8|YQ+mcxYb*g48KO5hf>nLQP|u*-mhLvj}G0VvC*r3T24l8^So}Hq1*1z zQS7m|nL;=b+$JS2TxI`N{ieHuvZNa!oC z%fnFW4|NxIk&JrTm3M0G4>ZoG^w7~u+t;+P$qY=VlN!dBO)+-%(dm#mEL`I9x-^FY zlJeZL+<0*Hb7~#4RrWn~mOSz5m~wbSL6qV$o{qM?M|_86XMZmAcnnr3^ZpfnwQ=X@ z^IMyJZ2Y_#!F(*ut#Ap`*bDn6&nQo{?58*S1lO zYCNjfR|y_meSDqfI)v;hX%GlOTOT;Q!ih43w(MbM=a&#++0bqDVEb^KJ7X;;4|5w$ zz0k$mYDvg*k^+*>TaAkanIsT|K+;T$riCIU1&AghH^eT4)zDl@PIB>ZADc?oIpkjl z8-(^)tzR3ttE;vX4vyQl*?_~FP$^XCuMHAxg<=IE0l39< z1(I2GX5wf}O$&U+U9qGRgkT0FSk{cu*xOC8@Y&siZ#EiS@HZPaXywDsJ+;T5XK}Gs zhjO(hye6mH4@YMsp!KcSM#<@hFxGcr1R-*kQznj8`4GbN7I_vJ`Frz`U`F;x?1NH* zgYiw|#`A82AWW+QTO}z$ab+;Wh6c%WtyZHGz~RhLQVd)MO^VcWoK**bb)lNP4Vs~# zl4bM_%M=Gw906f(q>b}PHmL?C2smmSwXm790|C^6#^h*_fULpQ-0mbB0b>zlp+1Vx zj!oc7_~d{zYbgT+6KuqRfD^-+wfsfWmCap99^Rm=fGn4HJYy3T?Xxp1#GkP}0 zV-rjo%G7%4>kMnDYUh~h^P`G5vm>2%&X*ou7}T!*C8w_;oo4EF!04@_mv@DoH;RiH;HtHpV3X(dZZ^mJ8kUU)) zhfX$+COY~y^P6y+D1eu;S71_C$Q=o-1tbu(&>9dFN*1!QZ#$A!7StuP z60%8-0)%8lV^(b7)4uv2>S7(2Sr5YujzifU znvU;RhbvfmmMfWXv`u3lYDbo@P7O(^8-P@ReqA6{&Jt22vOEYt&F-C*x|3yxdiB*k zaNx1UWjODniPW@A_0-zF2AZ#KoM&XnPl4PY@6J%WoOhNv+qYm(r*&eqsm)tMJAlIB_2(hg44>&KS6w%%i` zJ3`>2iqSr5Ir!1If2)FT9I~fZNO~9C?uRro9#nG;yy(bvhtEjnUg=p}!^*GI4`_Hp z-$!U$y zXR&J5kB&Iq^T#cwTCt3FcC@Y%J(4(=D|&hel07R2vZajjLRlkp8nAZQ3p19Isk9s& zI=uevb+58m_DI9Tz546$ht&9b`no}&(mI?JkV*q&CR{uyIVv4mwPTmChmXQ6tKD7v z^}pzMb1yvf(dw3?%Y<>zYFWs_QlyT>s8|7%1zuIsLuHWHBQBYdsl!Hxz3$gKbshG$ z8=!d6gRG#YbO5*;Ul6U_*)5Buz$iBOQly3!t|sVDt8hSkOGlk_w&BbHq$VX`yl-_J zU1i4B{de(j>Z1!KvkOOQhKb(FE=B|c zAIJe=Eh{uD>}5~RwFtW3<0PON!&*Sg>=r?)LP6ffA0_NuYTFzgNbw74CE$^2+}m_4 zAb>lO2{9|T^TCuR3!7;O`i6t1L|^Qkl$I>5*{DLy8VM}=rDDL-Ko>}%cd8H;A;Y*O z!26os$PIW~6l=jC+a^Q?oIVHC^5>R4FOj*~^L{gP^?IjoviyAaS44gw&`WOn5_x(6 zcJcJRz}gTN^i;L4kVfE-A(?L|AlVCa9vznW^F9d&h0$vUk3&biwP&9r*rMLujZ7ds zL7?+W*GZjK)C?IbugT|5lE=rJbZ;_O#nSTe4s3?WYPg>2PYvKQ3uquf+^*kP7U!>z zT-@k-Vv}lJ{z#2b1T@;jLbH9J+;qh=DTgvdW)VKHHhR)HN$E>j%BJkv*PH|`*8Mlb;(;Z)5Ujkq=Ll| z8>QzRj1h)~Vur}VOR5r#-Zl?M9Lmq;``;(f^z^dcE{u4z#QQWD-jb1mXMU0GuP-3n zzUJn@U}lsIM&t=Hp(_m{o8J+rJN}^o1QKX_2s{Rar86aYyiWW+_h)aYu8{5Syqk72 zu2H%&n9JqTrN*(XiVPghw*|%3TC7Z*%#A}$A&RokCtJ&o3AO$}|0@$I8BIegMV1}_ zZ2DSRRoafUews(p?=LH}f1g*7VZZrm&;S`rgf7 zmF|954qV7%O&88z6wzg?6Zb=O`k2a(+I({uW@6jPYh)6^YJCk`S48?(z$Z%P3!yB%{_}!ha=F``#FxM|I(SMhM>qC~y zrmY%eXfCuF8LYM*A#H?i{+1Z{W6m5pM=pz{#|;)Y4zA9A{tsw~yZUV&NkRNP-q{`j+Fh{504TZg2 zUQyVqn@xGJHaP4&wpJE3kg1NOq@j~D8JVekV`tq*#$7I_#Ouvp#nIN!tN6>WWrfMa z8Ucsj4I7|&0i?dX9HbuQ-0=Q?#vXltJg=0mkRJowuAY29FzpX+BZ@yNN6jO`NAM(R zBdSOFX&P#MQ3qoZI))dY>zl)GMN`8 zA7rvQy77zLZf<<6SLy8cF_X)o&scVcNOCwGGTC-5PG5vHjFpbc$M8cx4*oYs?1o1~ zkF36^bjr>c<6*sJE(44t77!A1#Fr75hnyUs8vF|ct0q~QBJ)qWyJ@g!m>YQN5Hr)4J@_MwG{ceg4nz^{SV8uE(UrtQJ;fKNMW&t zq73S*NsnE5Vys*ll!Bj>eeo7AHiroV5Yh**aDIf`kt$64H~h3Or~+=1{B!Mg$c5UA z=tXR9LA^3E%{z(YPBU8-)8N|Xu3Ua$TIc4HxNcWMa(bBmLNvZrAON{RYFU`GM_ zfQxLIO)IWapHw=X{UPES!Q}7L%hR`$#c9Qplbwt_wUX}fGS>NJ!CDqsTlSxJ&G+)_ z+T|UXhmDN~40*}mckLW2?#0n!#gnvSJz3>-xC6-FlP4}6Sgkb;QNyE0N7YSH)?QV| zDvTrE>T|)ka6Iw-98Y{PboXoPXT6W(qtY7ck?}Py-i~9LJ?}OBC&#mT{~P)|-&6VD z&i=1Nj>LZoWlyz6Dl?%(Q49vvM+LjzD25XShRBlhIiSufSL8mAB!6mw?uWz8wSS5H z^0}4rhx2HzXu@opC*<_~USA=0{iibgiHQC8>-_(ia$v(j{Pc7Z;BbC}=yf?iNa#I= z$GF46=5;o7JRhjh?>Ij>vG$lS!GAm%D?i#f{m(xiyU(%N-wehvi}f@hAU6gK7=sCG zV*?pN*uZ;_fuj$Bh8SVM@;Vwij;BMZd73*NPNz}ObsHXL9uI-k+0gKO4Icx+@HRO; z4@0@!>N*cWvFKswdL2!j4+o(E$Z{54&10^tvca%OK2W$wcMd${Bw(}QavO($+3+yK zF2{x-H_6W1+rH zBv8cn@EHuzeyF`PLjuAWLqTE4Q_4un8cG9?I#Upqu9iGjm5^d=Pk03?#Rpgf=){mcBHAiCBa}Iqq(cX?aQPz&$TZd<7oeJQ( zGbwrv5M&pGA!JNUS}~T~*$MYTlRhA3tbwen(_%cAYi@paGn*MO>9!U1c|&ychf4;0 zA-KGoc7`49EeIc4jqka97XpjW8i+!H+Q||CXkka7U1DvG%*M> z)-~Vg>N*;B#%S`FNc4{HHf}sB;%U0r$pBe`CxZZB^>#LlO0jYR#=;|w^gCpl@R6OE z=`AE~n;pC~;mo;l)0afwAFdys9?;x6et2~4Eskp<s(`x}^J^|PBcY}nS>w#KonW^X?`!^`&Sugul(g~OZ1Rcu!Q@AodW`@Ot0%_*`$=Aod}7zCfBe{BacUCPnyc}r#v7Md-Om|i{7MvZT|@`UO8?np9{hspPW-|VziJwpDS zURlXtU|?Xh*t&*GufjWSqRQ4EdDKsXA3b_RVs_}yKrb%KB-1LUUcjhc(3quzDFdt& zWCS1xQDPwUld-Wg#-PT(CiUAg8rr`*Y_)@f|6Xv=k+1{lVLUTTrg_R5+1r(0=P}gL zLiu}!gmuYBI#wuhSKv}!0Sow)bNxDee9KcZ$zX%;JOD&{O^!^V)hMF z_jfTRkMLR{p>nfzX8_W2>j>Wd}Td++D(KX}~qEyRD0*S!35z%nfDp2$>J>eeS6 zRs8D(l1zW4s8Hlb><>#s7$^SE|8Jvz19YV$1ZC#lvQ!cqO9z_M^?{Ld*DDUo#8P?7 z9;3cF68}uOk&2xye^^-=k=mKc@02w(y9&ClLbZ)=!8bE^aYP1n9OU}4#z70DR^8a`qIEnhX0hjGMcxa9_)9JjTFoh&Xfu)aN(kU7{L3l6Th zj!u`UhTc5-?$FIj zOg|q2<^Z3U^sq-+=K&@@M@?2T>$b5nCNFl#vuq*fu;(<7$-iVulC{AU-^yI*9TWl? zb_#c!`AiyE7#n@JgqzBe+iH$d%-_nVtk2*rAnt|wNL}MN?~H+ZP}pSOLasDWQ-|OS7qXU^y;u$XfZAy_UV?!Q6EYZm7PjM6gQ1>% z-*@qNzEs**LteIxi(<~@Jm$h&cq2^ASOY<+ucA1d?tc<`Ct+q7`zq)mGsR~AVgI+7 ziff$$mO=&=t&j8e&Y)WJd95QBh)2i=sHf<6F=B14*kG{|$G_^5xY$qb@+oTpII_2w zjeB4K?HOFieGwN&Y$gsdS3xUid8GrLA1P|A$L3wS`1uC0NXtfDG91cr9*fJ_Ej6p% zf}`tBK&M_arPcKC*(AWR-Fm`O-A;h{whwZVGnX@N<|LE({xeyj8%y8$+0{|Sln%>J z5*Gj!of^Q_)3YyEKRj=MO{`l`^oy|uI3x#koTJWGYT+_bDD*C5udgWncCFC2E4P*W z?#1ccjrcW+K~^|xq~gwwHNKc_);lP&&S2)4sjzsPyyRG;+qZ*gX3^)z>2ECedxNGN z$^GpNHMzshxT93_1~IWt;r_7^nLcz86%-?3Z5quZ2p!R$Mr=7OXtd|)O+cP{p<|3+u> zO@`F3tt-R)s$}MUSkUAW^+wWy>UM!-knr4R_<3@~I0RJ}zu;#L zG4btiktYsBzyRT}$I1`)g!Eqm}gcbbLgmNGfG&>m3%_U5$$WZ>h2t4AI4vA|+p=ymS%*ht@88nT$)WKF9&*WP(^t01F(JD? zS-E3VE~3U~fTo0=->&6P&d-AMI09pDaUDz8GPjKe=v}I`tRr+~<>YjdE_=s=5}U=~ z+4J9x4?gEUH5y+!E4AQGG)gE<$UbRV0C)K8Uaq^TX4vt~H8j+^BlwigGx^_uu$)dDjz~(~ z&Eu4q(Lry>hK9O7Pknc~S>33)kC&7`85eoOtG(vIuf*}#Rq+1o-P^cZvW0mqv7K+X z4gBYm;fxPueAyO0M|w(di<3SxbB~kQk|okLNNU`kIb_7Z^9_cze8!FlW}2%L@ysAy zP2y&=dzYI)&;8hrx-4!XxWHj`Wh|BqPL5GOn|C#dk2S0ST{@b&6-fwUuWgn=T zR6@4()JX5;75+Lf-W~6#`-ST$cMVB+2I;ukZRi-GfWZX?H;#QX7+FRcoHnPog#|W; z@As&uesBB7H)FV`|z%J*O&K+$8w-X{*at9}$^V`cnekZ)~gOR4w$#LW7i+F{UBQk7_gFW1Q=g6*X0~sfPB#A^W~`fotGzLE@tZ9M3DANad9TR7sx; zvsC}J0Jcq$rvE(U6onYo=j%U`G!AbOH>0V&?x~8#nkqy7m0isDbXLlZ8S)WaQV1@8aBpyM9#05QAhmpC^DIgC#Q$EBp(kEXew?}>fyIq!%zZi_fI-5txnq_G2slFLD! z`^8I}Q)GO<9L`HDXY958rS-}ji@UF_sJzKI{F;|NJj9`9#;Il|KoYU%xsEak&&<`D z*B`IU6vi1&LOsaMXKe$cmKatfqTX&Z3ZXrcGb%t-{5d*oK*x9K_GMQn${ZMA#4lY?qX=^|#Lend__WD{sacV7f#!w_)Wpd1W zln}<&Mzcbz)z;rNp|Wzk6mN)tcJcJBm+NMF)POG$7{=F+Ry~I&pp}T^{AF1`D60OK`O2@c^%KnzL^t)_(1*xu z|IO1a(!L=344+tP?5PFxuZ4?8nl7KGn?_-lskjNBs;k>Ub-(obcwGOn?5mAaFlz0F zOfOU)e{9QLN_|l0I)j$%Z|y0k#3ktokMaj9GdGym2uiX!%bulws|3Y!v;wQ6lj5!) z)z;;d34ocRcL67NBwKU?BtsvpC5v3FyDY9d$=h8^&j9_AHlP+X*(HK0+M8pu>2O=Ibu+ONGU_^335**^sGvj+g~7`LPktyXkn)jU5EE zCYY%rqq5pzihWWBq!WJwbP{WYc0FUnk45WA(SLB_2&-5>D3R%RYQJWI_mv4g&%zuT z#P@aUZlgt`b=Pg;5WM7jqZK1m^`}(fFdz8W*QS+ww#~5a!Qy03>GqO(ooi{TfjQW( zp7;Z2YC@N5^tvIcHCU0r1n`SkgLWmQr1%lUIl~fRO=9=fSBqnh8{((9qn*<#g0}*a z<}TgxyLpT(F~;H3S!eY1`e2=?G35@U#hR7$2^hD!>f4)xfi2z{t1oBRQSUGVdd1c5 zuJ}fSB8O+yzH#+onim=w0T_l=<17nL_sxM6(Y`v4>6nCIg9iHr@<@TfAc4)3P`!nh zd%ojqncD6PB#U^lSaY*|!wYg6y;H2`1+o z(=`y!NR-lqF2{hHYY zjQ1(ATJNY(L2^d}#!i<}1_lQDMeUIkzs`}r?*N;ZEyjQC6W7}dG{4!OJCvEgb9I@2 zJ?P52<8JQw@_K(foS*R3p0ftcWy5{!X>twjYqQzhTyXHW+UFa5-V-_EfBYUGP}|7B zVQupXF+2bpRjAO`Odj~l1=CqrB(u7A1xBDRK)+&WO}n&p`FRATYDWrtYGX|oL1UV+ zNd`Xk!q_vqfZ@T+hU@e1XU}gfh7W?=ZzLpX4R|`ckd~kWiuQCiZ`Xi=*nkUoy?)Y- zK<|~Zudp2FBvg6PLit3hp|CjPx27NMhb&E=5K~WVTO=xWIY=G{|8~REkeX8FMv}^b z1zgYpKHR1R4lV325CgoCS%4)Z$sSRn@=^2?*}+(8aR0X;GTp@36*&}=!7t#&6`0{f zz03ipeTW9v?h>fCZH3`p3;U93twQ@gg6Vo0hT*?+SIX9miq1e+=QkCtiS{BoU8ZhD z`zp8UVsxx+`z6PI59&_2-HL}a20)Y6JAXWEyh{cEKa*nY;c)~=%~|a0RMt;xKYyEW z)540ZqPA;1#F~{B6X>+@CVW@wS(*pKN8PLariR2=p1Pb(_8wD;Xda%n8`E?9ZDQ`l z_&j0e>5vS(pR=Tb}WG79NMy~9zqnhh$xnL!AaDd8(%!;-t6J26L{Y`Au@9Q4s@V1RC!TlmDd>%eY z9vTRCBXjzqDkz$67RExS)%Dyu(T}r$=U>jxf$s%=OeQS`{SZa*5fr(J6 z1V^~`;ctK(9k6ALufw8px~8OWF~*=EKzGE<;!`QT%ZC8ec>$>^G&#&7m}LOQTHUB( z!e2$vDhoFp@ce>0Onw7-+u~3{=iB;da>}D@4*__!hAnDzbb-_YjCX7>ZSk_yg!I|0 zne$fp<;{^ryF6;4Q?p`Zi99_A&Em!0BZf+5Zs^bBG-07@a zaID+GZ2wEl`CU$2;MDhDdrFyXP*4GnEeoIGhwoq>=Ua8jdR~V5kdjEC(L>j`1w#c1 zl!lsGacYU)&1o2J-KuXgV%1Z&JI}qZpCwjZO7?|Nsi{OC0NP_@E64}XuV+$?cHrw2>hL4S-wWaJKO;JCipOb;EG+@AR3 zhQF%nl1stHXo}$ZVrd?W@^K-TFnMuVx?_0}1qBoe1xGmIab!Xw%!9f{X{e?c3|g)^ z7Q{IY^%wME5^&_?6xb24#)?#FU0V5cnhL4Z|E3V8NILR8ZYF?bsJw4QX~$-36Uqkk zQ!^Km{HR^%6T=WSUAz5{WGY0##Te)DW|U#2(2bE|qbCgcM`{`}%`!15C z5F1z+Emx{SdJ3tf*?g~G*80%?KFC@B(Ej}Pm1!0|``&cuNvG4JKrTko?$^0WXd9l1 zux&QCwraNqUd8VEsE$cvJuB(q-@hvc8|kgaN4#$r?q}8F!p@i`wM)H+)s>9VZ+(%U z@?i<0?j|Qe?`vJ^MWXkm#4=(!2k5C%Mb(7u1v>0)W?oe4`DDbVTGvd|c>@-VJDftP zP_wJ@OCJ+0>u{ii1~YRM{hnwkoa_3*_$}*M?6&j(vby6!RTz4UyJh*ys3W_BxOPsE z6t2Ad-bu8&fzH!rP6#tJMov6zQe)I{B)%*1I2ykkEzfR5tANIifIv|D(lPcRyKoBi zX+EPk9nYYY&qQf?m=G7F2$-pvaG_g_EDd)wOTUJl|J(8;Z?&Rmla|KkTF%DZaHHds zL*vvguin_9bC5pTJ#<37SD|8x3=Xhp-nZvVcdB;Q&wVA{p^2H%Qu@4v3O*bEV(BAKzj zR`;rO9hcLP$3Gg$O=|&AO*1XExan47(1MYZBasF6O%7F6e_IT7RYIxLYoaR7F45HK zM%|Bqj%$sm{>q)Tb>W8XsL{Q^*~a5BkxHA?>`H;|?s?~dxC&eT0dhJfSiICJRgcH-H(!`}1)Tl*NBCI}r zwE&`=YJn~X2d<@#iD_hCEWUN+AW38@#u_EI+)yrDTGidw>_U014;E(UF|h^iwt1Cj ziF5qy70EA2gk|F!gmt~r6!{&^)IWzSmYYs|doXDI--L^6v}IBx+cyB)@Du6QUOBQ? zwYtkPRsEAmPON^%O?4hT{k`^e?a{$h`N%-`%|bOB&6XJKfNDFt8;5FI_A=v{>hdH- zM=iONxbIE_*|CHj8sMAI!Ja##-fTj@y*WHbmf;B#sf<|u2cM)cX8rkG#EHdI$Kcd5 zGWA>X(|;a-vtLrfJ1t(*enBKUx=hG&uGI9S`v-mvZz}eB)9-glgEAy%o0&2xxDPk{ z!LVrgV8>+5q##)547yK!Y6hKyWCek}pCN72B=xZ=;Q?BtlhB{v34JdTDeqI>i?P59 z9~&zqkka66m}a9D=R8BRt7gZWg2@_%3pKo{$=`BKezBVk_)G(RXXdo>fm{&(wY~4f zT@+^Dt?}EgAwF6FWBYVx{o6h^y58m2a*~9(W2ek6j2y+-lv3xAv(Tt`ZrM<@&=n>v zMbao;hhh?>PJVvObN-v`Sh}&!N1P+k$HF_8-Lvo5`rNWX#TV)n2wnxl2UHh}ZHYIA9Zc0*TlG^<-|fuk+?Fp$RNNPrCQg&uN#Q3Vr*x z=!8a+VWN1cJ$V#ZKxqlwtyg;RPWKNxwZsP#@Jp))CP-Zbr1ldbi$qs7_un&X-K}$Z zu;9EY)F(^%V0F1vx>31pEarD9z!>JGxG}9DNsQ~nYWCYPHfOJTC>+=ANUHgQK*LQ@_*oT zr^SkEU#p!hF0%F=WLhl!&3dF7w>Mg_^Y%ed$1n;)r_&O*R!M8S#MhS6wtpYk#>8rW z>z$GCtr_==asV4CY|ngH@vMK^iG>)HlDwR){|WUKt*CtexvSV&Sj_yuiwM7R#n5sy zW=Z<6Iq+LX{ROMZJQy+=!RceATqPh;DyK>JjX4EDc9+^usSx@-i9Ur|!{nkfEK`O< zje>csbfh;DoKfVqfHPrr_8Esw+yB9N_JW022~5pz&)g))vQrb(R7$hAY_WeNa=rMX zu$^5_Rq7W)92OR(3D&F_O!A( zp(9orxEJT$a+rQ^CfNv4C5K62H`HS?F4~W2|1mRyP5npJqeP-b0kET$H%aa!4W-Rr zjg;x{i;G+!^Fd1@zzHczUp6-W=OHxpQ&=hI0qkW6#Y6VFG=)*wX-RR|vOs3U?1<1; zUvd%s=oWsyM7V<2<_OI4&z&`hyVeTB<3sOBT8f`G!}o~R)KLnjB1S0j4@;k40Ph+yZ_t% zRzxE(Jy3S=kV_C^>qEeVwE=^5K2$tlP#=BupXIlt{3pT+r-TmChYRM-1QvlGG;}3q zS?u)X`hxz4-^G|s8?HE|6I*`4t<~e#eG>eoW0BXyY+tYP|uh} z1@xb`ez>krgfC-`LOqp% zgmlJ0lH4>Ac~7-}UoRyK-`a-d3!z3okd4Q4W;2KCx|B282~4`HPoSp3ZDs|N&-;w! zpC0Xk6y$?sIS_G)C5kSiC_s71vkpDeR${wDycq$jonRd+i^o)&^3q>b*#br?na!;*$Yac{n@({8)F#v`lR4OfDVDxm9vR7X zY0b@I{|$TRq3{p(;+^nrxfk0xZn)E|;CZD2&Sz^MCA=+E<)j05tZT@+X-x5Z{lD4A zf?3%f<~u1e&q7^4gA^6N{Q?F*Hn)%8R6v8-yWIkl#xs zT4tyYUVCMw%g8?Judz=7&*|9qm46E*0GJ4u&%h%m9qCe{x<2#5;sIU4=)=4~eWZ?M zE;~f@M`j)`+978)`-CFPRK?2{y?l23lBhyNYha2CL+Epmnt)YT&s=WjcSO#ygi&zM z(W`Ua4U4r7%*gnKH63Jz$4^AJBoUt;VC3-EbSO$VP_FCxZt{?7718@;`XuiH1%cJV zr-p<2Z963aYg2fp`F6q{&V|)+hFf^%gNH#;g##^*14D=Zc|fKHrf*ZN7pWP}yxttT z;4m5)n3&1AMxO_Xi`gY(p!ir$S&QEhe6?MYOu0KV7^UMLsmgi~V`(veeT={6u|t>` zm-IO6Pm4N3g@jSOdn$6&o}%|{U3$(?{Z|x zJ-y)*#!v({R`eIzJ55BPe)Iuz+ZraA6n9+EN}a^9qP-*X#7&Z}K&9FA#*ZQh!# zk2+rO@Fz6Vbgc{E3QD7NArA|ZD$EIb*11c=98*RWr`R-N=S|vmwfkHcui-Kqq4Y@a zO^sV>SUuVn(QwCNK-yJdzm%^p^bshAMaE(4CBu1FpT5~ zGRCX9C-Hb6$I^q|m2KYH;n9PJmpK-B_g;J&ZKr}l4QO8eZ#~C4+h{UkciO04LRs3| zjZdXkqKj@E;;|DDHBS~NE)QDH_HQZq*ODF(5;*~qUdw=TYVOZF1FhRbaH_9 z*<7{Tfn^BA-A-2oIhSTGm-jb9WN5s224%~}@~q6vc)cD+^SIyGBIzGXTg%B$&h6El z2#?+hDy@xt6wg!Ok6ZYu+n&FR+utV_*3${EqDiS3%19< zY3wtoeTt*z4u)u2Jc|3`+dY^Cj@XDp$4HKBczQ9;tAoNV*zoaj)E6t%>S=GYThc$g zjy}7;`R{P_Qc4uho_U*Vg{yqh!zi{=%NUqDJ^G~ev4)3L*X!rOR^-oxvRM>nIE;q` zLUv`|t8W-?!?>9(9`iOdki1?_-57Dzx{pUBvX>QqGA&BpM~b=<>w)aMr`c!)OWQQSVbW z^K@qrE17Tc%@I1NLMOrc`1J7(OZL0E-T#gD(#hLw@EyFHrMp>@riz-~V$vfwHv(y7 zg%u=Ki?SO6wdXW32hm#YxPTZ@>s09>F7v-_>crB$th9ax-EPiGJ^d*Culg#?NIywVM<# z?V=p`?BNa5NB0f`om0bT{z_Fk-KwoX3U4f{K~y>}TEpeQF)05$ka}!)LZf55q9nEJ zmT>^N_x+Ogv#r{Lnm)#O@|?kn;^`?z6_wJ__JJQ2b7Bf6<2wWDCZD7<;*U^nqVgJ& zg8g(7&k|Sa!6F<~c9KvEAlyEDjiviDc3eF-IXIca!o;%1%;CquZL(gA$aTFL z7xQFC#Qx3Bd=Mz%>MgwJcDeOzIqmjZaDla_a}+ci6d8PNU(ygo8_pa7cxyUc_MaK} zSjxvlk?(PWph*5njL`RlWY(?4AOWyQ1K`-J=8g@kJpsY{rZKNfxmijlv%*TX;F?)t ze;T^etR1_G2tp!Nda5F+Q3;wwXMKyidd}c~E9d-1-4ZmMK7e)Z+(QCo?n(F&}GsZ-^4vZwmUTI0K* zd38H#DiJ~^%Xwhtz3Ffvv^_0cDJElvbO2x0?Xz8DUp`vSXVYWnIIpnXU3cai z%`_d|)e~(43M_T@orJvBPG=(Q5nk7L#%Rr0R;NUNY_Xm28#>7ROD@E2(3A?$bOHX> z5KGfn&WY;)foD(BIYjg)+KYc1y)=lxq3G36A~{oOHLMm+s$Bs61bYYWzxyOo9bQUR zYD6+I?xbR^BB0G?uj}}!lD5PWqN~%bGdwJB&tv!#SFDyFFU(aLnUEApjZADwXA&o4 z%{HN>rQRzs?6zOi8}yLm3mvyyD=W4UG7B%tjSKLv*E6iJC-K}U6+N)y%dBqWaZ8p@ zrRwt1V7<=0PPlpS2YSxDK`-h!-SEZ~xb68-Z@2+UtdR6We398ijPzd9#QOa@)ZX?k zK+_7e$-U=&m1;gF&k`SPRoBugcd#4iw`ubBw;%(9nX#C&h}2h(T&!e39i`%0t&w0;q-M(yAB=IZLn zHEK*0&S+Q?*-hQx{Bfo?Ct_w9x;s79{m(Xd?C7}AiX~e6c7hk-a1_syFxM{o=)K!UeL8u=!!L zzOS3B8sjMzqceT{UQ{niZ}ltC;LKQjD!juFl!tsP{j`aYHNleKj$Mc^_mz%b(>Fr7 z8!S^l98TyGim1E6=PE;hcP5Fj-Q96}nXK3~M7&v=>Hiol#--x?h_V^l=7?3$cqh=_7<^|22zgP{ahhYg^d7| zG%&G@&V!H$WgzOmMEuFXs(mvVJYFXDPxX&af8|62V?RvT041C~j>9Eig zTElN0sQ?+{2PI*hw&sOW5mVJ(?vmJGf1OpqL^B~Y(<0e{98)6ylI1P^KD;KNB*ZC{ zeW%FVg2u)ioTY`BTIK0F6BxW0(%q%i4W-vj603mXxDpY9ma_jm86oB;N^csbsXWfA z`&Pv|J06s{VA~T~=F{D;c`fA-_Ebz^VA!8y^*G#;nXZ?5N9>#HT)S%FCh}P_P&%DEtA?M3X#UthRVcZG z#Kl=nt+`8*oxnhaAOIyyhpiuT5(oLx>R-5|dy1J2u-~30o#*wvuC$xk~i7+@{qQa+&$G0zm7oY$`wxc9M`RgEv3q3u1cg`DY?MX zi0f2pd!tvP#ZFaL-SQ3)yXvw=WK7n`VeANcK}g;(#MXSecjOJa;A|5zk?#f4K9NmK zUBP5jBX^c%#-$Fa)Q1=aU*)J6zz-# z$|^KNDfyt9>sE5bpxcCp#dt%p`BujRV>@+^jM2RYO?2HVuo!En=aK0_+i8;>qY0Cw zD;@i}39H+pc;u;X=YvBL(ebHya_Ob=%db^-sC^YU>zMzI_1O>5nbc1x-T>KfbadxO z6Dv$G4VO}y8vsI|lVob)C=Y%h7X=@SF+JnpjE6RsSDX>XX z2Oa}+SVN`9=UOZ}NxT@#-tn)5zWo1i)GV{?Se43jMK4zWu{Z@^g2mVV*A|d6Gw?uK zvxHc5b&D*YGQl>fv7^xW+~?%veC=@RVjd|g*v#w}W;ER{TtB`_DR1c5J}IVYXutwPW#9tjVRj+bu&Gss>m3~yzvXJqzGQ&4$kq6RMp`%Wh7vw%|G zd@5!l!cEY_@OVKDZ%!%atAuGuc&37<@z$SNdzt-Q4YS{2OBZ=Xe{&ls3~V4weFd~Z zDhrs|G1FRnD`|8QvTt=S9_gfV-FEf~-f(d~Hm4!!;?gUze=&Th97vJ7)GZj2s*qaa zINeGi%&;cJn{s)1y{u6=lcVxpGzmwV>-}0%+XLIyTmMkkf{%X7VgR&txuAooNDOQ7 zNGOr(@*K-8RKTCa-E#g3D(I($D~Dej-0%MH=F^ht(1K#mFWpnj8h5LIJEr+Zik=W# z%$!pNua!0~Tt$?ydr@GgRZ^m}7u9d~9VAtiV4t%=7$|!kD$YG%`_Wc);lB6KEAJ$n z+9dabi3A*GVdTeduU9TiYo*emFwo@1FpL%Q(D7jh6hCbKfh_(>pQ07z2Q~=CiN0>f zW~|;+B(cYS9X_EpR+JlqU1~h#>k(s2DCHs)4`_yp=pTfpNhbBH6MI;#rzQ>2_4VNB z*P|I`|KMLoQIcVk#_0O1r0}Q$D;1defu=bOaEW}Q;rKL&W`z)3(GDupD=_hyppWI2 z6Ab+F^|I^Y__*VLlQXe(ayt0rcr(Yk+pk-u33H$Jx6ZlT&=r6RanMI_@`woQvy&Lj z1D|Typ(>5~GdJD~8-{%mI+xNQs&OVI;O<$9<0c8S@QFR@*kW&$HNwEaTBAKvWjCZ2 z1|hWyERGpe(lhe~ZC-D?50(=+7q|7t<`A(x9S;t9%pOs?L^3h}QBB!Mh{#N;BY0+_Jw8E>w|(k97H zXr`L3naaPCthb&Li7MM~Jm9;F?Qc56^N;scUvsZ%m-4|Mp~Du=o}{Y$^)<~7)o_;6 z>G_hVW<@aXGdKg9I8MeeoUwW6>!%7>%x=;P1OXOrn9RgFTgba}JvpR`52V3E;S3H2 zj`ILrTc6ZWIDF8=9gcD1pDb=!x#^Wmnk#Hg3(M9iPcwi!G_MdvMgc>7)_yO$+&z?5 z`~1lXPfTMz$F^gZms)6KBI2$T*zh)@T9e~vRmpmC32L(A6V`@K`>s>If)a8MR?n9O zZIc0(OXi~F=eIwB)08>?-h0gvI7tac)G}L zm360|+#b6^lT$*IG@t)k>r2wGI4S6bwPx>J76;P_)$zUP-{Kwt1D}3d_hQ509r@ z!fF}(8M#)MUl7)g2UBp;Nm$8B5Ijj*)z`>3h$6p=y*lRQEX7Pm*wMl5;mo!dj0p@H z$tfrLR zg2EW~1Ku17`YW(|OXiiDm~Z{Ss?!kjiT(`v_)1P5_8_MV@RERv9zD8LVM}Jlj^9m6 zTNxwavqCw`z7brRQ1KEU)1+Bl5ZWSr(6l8ntrvGvj1?DmSl=v0eDGWNWtL z5EPOEnoK2I+Y-hz*wp2M)XH-MBBbjGrJ&?HSWUWzhTGWJCB*5YT}fF`16>mffwgQ4 ztAzwoZu~M`ruaFNvP)IxZk`on{K@=J*yvy>wQ8?ByVW1CHsiHT&&*-rJ(-GpIc4Vf zOQik~?XoaYG)6MvOP4B!|Mi-jw|0+oE+BwhVkx9*Lp?0JKX&Ee$qurlD|D5JP zr70!yQ@(;7Um$oWhiOc=bbO8Pj9*&2cyGQ5#43bj8e1@^R?Yt!iq(kntQ57Y5p6J; zRr4{zR|(j=pfhOBJ(k5{j}6gAo^}&+495WF7+_iyjX30U|E|?=k2bm0^h)nM&oSC< zFgaOqQ>vS(_51Nsfj+t6x-Sn{Qr%6j|FvL?=y)0jF)qTX#?Ods(Fs{^)%!8j6%zI*)nH~AR z&53n!-YrA>d7@2{<8}yK*at7`HtlaF=;A*%%Wts+g*Bj7iu?vGQIYbEO@&!r-V)NQ zFi8XgxKAs)07=Fg`Ptj=Vq^!K70e0w+bq-LjR=XcMkU&gBqlOPp*K!Bh6S&&PSF`+ z^bAfmTtmJR3wn{=WXqg3s&VVSwyjU0W~5C#amz_-pNa^ME=HPpQGW7!%NVWImaAfGYJ>)v9v>CPQr73WgA@ooh3?KO zNfB~FDvADvJ;kuP!|dLDYfQ+WvG?KoDvL5IVew1{E1vYOL?4|q(&5OHo)!)E5_`2` zHOD9?ZN=X+AmA3RUt>&h=w*#?)!3KF`NST^(>xq7VyBXfSmfIwLuA0Jq*@!>R##>M z!XC))88UY7DS})1)ZgnX3B5gPUsU;I+bN-|yWQ~F=%pyT(~FANDHf@@A{>tRQk|0A z-KQdSO)FbrKYCF&hE(mEb)}z|0>9j45p&0uN|laz&qmOS^I9qRC_(W{ox*yv0D*Q( zRJD3iMR9|<73bH2c)3qpr@H|v+&2RZ4X11B5f6ym4eZyf@}oCmT6X^O*gpSh-7}Bk zpO+s3jt`oZ23rL)ZSZ-HN2A+zr#F>z&WJGS4ak@}^803=LTKHFo1+W&VyT+-Vcv#2 zFbONpA!cLLyF}yZ=Dy0R40+}^30d|_sMRAqbK^0UKEtI?#!{G=@@p6?u8ArRLZ>ly zR>wNcW$w|JCeOc$F}?|?gmlKvp|{(z_qq(Zu88ymyETOes^i5t zoE5Z~yU&_6L5$61(p@Q#^7O9+9+{Guk2fifXYwib=ow-S39}mx5T#Te`wIPJ4!z6j zl;lXTu4fYdy`8SQC5KF9aGpy}%iyqYWW$nHGf!@BY@`;VyqpIYS<9ZM+-}K(x{$_F z$OwhIiw9ijh^prKIDT7=UbxiDkA;y-yPs#{KM!R=`RcLaFAT1>VYb%#nL>P@H8LJlr_5 z^nD4~J5i`+dOt5l3&{DSuOlWrfutis`&81h<_|eI-!VuPD;d$Ea`AJWgD zh9ZAn_Z%YU<*HBnY-mTXvi-{u%icPBTipfr3J|-*>!8`NR^aANanYpeyhuTd3xd@hY3#Wf#?~2&1e)CA1kgE zt)nFD4lcGZKII%D#R!J0e6ZfH5l3rcW7ck*sK&@w%+t`Td zDNTU?{QDuGg2c1d=f{03j~< zSL)$B^A2!2ORLhg;21=~tRtY<$O976eF>e_+XX*()o&Y@?LpQ}Wux5x%59Jlf=)FG zD!4Yukc1jX&B4U@8W*Q(&|iW>{N=f)>-morv&eMy1!(@uBO4~WN0O(o z`B?`#5uGZQks(5ha#V^2O-}0eNMjhy%x590#Et2(2Q+@!Q#|GMMD3oiDjy*x_Za(R zA>b12(`&O>aL^&-*rER7l{G7E8=dl~U=z4kegzoNFr-EG8dK@Zy@qPA=s4sc_ zDQ;<~wCp11?CXly7c0Prb62NxQ}RGkYnd+D+6x}kk=3QTeno1$n0kK$7anwhY0z!` z0$0Uqz8>48bO4jdDqRsV!7UNr!Kw{v55FwEEkRlKg7w$3f9z&w4pcb0ybChfwER?uVRWcjl=Dn}<<^?g}I87E_H zignj46w&OJ1(hZlA{vC z-dEJr+&HcxDMeo3`iOJp%?%tVsGl$oWb`RCO$)^vDmO`u^ZQc8rBK#1QonTaP1*wg z@9y0xR z{1vniyiRaLZ9#{vDmX(}d$LvoDTZ<@#?uSNE3Nb(6^WVKujZsCFOX`s&wxUb!o;zw zy_BV(+DnxUS!*U8zs(2%D?Qa*(|zWrsEq(#2{=S)s$&wPHHtL{)RYsx`bYG7_iX}{ z>)H8gxDuXBsgm}pMri?`jhecoj%psa=ESxoI_V}_Gv{BOM6+fmbI4v}vQI9$*T(=` zzf{tpUD~YM6Bwn5a5zHCfRs>&YFz&fjrPM%7)jV`{mwdjAuxNb zpj_qy!MNK&>DZCWJM`g6+}v5nwhM$C51Lao#amV8(`Yu=|6c&|9}VEdGqSEoWHpfH zhcGiH#b&k~xN{$6r&lu9XdPvf(bu`Pr#nYBU=Bj!5A4yH|4-!r8HE zX^e&%O>uW|H*0g5+lDcwH5?VzD+^hj&YO%=t+?%R#ue~b>qyOG3@j|Hsxw|KE^4e+ zH*&jGyN4yUt4CKIrM9Z`M`EnEmEv@Hc4f-uVJ$3DWW_SJRA!?L+N`#0S~Fm?C52_R z`}a?%eD03@HDdc6*78Rf<8i30qZZrVZKEufTC-x|*2LS4jR3)%)1N!0CS<<@1Z^&v|@5ow{DHj}a3n#w2B!NXk39Cpk%TDiL!xZz-uiM7Y%_BE6_89HB)!skQ`hPNh>U&RN>FUfcu|MD}PbB>^|DCj){7B5|KINi+p5j&{ zX`89=1l?beCW>=|ABIXfjg>uB>nxPCeCX%#jsvAUk~%ya=*YubqYdj@lz!Dc4Eu&g zsjRav;PS?(d zyjPpY@c!S{zNB9Yz@Mcf#FN6Eu!}J<`I1(t)+NX=y75|(SCKJFkG`-byTf^uZALndbe{5F>hx&4+mbwnE^BjSyOpl#;9(hN$qt9I?uN_$M=Qzw<=4TkjF_sv|T;rU$=Qzw~XAJnP z;~30%u5p;h&ydNy-%nl{jK}8Z7{eHQk6$ess}10@0nv4S(qY99?O_i#LbSsffsco7 z-8kl_V^A)S~$ZC$!)|psBh=?Nwy`*uE!RoBETz3r>gPCfzuIl@I?YDO%Ng^!SZi&!syeaM?5mXAwRNKD7O5Vv?A3Z0shA4%=hJSz z;ifp7xflaTz|=s<5Q^!E0XHluNt7;t)0uM$>xo*6qlV`%HiNti1PIy`LKAGxCQZ<- zt&px6NHAq2b1sjwzf&Fz>&m>gb+s%u*>NmsHj$)hBUv7UHLbnd>y3^_BRH218*{z; zayx9gFnPl%G-Db=RpWi7Zd~Pq2SX`wda>VXvn1^dROyP#Zq3!*HJvTP6`}T=`0L8g zjaN&Uy}rHCoyRP>c|&=xWqRm1ma|uuyO|u1WY&WxGc~Txyd-whv^SVpBU+t_+U5%u zM{KEJ>@;o!fhEC|3nq-x8zxDnb;>;Or$KYuPT1i0`n2cH&~qyY8ir7F4C@SS9Tz)g zp{vof(Y8A-5_XS&SDw2LnJw$97V)0RYD-L41`>42TN;yLn*3TkYWYK+`|GnUA6vR! zD<#b-?x$+FGN&|g)zjgVtW~JT-Eqv)Z5bMC7;xt?EtTWCwPw^K+QUp+SeLT}bjV$3 z#65Jo!J1o(QE3?VsTrg9~UX4ShL%v583vgp$Pz+3hh9XkM5A7f;ixYBjNKd7TAlUI zwl_T-=7v2w96sn{;_=PQ`Y~Mbw%3$VxNQE<^YdQVS3dlnYdqj+nb?w$5QPNYC|F8t z#t7uO#vYOxkkN8aJ^MN3UqZiDRX?)B_2)@8)aTRrzq#C=)(m}>`}&)cv53YNEQ~7& z`WO%Fzra6I^e&#q@Hks{{#{726G7APpO5*h$ZFDk;|5HS-rqYA#54{)`<7$f!c9?% zNIt54teHQM{o{&peUfdD@aKV{p_R8h+-lvr*wZzemgRNQM;A z;kJ#!(bXe;wPjXV=c}mS2XfAq;p6JZ1(LFjeSUr{kGgrOCzFDY5?vh4EGFfk)kJufq@xg#r@ ze6jUur_`A9noO7R-Dy)89)?LY$wKRre~T=Kfw@n!BfBa*vCrtI-)bLI>(seX{2$WI z=+Ue1%2VCyT8Z_3XWL(!^HIOST{>@iMk`y2X7pC8Q;vdq(Uf|9De#xd53b3C!Z>{4 z{C|u(SKixka6fz6twV6dS}coENCf=C85WhiPLLWU95VRE_05nU3*ar!2lkOH0(*^f1z%o!j6palmrBp5(h6OS^En zx6-TL>GXK+r@pcF%wCArttG{|6MEhPGWbKZ^**Bd*wPxIb+@6EkTtKVdZ{k?VB z>2_XS!Sk#-m4#L-DV1d}CCvwu8jLqPPVU>Z`=*t}x8C7${8*ik=hio`^as5YeKihQ8)bh_NK7qpI~Ml z#1dc;f0r}H?|Pgc5n$M03}#IkYmx}S>`kGrN#b~yEz6=^y!cphV!IWrsOCwS=4wYQ zV!2&6Nw}}*izxe6Y-J{XwmgabiED$$Nq3yA@hix#Q@bmrzkx{B@MvR1+qtJP%XVSG zoGRTM(Wum9V`sSSsMKmT9|iZm2^{TOmz(N-ZX8GHKLhyB#Q#+6euGwL8O6h^IA>&h zbF(cLi|34OWYiJMZ4E?wG_rUYQ@oYQjZEF2r zkxTJW)6`zl)kpAu6LhDJ4Iqq9@o2)FO`0Zt|jqM&up#+ zmR2UAq_qt7_VHJg87wuF#C!akIEU5t7{)kD%I_za3Bqfqgs(HpjTUYzk1mCFDx*@$ zMr2OEW@ndcs~YU^-0j8U1c2^AC`QWsYWpqDMuBLJ)=0M2n}}TZTQ280K2XFO!&Rbp zv;=PE3C&2-2GVAW66Ap>jD%<-BzH2VBNVPWJd>fVQv&xMg9h`Y%QLkM|uL|IYCZ(xfettJATVtY^M;tn7z_*8buU4&O zG~Y`9PMYUBM_iV}qc}51om114;c)IAZl^K*OI+cBwkQpQ6v%iGd5J10F6+0S1> z^l5xXZ-k@+xmE8GnkSuHDZX4)_%(z7A=L~aGnGKQ%1Nb9a0U7nX}o;;dY zIU|fqqg-#Mi+d9?;f1GMc6FBfs$E>97g3vFoWTAg%Y^BF7N6jp++; zvQSu%%$*59(oGKh@=>_$;#wLP9&Jm@H_4t-&RB{F^hTO(m#VZ{9g04E8LOe z;K^+GS&w;{n8q?0q;`)_aXvY-HGFr&^LM*DCU-wTdDWvuaLT-S+{xhS(#&a)`Xtp; z+-I@QhL9n;N(dXmZpFz$NJn678HQ`zryYD*$6kpY;o7>@IjexzCX1F;!!B%U0_D2W+*Lw0x=UN5N~IZA*jc%=$BIXmbri&p(w9YqHI;@wrsq zI%Ld{&c-lp+8r9P$}(`t=odxW2wsA+7AneBMavXjZw2Vlj5UTahM8)v9g>Z+J!0!B zZzo2*CQJO<%`eVl>$BPPeRj5_(Csrw-G3E+f#p~{SMiv1cBUvtI)}@YI8xmi!Hd`7 z@`ik+mCO!5AInWzyejJ%Y*|KTJe+rSsjVQ)5j3k6VoWO)Vt112y3lSN3=sEGx-g#d ze{h|pb4SFlSg)Wf&X-@QOPwc3I9v+oD=6CvrYL&;>f16Hh-Hs-6h ztnl)jqdwu{sh@Yo!!*V- zRqq{nblJ8kGbdEs{aqxVY^h%+sHf{RirCB}wMAgc6}PHJMAqL6aNG7DVYr&pUU=ZI zL*FevHCx3q3B@f^Xt_Bn)6C72kGn1eNL&>>EaEul3Y@Ak;s5Am)yro=qcJEef*yHy7%~AFB^4XEeWCmXbeStrg8!n_+0K z8{%x4<}IU>YTY9e<(9`+9 zqtoxiBi?s&TU}dbTLk4vVvlU&a{>-^~uRR0vCH_ab?U|IyGGh$G@plz%=@oyPBgPmZEs7G3?4`EovK0gYu=%idA3HWmP^qJzErCqMRw|;gIz;87h5DFS%lm zOG?j+Mldmf{H9CsOCik%;$Q9Bmf4uA7x%TnTlY89K91aTW8vkx;+8a~rR1;{!)&B| z)cN~9t`SE`Tr)Rf)-kkBCAmLG-}k2_hu8VK@qc78=aUCP3qq}z(LspqI*X5Q(?aP$(%w;n=QMRP#vu<&jY&@w`Or`rs z#f+-!#79wnAEx)dN&07Jd?i0DpQ@6f^&{l>zX$awH~mN1k!qBG4T`qU%~LGM%CC{? z?adNcLfraKGl$Y}M}qMmid*twvzxhghbs}zjQR_q2iI8s*f&W z-EWHX=~IuWAGxI-*>F*rC3>Exp@)U4aA?v;be(O9n6{&9u~#H&Q-guCMvO4qd4F|} zv6oWxr`Fpr+b>@R`y_k0t*VTD5}Vk0RC_FkOf^;bGzal@N>A}V)|7tJCKiX5KV{vk zH(1T=)@xdlg(K`jRU}q(E6R9 z3NcFUNxwGsvDLcUfoeCh!eNm;b#%>F4p`1 zcA-4qi+H?I=eFkP&SO+)?3U?m@K?b0FU0;M56pU`@>vy&`5tf6O@FwfQ)d{oYy1Bl zevf07f%VbHQ&t&I%FZ0au+NPAfiKfmp7GtReqzQi*55>X^=eM+A8M(_qgUCK;>}o) zzhtbVi9e#TO(l^HTIpjBtTuExQBU<*Re9IxUxar-`^Ambg3M`X8GJEaFET%Tv&yVo zWZ&V6;2YYxNXN$;V(Zs-@YeeA?at+!Xl9v~WRKcABz$rlTHSdpk= zMnf}stp;Lo-6N#5jt4nwthz?hGR%ifT+5q_$y-S1*s_3%ik0?|HVABG2r*=vB)$>F z;UpB>6^6TJ>0M?iI64>_;zumywsRWSD$>n3jBw$^?|!LiG+@YPOt#EaWM?k2=|&p5 zJHu|W=}748t5jneOi`IeWe+V`l&0a4g}R;CcW~2&73_rxB3T6pWFJ^W5%V9yr5A})gJw}W6_Rx=akyL=&~h~A9@osDNAJv{sD-N!ys?JkeEq0jKdm=WDS(O(m##y$$RJ$T#R$I4rM{@C8IzI-F zwj=Rq`lNL$)8|?is|@|<=pJc2*@=HydCp(izwdlrm%^i=)lB}=rQ<~Zb~pOgm-GJg zw!U`W>OZfVSwFL$&m{e5YNvcn(q>lraniLnk<*4YpG^N=JmVu9QSCZfbDDprQ&C?! zR57y6m4;}r+ERmPTWtv9eJDPXN30<{16iVDdxn#iNbOMn0%@4Pqv`al9K zd0``C#LAm5<~)zRP{Eekw%}YX^Ef!Jwc$z zX!QoBOw^hlqJSD20000001_eun2AlAnt1_D8ek(v01YES6jYvxiIYdD^*v1h00x?5 z(V)-)6hzTa(rRppGfhuYHlgZh01SY@A<)d3HPiu!AP7STMWI4LNf}v4AQom+Oqpc> zf&$}X%*CHXn6qn|N9bE}H`9d^z6slf$9B&1g8KC(o7h$@?$H zR^4so#0dO%^X}Q%gIPl442Ii(q*8mVG#ic`2`To z0Z0W#6(9iys1O#}0K_V{)GI?fcWUQfrSh69v`cG**d}@J(MaXFoRy_3*gHw`a`rgR z18aF#WfHSV%9q27A(m!Q6UVvtwoc#nz$8w zlK~7;Eo@fO)>Od;DRLyiu_zE(jPMDrqK=3KmR%5uH)opO_%mnuywlnI+D-qcRwGt-fJvMo9b}=I;bRzY12`;t8dyG(Lt)mY!LqGw9CjVuwIfv+ zsS-BROt-bl%8Wjqk5|8kHc0g~j5$&06pI_{*Rqbi~~sP;xIdf zNRg_8bWTmv5%oH`mPHTT^EnGVpmg*8bfmbaK&l(M%Q#S^+nJHEayJNRxev~1HhRmX z?3&gqFy1*#aK{b@Ti=UpZLf7aLY!e0kZqa9S0+izew_v`BaiXt zy^q2TQ6vq41%t|wnyy-rwtZTi{ef^1ggI&+7c6mLf&)PK%}sfBUDSt8(a|#waCupf z4R{Cp$3!#qak~du8k2SVBMBc|6m|+NZV*CD zOm~pc>{E-*1lq&Jx*Po%AZ{bI(LjPbsV_oPN9TiL9&ln%uvwo2x)6v04htnUaYQ}x z*;i4(l;GH8->y?mglgsH{CWmZ8L=)s27$;DR$Gq;eS;GznT9;nG4pS)dP%qfqax8rJYx3?+J#SWClK@$TyH zP}f0Ia}eXX0F=T}vXOpq?S;(etl5-F*3dvSt6LeAaxjbWBD6GFL8pr0dIlV|#p6`< zp9ZZwq^{uskW_d?CmAa-79ic65W*s5jg7qL21yOAMskpw5u1gt)O=Ejh0>e(BMU4ZVflAv7BzEs+v>Q9}<&B=oL8Ksq4= zq)R7M=^d~C`*hE_-@~4>-_Gvr?wN;~+1aP&E(*XWW`bZdDTBW&S1M`${(so2fcOA&)B=5?~1LM0g)tBGC9(3w>O~d?S=$Uf7JdG-D&>c0En=R~?# zQKM@#q)++zG%p{Dz7aO0DG)F;B3zEMV@~?~O8uHil{)j~()%LJuO85FUAY9iOT$4U z%nB2|o?`r}_>Ojx@ynaSEKlFQ{%VYV_3CQU+s7<7|Meae2pEapV|ntl_+irP&q?ne zGc(^6x$#m&RLkw!AvyuS6dkUoQSk zNAuZG_%)sAn^(-A>8fIBN{tM!(J)_r9HTC56m|KHk@3sB!k=Fb4whUh9jxZEH@f`b z-W|GYmtMHjP%JnuKYsZt<$A_K-$=LaY;bxP4#ce)14+;<29YFxf-oBtbJ7Jp2TG zkNntWaL~bplYxdthJ=3drSLT;4SlA|^*dia(_H!tq`Cf@hLZ+#>GM6(C)dw1E-oM$ zhW}A6q|bxo#|$*r^<=Kx7#yUb8DxKbp@Ns%|8wQ@J|Dc$cvBv-Ftl1<*Lh1-J73uWs0caz2tE)sd)eP%Rw3j z-oiJlGK0LIIsZvNdrUJZGe~m<7FjbFRxB^-ghC_CYtqfw9UgXwr1;2WI?}V3N!iAB z+m*-K0;ST^GaNZYO8$KQ8;?Iq_YX||Rr2S3dO0eCp6Fy}FY0Jl9up6I$KD}k8{6Lf z4a9CICM7M^BmAw*#OdX?3IUW9&^X>URjkZ5o?z1<5^vAJZqwdsYY*ZO1kjhfp1A3D zw_TS0>#EUu{!pq>c}gkitr-8c3|m{%jwD#>7a52{0UP_1^cYqX~FX7LY3 z773JpGAldK8bOv7Ev4SfYrI)?6EMe)g ze412~H5}D=`PWyCl)_T*hjuNWRvcZm=oc7kEbN}g(~H$eG|=Gi%inu{ZF@X9-N(bS zPZWMrCeJ^_2 z75Lx1=Y5h=&qhQai=`-pDI$74A8OfBZDxf01_E|O;3F7tQmxBMRdphorEz7Xq|7Jw zuYFin_D-g34cA1hm$M@Gy6ihMKIFyiKl{GA8M^3{;UQ9{3`L1kk@U?+9C=_a#HBAK z4L{nn1UAG8KJxG!Dc-G;>6M`Od6c21Kamh$N*WW7in5b4&}y|^i-JIw$y;a^HF~#) zz{U>yy5=piu|MEWKxFY*EU1WgCxlHP%C})N@2`>15m+^ntH`fg_b3Fs-^87>d9lnI z9NkyAZN-9)(cb=~2L+~tiu!Uw9&TwAS(*Q>9ysL-=N8_HHqS(-{V>*dY(4%~!2m>a z^f-*UlB1`wd9P(61YcGFwn=AKgzYjDK&xA+0l|EVD(wz+6+eYJQ_p0S_Rd- zrC~3p(rFPpXaCOJ?3}Z)uQ{O;Os}fg@}wp-s_jmJYT_`w(6HBZVf;iqTe=VPikO#? z?DnYK^jiq0o_<_WomFwT_F?I2?q2)8u7R&h?!tjkCU-7w-DC6QSN3V`g!lCOQOPgn z*4eN^x7MXB~>-CiGz1b+uED(D@H<764&lKxUJfUeTidh-?L^; ziLTw0ac0iBTHIP_HhFMt9;5#hX_CvkW=66e+yP8|JZ4%pa5#>FF0{AL${3GH8Kh^w z4clvxJIUiamJG38CaMnD9EQc>IDoNXmCjv-gz{^JamF&=GSt8>;{)4~1?L87KIc|@ zjr-e6$EfZ+Zj-odRo$~KA~pwEmS-5f;ydnn?%(Y)g-DRvGvKUJ=xzaD#>aj`y?a*-{QCH9fHj-%4CbCLl-A9cyDwe%{LoiHc~g zG!T-Za0e({}VqYwF7%e=EpJ8Yv1Whz7iTsIra zMp9=An#+P6dCe}82+^9XAA&|~T@~6#R=QoKwcE5ZG19<}l8#*2`GT$(@|V~P{l@Gf zy_-{sVJwJ3iT>CvVuudMA=}M(wAam=f$f%%Q5zFL_glZIhqSJ%UNu$`NFpAd0ex{YoNrF_FwN=3GKprWK0iN-YZ-5D#4oX3>n)iO zwU~~cW~(Tf+D|X#QTQbokQp+SZ42`^+ud{ZkDbiI-;-J z5Ir-jnu$IdWI}*@nPg`Gp+~Gi{M~zt?WtYH)h-;&T%$^lKz>N>c6H4t0T#riiUSjq zZ@wp#eC#f$+xOLAqF$*se@h7owd*S+cN`Z>md|lN2G2 zy<-ffb4%=pJu@**P`AU@3@cE?pjGH(*E_)=lCA-`-(95#ekX2+x$Bq_UxSr4`;rka zfJ*cN5(SgTB3N!?%9s#mIm-8PORKABZyOKRLU=F4WdS$c=r?pmf@<>2t} zUjtG99~NzAApo>!iw?jn1AM6Fi8_>*ex|`!->x#;9kW`f-J6jtXr{xF;bi#1k-hBh z2{mP>4I`jzS3okYw#)Gr4;uXYNUdj}*3)~{^s3->RCi*jK-(EX9@)1f& zg$E#t_J6N&Z^|a=%KNCR-O)-CPg%a+f9k`|9h5Ave*8S@>BncE)QhhM7=xQ1cBB79 zF%ODh?t$mRP0iodBpI`JGhTW4+?%Rx#QydMU1IyKQf_(6pF)N>u_W^rnV-Ks?3~0p zV}7*S#w5E5j*UUCuW|*{~ zt#55Q!3TVZ;Q)(zB>~@1*)b>Sjrr~RiNU)1r4v;gf~eTvYIiBtE%84>a-o61#78_p zkncLZ?f;a15M<9|Xst=U-gU7X+KOGw&@s**taJt0{ci{+v_n9QXv6>b zX6d}DU=YmGDctB}u&n73b)5#YzG`~1`#Sc-c<)0#>Sci7^OO(t#%wF?>a5$(OHZ-2 zPX@c6-@MUO4^dZrTyaajc6df%VQ!lixu?h)FjhkdQ|=j?T~c9poIi5K?98a2l+V=p zg%?15a^(7cDf}635>0KjYsJ5~Xtn%{T%2o=uq;a1%^nz2Hh8#_H_NyguA2MM3%guh!Rs0t52U5KGf>94>=%M)!!@q9fwvYy`PBM4Z``@1{CrNLjvzmK ziHh4!#LNiK?lNO@5DLEfX9|=Opd*AKSqt8ZQcBkRfdyvSRQIjOdg9!Rhx#%>=^5$v zB5~~L6d5vWyv&fR3`KrYwye?%Y+fEOMYOZ?(gOs#={za)GRtZUw09Ejdj=bDuCA^f zsiS1bHjzWj^5|J>+Wd?hvbqbuWp>NPuW5X>0y2=9;%no};!S#^iizf8peoLljljB4 z5ue!$!vN}K6|OFrlBRx>Uymz(#-F861TfmnmuJ6$I4l;lapzK#9YZX0eqQ4WEE66M8 zim46RopqNJ*4j}_^wVQ48>#9?#g|8U!878RSa-#^`n@xf9(8h3KF}ykuahe#vT_E3N$gyhSg-}(>tv&;CaYnESbcnHbsetP4&XePWf(4B ztFf`-%ic0*v7o)*pO4XJ+P!d|k9@a3Q-Qx6`qYT2@;?lhf(YULQJ6|LiTw|TVZ;rg zuaSMmveyzI-1@m> z0xhre89P%5Jce(KvRT&P3S^i3d_P?~deryj^FWEt`nu|Su+X>aLvwWx7Ugp&62{%JE5s*TaO%Bzbyq02!ginnS47=JO)s*wn0gnHH%Bcx zYH6=UkD=n-s@C;|-#DG6hQlr259+F{8WLV>W~i!8ZY_I{i}|pw6KX1KQ!8|xu;v{j zS?&~eU9@Uop7Ri%s7bgsYC39Wm}ia}RjRB|uh0fum%(bt>`jO}aNKmN3alxzy3)4C z)EM4Vvx+zFj9tc}=5@$7&ZT3+U+jj)9|;YHKo3I;%^}YAV{KTDZdnB*QnZ5TO%vnX zasi*H&Yy2ndLGOA&ka$QL+z%oFO|XyW4jVW3*XQCnrqK7-W{*eSeYy+1q;ZdO;Bxm zH(z{pWMHum+)ZN$WoUh_TMo_J12V=ClG{&&S)y0edOXy zatt~kggY*h?2>0>wM%dBKB2a)9_v>S6m>DeL=z^Et$?q|QA1uM$oVyh5mp@PZg+l zJz83O&?}JP_>uU=uJv1b8G}P=EWuYI~nx&T&K9l|GW-&t1D^JzH zO6vf1fQ@L2!CvDG9a+J;8IDc{$1=h4QrWUzG`}{H*0Rhl-u~{8x%dvOwG1uti6GW< zT`OaW`zPy)SU=oGhn>kzyX%97F$RMSq_o}4&t#2lHc-i_D&ov)E;)6YEGl%}KLHHl zSPH`F&aanjgxyvcK`8zW?ZlG@-;A;Z=$7aekRxGdJ5EkgD?e0jya?3Eo{(N>*h7alYYHUJ^6;mRKT24W?9~sNKDf|P z^awt0IKs*EarHL)Hjp+B4BlynHqe%CDLagIh8vE&iga$+1=vO7(*`1L%x@f5@<<=K ztZC**Myq#LAah3xdhz`PS>9hWna9R!T@haWjUI2&*W%ha=T@UgHWs$oX&5^lS+IG@ zI7UQ3P>jw=hrYebHYVnyiP(1{tb#+gLg#_4t%j%r@FS6(2)Yg`ENvAxyL%wbk?KU> zi!~P`RJ~8D5RudUkshyZBH#o7rh`B_-5?ocPhx56jScqhZ%wObf)`Ak2yC!M$%b^u zTAG^3;zmi?E#5R`MhjEf?B z5iAF&sxTqdh(^}Dn^fhqllm|);|J0%G>)(cmq`2LT!ETvdDsYP^7C%s)mp2|^^?z7 zmR>(DY+MTIcW(7j72U~EF2ali=lbPYoAu5}D;I$bEWn}YvOl>(A$3$WzmZV=(0yR~^J%hnmq^D;fh90SYBe*ZtFAi*VagOTbH5&`IQdH_-mpEisM{ zW*QtET8UAqj)42I?d9q0ZNj!1V3zmYQhZfrY}-;fpp;rrv5DA2r|S+Fz|9PfBqss0 z_dQbGwr?w#%`!3^q#u~Dd_=`P&?Sfgb=%W_n!OY0z&eVFp<<$*ezP@8Y6GxW073SG zc5Yz9WL6V;DQON+kAN;H-h|$a-Z9F}stYT$j$@+*diVWn%Ze zL9wY)DXB^G!tv>aHXNq0#P_`=*0UOs23u$M`2tHTZ}+7{y2Yr)ai1MkIhZ+^s^tOF z&npOdEwRCWwvHob?5&}+_fM`onX_)Dh{xId*@7{ z+W@Aq&*JgEnc(V4!!vb4trw=&B|BAcNz}Fsxj-DDdiglEjhCqfc~&|PFPdJAOaWU9 zl}m;Oz=z49nQe6?7zh@>IPJ5`2gCUuFkHxvPlxkI*0`x9aQ1m6feANYm7uxcI{XjR7TX|l)i?9^EZ#ma18lv1o_X`VC{WZA87w^9lj!1&0l6rmCc_&$%-zwqNqKQ9sqbXx!ZyxzTQ5|d6$@Scpqt;YI-Rt1M_#%$QEA$Vd zCIydwn?;Gd$!l$L=b{qv-UV^TmffH$q9dtCATg;$Z~@i|(pFjRk}4}khD&$zy=rFY zb@XuNG)*do zWVV_6@66!-a&r!myvsFd%a%~*} zV0g^mJXKST-9>&V@wNJ}R=U|3yBvP9(ccG#u)^0o#mIL?6gA`hxH?U#++8rm4pOBD zCz7l4Bj&v&YF0B!4yzHY8{S0A|vh6R_|OH|_r6X%M1!1-l(^=y6*^c@jt45T(d8ES?+>3&!X}P$zF}x*I3w$$ENGS*@Oi>cq zA`B7qOX1QD7;6?aV@_J_W=Xz}xkfH3hsgz_Jx#n=R6T??HPCgdNm=m(Q_zMPrHrlA zPZ4t-9 zhtY-LrU%OQ(~giyU$ncxmMyF-|GT4EO6#}OBk@=B%YZ5PzAW!^|0>1k3H@g)4AIuI zGK@{dV|?oYLJ`>^4RIkx-rEMQoz2U0g-x}yyVGuc&{ARu+!YT4ZAJGWRbAFDUqKA65~ zF95}V(L=tAl12(vPLYWnX=;W)%K;r@4x|%FPbKr4LHjd{_smb<17+mqy&XJ1TGy-bPpjfwv zKb(Q*rub5Ybi+_{`-eOcxUu+Nm8FtZ=g9KH#%96+nuj-ePXG+HHL_V#*!ZWi zyhkW&Rb>RVp?TH6DA7~-YxrOJl>^(UP1lNHGNC89h}AK5D8VdI4bgBKSoH^59aHCE8|BY(0;zu7QDU zIPYR8W7R+R=g!p9)Mf`TR3T)FS2Zo7hJ_NPn8(=Ihkul5qe%KR54VSP63w+vwddb@ z9jYbnq~ZH<4Tsy9xFK95ya&i-Z5PJoNmW^Lld{f7tKFVH5GB9SYmazQ|)%$M7-67 zc~G5gS2eIflG%~V4%72`H}nD*xH}jKF>^s~eOySmPDxtP6lH2nLwealFX}7sz~bRU zuSFht$#6uIM^|Z!NHRUvkldmwDIR!q3sJhhIINpq4bV^zr=#*{Z?i2(0(crAT~oP_ z@RLG6tncm0U+9<A(OFFxdCk?2YIo8hrR0t)8OE5SSrsxBN#)QxDRy%qA#)kA;p))$0f0Z9y0vgC?PHdi z3`^9SM_jd8$XH2+zy}uFcjeG?%Z@#mEKhBDMB1bME_M@^HUH^4_qE+h#+wZ-9xb&0 zB9(%$A2V1FQzC?s=;qR`-0Ku74H*DsgK;?7LdP=MgzY_hXF2C*CoFNBMT+a3zWWX2 zB&TOS?dxrqI_s9W3c&=$5EmT58zPx)w?Q1)#Ha2BA?`MaSt~sHJq6I6|1yX0RDHZ7 zy1cxDUa8N4SqYCMwo$zB9@!0R-0mM_b?gYoatM2+!y#&qA=UDvai2;NOl3iE`j1zA zCWf3|SZuE;Ky<$FCXY;HkU~$lxpr)=Jvh_g{n(w2+y>YgEqAbn4^};B2=A++vZm8i#%msXJ@GePK@u1#kISKl`NX~PgEiGUEMZUVg249v`$OQ@6#8I zJTo4=B6EmnWB>5jeG^)AIi*8Zd!E^@vD~Ww@ZxYIfH=dO2)!0mRjHy)GH+H<`@Zu# zO2Ld`;Ubyd*L%(A(Xgnbb*nhxlJgt4yVy3ofLna*KH4#`BO#dyK+dh-Xwem!F%LOK zX8)e^Dav_-p4Bj1Ge$}9)9uDf3h!7XM1`<4fwkdPXm*5fpP0iR6Sl0l=%i-6vtKSQ zj;)96e9alByx)U<$6-z-Sr&0ZlE0D}2swuN)ARb79%dE}fw_8yR5i%Uy|rb{E%>9{ zXb+ZL#hz_()z46GN!`0a$x^J!X)(}#)%$C~-Uh+p%GO2b6e~Sr~ z7_zVpgE?0YHm2YH`DbLBu4_9)p(n}d_M;c%U-A?Vr{#KN;L0+DLa0Mg-;H*pkK}Fe zLSZZV@2NwIjl;))phoZSqXd5_grjL(C2>foMtt+wTI`uh;zX$Vv?QOK$13#a{?9oD z!!qq+~1Twopw<-j&}}`)Fnu{UMM<Z-BP zK3+=+QBF-=S;4|aoM6&Q8jqIYPSuGX@4(b|`GKn@!Qavp}ET-0RH3oYP;#4!Tabgx4(C0hjYvCQJK^)PqK9itdQ9Q++ z$xt2O_Ix@J!et+)>}-_@fURKj{#8bVyhC{xsSj@GE$h7f{jEk!BGho%nCL~;FN?{v zSjY}2az^AxjEdV6(k6a|vT2-JSg?9> z;_~OI=7X{x*C1qGwMxiFm#Icw{4Suas+f?VApsXHiJkY9chjr2=g_Rjd`w_K&vS5Q zI6n+RH=$B7Yg^$KwTN^67FFKIZstoxw6;nWdLypbS>62E{4l~59%xF z8@jXBUEd^PWom%5_FN@jp_tia9$C7}lLrWm&uH@$!=Xk#Ej%hU0p5G-zx^SQpF3-i z^5oCQNp=RN1DD=x-wqC_KI`4<-?OVczKDF=5}j8wTigKd&w_g&dH&1P`uzOuB(*T- zQncPM<@LtAUU;ODrKg&u{n~r4C`atGnxT2GK91qOyhmFZ?JJ$}{TD+`Kk*NyT?-{>Pi*U(2FPjW@Qxu0VXN!9VfExWq|h-r}P60wTD- zdNJ#6Pa!>R)}>9Y6xj9$LbSC9cz4_FTOcGVDU~9roUdS31~A&At*e*QjQyRP9hhrX zd!hhw{<7vB-!H%$HGe?X;^k8H z`iC5j#8sxpl~J3y27Wn}Ym>MpYu-)>%hS>Ky|oH?iEE`2~l*INBO_$1@-R*wlZ1P~Fqx0clx|d-J2=W~|8+sx1`Lj9Mg1 z3j#6b!!jWunBIxfEs6&M-_iGSqNssP8H%sh+TK|GbExRQmg6!VH5QD{C~NvCNl`dz&?7d0k!#iz!p^~8hbePx zN|3wiX7F7dKlhg`?@z210>VUrNuo5Q9t3!B8Ggek8DIGWJD6>ki=U;bK z0*-xmYpnuz88AMQ@P;z|cTk7UyE-Ri!5cq-OYrDun&Np>4>a>zG3if0xB3M7KUy30 zIS1qmrY<1<+%5qv< zfsaD)2CQwrzD;|%0?S#Hh<;7s#!6T!HK^p!Mg@dyEf4TCoYn^I1S%?vuP#~;PzFJ7 zYqll5Zq9RP_Lj@~;yiJ@IZYeNDY*Y;V;ssY0W4#t^6^RA@d<`ioCx;udQhOCVLgc3 z+&T&%Q%Eh%y;LJ!f++AEufjmZD8DELg}yV;Mz5L18D<=tvUGGeLU`h4Xux3a1aYM? z#H`P^kkJCd+7>O?ZS5rf~2AD}yz*M?fn4AE(uz%JW!W;1CF;Z11wht+Cw*lTQdMo-#f! zBo%M)-B>p&C-b)xrVV8HQ}M{(GQD$IYJWqi^1;JCiN@>-w{oJ@PIMSS^LI4 zleA>*-{VaeQ?%USITrP&h=h$Lh|GZrOXqDgkHm6RXt~8R&ji1YERz>RC$ZbU*-U2L zz2@|CrJ=NPY@+ZAT#gorgN&ZivF)*HYR<(>+g%H{;sIcJH&m}^!5$p{ZSCbjw41n-9p2ZEPMM?$t{@|28ft->1^ z>XlP9Ru02@GhUkbkk`lI%AnK6(2&PlC7o5vkPaY zsr8{}XGY^QzD*H$wa(x6H>tU%EAWFN?_+O#5xTU$+fL=sswS-eM^-6k$*W@9w%eu#*P<)pGxz3Gqo)3ivoGpTYQRy`sB;jS6fRXE6YReT6y%&g z5#?$?BP3!~{@BS4!n!e+ENR{ZS^3scUs zJuD;s_Ctcch2qPz4qtXk^dHBE7*b4^3!FBNqm6wQaK_`~A zbEl4XNL3QlI9g?QL_4Iiwbr@Mf119F%nq%Gu3|>!kS~bP06tN9FF!pso@`&7(JFb} zclyNiupE)r*E7$vB~0bQWKGS7j0L-G`h#ae);>0EPlNuI9!&8*4`&HX4m7SpNmGz< z^oM|$=E$yG_kc!9*9lAP0xs;XoAvO_Qg9%f^J34R4-3>JSWob^y}%@@g>m53p4h& zuyVGAvy^~UT=zL_xYsG5fAt*J+7f45U~7qK{lHS?QxFvWG2{z*Gn#yRHTs2r^oxkv z(Aio)hG!?6FAqyjr%&=a&~3dc-M_~1eZ@<>{iSdj><8LtLBq2^HFkyHIC&BB_K`=a zA`GD@ztX9#Y#fNS(zGo53*o8bt6{yk6A@gw3b8m03N~qLQTKNJVO`?h5@NQtTqrU6 zcw6(wSHyvpuU!=>k~19}jXIxJXuvt|*q!GFttD=LOK=F*OdI9%54Kcv%HhUJCXX&y z++C8+g*C}~I3~7`x5)zJPQ_YRuo(}3bKWhW)w7pNAbryfax~J@btpr(D9qnwT#xbB z&cDdS8|P{jyTeYjaZMIG=&*)ZSj^m5H-t!vcZ}!VJS#ZTT*L zgSf`pMf`U%kiR2uJgZi;7Zqq?xNufF-iYcvudCuKZ;OfqN0dYTL(W{kMkjr% zrm{(@vJUlObF%g@q(+5_!oq4-oKjfh32rA(pk#*Rh7y(a|2Lz*grrnR?swQ$aW<JCKs(H4u)x{U@Sma+$+&+@vg#hANc$3VuF9$Z+gM=1dX>1YSjNTL zh<;BN%dVP%?zuIDHf3oWgRR=GJIdxYfzUqFKuXX;r4@LyWNh)$lMC}=J@ocj&ex}= zJ)^(Whn?=C0x&RSSIyx@@^peL;!mM3htL9_anoGDGqDhIe6sP~j|RmXUn)C@N`nu)!p z(Nlh*EHo~U-k<;#p*(T8`X|S}b#4xNn18sA8)>ZHKaL%l1W539)rL(4E%$LY^%N*> zrQud)R0PFbOO+=9#8U6zdi2~1x1+xaqEJwf+D|F9O_nrnLXj3K5nGJ7;AK|4WmS3| zBU_q6hGVKlki5LSRGUXNcj&47uKCWWi+5mq|0;EfEL+4$wu&sUln167?wv`TQ@wF6 zGe%yNHr-(P{dGS}X>)Xf8@{H-nTaD4&A1i?KYcXQ5?VbKaR<{9?o8oa%br+f#B+6Q zC3I8gARd%AOGTX1tSh5E5tbEdet~WEv$IxX#`FDWP?eL8?OsdIy@dIxMwlYJey8kr z&V*eJWqcKTvKPD&`1e7}Keutxj9X-C#<^Z`(m2$9-UAMe_~*F+KJGPWx}`6HFbzpN z2@=@M)~R`X^Yp3(D=Ta8pHX#ZfzUgB$$`GUJpNN#N1>GNX3RP9tW`rlON#Vmr zbPMy|C}K*Kik_x$!^I8Bx!tRH1L-fDyClf#f#|}@Tz{7p?-1~Kwtkg?ftv2W&3#{+ zFLn){TWnE!RKx$Hsmtp0&QKkoj!RSb7q+JGcu4Gwf2T7$AYtnl@~gXmsu{(q4T@bmKn|34r!8Si~R@P)LW zys}^DkwkNuEEOJ@q~nA%$tp!(;rdR?`Ex$d@`Le521Y80HS zB@?){92}JGv0rxEBi$R*l6EaR56Tl~`6jTUrg8j>e6Q9UBzg!`k@_jm8Y}q^Xv0!V z3AS5NBl0P;-nEwE!~bXt9RF_Ti;E#eiMX#Tjq?HjM5`^tQ+x3G{{&knRZTQRtoGN> zb&MhwPSS?!@d8tJW5MDhYXO8IVjSD=^ zVDr%4M()OQ_7`9|$2&yU->AP#s?UN*z)mZzxy4w9auqjoG zFcul0b-Z$dp5V5H#4ZNo1quj6!j`z0mDjJhe&zX((+UW&gn8j%^MWH(rKJ3l@|}7L z&*&|kS3|>s;H+MX4J;qoAJtC2LHQ^P)elQmR9oDLg+jlWgq z53YNIzj6%}m{Vky{LgBbQpBHbJh2&I{Z*@;Z*h ztowE#gE%49cdr8qs;>CnD$8h{{ZC?pIKdJdFnH%zoQ)~l>ooVvFJqn*RW|BBoQuCb zyxqjGfqX{#qx#n|XlQR`F5B?(3a<+TztnfyoM0`QaC_yRaNf=|QoeQKr>|>~plB$( zn=_U<)?F6-@(L{GSbGPugIUci2-GYv{1|3?{u74It=GJGWaVnr6npWG!?oOc^&?A) zXsFgbz9Y%GM^I;ejCI0R7-(zwwhWm~OMmj1-`4BWVY7L3PTHM2WnRhSs-uBwDc{y_ zZ-AqF*tT!iM*jkD2^(EHy0%Xwv7PjDM!&277Mx@C^>XgBHr+w}S~FpNiQkq!S3EDf z$X}8Z{`fumz^^Lgw@NhayBD9iTE`@7Usy8i9<0UD2EKWtUi>)cGCTMz#X5zoC@9x| z27kXCi9L*zthC2-L=q!Gr*?-u2cyH*gAzm${mh_ivsXSzd=ty1ZU)RQ|SC#mL3O2m|jIOvdN+I6d8%n%wPO>bJmO5q5*ijd0(tI)s6SSFZ1HsF)@Ku(73&@K)Bo<#K0Lqe zIKh_HVPypB~EVE@I#77(DEk9O*jFBOkQfToI0( zUULs}4iJlUw)Nk6_qYO$F8=cE9&BD_|Z296?s zD}V7s-ZUt}#wxy@zo?5MWDo!K?f`eN!6kzwO(kLC<$lD$$LE4>EgavKuc>NhCr0|E zEx2-UHf;MFEy3qrNd|Kccr@+kCHa3JkE13h=l|9hTR?8A);9hKFNZfpS}tY3xCm>B zT?}Z!Y%;DxlUEN5P;AMx;_4fr*VsOPJrn(%6!yO04*b{d`Cq{Ldic1SLDNIk8^&QR zx5ER2HjC|^oxfohIXeTKi=UguM!qdDPD&QdcLd%0;qb*SMXdJWf&sLrFr(uTz z&q!BSIdh1%v(-kB$0b;)8!zrb8MP+ZPPk1{{l3TmtwDK*eIi-4?f&YjS>LID@#XX& zC+A51CohM;?B)*Oi|4d``q;LR!6N?X?N~#zx3(^C+~KW!>CU9Hw?lrup)a2d)4XQA zakjV5()*vt{H{ZxUE&RP*-$m`am(H2PRJlEJS##-bP;NCvg%d!?pWft(6Bwj5*Lv_#T|+ z=AQmQ0s>Kl6sjqTXku1YQQI`m%8fnTa@h?GB(oGH7=GuoO$_NgGu^#Y|BdfQsnW8w zBJ8%BQVY)cQfFq}_dP~Usi2wgsrvmoh`JwwFM03u^l)VjPn_s$_)xs%XU`kqGmX?K z%ERLLKaP5aAEq|0OHj~EObaJfEAZg`+kx*wv-M9HXGcBco2;IpJ)SJ9&F;~*ALY1V zlJ}UVvqDyzQgxK)4L(#kTQ;U83|H4Jgg~c%RO=@fHd<~X${@k@F4h9>vbl?{)?RrL zb#1HQ*JnJG6PMAIvZV9hKc(0Kr?W9K99m!wQC2gSR1;HHF{ZJwt|+Rixwc|0iBC;i zCLTc50ML;N{`zKE{PqCfdP_)F_bFiDuu9M5?2@pMjPd@MO2TmX8B2N@0Rv1| z6VL47q=?%}GdsqZ4!L0Or+!PtiWIvEWH8+_w#*-$_GTSp3WneLi$Mw6@<5EDQ`YFA z{sGS$7(cB*jEiNonuQNKnR;r2N+a9+!V1ha>h)hPh3~RDbj2k9Ym)DVRYwQokQb|8 zh7d)qCAIB9k!$a|>^Rcs zwktj!YoN!wh1Q-GKnm~lpF$#*YJUdQ#+>|BDuqS`nmf+4Ty8`u*q3ve80@>iN~~Lq zZTKIwW+d@O%6EMbLyOqO=Uv=phH+?~f;TAa_+=Aw!&rF=Cp|s-CZsBQ$YSP!$CB`L z%#!gwq5zaa4NjC7N zvsL!wcLbYRmF*k-4C_n_bVwYL9b*v8FJ($zYyk33pAb&CLx=7B$x$b!Ln?+RicFa+)yE#eXKrFrW{^vZ45s$$Zc`$0NH^G&%dnN zhtGbOC=;m@d&Xj>4gZZPRm=+W#w!#QL=25>2@6AF|Fn8m=x}5568fA6qeOM{Om4)i$QGh za9h(yO>9MT)xTP_%h?ce5zVe_Y+2AD}T#)$BFT!V+YtM+sCz zJN-1Q1b`b92QH<)C5B*eLVLTbFI1bX?*G_5B4We|0^F3AD6Q9Rb95k7Km5;6M3Vg6 zvsc6{PKa#@6-~1%2;p~r)L{2RJuQ|;9|Od3^y^C*1!?laNU(;CFq+ zjMJX%51oe=HZ2D)dgj7Nu;vigCAy#y0JcQb-0$jeLx>(-^25&dtY;dRhc!(RvYZg; zW%wWXgjc5XH)X;~OUvV5Lx=T^%|+Ge_aU1x-VBxR^i8qSe-7`9?q#8}Gvjp-64r@x z$=V6KXfA@W@QsNUQ(L`ux9}WQ-f}_F8l$6=Xa7m2e?RA?9^1|LfHj}@=>@TCBi(9i z;x(i;fqxISC%K%_PeLqMRU#^ir_99)NsoUrRlb`qsAM)iG}xnQOyfg*Pk9EEn+f28 zfR|Yg7xS+=XHzhi5_3@1_g~7>GrS-Ssg8$NyTQmb>-DZR{ZYwxf9e6RUm_~|0VzP4 zNIu6hae^Q>$sy5N8)1ymd0}ZiZX0RfZB{lO`)HUk7dTL-7#CES@2&C2prgSWIHa`E`f$nb4;&b^TPIiPdly#WtGCld?N`p&u ziXmHr}lJ2$gH()}E5gCjE~y4Inbk!&{Jx$eA)Oloa_{c6K-f0u}Q@yw@av z)z~5hz%df(V^}LQe=K=K3Rm1_C}P9I09b(mZ$B~YwTWniIJeJ$mPW)0rjN2Oo7zDde>atWam;{iwsmwQ^hTS03(wEb|5|%EJGK9ZK=c^6&b4M@;o zFY{Gpc|)gGZQr=J2@Qruih`dugM@DmA-af;wsucY|6#=Q%U!?TIyX^5Fwzxu3e`WN z$T`RuqZ?C!LRdQ>-lopQyD-gQie6#E)yU^=P;Q;yrVoN$+Z&p*;``k=Mss%gNqr<9 z_50R$D`OqEvB!uM=2vw`@)NfgUqU@fulnekr6Cg^bjn*Ub>OiOKtj5f_0VsLvjS|m z(wpQf;Xc0{W{R#DHmwXPe zUL-HY{uEu-rPbkUZ3{ zv(@?jV!Efm`1#Hx`-hq!6JN`%QsEL^Cf-17Z4578MYgV# zJP9LC>3H2&T%SL%*j(ea3*oaW38@Nt{IiA)Z5ufSr711^K|aJP{%NR{iHTC!;Ez~_ zIU^@lhyQQQJ*{^4YyXVm2?=3-st- zDOboxck|ME@A{YgRJrz7-yGSe^lm%pKL4VHzB66B<~f#;SY+}o+NIal0};_&Tx7X0 z4j2>JAT}XZB)y~XZph4r;qFDrs@J9TtIqb0_qaj;q6%|77Cd@511 zA@7qsrCnY*sj;v2h*uJQb0&^9#x=<%#5yqwRQglCRTyKomHVovihrNN2iXsS&LM?4whjcgcFY*ueI2xUb1(b$6 z$>Q5n*KO^iy6$j|ZjMDJZ@i>du1D1_Ni*hu%U3v&s&rU<{pvwTErDzb(DCaWR#yGjL8_c7G+@ zoAhqI9B~5tT7z%ab^6 znwj5>k(J{2ZDL+NsWwlbUS1Ir=}RTW@vcC)zI+_;e3dW`ps35_7CHBpQ|;!%d!u7V z1J*;);I5Vo-LL#CW`&^|YyhqCNJzfhAE)ff{X3?wG!IRX=^k@i^eTtFu`%7H+KJfw zLGzOnsaIax&T})JN|!f=i%q*9I&9$=T&se1uP5=NoSj7e@VWjdjLH;;`B{zb_EOr7 zD=?9RYjXJ+tM?R3^d6~w$!~bX;;JR$BTg+4D`$eb!;o{?0nfej6Khi>CHTV6E(i z*ZOVxtAQ-RTo3g3(oGA(k8gBmD72qA@!(3S732ZP%J?h%pZ&ghs@fDDOO1}GXE4m3 zZ$CL^O?^t<&QDbwGg2=3(f?eDW1T$`FQ0w7zP{}5uwFLII!)lF&kw>jBs2w{ z&|z%zPg{9~qJh$|&HTnW@1p*=qGF=u@5WOJnur)4h`;Guto59sO(1Ia?fb9ZYt5J! z#gTD=7UxT~-;#sG0z{3ga2?B4=>kLg;~JZVn| zF%eXcz*`qng@NLw(X;Ln&fFo$+Q*B6w5fo?R{R!}oBqc;=;z_#^kWcAUY`^Zggn=< zzvv^WpYJ(?l}ROvDRgXBCpfw8nO%+^@HOwE+X-Az01YvTN@>(HEWD_>6!+9qsO z{ko?)s_cuvfUTM1Yt9`QC?IjdK$*+woyvU6j1NdDp(8w!gH_x{q}2~olR)mNK&ueB zQeQ=x`^sZbc5M49l#DxzX1Dfkwwi@0jd^tj&J!3GF-_f_y^%MLz;!UBX+KqwB9i$D zQO+pyZ5fEFPi2&zI&3!Ldih!BYk#MFvl^>nTcC*zhRH;EBHtily%6TGF0U}0Z3QQY zAk-eyZylc$Zk`B5Ay7ywXs5>TJY~h=a*e+M3_D*tQ8G&|>J##d^n2|9;`X3r-KI_P z4H;gZ7$385P+O7ANYnzd&f_x0_kj|ZnACx(Y$qcRhrX!6F_a-)JYHMGRyl!oUERxT z*YKmjinmO2OlTd^B1RO+{AEO(OS5X7NU=$oi3&9-Gj{8%f0$c+;4P#gr!0izO&c5I z8q}S%kUd;?_AHb1^!HGpM0?BjrL~EEY(YcgrP)VTeU;=_IxG0?an;y)eEqAI!u@J? zN%N7Upn7~iv3|YOP0zw?tL7Ih+R?OPO!qete_cMP&*S8FiORhb>4&L%ze`9mnMPRsOco|h}@VAY^nrhx$4a{-o z?erXoX&1pb&vai&)Kqnr45Op3i&0uGK4%&g(kyug1)gSDTxr(3r`*UfO!YjpZm-GS z8va>KI0h@4a|MpwtX~%jK|ai^K13Cr8BKMOxfFM4`q+>Bv%TyGjq6CPHBqbv*zd&5J!iBzIcQhU<&u=d8H3srf z6P$R^{|zMb4kTKm=;(Jicj)tSQdAj&*AX$=TS0+5ZM#JmhrCT5((DU8XLAun=Prd- zOe8wj^M!Q=SK;oh_`KLgIz_KCuyp_YQI#}&A^o6Z}rT2B%$C~TplyQkc}5f z#a9*=Nm+$QfKUkFlcUdH|LGB>HXLlaFoq&~9<COqzC7kPYMvd( zB4^Wb*13UEhQ_Ud&izktV5U{j3BT=4@?`_IY)#2Ookc=8>w9b${>$S1goK(cG}ljf zL<@36E#WfXZjx*+-l?tSL(Z$+a{dvBqU80`9&(B7=}%o#Opi-()+n(ENJfskDL+oe zu^EdKR0y{nfrN+;835dd&MV8 zya-L{D~f```ULHyPgNrFY+QEda129EhCV@Bq@9kk0)%i#-Nk%je(Jm@E+ise3854UFiFq!&-+7~Lvq`L1Sei#n?YE^JK0Flh%X7z zzcn%gu+c7}qpgkx^Ac11_D^2-3|h2hHaC=Mjj4vbJXOY%BH&vO>92EAU(^fb2CK3D zIktFwI7VN$s%=W>wJA5>|CS4Y*-nRuxWNrVw8YM^B2#(wfRyl?_hzts9h4=TvKUg9j%dsFZf{V$BY{{?JeX?yCYkq7zIq^B|03$PQbz@qQ51njW3j1 zcTO&eF{sS8E7HT`R*6dLCLPJ0fz<^G=k(mk$m)!i$+HRVY5FOpSB3RM+!5El8ms!hi?8Ju z+X9|jM=l5J4{S?-_K$D zYB9VuCQkB1m%H`3eNN&7eOb{$7fdau!XFD8L9m9$!W~1&3$?d(j4wS)VLWU+iun*X z#Z<`5iYw}g?BP6?I7+?ij#vJHt?ivNlmd2G3A{Sp!~XDHX>X`VqSK+BfKZY)AeUbI z(0=qsXbIn@xeA{Wrg*cx)Zr2o*F@MZXB->9YQs9yA96VxQ$lyJP6s7<*K2g6&5^L7 z6}4Z6O#v9(u0t(Hi7ugX47>U#kG&2Z6{d-e4%3!#TU}g+g(+Qv$v0yI$L3G~q;hw} z%#E3_kY6zF(3=ocGg5`ePK0pB8S$!a>N`azrzc7Q|`o>{E*W} zsmPZXnd7f%@)f=LaD0H=bZuax?rE*^a_aLAbFtTAi~OQ0pt$%(=y%TqvWjFvkIHdcyDU$bfbwQrf`FA zhVZe&K7VE8+cBD1h0>}Vr{?lvLDi0`rC|5Y%z>gWo9+a4MdRho!Rz&TYc1=y{1*cX zf^N*K{+BKm^PfsQ|2ocE(Wy5u*dQ=m)^L|`n6mTNGr)UIrA?Xdui!Pdx2OL_3VJ00 zSVl9_V!2Rt?e+7Mj=+q@El~?!%ul`6m}ie-{elHz(nEMk4FYD)N|xBd1>cndf3XbE zZ<15yU9x!z2afsnoI~wh8-+e!bUlPLTM=xUBq}L?k+_PunnNRIX!(lFM|TGaVX3wD zHhz<~6Mf|{hsn>>@!OEj!d~0xO>#+d?Y2SPlgSdr^z#XnPxJlGrZCi?*H7vqpatj$ z@7A14dNZPRl@+aBbqx`vPZ~S_QZ4s9j%D!e&xl3N{T>D6x6ds%sHM2z>aeFPYa}c^ zG=qEy-^~TqI9;E;&7^hI1_tAK)!pL)MNY7Cu=r6tX7}ripsk-=c+y4htM^JYtSl<{ z82d+!7T^lk#D?|3Eucul?$<>{C_kCLKni>4GpH^>Xle(=kP^Gay^8O(k@j4+G+!4<$PLM6iiO|j_2Gs&|?nppFL2J0Knq~?%lDQN!h6c!>mcQ0n<2(DkyW0kQkpAV&kN9|Utz~Z z0K`hTR9422&J~gMlR@M~?N%2xBPwb9rpK-gWrd|<`{goHv@LAoqd zps>NusO&1S(Xj*dBbm{aF8A?k;fg@R2&DUAPTx+(I_uXOgkLG%Vrt+{iQNu(5hjHiv-9##Ex~ap$(h=^zkvegTLf+U;*!DDN zx+KzcPo4-DEKFjuS}3k7e_b00Y{v?PYw_f_8L8Z`(d?@bI!qt_)xkZz7Q#EPB9@uc ze#f*g@|vhwN&{vs};icTvG1evI+VGO{_IfmaI_aqlI6Pn$*?CXUfNp*y z)=@k~!AX1^d>jLWz*BbPpSc-Z6e1TWzgBWH z^;kDt3Hx0ALGZ_R6JL!|mYS{y>k>8+iijA zT#Hrqo~u-vsMP0t_X?+5nUz>-s&?wXV~#-S`(K0)a%gJcW`~qihg3@f0ZNT`c&Sr4 zDX|ISVZ(DsffL0Eax6CTB$`zS4xua0F1#@?<~eipeF{-CUHWr|9jIT2&v{8a|DG3- zGILeiRoK~>dxTHQD(+=6R>Ghh@ZV?!?8p2OQoSE_R(?4&`%@?14=Xr+p^{jM2`d?3RvB&H4H9&Jl# zX6U5JUkxW=$TEE?xr}LcAXjsFA-j$6fT_FVnc)p#EY78kfTQ>p*hw+PPT5>-+CX7< z5-Fq(xchvxpmju>%`h?t`+(GpE6?7c2VLIBlZ%XH%M|1uN5_o!sSHo;Db^(=yv}dr ztgNpm@jNdR2{I09d+J+I;pJ#uo{dj_FBMA=0VPO3u)@86z;dnhc$)(*|3U8Sj z%S$4uYAfSwH-11sIm0E|x> z;Ls1s>BFZ_Rn{z2juH~}Q|T0OOzc{|LnuDlCfA_-C&>MdL5bKgZ;JICF%?b56guKv z0ST>b&)Rq+wF04i-`jCkJiRZ6ET@t~?~gM0q?p{q2;&NEN|b0m#KvLzRhR6v8Y@6j zyo#h|gzkhU(0xpa7Cc)-gSm8mQ3g?>!Umm%ZU}J}#o401;~*Sj4mja5Zi7?WKNk*! z(*E3BqBFS6&v~spdrIA+F8dDMjI)QAa_I$%3IJb{{+9(t#I(jUgO{fF zfCuYp)3+IZ&6!hWg3OpdXpvNneFZI3EV4LNJ&fad_*w^C_~y5W;e?n5Xrrnz2>$%r ztI?M$8jY=l7oIHd5&yA@xy^@pg% zd?XKUu4s57kF$0ST|p&#^&8JO38NHX1svv}{F}|PFP@kZ*{-ltApd&>_8aN@bdbl* zE#^1L@pco3TT3CYW+PxzlX&^WfHVcoLG~28=DpnUqOu^KDRe z6<(fU;|b9Ul5NA4=dRc}J&9l>N6pGb*nqUl?#3F1e|FGz{cp72mNtJgQJeY26PK=a z!$kD0T2f4`l64)BE%fps$UIIfA*d)W$>w*bmIRQ#{a5Y>a4RG1o9DIrdry50CVi*d zldJy>3!e#&W7V~m4)Y`AB@Zu|mJ%0s6H65@4VEAZ-i)va zy|((N@4hZD_wB#;m%fS@qRjblaTqJizKrJJ?}3NtfkD?;%RRqlX)gRg~jbx=m5G+@Rcvzk@3i-N3t?}<_BixHFo_hCmuVkA3Q%s zWIAMZUSgvb#vvrf{8YzKjAL%3=dTo%cYIHd0WVIx0`O~a{sPbI{qf!?PtfOFmqr1T z*hS5W_aQ|vU(O`x(}YfOD@-V=Rbw#Y2I!FIMM=G#DH!mEOz#P`Q+(MzVxDYr&~k+TF4`slv*pFjN-?*j43-O*RxKp`-rP7 zsq)Hdv546SmPs7cx;!7}2`u`#*Spa$jRY;Dp%_?!F+-5#3dvv1vECWT%Q%0?=qoQO zc(HD)-GTgo$}Wijhz6Xj)349>#-RZMA6^=lCR!AqOiff`0#`VeI<~EgV$m9NN;Xqu ze{2ljeo-JVg{zM(;cnP3AU5!(g^y3>vJO(4+=tR8(h% ztM+fD@*oU=_lvb7I<8)fJnzrh*IZPkcDo^E28F!7E6G(6>FFe1(PE-gOasc$j48Zd zatXQR%q~cBN(=YRcu+E$y|T;DZlO=YQfi2oZ77R7F{160om!ok#9bW8x)PBB&;DXe z3b$momok~<@iLv7gQC(pT*>VyCbI>4tFNC;oa~6Bi_<^$KPgNZP(t$QZlH^Vv=Qye zhi<^-fo@2?{GgK#2Lfaj@s+hp&GElBpge;7(j^g^Y|VpTX`tHfXv(Lh$I&dXNKF^$NvK?)FvA?xSt@HyP4Um?cF$$OJ=$mW-F90Y$VMgoc^w$)nHS5o5swqA%2Rxpfu&P*N_Q!Q<>_k3g@hoQTP2D~JK1;n@G&rI4-2fq^93`H6$J&I*DNDms zaPaKvtn5OTP^=*r-Xu4oszmxCua%BvX`fCd(WDgeY$L~eXyN4fgr9a$ZPf(%70A;Y zv1R4!(kDmPO5QA6THo}~A{KjS%nAJ?E@p+5q9tmFCoPR=HmqJA{0S2kVx$_%GNsK? zw^w0ewAX0S&-jA_-Fq|J9kVeJ=4xN#tM>6y7Bj(O<$2eV%gBzT;5ht<*21mohu_#Q z`~sIEb`q4Fu%xAZvAtKivu+Ep6)on;{l0QY%uKGu(<Cs)h~km{>3yFZvDLtK1U$Mk4rd^}k;*Xkb;m(3tj=A(a67L<_*~ z6!7NDX?9*_GnsI-aZGVea7n3v5+G5$ePw(jkOuBc{l(+j2x&h%+<=40h!*NJP2gxoL;MFfx?g?l_&ofhr&Ib$P@koC5K+E%zP_%;r_jg-M+&)g#T}UO z!QF~CD_d5wer#;?OCev}D+i}A8ZZ0fP>xz()jHbh915WzGr`qh|7?7qOTUpdkJBz< zsr%MUg}@1;AE$&}%`*lse^va2QW*m!HM^Qpk}%E{n0iA|)ao5zz}CUyH@EJilp**l zlfKlxvg|rng?@^Q^QGq#&@Gp!dS{bwt+g81@vq!OYh{~2gY|aG%V{q}NY0RA)p9OL z5*OAGUwKr}S2v^H#IL!{dmF&zQ_3*4H4aOu-y`~XcZ^2Ee{l`zc7OMeVHc3=_k5ja zi0?H{(=E5f;+rcpyCCh>%&YNYqH$dv$={IHxC{Hc8c^(JAwHJ zdgQokH_4D%868yr<9gPCG1fM8_{8H*=gm{|+V5WxkHNa|=8SR%M(%O9XFnkdJC*uk z_yczO)DybcJ^rYoA8|77JLRc};gR&Gz@5aLweGkM4@^7Zv8=vsG>KyIRod&-LU>)B z;`~FJaK~7Nmls1iYXKoD-yvU`_gG6Cq4rN3i#Q;n3aC!b5Shqv<&ee+>$g00#=lKS z6en^e0eJhh>5x#h=9&?{-10(cs|d1xVV5a9R-2&!)z4?h*_uij(r!1s#@I~dM>mjh<({@l4l;|e z(j4OVy3hYxxhCLqVSMUNTdH;$6*3fkEIVJk%SWUtTlhednG;?WPOtl=J9GC*o+QUA zJ9&~zt+YMs#Bz+t>(Hr{Yj+p>D*$7jSjjv3{Q*m!T@#Pl(JKM_0ipGU==(4rG>W>!R{2ehmAJmfd1K78Ac;HTbtVqg+fgO9Hvaz z|8$uc-o{F8%EK_d+HMQ|0XENu`Dkuko->n`o0X>U*9eZhyF+O;2-!TPop0_izF}R5 z`KS~IVqF24^rV~iW7l@Ee8{BD9#r5_0ich9E3N5D)kEfA%(zCru3 z;w8wKf+o4hy(fwsaL1And!C*)EW6!?&gjiGUDL6vZZ7yLQ#&i7b7-zN+tl#cvSafXoJypU!{bn>t-yk8?D3pGWXGWXKL+BX z@>-L?oFdcEqKU~QKMK3X`&KU{f>B>^0N>-;0}D9~|KF7CbY9V* z_q7nU&8r6+L5g9`d^FyVZK^wRAs*js=wXD+g2+J;h10IY9Xy;Lug<`YK)J4F$F>?{^8 ze(eWrNr<(O^II~Tj|=z{7w2?EnQNe(p7vJ;o&(RHLvCp}%g!X)vjhn}GPd@ee}I1K zojOQPp2GFbIHO#K(0MHo>hO=QUxH9^2Do|$_+8BS^1TkBcWeY%TYZ^ZMpfsz!V%rc zLrw3Ue|`V+1%sd7*_b%+><^MWAJo3ADre>;iFw6Ei+&BVT;?(sdJ=zOy}}hs559#% zR#zhu8g~O?RDGt>t=y#a`he@lC8iLW%hT5;m$Td&%r@vb(Fr3WM(fd>^&b+LCntxGnShz{l}4mF$`J0q(d$p%M@dXkhcC7 zfU7{a=KhMJHbLg?Skv0Ih1$o_lDb!O`^>nyg>z~(9~xOb7tcycUK~obH&W=x_4V>xqC0@3K+Dk3x<_X#T*-?gBPPq2JPE_$5N8vwh}vrG zmX{ZD!*ewaW^R)*NktZ(aQAHvdd|lDQ~!JcaY|&+981O5IlICjGc$^NJJGMg6MH|n zc8Azp3JXeYtA`lZp^c#m<9gGEQI8cf%oKs$_{Np_dPD7EVb{rJ7^nQCfP#|qXukJj zlDEvvfWqGGhp8lwX_qS>F z+N@;Pj0;%lHByO^+EMvnI4EM;9j&nMkvlJX`VD36sP!{^h?Tn*ArPYgfu&ES6bd{{ z=!h2M4OixoA@Q9HNP=)02!I-Xqe71NL(BWx(m zR&3{uB`^Ant`BFm#6Ms4tl$N!aW2%p$H&@szMOD&fgWD;AepLB6niHaiBCZqZTT(V zyEKdEy-wwaklr>|AKnVf@kq@MNMf~`5w>CUWzD%D!Ho$$|J5L~AeMT#ulayutnsF; za{IPzn-ve3+=j7&f|8kBuL~kR2j5|~32gz{ExSF3d=ZI~TnRB!BX~+1Vx7Qq++(WU zDc*Nv&#|6%h!&Szp4Ec{6a@wfc4Rb-k4~I7!Wg$o1M(qvBNzu(i?y;~+z7noLSV9S zuExY5?3!b85xzV8BVFz|q6^4^TAF?ct$-dbSH$Q7*eSZ@nBjTSY{Ko|JW!F=0-q5fQirHdy!|SNZC~kl68U;q z*$=7FdTyKG+{GCN;S5uG)MH&(qZMs|3{h+)76{elSU)CDLrCE!(s-nPG0wI0M z8?V(9{kB&~kfF<{V4&Osa4LG8cNdL>oO;y?K zv}qFx=Yn>SkBo;`8r-5YvhWX$9aHF4q86_shU!p5Y3)l@(x2596o9@^h#@&L)G~3~ zwYV}01YX7NFV)GzJSB73@N^K8ODw%QL#)H(Pn)>)yHN0QG zpQkt~DkZ$KGV*d07i>cwVTVp;hT)Nr{31JyI;Ij^ugTD^)8*iy9kxu{AMYpn97 zFuw~Rr2h%DN_buRp|6S#^s}XUhXbKkL0b_%W>QR+ZcG3syk>uMR z8FGK(7k_sTQjB|Ez8o6dW^8qWb8Vq|H$Yjo*m%(hW+@%Ko8OYB4-d|~3$>D%dePTT z*%Ni0_D>p|QYylN{L03k^bG%9A?bwCKKZ{CYzIq5NXc^@s9nsI{V<`^-j=}_43IS# z(W6`*7u^v4*K8+$I~OJ&eP1Cy&VOmt;vQigf!`@JfqnS}-?Qlf*xA{}3|q&N5{h`2 zER2E;qzD95=Y@UC&UPZ>aCUKr<{ZIP1Gtl&O{@=3!F!eKA3Aib<;zL42C5K*j>tja zrczNq`u17mDCPH2_Kky^>%p40H~R)OkFcJ38(;W7R0f%8487iQq(P$WqAYC*54Hv& z1}?Hr7wBLx+V0i_MGA#cYsKYHm18drn3go2LkI_*@}fVvc5DWlGb=t zAs*J~ANB(fDjWO2%JLR%Xz`Ke@g(aQNuyr;(6jtd2>xPr^SWo-q1l9X)I>yUY!?j5 z(~(R~Mu3yqFaRMjD-_SVMAJFTkp^6IDMduje#@)uPhNxZnDBs~xPTBgK2$vbkQa(S z;`gICJClaz5o1V2jkROx0Z50;V2Is)+ZB9Du_cCb^_?V0t8F*8cgo#3npW=88mzz^75{KJGsIu@allzyQWYUAOb*n{b?)D@4rrnK&o8sUH@jH0 z*`aE;X`Dw~8@Uq;5T7b{nu=<2ZQSp5xC#qUxJnm|wuw#~;8EUxQ8!bY&dK+T?wLhE8U~dqSi5c2^T4L(LA% z9A;B^`1(>UC!h1^iYyg2WKmMV{UqMEb#-wsrRAzjQu$`k&xf?fIGsdIDUfUOQ$%~S z%^n$hQRkxVxk}`GfMC>^Xs`eH6j9U^hq(*z zKrC1P4MF=tt{t4s5^#l(G&2QNXma=~dC>jgn5`Awl!?Zz8H zz5|(8;ZK^IZen3S{M|~EtFF9jlpXYui1^)dbh-cQ)^U(3ld>*bUUgf5XO8nK^AskL z{OGF9>Y)^qhND_zesL4PwOtZmQyT_}D6x-77uviEbeNuk7a76&rK_CeT+ecG^1 zVYZ{4C!E&Psx4h&^Pubs^Rd6KmyWzp>T++aK{)u^NG?mGD9u0oblvm!3M8`nthL)q z`KB%YGG8Dx5{C3Ef4qH@1XKNg;q!n0Hl6GQ?*844T>HC~vTpiXDR|;c(s%BOQQ0~l z9U)PBXXR6kv&+24d`HpYtoqr(2ri>D=fAP;I)ldUZIvO-xp(3}U#jWmJTo8mz~5{l z#^tuRx72NK;!C%ywHO}$SzeLzHvNOupFOQfD?dO_?9SZ$Uih1Q221uyUO{bT{1Gw1TpIH_T~ivK(F;>8)~1TH6k=hJ}mE3C?MWm1aKPXZ{NppHtv zoTkg4x$(cJ|I4Ijd2{9rnC;&)XWCE8$PSiadt)VYS~#Nc>HQDc;a5H;C*%GHe?Wl0 zp_IviPg7+LqHRa0dPbX5)OvtDAU#HggFpZc0000000000000Bj00Yz$RFMggAjvTe z38o`VBAyYUsy|Ir)b^;;C!`rP0g;es8fe5C0ie(T000000001F00vBfN<=~d0W<{D zCV&K3B?4g?NPr|@mXQfr2uT7;5=Eh9XrKt1q9O_i zkdY)RlBpq?Ng$;BCC7=4s>1=VGB14tjMQIbuz@X)R)D&j;L3WM`;I1(Q`$SlO`jY zq~<_!QC1PUM;ItLg(rQ;5L>BEC6yxLMI5IIP&l}Zu?jd)PA3$gIN+tlQsEpTMBw5Z zs@jxF)S51{UEvfTl0bR&8jgs2gVn>o$H-J? zkaQQZ?7f1jW+Ihn+h)j%>h$$sT$>4m*eM^P1vtFRhE$cygwy1c`LTnqans?*aycJx zcthmwd>#!Z4J*Tg7D11<7d>YW)}mkhBpbnO5G7%r%O&U~VR{Vyll24k zS7Um*G@g>5L+`PVzf;$mrKb3K`>juIFh*aXz-FJr@7jy`o`8EoK2zmbflmg1R)^A` zB3v|4D3n7-+x$&7iL^wO3;2)*km5<8uzL=A5ygyh;k$M3UK7JXMhUzZj{2gQ$;!o(l4X>fBKr-n9mO}iZnP+X_` zDeb=*9~Jwb-80WTlRo9F)?_9N!QkJ6y{W~Hm>qHxJ2h3AEif2BGC~QcB(;7RwjwY` zIg3tpn`bvR{t#$LOaqltgt{6MOhGaJXYc=C`#D1)fe33IN3EjaGw4FUtmrLdwk%k^ zg9^|)*^u%`ee?z=yAOi*3jOq)2y*55=#78@-G~{Eex4eu<_`X?PJZCQw?Ex zvR*kamCphrU+6Pg|D%$&~twmE^<|Y?S&J| zQ=`EnWLptu1TX}p!IYvIfZWJR7B|Z`;mLUVcvb2Aw~%-u zv3cd9#9kPXTE0-~5Rjxo#}jq~*q;&gY;1H-5Fz3~A=ws)LL9{4a$zplIvAorNDLs1 zkdDk{?1J54_e-_}Qd3J}K9ThZ{Qo)eGW;K3%aYr0u#>Zho@rsnvjfGG;e+MLte-c8 z?_TSRypFUm*^v%d2a&h~<6VUQjU)52GWmi;U!cS)OA16VKOc2$8X{nbD1spgk|8ok zI3>g(fP@%;ZGptDVPY}JQzXI%qeX>HG@FJhW`$ZrH(>a7mB|EFT^ukM~$3M zkjo|Il9(luY^(-%nJC57X3CynN>cGL`z zK?s#B5)N$^tP-EDo~!nR)zHG*TCp9cjFN}<%jB^mW3_6CJ5hWb9A+WRV-}kP5Jm5d zTGe8>qN*YC#K{U&&Y-kljvP&m6Mipy9-wwPNi=yg-p%4THYK!NsI&zQ(rO~f z=bi__iHzf;M+>+*&pEc`!&j@%0*47djSPf2yqTo2Fk!I4y&VX$ixsNW^ETD(2zlr%O&8Z3K=9MWig8dhRJIiN(Sjc6H_?VK>?N~9l^2)AS^f} zhHCKI@iQcm1Q>$RFpjK*%lKt2ixTDjAp^9%(Jg4aL@cyeqR2?G zB#?!LxMMgnP7L~X6o?H0k|iagCO%h?Si`egudpb~r!? zb&neR-wO5YHN;iyo3zPN=ifU@Zuce7^4#? zNJAq_AtN+El(GfyhBAO?6ecF1A!exXS`tZGmWCLKhKh=~L?oF2kRpO531KEmJUase zN)i%4#8NOvNx|UhA!md_#33v!$V?>35F=6$1QR5UCxRU%<8y(?4pK5h0SQdR1c1p5Y;rHF9<^t?Luov;sEHF%dHWxnPrj)fSHB~C6ZMl3So$tWE;h%0x3Lf zoF^p8lMv5iVldEzRZ>(WGQlJp7^xYzGMYj-8f;@FCN>>Lv4D+;CrbBcny*>W``S{@TfFX zD-!eP;=-SyoiCq7Jh-kon5y#0C>}id+(aAJ0M|M$T)v^m z1&}gD>YS#T$U#suBs1IDuU-#pIbz3FxX8VD%tvMw&II(GBK8ErLU~0$Gav`Y1MG@I zvKRvL&CR)sGk3O-5=xpJ2#u7+xvf>u>({PZ zTIc7CPK)gvCJ=#mNc=>f2{R-^)?>H~!UM#TWjG$Y;ISo}Sp6OYmfvT{_0!7cUW`6WRhno# zF9?WY0gZ%8k``*aD|S=jXV8)+NH~9Y`(}2R67Rmox|vt+F+1&=UbA;v5!aB$jH5W=U(Q!T=*NI7(H?*Q4hjDdAJH0B8a8 z=I~kY@HF~(6Nft3%uH7kgl@4pjEgxnTXSf%YS-=FsXOL6csgM_&Y9vd>r|kqVj?ok zGZtZ)FQWEUbeNH#Aik9Mq-i9AbCx0sEET&2izvoZEK}~!y#8bF_&(+b_$OEJKK{<- zB=nT&D5vlC+d}~h5hS@}nt!B3XLa)K#*XO7BATSPYCE-=D*8rcCKIWF8FdRh0>Pq( zxPdDY(hC32Hpl3lsTcuBki!KmBcybSQc@EV6Bvrv)yyW4t7E<=*>kL)K(&M}7l}*7 z(vXNZApm?Ki?5Z{w?}*JwD4md3}YDN{O{X#ZRB}6yIQxT-jljrc#HDo@1p!mXgvx? z>ncfe*Pmk>0uCJ+cb;Z=@b%3M)eF7i z{$%_cp44KVhrr$7oJ_{njOfHiXD1$!h#-WSNRnW|IEV;4!-#Qf zu+D3NCmM)JBd~U^^xemJI^k-b88}^TlXkHtH#43QWQZ7n(HX|v6M*ZJ$UxK025|&L zLT-tL4oheT+e=#hik@Vr!~{r=@mP40ypf8A7>Xf|mNiQ1fYXG$ zSWcuy6A02|cOl>zOW=jOt1IyyKQZ?}7iNn$vY5t;KbYcVleYb0=& zMWG+BIB^Sq>~@*oxFQU=~OiweMQSeu&+$AcI>S%^L}_5K6v&IaO^&<+!r7;aUTDa{Y|J`p+fCw>9<<`GzE){j0 z#;U2ntPnuMh^ z^KsWlv9H6!wR!6HF-3XhGYZVVjLE-m*nY>oyE_8p2EOkuayt&z#zuyO85z~}DJGs^ zlJlvZ&ubH0D+wQ67=BNlFySNax~GKW%NuCmY$OaJhDkMOBoQzq(TZ7BX3`9kzx|j zHfZw5P1#lnF~zy zVB%Y*n1(p2WH&Z9Cge0NYNh%UXwoud$;P#g7^bSWj8`bQaKwfv-L<(vrub=&ZJQ9? zVKQVHiIiap%o$;n`b2yP2LsAu@xL?mQ}Vai+^BP_VI;7TxLZ|ukppL&fs3q)S!6o_ zl8!M0$Rq8;es@dJvPKwy2qGA_Z^YTMx~ltqqxgrQdk8)FOo0nQn*}oxvJ1j^FtH)R zP!c4$zr;K(&2!ZwM#Uevp4t5>prbHEjX;D z%SG**$pvEdhx2O`Ta0mKZX2v;sPXCh9ne@U`$HK zFa-xL2?NO-rV|DkW>d%HM>r;hc2^TLV2FUhC$chhj&QP`d@0d(!mShuBLM=-3o(ih zNIsO$wsZQ$ve`Szz)3#Tgp`QFl@Y-R#EB6BY%)IT;&_MDkp+R zsaJG0IEiW%?pUn1*Vh5mApY;vr5LOBex^;#7NXpH*H? zu2lyQ3Ehu3zsj5Cj3_^pO`TmyQ{>>(9NQeeV)X$Kq{%Liuj<$j-Ysw`VPQ7pg>3FG zZJob(hQW*0uxl6503T$5Zd3V9crtv;>zgz{s6$YQ6xAqv1SF&kLkvXBh$IpSLkWm+ zC1^!(GEg!SLPQd*$v{a0CX^FM(jn;4P#lptjDWfk$Ji|ghdG&ee^SOwixY4dvUF@K4ND@f_9fM1c~pND)B-u`CQCLkloOKtM#KvINS?%>a}%i3AKm5X2D#N>ZT^ z6hkEe46MU5Gce37NYqpj5dbt$#DLT!sD|1MVHH%wkt(VMAxNo6p-3o1h|&to0!b>d zEXt@cAufUbXvD{KK~X9S!%oo)aVV z<&+UXWU`nfG9H2kLnciNP#If5rrE0#W<=~~UPBzV-POGu^O@kOly^qU9z=%d|7zBX z6!$-&B)SY4`Mq704k_q7~1jdzZ306REP8>Xq5aB@(7jiw8n+Z@$@VM{UvA`e8J;aJSx2@!nou5 z7xdR?v>$R0i0ny5RmXqk`xcv@&p$o(LNhXFN0Ld&VzAr;Z)Gh?WD{LkD74LpDiM(@ z6zcsKwqhb)ts-QHFKAbVU0m-`i!O(v>MsJs_Y<90YIXf0^jAZWu9f8N9YbNxPD#C_ z%i6Uj^s-Kg*`)4HS{lfHj>x_+jzKEqqn}$dgdBT=HX$6w)b1SEm=bY5RL)VH5 zj?OMq269-jCS)=!mXQn+ct-Bjz2L3ASfap}R>;#~r0v}E86d@oc_Sxez!bPF7dj3N z5@1Z_T%4CSCJWf@1?bI<7SC77qp(663l^tJ$y!Y(QsA7^f^tr=$Suu>gt(Uy*l0Wa zI-M$X$r#BQ-m_)jPLCsDhNmoJA4Sh^7gj+2c@BuDMI1;$+Q=5~J)@`3M}FJSGpROg zC@J#?M;1VWH9M^YXy)Y@oJDAyp5bp<+-LfiK+g89*Pe)3E}iad?v>GV6Ow-%@B}IQ z8ZNF;gf-rSv2(JkfDW(QlYFKF1PKCa5X8{?99VL94`UuSY3}jgECEOn z1W&M7M~PDkNL;EU`4uODI=_QMVwCJZfRY8{Nyh%E>@Vn`zZck^I5<}7u0Dsqa z4k;V@tO8;VK7I{ZJ07np+=j^?AHNy$C$`|eC?)xZ`0OVqs|kU0 zc#0A<{a~?5#0#)?tQPfLfxkt*mhe2c58Ce5c%HY|-@87JIy^W#vJZ`ilPdk0VZ2q{ z2q~CO=?XJ!(gxu51fyfMB2W;l2@3gP$pNSYu#vBINx{}3GD-0^)NK~>Xl|60X^^nQ<32+V!SOWoLmGyu$ zxY@zH`9HzeU=B-~Rd%Y(i+&|0Z=wRhqU)}LGnk>FP=0ec?m!mP&yzxavX<6 z(z%J4_?UMbJh>CwGGxk}n|@t9+#b%knxk6b(TKEZ#N6?5%Q2A`vbP}`Ar6P3qQhh* zSYaIr(w-y<=Wi;igX^wOn z*BD}Lu6S=_l3GfskcOtkRD)FOAE%mvzV$nq?z%(V=(}{oswG~3Ee6kd#%dtyu zA@_%7Y(aiL@=PaHR`1{pJ*$=pe0ir1Huy6_#N!V^l~=S!$TRPFk8{kGy}&gFb2S0} z1p2(T2Hf+T`7dTj1_&mI#~)($y~!uR>ACqq;V`+dSFjdbEOfPNDrs)NFS5vXOrG@p z-@77oeL7-as+v>xRQjpG$ZtKslt_=s^YRIAV!iwajhhc+B!-XPBn?K4nNg#+W>9R_ zOiW`VERLQgO+7|O#Od#Hc~Rglp>j6o-QDmGyLyV6}fy%OzDLpf4pH3~hB_PM^RzRuXjH)93Q!2bPznyVc6 zn4XRBa()_!&>8Ld8V=|Xd~qk{KAyf6$-tOS$CgW2k_m}BAbci@`a#7_dlEcuV!lE6 z9P}_Db7FFD-0XH4m>{puMIMWHEH)aDk&l8#L4nu>VoMf286zZQqQ_S{*b=@yyo+DS z{Z~iH?D+5yRWqG&)N03XaJQcK9G@w*wXJ z)uAE!Kt0oTq7Nm+uLrZ!O5r=+TbFV69=O{hC6$ho6V%Ch%0(jzd(Ukuc%J~6N5mRC z60kxtq$Y#B*kD9~OG&{UMbwP01&u4pyUDs!BtV@RBrL2fGQ1L9mv;IH@~M-O3o-P( zzoTvlOs0==7u<*ivmKhC`43`fX(sPyk@rXTrg$PvluvG@8j0R>cg8d zFd871WWD9rPm6V~L2`OgIb$X><20}5ir$RLp}BnTXNOW+dE#2$E> z+~eGw?LJ(d@3^TjLE#$<)j*sYpMzll@C9J;1v4$+{10Klg?LWiF+3Iw7&;#l+`9c? zr6as3Vh9&|*7M=y${ahBU9651VDY9aIJLvk@Pda6k~cI3ndq2<_n@Buy3*ky&XjXhUQn zgGX!$-rNSm^+!fd+lYv&^g>5z9%EhnVBdp5_!{GegtpBj;gSfxH-!QuB23d1mYCQF0zLGF@tc*DX+fg&RC zE|Li$fJkUaFkw9w#mqwe)X9VKG|5DvfN(-wlYDY=I2PfsBuEl@ktj;^IHaTGXfjk; zGNAxKldvT_oudoMlg{=f&p>?7fcP*bFNEpGGpw0Ts@cSv$5(B!o!9e899+&Lp17B1eQ2}(RJP(^yk zOpb^f!i{6*AAe%P)LNiP6X|X#Oo{3qNFoRAgZ9WaR2DoO8TyGHQK_f&}a__=y~^qp3Nn4F*e^C+(&P2j+GS5&Axt6J(%X1o*WHBob~8A`%nL z31l~7zz}jUe2fCj3*6>AoEE<`$drr;5}_rLgx6TTlF=Ywfl%xcnzN`}<=9(yZ`KX2 z)XQ?r7@Lf3WSE)YnRQnB>st#&?Bc5Dyeux`Gtuy^f>G~cgUKd}yaA)|KEr!0;|3J+ z6dG&ZNq({?v|ZO3MvSVvpSZ_D;p1&N+l-fKlXPbB!&KhO4rH~5fKDLd6l_wI!vV-2w-#t(!*r#eT`Ag70rJ-t`Jz>unXid zd}#<0M1UW|pBUJ`3u2FBJgZsph~T4@i7=*w@V7KySR~cLn~uU|u|%I0&}{LAGY3jQ-$z1J@RgA&lPr=Y z(u#oCeLO@&L`3`}p-r0D3S<9QGjk&lAo+xx_jJ$t*k#M$+g9qXQS7vxbt&R6AJdc*|(Se^b9Kqfr+dfsX0KQJB75SMicrafq9nWbq z$tsx17K5rt{b~pJ`1b(jPE{lZ>Xbl08Y8{;!mHs~6M1aA<=ZYraKX?X9C>e{V)R-I zupKEq-R|ji4^>BVO2$0%DcsYkI~AOhw?>Lx{oPW^!7^mJ>}wiWX^Xd}k1T_d#m+Aa zqe*ZG6Pgk!I4oI&a}vK^(-F*e5(43|83F{dz?~VM$+$;KM)=yi3kbkE{$lvce%r2T zcHWyk{p&Zl4?3L}m3j<(Zf}S))tJu7jXk?vn$-4Xysy83;Yi7EXphP8?HGF=*;npp zlW+%k!~zTSBfd|ky^KV99}pj$|j%Bee&V=Bz1af4! zAA7%0{NDm82B&Q11kAene7U}GQ0yhEUNgo()(b@#lq7fK&spJ zN9+`IXa|p>msmbJlO@Jap#VEF%2D8gfTO}N_@t2QB!wn(5jweeD3VYlfMJ|4B@Hdf zVhY}6>{XmD6r-(1aIx@agsewlJrAQcx$6B|hl(G+l7L(vt-sc7TWph}kO2J(EmTj?Oy_ z1}qni4q%Sa&uu19=ID7{(%3(5nlm=;K_)lBJErE27&6O-4V3YknvgsNi=~3dX9ERX zw&%99YaYfOkZuccnm9s9#Lsf&%ddl7CC+w-8nSU}Ab?(>n5Z}yIDyD`B)Q2uC?q^Z zk3zd%3{BEwyLk@BGNyYP4V%)i3s=<8WD@(u@2I_E_3oYQIsJPik^rqW5ciOg7vw^jLT( zB*}t8gt9p}C|L3`-=QF$&M{A6Re?DOMC65)zNMBX!zAdKI){Cv)X6;Miqc$4)-XGs zZud5^=9x}u!b%3 zCCFxIjsnHf#5N4la-1i7w%A-2VLCcfns#)h$)PiDXJr)-X&nj{1#FT5@)h=0W&KP; zhEdVXyp!g3OPX0P3b~E0!HLN{bsP)GEL;<`d@0_YDSGPdES5{oTbFQiF0MnFZa7v? zumRe*{C=8L^n8!fW4-x2B*IH57ERxt_|b%fV3t%OR$2I=OkE|TOfh2(>CV|$e6q$% z>#il1r4kTda{-?zkPF^9*m<9tI&fz(5$I)*EUNs~TO)L- zIsl{RY@b{;1Rm;|CzajJt)Lm2pP76d{u7k@2{Lz8U^o-Z=h8lVb}o*CPRdqM(lA`N zn};`;zBOZ=i2guNbv!1zo^AZ2g9>#WrS2&!+QM784M56L)eY7tJb0RLp%7dNpob9& zl9J^Fhm)zqnoQ8pw2SR~nLJnv!Q2BO#y#~;J&qHTDcDIl{FZE_1?}3fCt;KD-^<56 zvECf;B!j>wH9!U(ryHBcDzPy(#MJdnnx5qJ^z?aSv@XQ$DKMNT2{(>Ud`(4BK@s1+ zOcy6N*iv>NBp{E>1=QL+8fW!f%4?s?MVF~M0t|3ncVGbZb1~S({A8X^#fkR|X-{D< zZcXr+Sr0_Yz_^J0T<*rifI7|4KWKpOv@!fc%SFq?9AnH-o0EdE7Q#Vrh6ON%ht;eL zaw7_z5$NAHM}F7Mk7ak0A~JA$2gv64Ang1FCXbo<5|i}z9etm_RE_}sBrQZnI4Jn} zfO+@%;{n8@f177}{R7Ac!3Lrqcw=}D0>{2`QR>0y+MCKN!*36$K!&PUJg~~_0-q0I3n3w zCTSAVNiZ#d2nn%5y~~Lz_#@oGihl4O3Ns3n5!-~>a?0GXFDdi#WVT^TmLdttJ{2cX zz#W_7rhd=P_dW-gjh69rW4_Z9&kLeU&% zcRs(mqa>7Ujs^5U4KP3tM+v(hiKAZ%m_YnD4<#B1%qvR$Pe&o3aT%CrCIXC&9v%1a zM2oo=?iNy2$G&nkJKg~V{OZ3RO96$b!&1gC0-IOn(#m;7-Y@GRes1#j-cADjWv%CC zCy_bX&9wB8XV#39GlDQ<3ge%!Qbvf##b5FW&{D`)`OKb%ehQfSy-#HI=hd9`(#EGr zgYh_)l*uWW%v<9;Kmm;yIm&H$N(92dY%PrI1#zFYc zZetA0TX;Mk4Ws=(&#Kl^ml=wO^=XtHE9@}-3F*DNo!#Mg+xxp0vWoK&MHO)=HL4WL zd5}UxibDqRJz_6T%*R@V8mnOT=_|301j28SF$ji8j1`J3!3!mn$#G2KhBrGOo!R?1 z^64)(Pc=663NtH9EwBp6vWX0$-a(F35R?VIVS$S*P=>}5<_8wBAi+rF(SPJ*`hhr) z(|P+h3=<>s<{Y1txB-F(?UCWf_Q^Sefi{eO$;S0_OmgPn{x^jhUiJ5|1&92vq_hd}*R+(5xXlK#*dwo(y*63vr$s zP}^E6z+R@q(s5{EhD;31Gc%GcB>{mYX(A}X&_@bJlu@<5-XioNNkfT2jp#~FlSn2J zwbj}@zjxT3IDJ8Rh32I4S8{Rbz3^4kox9bz_rc%}fcZh7atGrF*nzk_;OW|z)vLm- zwO4#Sr2T;YAbt_rISicqkj~Ymwpp6#wH=9xiIQ?v^d=5>)q0K1&vqBw?DZgo=K*}9 zq;QSa%ZO-A11WRyMnfuP)hxbL&y$}`hsc<52c~$Z91&s*P_;1BP8G7RXe@>!7&=Bj zn2awvk5^8rKEohS%>3FEKLoK=Ev>53mFyXJm=_emD(*~DX)`hzVlgo)e1j0JSqvEZ za-}*RCa-}!YWb@0e?tf6KSW+-=-!_k_h;3gJ$kz;d$bRr8C4BoPh7q4KQ!x4te=qV zPp+9K1jS-pOS+N1OLFnaZ|UBpxqV06c@{#@ao8&c&^5zmFpN74azNaJclbgelr*_L z^e0jDuc3WDIh6By&x&7bTVCDo<~Zfh$7*dK6a0a>ioC%pz{0V>bbk$Cr7iqSe*&Mf z1z{iKAG_yj`LT_OZVpLH2?~8=ntO@)1jy38A1j*-0IV8$|EOtsX9d^N4O;-Zc z{<^}~A^kYtZKYGh0*A>Qhh%n-5WJhmJ+;ZgNn!&o*kOM-K%MZA&90J(1O>eZ;XzyH zI&LnA5#p9bu?IjLCiJ!k@PWXseY+#VV@)A|boTaXy z5DV)e!_mUGP7_~y7nw0}^6S%Qn#<@Nsjfiq2MCgq6rljHP%U7!Ap^L3>I-J6s&FYu zB_LPiSr3&~D!$mof!_R#e(UsprU#KhQEe$qlQ6^(C6*US#I=x+tD#wPM+;RX;-|V_ zv!yw!39@XTPmkX3_bJ=)oTt*5ue|%;U(|BL8XvV+LR=g^)N=f%i@o_?F2}1K9awdBb#-9yY!*&PAc1n5;K>9Q29^Lk zp2U!Q5J3bM4onhcGGNH`NuwrAh65o%(FX^yl8hW4#Gc0ou|adO*x9oofb0|u*MGY z*G8BSc|0(uqq2Un&|A|-M_g_V5&NWj9Zj8@B$M?{1C+ugx34$T??2)NV=kwpKergk* z{BL?Ogb9b@r69-hJ6AoTJWfk^j@zs54oiGjYMx_sa>vTY$6{MYBvTK=r-qqj*wE#M z9tM)(;PgQUdh*Gd+(dY=RTe*YbFwUUIulK=tZ+jxW6DTi`y04y&gj7b#Av1ngAfEy zynZIcp0q|vB$}sJB)=G#{dg=v&CI}=A0`t23g@}bjiYXT$R-V#@Z!)D18^ajTaiI% z(gv7DL$8&ZnM;IJV#Pl-#hz8ulY1RiKEFks)5AH4kI3S%^ceB!@;Oepb;C z*@6wLf{0QYAkhhO#$iaHkhEyRaOOeJ%Qqt?U~PtAz2NL)F&$M@MO6k(kQz=SGv}pQ zisuI~O$;t{WI5zZFrUCl07I+K1_=Xk#tlKAB^owmVbGgO3DoZ+G$mZ$7DnPolit!` z;O|xr?75(E!Iax#!bB6;?v3Z1zeIQVqp2f_*Np*tiM1;qPDAH`>VmhC@AED+CJ#Zu z)=m~zbGY-gz+E#wfQK5rBOo~)t19puAAn^WBjP@NWmBEq6TQBHD#2UcjcPkmKh-Pz zD$>3aqY1)UAD~JzQ}kDZDc-^z)%ozOtDz?7-?ZS`wz|1jQjbdY(PYIh%!HEydrCZv z3=c+4L`AJ}Dt!qiz1J4H>BXWK;g2RcKdH{Ob0%WZ5El7zjS1NtFtO~70&-ELVBMr7 zj~1SB$&8o_7_dYkvM+RToF4kZmeGG9C4{sVqiUM~zeia%LaVO{KSK*}lQ2YwB3*kf zj!2+30cx~Gx->}M04t**lj(jdG?y?)UxilHfYcyQ3an^@0!ph$QfG2+f=n3`CA)Lc zZ;!n%u3nPdzPWSSotHBt<&ESts6uoHd+~n9V>!_jeahf2jE96}$)0Wc{xie#)OGDl zCSRtf?C|DfPqL$LchLMY#d%8+``Ps>VmB<8YzN^_;Vbqg`+)lC@qLntDL(eZA8Q$^ zDVWS=Gk+Ux{%S9SPsa{>e2H8kx5&PZN=Mem@6mf*IlNlMpR(>YP40Ec@%CN6?&zaNUu7jKLE&LIX7GYSkEd zm>I*zkPrk}$ z8n)dHrY42FTq$kwrbAcpJIVd*{-&?u%WX>;EN?wd=egXL+ikgN78O<}S{tSYlf^wr z!8lvkH~nHZ%qo13Q6@~4kG;#6J{l;Zs6&Kcv15>;ian^JkDyUS9d5;o9S3DklTYsc z{qo`;1v?et3mF^&5<(}xdX z)8S24eWCmmz3be*33N+VCX))eCe*a0`b(wK>$7qDWWvu%pUNmiAVLxJujK<~%$qW2 z_oQD;227bUSQtkr_ngT%}%Gn<*)w@DSiEoKno6`jW~dxr-O96h}><&GAre6;yW%6`56i1s=f?N!{ds zN<5=otJ7!kPIg#CdpeuL@5@2jhIPkjDcr(lIk`VR~%?br)~9S0|>C@7GVB%2;l z;Zw?_qh(2-g!GTgHs#_G^cpzoTnphx9U4D!LQIl(HMp_J_g2C9>A$t2s5@}i??&Fy ze&QZ{{Wm*)FuWXdOc^XeBp!`oj)%HFE68}a^%)Nv4*XN_j~lnRR(VH{C>{&*=ibM^ zyngqr8u%p1;IRafNWsoYSxIw5mU>FzaiWv}T0o`0B@31w7BPy*RRqX+E{%of;>5lj zS9J}=@O(8sT&wJRzo+(bGU;dXjH+#v{yrN!Ym?$+2fNayQb@4X#R!(`hCqx)X{2cj zKyd*GmfSN0!yQ16(4+Rzu<(DNj!6D_U|-rKqtLWM}= zF1Xe)i3b>NbAs@^4{{4g0=W1}# zZ~A)3|AVRNA$n;etG%F;~ru6PhdOp1MHky5RaO`d+pifxIaN8ZIWM121&Q3 zzi2e7zw{rBYF{1YwH5oEqF??HsQ>pUhx|mR{iL6eN`w4a|H1i31pT&8;n4_R>pxGC zK11~aN9S`(E7e!^|Bhk1eju(3U&l$W>6|Zn{h4c!uQ5)~?9#5Qg@^ZgKi1_F>#5zQ zbG{E^isRy{H@7g@q}qwb*zg^ zeLwpcglHUZbsZlDGm>u&e>lBg_|b7?qr1DgI)bBD_?YoB^Mr5x1%Edt*OBLUr-*wV z5?kNF^}cs~f*a+08`Gg(9FKExUx_3HvP_dm~e}S*YH2U{2}ywtQ#C7 zwmgtJW_OpHN@g5#_w8B5@!}0`T%JtE}*fS2S^G;$u+CHBQS$A&pVk0rb z+1_~HQFIPT@zz4s@O|^z?)5xz8a2!(&&JC*h+3!eCEtFf+nXFLqp_{ZxP{T@*4-2@ zvA+CsuK(^q^pf^?KiB8eWIK@Po|)icJ%gX?%kJV^@t1BRZX>cu=t;*3Bk;reZ?M0z zr$!v7YnMlMgG*Uye{=sB1EhLnLI;)g`*TG7pR?j2LC3Y`Z8d+R-#jzmG5{@;cwV!L zdtSYF2;m__Bjt5zE;1K(h079)c84T(Vlwx>k1U8gPqp%UZs-HrJm0Ghzi@7hN4=(V z&>WIE8-@ACP=_%RUlkmG^!XhfbEaz%+iP|aB$5&lM$yKPv~zu-9^yNsU`J(->g?7! zPwR92CF-ub0_zrspm9mMZ$3oaRF`Ixe7|?FmPC?VQDzwZdaL@weyLTy`4B(r6#nag z0spM0_0R+^Ib$AKEIxxE>;K8d207gC!|z_q>|;kSj&=|SA(u^m@4*A<|AVy;`I-BV z&TTwSDg3;se>)Wq>D5?@`fra?{eAw0B46i4Oj!c4BOyi@D8jKNSxi<|RR$@FvdI=A zLm4S>r`=EP)agI9-J~z-w9x<9^l5*~;b{*>9tYiWcuM4l2g%JjMWgx04lWKJMv`MN zObDd^I4NPwf9?dKN&bK*L4oASVvmsQkL>T7!YCv-fqRM2q?EF2{5eU7Yyu)lKs<-f zDpHXWyA$VkuRrY>7-0WlV?o2<_pYSim9K4j>-Q111bV1b*z=GjoRB6Ek6B>z^_XIS z$+D0yU{J#b#CXu7l7-^LN)V0#!ww!fhjw9*q<(18{9buHA8|kDIY<7HM~ERgB?$LNyCMFuB;5#X=a$=H3~=s z_StI_+Nh*3(R1v5XpBTg{np6Pd2sFMuK|YN9E($ z%lf%a&FY<<^{QcIb!n6(WL-xkcm*iZR6st0K!%6oFqu#<8CS>ghg=l{z!D&*%~~$4 zt59M_GNm_UYav2ee58W-E(uWIZ+VE|Vf~DL%C~fT+gnd#4j9WA#$;iGCJeCc$sbMM z@qN41ex~A7+Pl3LpY>i)s^)q$>7UZVhq9{1v!8QQ(tPI*$+-8IYP-xw=uf{j2kc?x z4`x^4V$6ufGX)4FXfOssCG|@EW`&*6TWBBJ9xfUzcdv={K zy2hgKV>SKuwE7d>Abyg6S{bFw>R|loL1QKGP*VuF1JXAyMe1*eh=_=YAn)MD!zJ>m zpa{~+l@Lmhh9reaog;K^i%3C@$;D+W0?9LuTwBQ*q{8~yi(6j_R7A?x|w9UOW`d;b~<7V!uzy3t}RNd zaFqNE4IL&@Tztt8>=Pgr7!>eK^9Hdi>QvmV27i^Rw4nanVytCD84)p*4fcK0&5J@y z0!|W9WhtP)v2pk)LdyP9y?7}H0gM@xk_ZCUEi|(#%thi(t+$3&d(6Hx@)W*K1nCE> zx%Vo^gBq;JmU&7}lJra0sAfy=%YKJPd)1QAtXBD;q1@m@XBZPHh72wbBP26=d+M&w zsq9XVMDsjfajB)2Gdx+!mW%K>aNDaor+2rqs=OFe8fr(cB0hzYZCN;jUQZ<1aU89N zxOmd5rZXYaO;4p8eu}%A#Ct+!>dvKcq4Qt2yghEfJ(SUs z&<^X;4>!ii=#lOFMbD5=@;+7l8iMgpd_qA#JFmjpQJFs;Gckju-IDdyWxq7zJ4$+C zCknvjpzX_oi@KdhYu@&LIf#C-3BETg7`A$FFr0*xcncR3a7kVe@JQltS2$J`#nB*w zARZv&unD0|z4n5he_JX|v2^$+5M!*K6}m*qS^B!lt71Z{l{L_>l)?GTAEX!|PLPh~ z>nzJDOJw0Zfu5}XOpkiYC78(=!z&WQ>afFRRwRCu!|@bkr#IFEnLe>s*5zBRJ`JJx zDy%KN&W)JU8+%WdDD?{F9|lLcG_*a1$LTq%f*FsY^8KxRGW$X4RdEImwhYE1{aRI; zvg@^FX`^_|(pXoqlHog5UbfZddSJ*%V}EmG00ayOAC1k3wVT`K1n$x(9Dsjj{wKOEKg{JRm_XL)ufvbKwyWUztHI7RxW$uhbr+^k*q+7dz`~}L zSdvtL&06J(1PYk$?J6Bif!AYPXq;PQqWRkEJHxe2WZhNEdln12%?7fX$z@haSy$XK z0VEs%$dv${XPCW`MYI7zREs>N+gfZSl`M}0LPbBMl=M~>x!_K4<0-6>5$5llI`AhI zh8Y$U9rL+5I`1wzgVH%uOv;#Fdm5;2kCGVkCvNB7{PiQX@=5%&LrV;;GG8?g?g#h< z_7A4|b?4Hj)j60rA5Dkka-@9_#(qy76X8{Her*+6F(mk(t%(n*-fCFLb5F{dEAQJQ z>~5cb`3(I7^76&@v*!DsH>>OLh`X^RnM!vVM0agn#x*f%c**qooye!v?bTmlZWrrvh%GI+ zl1a8ha)enmQU!S+R?7tZh)xN_IMorNa7O5)n*5mROqnuZ ztct9!quF1g{C=O4!_(DDSKh)_3=KT`<&Inis;`+*of%i-URAsmv*e(c$B=d1Q}as| znJ>fQ_hSAY6F5(y{>A%g>`wkt%jEd)?v|h#iNn=$W*LM-B&xF_gsf31GD!rOm}Qb` zm|t>>^q#SB$>%9GL+!fg_xML<0be<&YM+T&JU2$>%N|OSQqM+N6IIYL+yNalglI>7%KR;seQQZf{(kE zB>Ge^g|@6GAVOgv{7>C5CnaB+aFI%QB28GUS{Ku5EerA!v z6umT2e^VFGmH1SjV5SN5zbel*UEYeXm2bn0xm*?374D5Y{#^w9EL~XUbziV#CH&{$ za1cccC7Bh<0eBZW#=+!2`aV-{14g2-U51Wne$3d_9V^PSvhPamd{pCBdw&?eU6;uU zdaL6szQ6#K(40m!cRU%CVq0ZKVp^3LwJIN|7)33cKIkxnLjC_J)0d_`;;pu)RwbR9>@2S7VP;VB5bu@o26*%AnF;c#h=N&E zm8Kw2sl;NI_L)s63`1*Gth$_VA5X63#eA~V>lFGqQq!yjph<*;SV(%V6P)5hc3&zo z$C!te#7xJ=pu-Y@LIAXl3NX~5)s=~6J8+{_OoB{c?s=d&Vn(gjkP>oo%Q2p-Vnc-` zjVyuT9;<>eh%CNcv4+X=;tx7w3^DhPvisSL3XB+XQ~}?RK3`M!zoy%!`mclpB1D+| zUfFJZjF$f%HEF!kEZo)H<@rkjbvGdXT!pWhu{wkbg2G%w?_{^VnjY3&rH6spI;NtB zuEi!jX^X&vK}|H%PfrHL_0!0oLJAuO+t5DJ`W6_mplIx2k z$tIVcSy1#&_!)mU?S6`O_mdWN=W<363JLJgOLq{iNHK#e}7IB7FcFvn8aBRv)=XkK1a0mycK?~ zl;aOoGEbVGG44-9<74&r4k#av9~?^BKJOveIH&;%9d2AebkSTxCEr} zOr{gsNCAdY7#2>34ITwq(r|zQ(&5&amX;cpy6)!6ZY@;OGz6&(0BCe1KtP1BE#$mo zAUH^Q4i#q+5_m@(j~Gsc=K<6hSY8w8sl>t;Gl&zX3=cL>9MX~KMX@X3JA?y*K`ktc z72wLo0Psg4Xhs?cLJ|bzI*5r>V2G9Z6thgI&5c)Ve?Z{Xb}%_%Y;YhV1j1rNLkk5g z(IOgPrkKU$>Z1GVFW>#|O!jyk(J$KfOz`zMC!;jVdH(zEy?q^NFQ?YS@(eEK#j*Cs z~M1_DPn2?B(`%11224rZ>QGj8MFvboVGz>yKk)WZ2 z8PHS)Oee4L`q1;e%s+(my1LHoP;!*zSgXv(%PHjo;CNTpgYkohtLZ~U+-SL#(1c4$ zkpVzSEUb_eq*VgasT>?Hm5y^GpKb@GruA z@5=lS*70rlnEnGAY5HHoZABD*@%!h4+7BuT;q&lxte`)mazAz*{N?A+sJ_HLa*1I` zVfp~E7%*gVRojZUtQ#(FNam~>mJ9N7O53PVIe#)G=ysOnW>m*@EH0|a`;ye3d5GCQ zujCJ4m#}DZ*`d&2$A8-U`O4Qu8Kq})(dkV#K9=X}C1xAb5>2ssb9AOwv1*^8diPDH zB|r_R|@=HosD}o>~MNQdEl`a6`3-rkXOs5 zv+^_eCk(%=Z=c-7D%)*64XAL+A7)dME9gjRJS+jEe8-3d4^=RoJqZlNhY8W6K*(cc zA|n=@K|qvtP}IUP0Y?bf3>tNd7=+Go5St&Q6MX_iP?01^6s!jgLQODI z!bvkRDL}yy6H7%R#T;NpU{Wsyv5NF#^5=2JAr`SxI;RdllboFO#+Gp? zg3=)pg(xsWM|yj}THb7~Gi}BcC`*R*j7l-NR@uG7Sfh*=1rq>5Dn_9GN&Q`rN!l=1q%z|jCG2MmH-Nd@Ml{whRQb`8L zF;9+kzTx?rA<4%jfW?@e#swj$56M*f<_K4{_S7D&X5Gm1Mtr2HkuEw{EV8 z_Zm98iw|R@^J2%0%aGBl<0i~%H0tYhYT6kPmlNk?AYf`s5%Tn3okvRZ>qeOyZ z&6^fLv|HG{az})73_yd&GOG2C)TT0l|G`uGYg1v;OhU^ldN@wbcuwuCZOeV)*nrSwQ1`=4Hnc=K$8`r#O(Z zzKI^OH-I7pUZDn_vUDIVxZzAC7qq4*WGuirgjBf*b`bN0eOyjP)Xd4IldYlV&r7^> zR_t9E*AokEns;Q(nT3Y78>&}dKMl?~YMREfQ!-AgMWuI-7~)-~Cl`lyk=G2w4vZ90B=#c7a>XeM19BAJCAK1YCQ;H| z-Au`qcphtsSGRIZahgmFZ5U9PtD1o)zOI}p-T{dah)*g@;WGK-@2B1-g7^<+j?${n zY19aG5wZaB!f-&ehhSY#F(f8PY+6Ct02Nb3&GBJ8@TsD;;pOGRs@&l@i*D16C3<7i zDVWSGWN%FN7X~lVA<+bmH^+VyQv_LEEAf4rNb>Mzi70@H9$;h0@&FJ%k)BbEiJccl zjFGGfYZ6HzIy6$yj2RgY#pL%Of(S6`(}w}U;Zshg zCY}s2rwn5ZF^ppmiKd-ec4^teP8>Ah!?Oc0BVq_RyhG|n%^A7GVt0IIIx3fTCAdu2 z6xc!rLA@ZtPdDBJR}#Zm1eWg|DK7JF&{ZF6I&bMc} zU3+(m>4hx6Cv@)kJ9aHBxRt!509ydmh|Hw3IYH=au=pxF+t~}wacnyC$WwS zQ);Yz18Ezhh<^9qCV2qRVEO&`bjalxM~y}4NL6ho9i@4+g(|ZP>@m;>gMiWBV)K}K zFiA&j7qFU6%F%_j`bHS-!Qi9uD`W|d`4dF&CmA;=NtBHgNGCL)G0)tfvFa$b0JN&W+g)r-xz-hmMJ{ zoPh)vEG4YkXs0$ICK#?6(ctpuSrfAZq=bk~Oi*XmPHev$crzuQ{)~e zv+)H3tvb(B_qj09q{H~nDP>lTRWay3q}A|zFy|V^WG%CKEgq3E7p|)I$o_=IQz@2i zlAf>|Hp7C-i}V-g2Q4s1bKmjryn-a6ezKok47$UD72`tic5u3tVq2n|%i+-JQ`_{3 z?5B~Jiw?gBQ{9l$9+_i385XieWZU1iw$iLv!$;bFXYD^*+Nt4}xP{vCRq-Uo;j@wb z?t4cx_?tPU=jM%Gtfum|+e)+E|LY`Yx%GE?UCKe7ktnlpNG)iFuk}VAmZq+LjAX(V+^udS(rly3~Hz2?FVtn;I%z) z#p-UQ3&Df<10bJ)!Lc^74w3m%kYFLcAI^A1T@%}->)Gr(-tUx}clv!3?B_w`w8qIV zMl^+ts6vDz3c@b|NiZC#fUL+CPV!_8oPmWf@T%Qj6~8mI=lGrpd;pnT>kg1+T=s;vFX7my)(kx+Dx&fZLbbl}IX>9wLz3%2S z4;hRw$(dpd5D6rsK*~U^IQdMV2MIXG(rbImuOH)Ra&ctP$f)U?_L$Va}% z^0XGZyeainYKZz^Oc^*l;SfUv`%h6dL>T7pvF6aQJwrDOv`A}L5P>2Ml&MxBZX5|% zHbQ$~2E|MQGd3`p65Ak65EPQ$Wn_UZ2p_Z~1X($~(u=m>wYqAoSnR6d3f=DH?optG8CFN5fjgs^5tUaeWN;g> z#9;^)3`59AIc$x@wG(i`3a*j1z(`RD+?hm_h4iCo+OI~f)dyD4bgI1u7aW-V&E2@l zyI?fa$s*m|lZV?rrzfz4;_U1@_VX5{GCvJf#SZmhb31OfF0KGHWSz+x;gwC2$Zn7( z-V@EFODO|AmGnNy#exPj4B<+FNkBQ)i%jkcfldUNDu(OwdA3~`rP6J>GN9;PIqX;o zkuoWf508&zMIeL$wdRkBJ?+KjQpc)IU#9DV)(#5`qXF4yKJL=$thJSU1`MZ1CBWF6 zBg~sDB=h>zCw}}EEfKCIO`UQE6|7uNYVbC7(URd};1QWFWgFbLeVxOX7w;Vj9=bV! ztSY>$M5U z%3_O@G-{Qg*%B@AG*KyPTNJIlnBJ&Ild;DGae&kSEJ7h=NG`2O5G3_Wq0Q`I_M-W8 zdV#giu+dl&90rO^+WacMY#6@vDFKoY>>4P{l*Nk&Mhrp)wJZcHBuE@W@t3XNKvttz zbc{qG1-7;WMcZ8qCa61?lxr6)Yo2QFo~`zU^|DA#a`QsFd;~b`4wK9BS7P^dqM#K! z_ddt83+uusO2R+`D=8UBWirlF>^?>Wkmt@rVWrwc9HEHGEJTp~#ibGgA{98W93c>- zGI_}Kl_^?82P(-M;A8YFNa11Yx7x9ox)*tPrq@o3Ea13Qyhd0oScPSgt@=u*O7~CS zPGRv?+`6~%y+S)>DxQo5nL;xV`-()dJsem{!*{&DcGg+%><$*)YOYJ!l{b%{%^pj_!D6WU><_~7-xa;^@Jrtr51eE#Q`dIl znTo2$S&=g+Y_gc0!Ii3>=g#!=m30%zBPYM|_#eFeUsLmajR)29v822CoOmCu1^I~- zZ#f54BIs2dqE29urXiq6OvVxfs8k@?EU@ebh=9YC13(EuN0B%RnF5q&nIOax;1I&J zttF;N$Sj7Y5pNTD2poZ2K%!X?Fb)|PBn&{Nj2I}%1O)+U$h<#%RL&Xv0Jwwi?79AC zanHTieaSl#zYWjv91p~qbH#M?)`9E4d&&4{$12Lq2f7TDemQihAJ6_Tua}AkDx}Po zwLTTbaYb^;d-$KAsm*Q+>+Nm)l+wKBc&|2>@^g<(L&apqClySf;+8mG_b^Pr(FrRk zL`@LO48%-;O3L?v=kNmRz7Qj);VX$+eTaeEN+y+joL6o!W?E(RebC`@sou;J zv+48ho{u({?^}3RI@QzKcRLjhgDcJ6(UD|WKI(BTIQ@S^ws)-5N7EDY zR6dA-=?El3w71&}E(<^mLm?9-Aofu3iie;eZ^iE)sJ@G!9Rnr$Y^$^lvMilxc~%@; zJ$Sf=Rio^tGGj0^3a!^Qs^vJeKR~7`bxWBqCndEGMhRkPeH_PVY1CJ{6lfbG;>b&W z7WZBl(#93Jbq|J@rrq#MDvg(kg^hi{zQ27pD?QrG_g)%(Y@ayqe{g!Q79-sjEUBhc zj?9c^p5yX9Z@Sm$&y#P7%4-H>=N5)cV5CS124r0bEJE;r2uM)F3_=S~3>2^-5lAGX zJ2>u45WoS@FcfHDlv)^-V3H{50geHa6)a7N0~|A`k${yYP{dH^N;n433CX|-ILg>@ z(n?ofYG#}=))`DrYtsWr2$b4J@Kq`{z{2gvomp6yimGQYD~QKm?`!`UZzHWQp# zl_LWR0trYWghXgkgan8J82~70R*@!X7KJFFB1)S8`eZ+(Q_)CPRqgf zUxoblv8S>8_SA(z3x`WT+4a_+0+dlOR`F=b1_EP||A zRfY^EP-7z9>FoUtr^8;;iCamOb=<{1c9Cn+a^?+_3vfL=AHL#F?#Wk(x{{}p=%jq%aK>%kWF&rRtZ-d(?d@z02}X zvi*mv^TmDw{7hi>GeXryAk);snoRRgVs%av3pl`;iyaEojpc;8U^FIvX5Yh2={=8E z@GBp#yxsLi44$Ke5fPar0$F8QSy9kC=rZzws&!C2i<3eWtSKW90EGf22#iPwL?aTR zNYaTA2f21qGRPZJu?cGx48;%B*Gu5`m)pKxS8OY;<}rfWKGAPZRNDB`rs<{@(-m9N zYv#7&W=9R|J5_j6cqhkweH7B+TJwV=+T^#HVQfo;&Y3rt6sx3WR6nI}R%krr={AFD#%%0`q^w$f*hzHvV80=A$ z12Kbq775@--eIQwyctT~Ny9ag>yN`s4YHb(Ma~;m*)c4pR2f=gOmMU%s}km8SxDz{ zn>Mb;CsRxf@mDJu7sqvD*;2Q`^zl!1#3q>!*t0g$J)k5}Zn*cK9Tv7k1%a9-hX*q;f?b{u#o z)NE|69qYFStHq5uiqp|2QYJbmEJEEQd$C2JM$iPQ2^9)JFG5HRlTIj-!tDkU51uW8 zz!pt+qT|6Ng9z+Qk}2n*Q{e;QHpiNt84n(b$sHyiOt5^C`*QYfgP*-v$uW%2%@bu! zESBbyv69Rc=`<1dB~21t{&lu$=(<(0sz< zd7{>cXR4cJG%BUw`yt!zDDGF;++*Yhb1#WBzq6U@q2I(K?Y@yPA@zwR1@;pZNaO*P zag@dgNl?m|X-7bTC<_KM>|tCfMJPmw7|DP`Mgj~hu8f4`$WS2!7{(07C~&3~2^_FU zGlEbtjI96$U4sZhDoZFajG1s?Sdn1J36#RXsd>j zEQ{nW;4t+{_8|40*S$5=gQ?M1W-XU~lN)uhcKDrY@uc!+em#eOzOB%F>`9#%YO2O6 zW;s~x+g*Huf%9$QRcYJF(;jWituWtiqWajA>Z&nE*Ykm1q55oAk3LtNr)}o#l&x7u zt%YAIqld@DOPSJGuM^*`Hbzs`UAD~3%P`5uWVXsZY+a9%oB`qGT9EB6EIjcq=N)C{ zo^YNijLH|0i{C25K7SZ5Mpb4p7-D3v5WY3`(-0qOn4T663G#kw0rJEiqZ&kG-l7!Y z#DgGu<17edc;Q_M5(18ZVh)kVn=ENTe-S@WITYk5#Y#TH06$9temm_UUcm^-hh*?J zO+WtfILr5u~-CnUtEuQVXD4 z$e9#d-XjDdFwzm}8|E{;uxL&&sUsO}*Cw}49eRA);iKp}81mg;Xh3G_!i1(U8AJ&g zjXHrWSwN5~6fon)K;ZC?2RA5+-bMo$)8pm9QV7%hggoT2Jc_m`@j99{oLO;+xy)Iqv$(@05KHWiN!x zdFhm}?)cAl;rz;+5%~8>UITcCobc1!&u%o6om64JW(ZPCX?og7zHgkAy@yOYRo5LH z@0M{jgik{_?EExjxYi*%D+>mCq z`8-x=p=886m6>g2O1a&fw<=DJT<~Fz1!JIROxYRBKx>(*qcv#+xL|H$>j47l;^|sI zRJai1cQ7r&;XD~F!0{T@jHBICI>}5svdZ%zcIn92T8?M<&~+OIMy4E@cU`?n5V)|t3Il@8u>m@`zB>JRQV~# z?I%?7o~2)Leh744s6ABXo$|km)S3$u>|E2>@3cNVe6N>jzWl@G-m4qyKQ-2ugcx>w z#v3|A4~aaQsQ8$AxvIE^OtMd%I+x2yw{o$JVEeTloRv(zdaLezP18EVP2WU?k13PR zWyiSm-r&rn^k;dAT^us%HH@8~FV3Gg(eCb^xrO#HwE5}HM^bajUTz;Z%R@3u$r#F( z89g-m3^uH!CIUtRQ6t(&nWo``9hF>6fg{PnNXgBWWPdNg`_w*P0(dkMwooA14gt*p z=PI}+hKq_ovA6`m9Of~cCnvBe@09FU=M?Nap9<2RfMQx%d{yT6ew}zw{Nu3u!v|Zn zPgmR3ecxmfz8DgE7wN@0Vz`l2`3$II3}KlIU7ogb$&c9X+i#R>F*M=pacp@pX?Z$5 zb&RGrie@H*C6Lop9(gs9Xvk{|8qr@GZ$pH$BxWdMi$SM!l~=}wWK)hXx69OArN1nt zTmgl4cPO@qKVZm(hEa1<)hu2c?f26>309+sF;#2eHD)TU?Ob>R)P-{?ZyZe4nsDck zGl(B*T5=V zF!&pDJ3`r9ET!4$fXZ-G{Mp&1btFN ztLxPl`yZ&5)uix=@d{;r$9)!`RN?gc#P$6y67o!n`-j%Uq#IUrWJ3>nOA7C$kjkf< z5@QCk4KTBr4iRNhjzImt;AsZ%b=z&w>f+Ih7dk}-(sI(rCN@h=%tXXs0Etw`$a(65 z^<^T$VpDcr90b7F>A`X_IPuXt)*=)oQUOJoL&O=OXo{C9wg8igT!tb5m(>|qJQ(qF z@`+8yR=V!4d8w)nFlw;FhBYj{R!t73oWpCABY3lVnlYrwl~$pxu;KXI={3k87^Fjpk}0kElsITl_@S!Hc?o_F*eDh(^Tx+ z4P9Jn<)aSt2X7aj!mKsPG{3TYS{3yimm2~s4I(@`wymhQNxgDJ6$ zGbbF2I&UW!P19o&MWI_tjq=nLl)p_k^UkK_BaURo^-^t;&9XEw4e)KpDqx(j z@EKL%gyaHB%5XWjE0tLDm(9mssmpy?VzA6jD@3;1#+wfHaC9)i3}H-wm|<-Ri5LnT z9alO5IS`{JB{X4+csjp}FHh*7y4U2oyAIhge3H?tW-vqqXu-$UbROX(?1Kf5q*t<} z{le=_C*VvQPOs%(A@95K#8|OZ$(?svJ*e@Qipdd%mj$$O#YOos#|m&Go-|)Sla}es za+^m-g=}ZzoVNz3wkPjDP0q{bYVT9l?CM8txPbHv3rXVt% zBB_pG;333L936=O%C16}2SZ`7h6X?npp?MA8H1u3OmLOL?x}dKjF>DAG?~ibP1fSL z($ccAVd(KtJ0%FHeIec_1elNvL8L&HnpBhuhDZ!E^s2GJQi(|EfFbThC(n3`36if{ z0^?ds?hN_ra@8Eu73xf_<xjHvUJqe?T@kE1Je2|>O3BY0oP~xi~ z7)+|cmL-&#b}+Rt5i10;vavD7noN^a)5P?vu}Nqs(!f=nBUyOsj*@gjf7mVh<-^Rm`GKA{OIE{A>O$=+fsC3 z2aI-8pv0{94tHc>=~FeQcT;;99Rci(NuKh!#vQD!iyKPGSzRuywC`}D2Z~)KCwX5l z5dOd0^OwI+syq2G?dssaB170d?}$^&7pTl3NE0!FU;-F}QUQoGsQ_T0@QCooyqAqt z%}z3to}tmFv*OWu$&wh>sJQ3U3#$~BbZ6pU6w;C3fzv9?6dkcHtd}`QQcRF?HB2EG87uc%)oA7?N-vjPKqC$|Vh{Ec}mXz0)qI?P_QvG3iJTWbx+zgX}<-I7E zPO6Xgyl>OpR33i0a#cQ{ycGCY@H@JnG>hN3O;%YGKAWo0KJ|@`rQ-!cRwhzFl6^_J!$1R}#1x?EQ2EtG@~cQO3qWO3Mt4!~Lyz;)VJ&akAT-3m zZ!}#jYe70Gw@VyOH_naHZq(sovf13xIhNxUGa|+XZFqWImsF$r)AE`vi3GSs4g!?U z_-U5RTV*jO8G{(4cB!P>jFmLt4OaVad>sykxS5<8EPA*;#Oc+NVWI-&91^i0)dm?? zZE9L+xxFsonqiY1I4P15f*#1|5*R}sq&RTuTNuL$jFpQP>a2-A)9rP4Z}rcEZguY} zu#B^MG!~;RvYv4s(=`wHD7v%54<4MeB zNnjxx5EvDduwZz~VKFlZ#AFC@4q`zf00~CGzqo{PTb3zDbMV`D zVGPQ8qR#je=+kC-?E+)Gbp}HPm>xJW_27Z7>BxWIEqqX zUjgzc$qcU$L)ad1-Asl{u7|+=I2Ce!TC0NfZXNA@1G>a!2Z_seH1+S_xZ`e|=?~;} z?d})XO(pQB80Rj=VqA%>n`I;v}CX{4j3*OG(nS0s=FIm3#z`P`ET55qO3_^crjPo zvC`wN9(rDCI_H?G+E4^^s3Mf8i>)YvhPKjVW-&7*EWz?1cq%@;z{@j%RBm`cofW8hviO+>g> z_FMX%_61I?g<4u7$zaTpU$T*<@#MCs^E7H$StGm$et7Pe(EFNRuNrYp)r<$L3T&}@ zKUL!|I`c^4J4+#zVk}rS;oap4-g|91cwoV!`0U>E{oHZWKrT-IR0 z2%Z#!G7L-*z>p-Q00d7G6A}!m1tUsZ21KSAa$wSx2=YTnq!$x{W#&w#A^=E8Q3z!M zQiK8}VTw{Hpk<0wB0+&jqk`&801&dkAV5qK^5HKMB&k{xs=#n~fynAT)G~BP9FRn^ zz(7Va;z9_CWC=nD76}4I0wh*O=LdkbNhrrToFo$uF^KPSah2(_K_Y~)lG!u~XdsOQ zM2w|_2}+q5hzAQJpis#Jg_0N{0>d)|OH&zGO$IRNK#7+`niAC{EeSyz215YGKnYEe z#0rvBsR4c194Yvpj`yDx(c3ys!rnEy)mAGFx4hd%Sy^p0R|SW5s1M&vl;~6Q!eyR$87bBWU z_Ry}qnK318hMAc&*A<01615oBx}>yB5MhY}2Fe#9ImZK(fd>NOnw!CIX|QY!#W7ZVgo*{8t~RI zF5)vt z$JM%h?x=+IxY-qf)^%b0LBIq$pwK+E0W71&;cn7NfOEK zDjW)sFV~9zp@sx+D||K)?^Ww7&X`u0AUwc4VG~R?YxB>+q|MB(>wnVR&g-Ki^=Z~& zyBN$!K`=}c3@}b{m}eNwOlZR%5;FwE@LXml4?I>9IOR^pR;lk~j@r>o2tf!KIZZse$$GlCQ;UFP-G)v} z;W@|O9SMy_lE=Na1@G0b*dE&Ix@RH6WSqq2hIK}gx+LU1c_sWH0jI3#5_Q#+G zQ_0NXSTK1ziEu0`upkk2Rte<6(-qBG3f^XT^uvRA^GznswQ+_c;2w1zWN}YUa8^5U zc^wuIg`ow&lVE{MBi9N~=GsWO66MnfZj6=H&SxKq%hq+PIfk93qo!_BK9UcWR~}QI zQbien65HTT14`Q_ zg>>XgABAM#CpS}?49bwxK-fqL0+m@7Rau4X5i>`cwrsK&F|^^sZg;;*(jlg>zE?wJeI}S=LygaF?WjkR^K*B$Q|@fN4Es z&rw;dhIH)3yl0}C6HG1)sC2;aB|?HH;eg>MksNou(FDG;VK}5Ii3$KaA*67!p{2o- zCxRTngsl5q7>Pob7D@Pd?jFjn>9csk5mL%q&F)HVZWK_i~ z>I^$_q5>ESOdBD` zs|3KD5eS{Dn>+)Gdh^aOF?`|vH*e!D1j-(=(%aC0`$=hdW{K#8HIIlY#Ei3 z9~32S3m8bKLXyp?WFpE!W+E0XaYHEDl%Y2Xlx+lESRzp|UEsQ2;C2$o%Em1UO~kP% z3A>C^u}LYpywcNQl1N4Z#G@n9Fc)B{GDx?z6g;Y}BS-Q-lX39^m-PeC$4Km|;G)RL zl2#I2rVC;S1Ig9n+dHbvmWz<_-=m&Y@u2+7KFsDDeunOR|7Z7mi_;I1ejUxrvlAFG zWXhOdV*~WRnmkvLbo4(Hg|~O;)a5aG|6cuvQ@0y&&u_Pb23A+5<(Tv0hN{Ynm$sYu zPrUobDbK2$1gr!GcLxa7vZ|p7{c;0 zLrf_hGGD%#F8J9W9uDRz@W($=e9cSW@#wh+;Qh95MvY%SNP4`}RbKz4^4HV*Rd47n zoj1J(7PgU_(wdr_bO)VTSC_#(h3=K{*)T91J}G??=6ui0+?)@==&eg~$!eI6h|{{J z1`{QIhsO0j$B5}y&ePz=ipF7@S%xDFLeoS*=p1kfz`ZH5I|5M6b%7EK#tz^ zSCIT6>r{RGv)szk^KI~BNcrBsb$1sf)#dpYs_33>UAWXA(eU_hrc2i`@|bx%wa4F9 znJiW^)USuudey`44W4a>^{*WD=H59kU5P94b=RlM>V3Wf{)-olWfoRb3@6a-E8NXS zTb-wI^G&OF+n%BiK0SjHBqcaFd9^bQu`vN;W1umTS~H794C5))G4_P%VKv*9gU3!q z_XeQ-7mRrNyU#zF&#>8wgZ4-@91>BLam>dYMbEKkL@5w{gBm*$PD_<`;2V1>YEvMZ z>d6Jj13)tX7?22q5h}PM7XzChW`*}@VD;8*G8ysNb=7^6*6y5Tu3;mBrx8pp1{3cU z9NY{Mn(i^k;kKI5$(%*HxvMJ5u~1RiH7hGCE8q{S<5hfcOeeIqWxRS>hC#_O9TGz{ z!ep5wXT~-Tk@F7ZgoK>&P0GG1KR@F&1JR?=wfMgu#e6YiWu2pPK2%8eBP>J8>to2OXQg2IyS!RjkZ7;F*Z7GT+AMiEgFD zPAw})$z-usLlUtpba-l&vaCx6StcWo-Latqe2_r|f;)DB&492N;8f`65{%rZ9vu?# z?vxFtNM=av@a=UVog5T7z1|V9#S&7780!0Yc_9NtoH-=E_{EHX$#{rK6DqKXu)q+c zgSvDL;^DdK?+IE+`v-vJaLQtI%eHhb!Vw@?6dM@i3^PO=UWrO|8f+XvEXhFFy0Zdd zItO97+f+-&6)dE3teY#CC1md)8&bfJK_W`0U2#g2L>dt=TErBgFl|S8*(h0Cpr=!``pDrm+`3a>H7Hd+>VX-QVs2sEw$ z;Q+C@Ob}EFEfE1WAkB~ilv4_>RODnZYK}mQ0Sada7*^)ljuG8nFAA<~Opr_%S46H7tTT3O3OGE`$QUQaI zDo*Avb-8Gs6|5_6c;qg1JWn=LlI)i#)g8@@mJaTDD%kDbnlxN^wM}qmc_PFmgpqAj zR}m#Cn8wZwKuH7;Y?4Tl?V>d*#0dvPrE(;J&Na$dI>BP|tH#zPaBce!VF=jKvMw;2Nwr>MGH4W-Tl*psDMJ^w2Gd|nu zdF|rHF^ps0oXclsRP{@8YCEi|yDwc_!L@|`x~j?hzNd?DyXSp;_wV|L;?6$R>N^Q~ zRbJxJ>$4uCGR86tVH(Kaumi>^4;#Vr?%M?+8y_fhEU+Vj0pZPvP6kX2K_rXlphyYX zBdLtAfO>7=af;(!4dsPUJdp$j{^C?)hAoULx>tqJEnFBK`{-^uGF-ChV@ECO2MxsR zROYC=XJQ?MH9J=24`O_jc>W{o*jSE$$1-u64G**wa2*N0{`4@7FFWQJrD)C{lSIz#UffX31G3*12+ z&XSsx_}j*pls3Z00iz}HKMMQTPub?4$82jDd)K92!#{4lUn_fm4S~ijV#38da;Ho- zs=%yFp1mffOF%^W{l}#Gfc0fCK5-s|R1mm^Mdv>)9;SxjA0y!q<>pEeZ%{;S+Fd4{ zX{F9Di96o1NF5&XUMHqIG#j9}Srq$|?D*dR#M7*tKBe;#ZpvmOcuE#!1U)!(iA##aDy!I2Vt8AC z#z+Z>BzPn#WLWj=5=zMz2pxDN;BhkggS``r((%CY9qWOT6qU<>BM_W0I6&etr7LN{ zl!qC;YZ&1HiGrIlVhAt~r#R0y4p$C1Exom46Mgo2E+&jW-3nHb5{H#vddK)GO{^s<7>Dm94~7=p~L zuFzmLx31i6_z#TSTGL(}DdKvmr?!^aD>7FBXqJnYCXcm>YUd#_h+I87pl6ZR#Y4-B|g7aldB{@4dyQP$2iQ)uXM+) z{l|!OUbD3(>!Gg)XWC=;SZj1}CqgOxIzN$3H3h<+Jbs!F8E#Y}^e9C22~))%^6RxhLC+bxb(p~5oVS5(cK`-3R9Jyw7;XB*rrs{)ox?zij{bKV+^ZpR@Fa7OJK83ZtphYqw7u-^6z52#*+#?>@S&OsZWrCAYxa?;+a0=5>vtp_apokrEO+mGJXwj z8+Y4r%kJBbtbF-ft}3ylXnhQX-CM_oQodyO`Y(1ksaIJzxUp*(-3JM{eb1lgtCIMA zcfwkY@9Fd0G7Nm}EW}RCD(UmX`y|6FEX1DoS}vteY-d$fnuaKq+SnY9aV9s~5(GKw z@L)aE$js>tv`%|A=NX$X1yT5@WX2WOa;~ELUuElim)Sczu}Jvg_e7<8>F#>pL-i!L z`j3+&(FfzPEwk#SjKyGn=heQ+Lnw|b_5J&w*Ucx&eF5-;d~ngU8b=8N>3%%CINBK+ z!qR3|wG+dnd9gY=s&cZdvj#DeI?0n28>+A!TbCTTB>ojuklDUIEK}N-Dd%$&r!=%I zm7{~V&$?Q372XDNLE+3dTjF^1Cm!;@iqamL!VJkP&F1oBed}qXMyjo7XvE731c`KM zT0qbtl~@!ybZw@X#@oyHnE4rXFC_T<^Ehh`8E?GbYOB@FY(p=EM)o&K;V`XOGLy?G zFWAWl{vXQFKN}`3F9`eR)@I^G&IY#66ybbEPVkR!y&ZCT@vja#JHPifq1;W*ME z=z7fX`TSlLndygLU05bCA=ay_A=;9eSs7XeB4SV|0#;VavntA&=oy};)}0FAIjaFa z@*mZg+Cn;HemM+JxO=#YeAvqSUAW745s1?m-chNAKH%?KIO&dOr$5%2E_rCDLq;ad zZW?ahSL{XZS1dG&3&ilW9oS!;IdN}>^xs(HTu25?T#vot zt2L>=P&ms`z~PN@PAgzzGBLSs+0eEJ3uRbUt@XaoomrBwu)4ZL6k{(qlmQAMNJ-RE zDV7wtIv6#=u35`$vCp;#ly*Q>e`qNE)Pw>}IC(t@e3{c%nheXPanZdJA z%&t#~_SnbH{BDnp^Sm}5ewMryj9G<@-izvazG`bGljisLJ6}rxW981{w-u~vm$mV= zHf^b@##Ul_%TCEYVWa6?zHdhEJyIPn4(}#L;;SsZc69JiRr5;jq0pn0uG9M!IvFJl z7*$4OQW<2h#$XdEf>}&~MhaiSX-!SI&lZ_6ULrdb9F>R+P&E-W@&X4T{2;V?U(Iir zcgMR~uFHw(34A9CmKeT;^hcYOCQ`c%jbW5ZpxSsjOCA#HgbpK*y#c{ z2I#z^b%FXb1B!tapa`OoCEI##9Y0hrzAx7c_z`wh?sHm8Rxj}8NpB&%DgFJuG{648 z>~nCOz|^#$kI=%W_QQWtLVl;t5}!48Q~nT?fdBM591#0R$_DV31c?jNI0{w<;^e?d z{aD5pXMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,h*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":38,"mouse-change":453,"mouse-event-offset":454,"mouse-wheel":456,"right-now":511}],38:[function(t,e,r){"use strict";function n(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}e.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],c=t.mode||"turntable",u=i(),h=a(),f=o();return u.setDistanceLimits(l[0],l[1]),u.lookAt(0,e,r,s),h.setDistanceLimits(l[0],l[1]),h.lookAt(0,e,r,s),f.setDistanceLimits(l[0],l[1]),f.lookAt(0,e,r,s),new n({turntable:u,orbit:h,matrix:f},c)};var i=t("turntable-camera-controller"),a=t("orbit-camera-controller"),o=t("matrix-camera-controller"),s=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+u;if((r=a-u-h[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)(r=(e=t[n]).y+e.dy+u-a)>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(f).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(h[1]-(t.length-1)*u)/e.sum(t,s)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),d.forEach(function(e){e.dy=e.value*t})}(),n();for(var l=1;t>0;--t)!function(t){function r(t){return o(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,s);n.y+=(i-o(n))*t}})})}(l*=.99),n(),function(t){function r(t){return o(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,s);n.y+=(i-o(n))*t}})})}(l),n()}function a(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}f.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),f.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function o(t){return t.y+t.dy/2}function s(t){return t.value}var l={},c=24,u=8,h=[1,1],f=[],d=[];return l.nodeWidth=function(t){return arguments.length?(c=+t,l):c},l.nodePadding=function(t){return arguments.length?(u=+t,l):u},l.nodes=function(t){return arguments.length?(f=t,l):f},l.links=function(t){return arguments.length?(d=t,l):d},l.size=function(t){return arguments.length?(h=t,l):h},l.layout=function(r){return f.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),d.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=f[t.source]),"number"==typeof n&&(n=t.target=f[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),f.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,s),e.sum(t.targetLinks,s))}),t(),i(r),a(),l},l.relayout=function(){return a(),l},l.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,h=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+h+"C"+s+","+h+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},l},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":115,"d3-collection":116,"d3-interpolate":120}],40:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":157,"gl-vao":272,"weak-map":568}],41:[function(t,e,r){var n=t("pad-left");e.exports=function(t,e,r){e="number"==typeof e?e:1,r=r||": ";var i=t.split(/\r?\n/),a=String(i.length+e-1).length;return i.map(function(t,i){var o=i+e,s=String(o).length;return n(o,a-s)+r+t}).join("\n")}},{"pad-left":475}],42:[function(t,e,r){"use strict";function n(t,e){for(var r=new Array(e+1),n=0;ni&&(i=t[o]),t[o]>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3])),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t.str2RgbaArray=function(t,n){var i,a;if("string"!=typeof t)return t;if(i=[],"#"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),a=parseInt(t,16),i[0]=a>>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3]),a[4]?i[3]=parseFloat(a[4]):i[3]=1),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t}()},{}],48:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!f(t[o],e[o],r,n))return!1;return!0}(t,e,r,s))}return r?t===e:t==e}function d(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function p(t,e,r){f(t,e,!0)&&u(t,e,r,"notDeepStrictEqual",p)}function m(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function g(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&u(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&v.isError(i),s=!t&&i&&!r;if((o&&a&&m(i,r)||s)&&u(i,r,"Got unwanted exception"+n),t&&i&&r&&!m(i,r)||!t&&i)throw i}var v=t("util/"),y=Object.prototype.hasOwnProperty,b=Array.prototype.slice,x="foo"===function(){}.name,_=e.exports=h,w=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return l(c(t.actual),128)+" "+t.operator+" "+l(c(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=u,_.ok=h,_.equal=function(t,e,r){t!=e&&u(t,e,r,"==",_.equal)},_.notEqual=function(t,e,r){t==e&&u(t,e,r,"!=",_.notEqual)},_.deepEqual=function(t,e,r){f(t,e,!1)||u(t,e,r,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,e,r){f(t,e,!0)||u(t,e,r,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,e,r){f(t,e,!1)&&u(t,e,r,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=p,_.strictEqual=function(t,e,r){t!==e&&u(t,e,r,"===",_.strictEqual)},_.notStrictEqual=function(t,e,r){t===e&&u(t,e,r,"!==",_.notStrictEqual)},_.throws=function(t,e,r){g(!0,t,e,r)},_.doesNotThrow=function(t,e,r){g(!1,t,e,r)},_.ifError=function(t){if(t)throw t};var M=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":558}],49:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],50:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(h):h<0&&(u=u.ushln(-h)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":53,"./is-rat":55,"./lib/is-bn":59,"./lib/num-to-bn":60,"./lib/rationalize":61,"./lib/str-to-bn":62}],55:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":59}],56:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":69}],57:[function(t,e,r){"use strict";var n=t("./bn-sign");e.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}},{"bit-twiddle":68,"double-bits":125}],59:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":69}],60:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.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)}},{"bn.js":69,"double-bits":125}],61:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.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]}},{"./bn-sign":56,"./num-to-bn":60}],62:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":69}],63:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":61}],64:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":56}],65:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":61}],66:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.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,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(f=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53,f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":57,"./lib/ctz":58}],67:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],68:[function(t,e,r){"use strict";"use restrict";function n(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}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.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},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=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|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],69:[function(t,e,r){!function(e,r){"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"))}function o(t,e,r){for(var n=0,i=Math.min(t.length,r),a=e;a=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(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}function l(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 c=1;c>>26,h=67108863&l,f=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=f;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+h)/67108864|0,h=67108863&o}r.words[c]=0|h,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}function c(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function h(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 f(){h.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){h.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){h.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){h.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(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 v(t){g.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)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var y;try{y=t("buffer").Buffer}catch(t){}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++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;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){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),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,l=Math.min(a,a-o)+r,c=0,u=r;u1&&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 b=["","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"],x=[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],_=[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];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?b[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 c=x[t],u=_[t];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var f=h.modn(u).toString(t);r=(h=h.idivn(u)).isZero()?f+r:b[c-f.length]+f+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!==y),this.toArrayLike(y,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,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[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=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=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,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,b=0|o[3],x=8191&b,_=b>>>13,w=0|o[4],M=8191&w,k=w>>>13,T=0|o[5],A=8191&T,S=T>>>13,E=0|o[6],L=8191&E,C=E>>>13,I=0|o[7],P=8191&I,D=I>>>13,z=0|o[8],O=8191&z,F=z>>>13,R=0|o[9],j=8191&R,N=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,X=Y>>>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,ct=st>>>13,ut=0|s[8],ht=8191&ut,ft=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(h,U))|0)+((8191&(i=(i=Math.imul(h,V))+Math.imul(f,U)|0))<<13)|0;c=((a=Math.imul(f,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(h,q)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(f,q)|0))<<13)|0;c=((a=a+Math.imul(f,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(h,W)|0)|0)+((8191&(i=(i=i+Math.imul(h,X)|0)+Math.imul(f,W)|0))<<13)|0;c=((a=a+Math.imul(f,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(x,U),i=(i=Math.imul(x,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var bt=(c+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,K)|0)+Math.imul(f,J)|0))<<13)|0;c=((a=a+Math.imul(f,K)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(x,q)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|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(m,J)|0,a=a+Math.imul(m,K)|0;var xt=(c+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,tt)|0)+Math.imul(f,$)|0))<<13)|0;c=((a=a+Math.imul(f,tt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,q)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,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(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(h,rt)|0)|0)+((8191&(i=(i=i+Math.imul(h,nt)|0)+Math.imul(f,rt)|0))<<13)|0;c=((a=a+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,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(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(h,at)|0)|0)+((8191&(i=(i=i+Math.imul(h,ot)|0)+Math.imul(f,at)|0))<<13)|0;c=((a=a+Math.imul(f,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,V))+Math.imul(D,U)|0,a=Math.imul(D,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,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(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(h,lt)|0)|0)+((8191&(i=(i=i+Math.imul(h,ct)|0)+Math.imul(f,lt)|0))<<13)|0;c=((a=a+Math.imul(f,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(F,U)|0,a=Math.imul(F,V),n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(D,q)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,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,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(h,ht)|0)|0)+((8191&(i=(i=i+Math.imul(h,ft)|0)+Math.imul(f,ht)|0))<<13)|0;c=((a=a+Math.imul(f,ft)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(F,q)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ht)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ht)|0,a=a+Math.imul(m,ft)|0;var Tt=(c+(n=n+Math.imul(h,pt)|0)|0)+((8191&(i=(i=i+Math.imul(h,mt)|0)+Math.imul(f,pt)|0))<<13)|0;c=((a=a+Math.imul(f,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(j,q),i=(i=Math.imul(j,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(x,lt)|0,i=(i=i+Math.imul(x,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ht)|0,i=(i=i+Math.imul(v,ft)|0)+Math.imul(y,ht)|0,a=a+Math.imul(y,ft)|0;var At=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,W),i=(i=Math.imul(j,X))+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,K)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(x,ht)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(_,ht)|0,a=a+Math.imul(_,ft)|0;var St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(j,J),i=(i=Math.imul(j,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(D,rt)|0,a=a+Math.imul(D,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(M,ht)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(k,ht)|0,a=a+Math.imul(k,ft)|0;var Et=(c+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(j,$),i=(i=Math.imul(j,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(F,rt)|0,a=a+Math.imul(F,nt)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ot)|0)+Math.imul(D,at)|0,a=a+Math.imul(D,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(A,ht)|0,i=(i=i+Math.imul(A,ft)|0)+Math.imul(S,ht)|0,a=a+Math.imul(S,ft)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(j,rt),i=(i=Math.imul(j,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(F,at)|0,a=a+Math.imul(F,ot)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(D,lt)|0,a=a+Math.imul(D,ct)|0,n=n+Math.imul(L,ht)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(C,ht)|0,a=a+Math.imul(C,ft)|0;var Ct=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(j,at),i=(i=Math.imul(j,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(F,lt)|0,a=a+Math.imul(F,ct)|0,n=n+Math.imul(P,ht)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(D,ht)|0,a=a+Math.imul(D,ft)|0;var It=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(j,lt),i=(i=Math.imul(j,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(O,ht)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(F,ht)|0,a=a+Math.imul(F,ft)|0;var Pt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(D,pt)|0))<<13)|0;c=((a=a+Math.imul(D,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(j,ht),i=(i=Math.imul(j,ft))+Math.imul(N,ht)|0,a=Math.imul(N,ft);var Dt=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(F,pt)|0))<<13)|0;c=((a=a+Math.imul(F,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863;var zt=(c+(n=Math.imul(j,pt))|0)+((8191&(i=(i=Math.imul(j,mt))+Math.imul(N,pt)|0))<<13)|0;return c=((a=Math.imul(N,mt))+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=bt,l[4]=xt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=Tt,l[10]=At,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=It,l[16]=Pt,l[17]=Dt,l[18]=zt,0!==c&&(l[19]=c,r.length++),r};Math.imul||(w=l),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):r<63?l(this,t,e):r<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):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},u.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);var i;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,c=0;c=0&&(0!==u||c>=i);c--){var h=0|this.words[c];this.words[c]=u<<26-a|h>>>a,u=h&s}return l&&0!==u&&(l.words[l.length++]=u),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&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;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 c=0;c=0;h--){var f=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(f=Math.min(f/o|0,67108863),n._ishlnsubmul(i,f,h);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);s&&(s.words[h]=f)}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){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 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)},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),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),h=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(h)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(h)),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(c)}},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=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,h=1;0==(r.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var f;return(f=0===e.cmpn(1)?i:o).cmpn(0)<0&&f.iadd(t),f},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=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=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 g(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};h.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},h.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):r.strip(),r},h.prototype.split=function(t,e){t.iushrn(this.n,0,e)},h.prototype.imulK=function(t){return t.imul(this.k)},i(f,h),f.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},f.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 f;else if("p224"===t)e=new d;else if("p192"===t)e=new p;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new m}return M[t]=e,e},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.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")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.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)},g.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},g.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)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.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(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var h=this.pow(u,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var h=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==o?(o<<=1,o|=h,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new v(t)},i(v,g),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.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)},v.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)},v.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],70:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var h,f=l.mallocDouble(2*s*a),d=l.mallocInt32(a);if((a=i(t,s,f,d))>0){if(1===s&&n)c.init(a),h=c.sweepComplete(s,r,0,a,f,d,0,a,f,d);else{var p=l.mallocDouble(2*s*o),m=l.mallocInt32(o);(o=i(e,s,p,m))>0&&(c.init(a+o),h=1===s?c.sweepBipartite(s,r,0,a,f,d,0,o,p,m):u(s,r,n,a,f,d,o,p,m),l.free(p),l.free(m))}l.free(f),l.free(d)}return h}}}function o(t,e){s.push([t,e])}e.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return s=[],a(t,t,o,!0),s}(t);case 2:return"function"==typeof e?a(t,t,e,!0):function(t,e){return s=[],a(t,e,o,!1),s}(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var s,l=t("typedarray-pool"),c=t("./lib/sweep"),u=t("./lib/intersect")},{"./lib/intersect":73,"./lib/sweep":77,"typedarray-pool":550}],72:[function(t,e,r){"use strict";function n(t){function e(e,r){var s=function(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),s=["function ",n,"(",_.join(),"){","var ",l,"=2*",i,";"],w="for(var i="+c+","+d+"="+l+"*"+c+";i<"+u+";++i,"+d+"+="+l+"){var x0="+h+"["+a+"+"+d+"],x1="+h+"["+a+"+"+d+"+"+i+"],xi="+f+"[i];",M="for(var j="+p+","+y+"="+l+"*"+p+";j<"+m+";++j,"+y+"+="+l+"){var y0="+g+"["+a+"+"+y+"],"+(r?"y1="+g+"["+a+"+"+y+"+"+i+"],":"")+"yi="+v+"[j];";return t?s.push(w,x,":",M):s.push(M,x,":",w),r?s.push("if(y1"+m+"-"+p+"){"),t?(e(!0,!1),M.push("}else{"),e(!1,!1)):(M.push("if("+s+"){"),e(!0,!0),M.push("}else{"),e(!0,!1),M.push("}}else{if("+s+"){"),e(!1,!0),M.push("}else{"),e(!1,!1),M.push("}")),M.push("}}return "+r);var k=n.join("")+M.join("");return new Function(k)()}var i="d",a="ax",o="vv",s="fp",l="es",c="rs",u="re",h="rb",f="ri",d="rp",p="bs",m="be",g="bb",v="bi",y="bp",b="rv",x="Q",_=[i,a,o,c,u,h,f,p,m,g,v];r.partial=n(!1),r.full=n(!0)},{}],73:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){var c=M*t;T[c]=e,T[c+1]=r,T[c+2]=n,T[c+3]=i,T[c+4]=a,T[c+5]=o;var u=k*t;A[u]=s,A[u+1]=l}function i(t,e,r,n,i,a,o,s,l,c,u){var h=2*t,f=l*h,d=c[f+e];t:for(var p=i,m=i*h;p0;){var z=(P-=1)*M,O=T[z],F=T[z+1],R=T[z+2],j=T[z+3],N=T[z+4],B=T[z+5],U=P*k,V=A[U],H=A[U+1],q=1&B,G=!!(16&B),Y=d,W=S,X=L,Z=C;if(q&&(Y=L,W=C,X=d,Z=S),!(2&B&&(R=b(t,O,F,R,Y,W,H),F>=R)||4&B&&(F=x(t,O,F,R,Y,W,V))>=R)){var J=R-F,K=N-j;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),y=d("lo===p0",["p0"]),b=d("lor&&i[h+e]>c;--u,h-=o){for(var f=h,d=h+o,p=0;p>>1,f=2*t,d=h,p=s[f*h+e];c=b?(d=y,p=b):v>=_?(d=g,p=v):(d=x,p=_):b>=_?(d=y,p=b):_>=v?(d=g,p=v):(d=x,p=_);for(var w=f*(u-1),M=f*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],76:[function(t,e,r){"use strict";function n(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 c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>1,g=m-f,v=m+f,y=d,b=g,x=m,_=v,w=p,M=t+1,k=e-1,T=0;l(y,b,r)&&(T=y,y=b,b=T),l(_,w,r)&&(T=_,_=w,w=T),l(y,x,r)&&(T=y,y=x,x=T),l(b,x,r)&&(T=b,b=x,x=T),l(y,_,r)&&(T=y,y=_,_=T),l(x,_,r)&&(T=x,x=_,_=T),l(b,w,r)&&(T=b,b=w,w=T),l(b,x,r)&&(T=b,b=x,x=T),l(_,w,r)&&(T=_,_=w,w=T);for(var A=r[2*b],S=r[2*b+1],E=r[2*_],L=r[2*_+1],C=2*y,I=2*x,P=2*w,D=2*d,z=2*m,O=2*p,F=0;F<2;++F){var R=r[C+F],j=r[I+F],N=r[P+F];r[D+F]=R,r[z+F]=j,r[O+F]=N}a(g,t,r),a(v,e,r);for(var B=M;B<=k;++B)if(c(B,A,S,r))B!==M&&i(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,A,S,r)?(o(B,M,k,r),++M,--k):(i(B,k,r),--k);break}if(--k>>1;s(m,S);var E=0,L=0;for(M=0;M=l)n(h,f,L--,C=C-l|0);else if(C>=0)n(c,u,E--,C);else if(C<=-l){C=-C-l|0;for(var I=0;I>>1;s(m,E);var L=0,C=0,I=0;for(k=0;k>1==m[2*k+3]>>1&&(D=2,k+=1),P<0){for(var z=-(P>>1)-1,O=0;O>1)-1,0===D?n(c,u,L--,z):1===D?n(h,f,C--,z):2===D&&n(d,p,I--,z)}},scanBipartite:function(t,e,r,a,o,h,f,d,p,g,v,y){var b=0,x=2*t,_=e,w=e+t,M=1,k=1;a?k=l:M=l;for(var T=o;T>>1;s(m,L);var C=0;for(T=0;T=l?(P=!a,A-=l):(P=!!a,A-=1),P)i(c,u,C++,A);else{var D=y[A],z=x*A,O=v[z+e+1],F=v[z+e+1+t];t:for(var R=0;R>>1;s(m,M);var k=0;for(b=0;b=l)c[k++]=x-l;else{var A=d[x-=1],S=g*x,E=f[S+e+1],L=f[S+e+1+t];t:for(var C=0;C=0;--C)if(c[C]===x){for(z=C+1;zz)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?function(t,e,r){if(e<0||t.byteLength=z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+z.toString(16)+" bytes");return 0|t}function u(t,e){if(i.isBuffer(t))return t.length;if(C(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function h(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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,I(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:p(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var 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}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var h=!0,f=0;fi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function _(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,c,u,h;switch(s){case 1:a<128&&(o=a);break;case 2:128==(192&(l=t[i+1]))&&(h=(31&a)<<6|63&l)>127&&(o=h);break;case 3:l=t[i+1],c=t[i+2],128==(192&l)&&128==(192&c)&&(h=(15&a)<<12|(63&l)<<6|63&c)>2047&&(h<55296||h>57343)&&(o=h);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(h=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>65535&&h<1114112&&(o=h)}}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<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function k(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 T(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),D.write(t,e,r,n,23,4),r+4}function A(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),D.write(t,e,r,n,52,8),r+8}function S(t,e){e=e||1/0;for(var r,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 E(t){return P.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function I(t){return t!=t}var P=t("base64-js"),D=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var z=2147483647;r.kMaxLength=z,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=t.slice(e,r),h=0;h>>=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 m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),D.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),D.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),D.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),D.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){M(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){M(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},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeFloatLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return A(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return A(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var n,a=[],o=e;o0?u-4:u;var h=0;for(e=0,r=0;e>16&255,c[h++]=a>>8&255,c[h++]=255&a;return 2===o?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,c[h++]=255&a):1===o&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,c[h++]=a>>8&255,c[h++]=255&a),c},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",s=[],l=0,c=r-n;lc?c:l+16383));return 1===n?(e=t[r-1],i+=o[e>>2],i+=o[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=o[e>>10],i+=o[e>>4&63],i+=o[e<<2&63],i+="="),s.push(i),s.join("")};for(var o=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,h=c.length;u0;){for(var d=r.pop(),p=(u=-1,h=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),n(t,e,r,u,s,h),n(t,e,r,s,h,u),n(t,e,r,h,d,u),n(t,e,r,d,u,h))}}},{"binary-search-bounds":85,"robust-in-sphere":515}],82:[function(t,e,r){"use strict";function n(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 i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}var a=t("binary-search-bounds");e.exports=function(t,e,r){var a=function(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var p=0;p<3;++p){var m=f[3*d+p];m>=0&&0===c[m]&&(h[3*d+p]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var v=function(t,e,r){for(var n=0,i=0;i1&&f(r[u[d-2]],r[u[d-1]],n)>0;)t.push([u[d-1],u[d-2],i]),d-=1;u.length=d,u.push(i);var p=c.upperIds;for(d=p.length;d>1&&f(r[p[d-2]],r[p[d-1]],n)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var r;return(r=t.a[0]v[0]&&l.push(new i(v,g,m,h),new i(g,v,p,h))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),b=[new n([y,1],[y,0],-1,[],[],[],[])],x=[],_=(h=0,l.length);h<_;++h){var w=l[h],M=w.type;M===d?s(x,b,t,w.a,w.idx):M===m?c(b,0,w):u(b,0,w)}return x}},{"binary-search-bounds":85,"robust-orientation":517}],84:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],86:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],90:[function(t,e,r){"use strict";function n(t){var e=m(t);return[v(e,-1/0),v(e,1/0)]}function i(t){for(var e=new Array(t.length),r=0;re[2]?1:0)}function l(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var b=e[o=(S=n[a])[0]],x=b[0],_=b[1],w=t[x],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=x;x=_,_=k}b[0]=x;var T,A=b[1]=S[1];for(i&&(T=b[2]);a>0&&n[a-1][0]===o;){var S,E=(S=n[--a])[1];i?e.push([A,E,T]):e.push([A,E]),A=E}i?e.push([A,_,T]):e.push([A,_])}return s}(t,e,o,c,r));return l(e,u,r),!!u||(o.length>0||c.length>0)}e.exports=function(t,e,r){var n;if(r){n=e;for(var o=new Array(e.length),s=0;s>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:89}],94:[function(t,e,r){"use strict";e.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]}},{}],95:[function(t,e,r){(function(r){"use strict";e.exports=function(t){var e,o,s=[],l=1;if("string"==typeof t)if(n[t])s=n[t].slice(),o="rgb";else if("transparent"===t)l=0,o="rgb",s=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var c=t.slice(1);l=1,(h=c.length)<=4?(s=[parseInt(c[0]+c[0],16),parseInt(c[1]+c[1],16),parseInt(c[2]+c[2],16)],4===h&&(l=parseInt(c[3]+c[3],16)/255)):(s=[parseInt(c[0]+c[1],16),parseInt(c[2]+c[3],16),parseInt(c[4]+c[5],16)],8===h&&(l=parseInt(c[6]+c[7],16)/255)),s[0]||(s[0]=0),s[1]||(s[1]=0),s[2]||(s[2]=0),o="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var u=e[1];o=c=u.replace(/a$/,"");var h="cmyk"===c?4:"gray"===c?1:3;s=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===c?255*parseFloat(t)/100:parseFloat(t);if("h"===c[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==a[t])return a[t]}return parseFloat(t)}),u===c&&s.push(1),l=void 0===s[h]?1:s[h],s=s.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(s=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),o=t.match(/([a-z])/gi).join("").toLowerCase());else"number"==typeof t?(o="rgb",s=[t>>>16,(65280&t)>>>8,255&t]):i(t)?(null!=t.r?(s=[t.r,t.g,t.b],o="rgb"):null!=t.red?(s=[t.red,t.green,t.blue],o="rgb"):null!=t.h?(s=[t.h,t.s,t.l],o="hsl"):null!=t.hue&&(s=[t.hue,t.saturation,t.lightness],o="hsl"),null!=t.a?l=t.a:null!=t.alpha?l=t.alpha:null!=t.opacity&&(l=t.opacity/100)):(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(s=[t[0],t[1],t[2]],o="rgb",l=4===t.length?t[3]:1);return{space:o,values:s,alpha:l}};var n=t("color-name"),i=t("is-plain-obj"),a={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":94,"is-plain-obj":298}],96:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t,e){if(Array.isArray(t))return t;null==e&&(e=!0);var r=n(t);if(!r.space)return[];var o,s=r.values,l=s.length;for(o=0;o1&&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[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":98}],98:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],99:[function(t,e,r){e.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]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,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:0,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]}]}},{}],100:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,c,u,h,f,d,p,m,g,v,y,b=[],x=[],_=[],w=[];if(a.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",(f=t.colormap)||(f="jet"),"string"==typeof f){if(f=f.toLowerCase(),!s[f])throw Error(f+" not a supported colorscale");h=o(s[f])}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);h=o(f)}if(h.length>p)throw new Error(f+" map requires nshades to be at least size "+h.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:o(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=h.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y=0}e.exports=function(t,e,r,o){var s=i(e,r,o);if(0===s){var l=a(i(t,e,r)),c=a(i(t,e,o));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,o)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,o)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:a(c-l)}var h=i(t,e,r);return h>0?s>0&&i(t,e,o)>0?1:-1:h<0?s>0||i(t,e,o)>0?1:-1:i(t,e,o)>0?1:n(t,e,r)?1:-1};var i=t("robust-orientation"),a=t("signum"),o=t("two-sum"),s=t("robust-product"),l=t("robust-sum")},{"robust-orientation":517,"robust-product":518,"robust-sum":522,signum:524,"two-sum":549}],102:[function(t,e,r){function n(t,e){return t-e}e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]);return i(l,t[2])-i(c,e[2])||i(l+t[2],o)-i(c+e[2],s);case 4:var u=t[0],h=t[1],f=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return u+h+f+d-(p+m+g+v)||i(u,h,f,d)-i(p,m,g,v,p)||i(u+h,u+f,u+d,h+f,h+d,f+d)-i(p+m,p+g,p+v,m+g,m+v,g+v)||i(u+h+f,u+h+d,u+f+d,h+f+d)-i(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),b=e.slice().sort(n),x=0;xt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],106:[function(t,e,r){"use strict";e.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=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":42,"incremental-convex-hull":291}],108:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],109:[function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r;return(r=parseInt(e.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var u=e.substr(0,i),h=e.substr(i+1,l-(i+1)).split(","),f=1;switch(u){case"rgba":if(4!==h.length)return null;f=o(h.pop());case"rgb":return 3!==h.length?null:[a(h[0]),a(h[1]),a(h[2]),f];case"hsla":if(4!==h.length)return null;f=o(h.pop());case"hsl":if(3!==h.length)return null;var d=(parseFloat(h[0])%360+360)%360/360,p=o(h[1]),m=o(h[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),f];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],110:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,h=s*(3-2*i),f=s*o;if(t.length){a||(a=new Array(t.length));for(var d=t.length-1;d>=0;--d)a[d]=c*t[d]+u*e[d]+h*r[d]+f*n[d];return a}return c*t+u*e+h*r+f*n},e.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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],111:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":113}],112:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,h=0;for(n=0;n0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",h,"]-=s",h].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var b=new Array(r);for(l=0;l0&&v.push("var "+y.join(",")),l=0;l3&&v.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&v.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var T=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",T,"(",g.join(","),"){",v.join("\n"),"} return ",T].join(""))()}},{uniq:552}],113:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+h+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+h+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u=0?(a>=x?10:a>=_?5:a>=w?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=x?10:a>=_?5:a>=w?2:1)}function n(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=x?i*=10:a>=_?i*=5:a>=w&&(i*=2),ee?1:t>=e?0:NaN},o=function(t){return 1===t.length&&(t=function(t){return function(e,r){return a(t(e),r)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},s=o(a),l=s.right,c=s.left,u=function(t){return null===t?NaN:+t},h=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},f=function(t,e){var r=h(t,e);return r?Math.sqrt(r):r},d=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},T=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},A=function(t){if(!(a=t.length))return[];for(var e=-1,r=T(t,i),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=f,t.extent=d,t.histogram=function(){function t(t){var a,o,s=t.length,c=new Array(s);for(a=0;af;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)(m=g[a]=[]).x0=a>0?d[a-1]:h,m.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=T,t.pairs=function(t,r){null==r&&(r=e);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l=u.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,c,h,f=-1,d=e.length,p=u[n++],m=r(),g=i();++fu.length)return t;var n,i=h[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],h=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return h[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},t.set=l,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],117:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=E.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=L.exec(t))?i(parseInt(e[1],16)):(e=C.exec(t))?new l(e[1],e[2],e[3],1):(e=I.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=P.exec(t))?a(e[1],e[2],e[3],e[4]):(e=D.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=z.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=O.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new h(t,e,r,n)}function u(t,e,i,a){return 1===arguments.length?function(t){if(t instanceof h)return new h(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new h;if(t instanceof h)return t;var e=(t=t.rgb()).r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new h(l,c,u,t.opacity)}(t):new h(t,e,i,null==a?1:a)}function h(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function f(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function d(t){if(t instanceof m)return new m(t.l,t.a,t.b,t.opacity);if(t instanceof _){var e=t.h*R;return new m(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=b(t.r),n=b(t.g),i=b(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/N),s=g((.2126729*r+.7151522*n+.072175*i)/B);return new m(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/U)),t.opacity)}function p(t,e,r,n){return 1===arguments.length?d(t):new m(t,e,r,null==n?1:n)}function m(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>G?Math.pow(t,1/3):t/q+V}function v(t){return t>H?t*t*t:q*(t-V)}function y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function b(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function x(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof _)return new _(t.h,t.c,t.l,t.opacity);t instanceof m||(t=d(t));var e=Math.atan2(t.b,t.a)*j;return new _(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function w(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,s=(X*(r-i)-Y*a)/W,c=Math.sqrt(s*s+a*a)/(X*i*(1-i)),u=c?Math.atan2(s,a)*j-120:NaN;return new M(u<0?u+360:u,c,i,t.opacity)}(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var k=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},T="\\s*([+-]?\\d+)\\s*",A="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E=/^#([0-9a-f]{3})$/,L=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[T,T,T]+"\\)$"),I=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),P=new RegExp("^rgba\\("+[T,T,T,A]+"\\)$"),D=new RegExp("^rgba\\("+[S,S,S,A]+"\\)$"),z=new RegExp("^hsl\\("+[A,S,S]+"\\)$"),O=new RegExp("^hsla\\("+[A,S,S,A]+"\\)$"),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),k(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),k(h,u,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new h(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new h(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(f(t>=240?t-240:t+120,i,n),f(t,i,n),f(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var R=Math.PI/180,j=180/Math.PI,N=.95047,B=1,U=1.08883,V=4/29,H=6/29,q=3*H*H,G=H*H*H;k(m,p,e(r,{brighter:function(t){return new m(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new m(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=B*v(t),e=N*v(e),r=U*v(r),new l(y(3.2404542*e-1.5371385*t-.4985314*r),y(-.969266*e+1.8760108*t+.041556*r),y(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),k(_,x,e(r,{brighter:function(t){return new _(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}));var Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=1.78277*X,K=1.78277*Y- -.14861*W;k(M,w,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*R,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(-.14861*n+1.78277*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=u,t.lab=p,t.hcl=x,t.cubehelix=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],118:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",i),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;ad+s||np+s||ih.index){var l=d-a.x-a.vx,u=p-a.y-a.vy,v=l*l+u*u;vt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e=m)){(t.data!==o||t.next)&&(0===i&&(i=f(),u+=i*i),0===a&&(a=f(),u+=a*a),u1?(null==e?g.remove(t):g.set(t,s(e)),l):g.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,r=0,o=n.length;r180||r<-180?r-360*Math.round(r/360):r):b(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?o:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):b(isNaN(e)?r:e)}}function o(t,e){var r=e-t;return r?n(t,r):b(isNaN(t)?e:t)}function s(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:T(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:T(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:T(t,r)},{i:s-2,x:T(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(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:T(r,n)})),a=E.lastIndex;return a=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[h=u<<1|c]))return i[h]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[h]=p:t._root=p,t;do{i=i?i[h]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((h=u<<1|c)==(f=(l>=o)<<1|s>=a));return i[f]=d,i[h]=p,t}function r(t){return t[0]}function n(t){return t[1]}function i(t,e,i){var o=new a(null==e?r:e,null==i?n:i,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function a(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function o(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var s=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},l=i.prototype=a.prototype;l.copy=function(){var t,e,r=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=o(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=o(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,h=-1/0,f=-1/0;for(n=0;nh&&(h=i),af&&(f=a));for(ht||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,r){var n,i,a,o,l,c,u,h=this._x0,f=this._y0,d=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new s(g,h,f,d,p)),null==r?r=1/0:(h=t-r,f=e-r,d=t+r,p=e+r,r*=r);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(a=c.y0)>p||(o=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var b=t-+this._x.call(null,g.data),x=e-+this._y.call(null,g.data),_=b*b+x*x;if(_=(s=(p+g)/2))?p=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[h=u<<1|c]))return this;if(!d.length)break;(e[h+1&3]||e[h+2&3]||e[h+3&3])&&(r=e,f=h)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[h]=i:delete e[h],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[f]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--h}function o(){g=(m=y.now())+v,h=f=0;try{a()}finally{h=0,function(){var t,e,r=c,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);u=t,l(n)}(),g=0}}function s(){var t=y.now(),e=t-m;e>p&&(v-=e,m=t)}function l(t){if(!h){f&&(f=clearTimeout(f));var e=t-g;e>24?(t<1/0&&(f=setTimeout(o,e)),d&&(d=clearInterval(d))):(d||(m=g,d=setInterval(s,p)),h=1,b(o))}}var c,u,h=0,f=0,d=0,p=1e3,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,b="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||u===this||(u?u._next=this:c=this,u=this),this._call=t,this._time=n,l()},stop:function(){this._call&&(this._call=null,this._time=1/0,l())}};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},t.interval=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],123:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(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}}}function s(t){return t.length}function l(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function u(t){return(t+="")===ua||t[0]===ha?ha+t:t}function h(t){return(t+="")[0]===ha?t.slice(1):t}function f(t){return u(t)in this._}function d(t){return(t=u(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(h(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function b(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=fa.length;r0&&(t=t.slice(0,a));var s=wa.get(t);return s&&(t=s,o=G),a?e?function(){var a=o(e,ea(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}:n:e?x:function(){var e,r=new RegExp("^__on([^.]+)"+$i.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]}}}function q(t,e){return function(r){var n=$i.event;$i.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{$i.event=n}}}function G(t,e){var r=q(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}function Y(e){var n=".dragsuppress-"+ ++ka,i="click"+n,a=$i.select(r(e)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==Ma&&(Ma=!("onselectstart"in e)&&b(e.style,"userSelect")),Ma){var o=t(e).style,s=o[Ma];o[Ma]="none"}return function(t){if(a.on(n,null),Ma&&(o[Ma]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Ta<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=$i.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Ta=!(o.f||o.e),n.remove()}}return Ta?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function X(){return $i.event.changedTouches[0].identifier}function Z(t){return t>0?1:t<0?-1:0}function J(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function K(t){return t>1?0:t<-1?Ea:Math.acos(t)}function Q(t){return t>1?Ia:t<-1?-Ia:Math.asin(t)}function $(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return(t=Math.sin(t/2))*t}function et(){}function rt(t,e,r){return this instanceof rt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof rt?new rt(t.h,t.s,t.l):gt(""+t,vt,rt):new rt(t,e,r)}function nt(t,e,r){function n(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(a-i)*t/60:t<180?a:t<240?i+(a-i)*(240-t)/60:i}(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,a=r<=.5?r*(1+e):r+e-r*e,i=2*r-a,new ft(n(t+120),n(t),n(t-120))}function it(t,e,r){return this instanceof it?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof it?new it(t.h,t.c,t.l):lt(t instanceof ot?t.l:(t=yt((t=$i.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new it(t,e,r)}function at(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ot(r,Math.cos(t*=Pa)*e,Math.sin(t)*e)}function ot(t,e,r){return this instanceof ot?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ot?new ot(t.l,t.a,t.b):t instanceof it?at(t.h,t.c,t.l):yt((t=ft(t)).r,t.g,t.b):new ot(t,e,r)}function st(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=ct(i)*Ua,n=ct(n)*Va,a=ct(a)*Ha,new ft(ht(3.2404542*i-1.5371385*n-.4985314*a),ht(-.969266*i+1.8760108*n+.041556*a),ht(.0556434*i-.2040259*n+1.0572252*a))}function lt(t,e,r){return t>0?new it(Math.atan2(r,e)*Da,Math.sqrt(e*e+r*r),t):new it(NaN,NaN,t)}function ct(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ut(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ht(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ft(t,e,r){return this instanceof ft?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ft?new ft(t.r,t.g,t.b):gt(""+t,ft,nt):new ft(t,e,r)}function dt(t){return new ft(t>>16,t>>8&255,255&t)}function pt(t){return dt(t)+""}function mt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function gt(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(xt(i[0]),xt(i[1]),xt(i[2]))}return(a=Ya.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 vt(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 rt(n,i,l)}function yt(t,e,r){var n=ut((.4124564*(t=bt(t))+.3575761*(e=bt(e))+.1804375*(r=bt(r)))/Ua),i=ut((.2126729*t+.7151522*e+.072175*r)/Va);return ot(116*i-16,500*(n-i),200*(i-ut((.0193339*t+.119192*e+.9503041*r)/Ha)))}function bt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function xt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function _t(t){return"function"==typeof t?t:function(){return t}}function wt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Mt(e,r,t,n)}}function Mt(t,e,r,n){function i(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=$i.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=$i.event;$i.event=t;try{o.progress.call(a,l)}finally{$i.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ea(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},$i.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}function kt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return Xa?Xa.n=i:Wa=i,Xa=i,Za||(Ja=clearTimeout(Ja),Za=1,Ka(Tt)),i}function Tt(){var t=At(),e=St()-t;e>24?(isFinite(e)&&(clearTimeout(Ja),Ja=setTimeout(Tt,e)),Za=0):(Za=1,Ka(Tt))}function At(){for(var t=Date.now(),e=Wa;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function St(){for(var t,e=Wa,r=1/0;e;)e.c?(e.t1?Date.UTC.apply(this,arguments):arguments[0])}function Ct(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3)}(+n[0]),r+n[0].length):-1}function Bt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ut(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Vt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Ht(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function qt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Gt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Yt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Wt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Xt(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=ca(e)/60|0,i=ca(e)%60;return r+Pt(n,"0",2)+Pt(i,"0",2)}function Zt(t,e,r){oo.lastIndex=0;var n=oo.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jt(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,h=i*l+u*Math.cos(s),f=u*o*Math.sin(s);fo.add(Math.atan2(f,h)),n=t,i=l,a=c}var e,r,n,i,a;po.point=function(o,s){po.point=t,n=(e=o)*Pa,i=Math.cos(s=(r=s)*Pa/2+Ea/4),a=Math.sin(s)},po.lineEnd=function(){t(e,r)}}function ne(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function oe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function se(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function le(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ce(t){return[Math.atan2(t[1],t[0]),Q(t[2])]}function ue(t,e){return ca(t[0]-e[0])=0;--s)i.point((h=u[s])[0],h[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function be(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(we))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=h,y.lineEnd=f,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=$i.merge(d);var t=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;fo.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>Ea,T=p*b;if(fo.add(Math.atan2(T*w*Math.sin(M),m*x+T*Math.cos(M))),a+=k?_+w*La:_,k^f>=r^v>=r){var A=ae(ne(h),ne(t));le(A);var S=ae(i,A);le(S);var E=(k^_>=0?-1:1)*Q(S[2]);(n>E||n===E&&(A[0]||A[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;f=v,p=b,m=x,h=t}}return(a<-Aa||a1}function Me(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:x,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ke(t,e){return((t=t.x)[0]<0?t[1]-Ia-Aa:Ia-t[1])-((e=e.x)[0]<0?e[1]-Ia-Aa:Ia-e[1])}function Te(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,h=1,f=s.x-l,d=s.y-c;if(a=t-l,f||!(a>0)){if(a/=f,f<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=r-l,f||!(a<0)){if(a/=f,f<0){if(a>h)return;a>u&&(u=a)}else if(f>0){if(a0)){if(a/=d,d<0){if(a0){if(a>h)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>h)return;a>u&&(u=a)}else if(d>0){if(a0&&(i.a={x:l+u*f,y:c+u*d}),h<1&&(i.b={x:l+h*f,y:c+h*d}),i}}}}}}function Ae(t,e,r,n){function i(n,i){return ca(n[0]-t)0?0:3:ca(n[0]-r)0?2:1:ca(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(a,s,l,c){var u=0,h=0;if(null==a||(u=i(a,l))!==(h=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==h);else c.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function u(t,e){c(t,e)&&s.point(t,e)}function h(t,e){var r=c(t=Math.max(-Eo,Math.min(Eo,t)),e=Math.max(-Eo,Math.min(Eo,e)));if(d&&p.push([t,e]),_)m=t,g=e,v=r,_=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&x)s.point(t,e);else{var n={a:{x:y,y:b},b:{x:t,y:e}};T(n)?(x||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),w=!1):r&&(s.lineStart(),s.point(t,e),w=!1)}y=t,b=e,x=r}var f,d,p,m,g,v,y,b,x,_,w,M=s,k=Me(),T=Te(t,e,r,n),A={point:u,lineStart:function(){A.point=h,d&&d.push(p=[]),_=!0,x=!1,y=b=NaN},lineEnd:function(){f&&(h(m,g),v&&x&&k.rejoin(),f.push(k.buffer())),A.point=u,x&&s.lineEnd()},polygonStart:function(){s=k,f=[],d=[],w=!0},polygonEnd:function(){s=M,f=$i.merge(f);var e=function(t){for(var e=0,r=d.length,n=t[1],i=0;in&&J(c,a,t)>0&&++e:a[1]<=n&&J(c,a,t)<0&&--e,c=a;return 0!==e}([t,n]),r=w&&e,i=f.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&ye(f,a,e,l,s),s.polygonEnd()),f=d=p=null}};return A}}function Se(t){var e=0,r=Ea/3,n=Ne(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Ea/180,r=t[1]*Ea/180):[e/Ea*180,r/Ea*180]},i}function Ee(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,Q((a-(t*t+r*r)*i*i)/(2*i))]},r}function Le(){function t(t,e){Co+=i*t-n*e,n=t,i=e}var e,r,n,i;Oo.point=function(a,o){Oo.point=t,e=n=a,r=i=o},Oo.lineEnd=function(){t(e,r)}}function Ce(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ie(t,e){vo+=t,yo+=e,++bo}function Pe(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);xo+=o*(e+t)/2,_o+=o*(r+n)/2,wo+=o,Ie(e=t,r=n)}var e,r;Ro.point=function(n,i){Ro.point=t,Ie(e=n,r=i)}}function De(){Ro.point=Ie}function ze(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);xo+=o*(n+t)/2,_o+=o*(i+e)/2,wo+=o,Mo+=(o=i*t-n*e)*(n+t),ko+=o*(i+e),To+=3*o,Ie(n=t,i=e)}var e,r,n,i;Ro.point=function(a,o){Ro.point=t,Ie(e=n=a,r=i=o)},Ro.lineEnd=function(){t(e,r)}}function Oe(t){function e(e){return(a?function(e){function n(r,n){r=t(r,n),e.point(r[0],r[1])}function i(){y=NaN,M.point=o,e.lineStart()}function o(n,i){var o=ne([n,i]),s=t(n,i);r(y,b,v,x,_,w,y=s[0],b=s[1],v=n,x=o[0],_=o[1],w=o[2],a,e),e.point(y,b)}function s(){M.point=n,e.lineEnd()}function l(){i(),M.point=c,M.lineEnd=u}function c(t,e){o(h=t,e),f=y,d=b,p=x,m=_,g=w,M.point=o}function u(){r(y,b,v,x,_,w,f,d,h,p,m,g,a,e),M.lineEnd=s,s()}var h,f,d,p,m,g,v,y,b,x,_,w,M={point:n,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),M.lineStart=l},polygonEnd:function(){e.polygonEnd(),M.lineStart=i}};return M}:function(e){return Re(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function r(e,a,o,s,l,c,u,h,f,d,p,m,g,v){var y=u-e,b=h-a,x=y*y+b*b;if(x>4*n&&g--){var _=s+d,w=l+p,M=c+m,k=Math.sqrt(_*_+w*w+M*M),T=Math.asin(M/=k),A=ca(ca(M)-1)n||ca((y*C+b*I)/x-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(n)},e}function Fe(t){this.stream=t}function Re(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function je(t){return Ne(function(){return t})()}function Ne(t){function e(t){return t=o(t[0]*Pa,t[1]*Pa),[t[0]*h+s,l-t[1]*h]}function r(){o=ge(a=He(g,v,b),i);var t=i(p,m);return s=f-t[0]*h,l=d+t[1]*h,n()}function n(){return c&&(c.valid=!1,c=null),e}var i,a,o,s,l,c,u=Oe(function(t,e){return t=i(t,e),[t[0]*h+s,l-t[1]*h]}),h=150,f=480,d=250,p=0,m=0,g=0,v=0,b=0,x=So,_=y,w=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=Be(x(a,u(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(x=null==t?(w=t,So):function(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t,e,r){var n=[1,0,0],a=ae(ne(t),ne(e)),o=ie(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=i*o/l,u=-i*s/l,h=ae(n,a),f=se(n,c);oe(f,se(a,u));var d=h,p=ie(f,d),m=ie(d,d),g=p*p-m*(ie(f,f)-1);if(!(g<0)){var v=Math.sqrt(g),y=se(d,(-p-v)/m);if(oe(y,f),y=ce(y),!r)return y;var b,x=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(ca(y[0]-x)Ea^(x<=y[0]&&y[0]<=_)){var A=se(d,(-p+v)/m);return oe(A,f),[y,ce(A)]}}}function n(e,r){var n=a?t:Ea-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var i=Math.cos(t),a=i>0,o=ca(i)>Aa;return _e(e,function(t){var i,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(h,f){var d,p=[h,f],m=e(h,f),g=a?m?0:n(h,f):m?n(h+(h<0?Ea:-Ea),f):0;if(!i&&(c=l=m)&&t.lineStart(),m!==l&&(d=r(i,p),(ue(i,d)||ue(p,d))&&(p[0]+=Aa,p[1]+=Aa,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=r(p,i),t.point(d[0],d[1])):(d=r(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(o&&i&&a^m){var v;g&s||!(v=r(p,i,!0))||(u=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||i&&ue(i,p)||t.point(p[0],p[1]),i=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},We(t,6*Pa),a?[0,-t]:[-Ea,t-Ea])}((w=+t)*Pa),n()):w},e.clipExtent=function(t){return arguments.length?(M=t,_=t?Ae(t[0][0],t[0][1],t[1][0],t[1][1]):y,n()):M},e.scale=function(t){return arguments.length?(h=+t,r()):h},e.translate=function(t){return arguments.length?(f=+t[0],d=+t[1],r()):[f,d]},e.center=function(t){return arguments.length?(p=t[0]%360*Pa,m=t[1]%360*Pa,r()):[p*Da,m*Da]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Pa,v=t[1]%360*Pa,b=t.length>2?t[2]%360*Pa:0,r()):[g*Da,v*Da,b*Da]},$i.rebind(e,u,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&function(t){return(t=o.invert((t[0]-s)/h,(l-t[1])/h))&&[t[0]*Da,t[1]*Da]},r()}}function Be(t){return Re(t,function(e,r){t.point(e*Pa,r*Pa)})}function Ue(t,e){return[t,e]}function Ve(t,e){return[t>Ea?t-La:t<-Ea?t+La:t,e]}function He(t,e,r){return t?e||r?ge(Ge(t),Ye(e,r)):Ge(t):e||r?Ye(e,r):Ve}function qe(t){return function(e,r){return e+=t,[e>Ea?e-La:e<-Ea?e+La:e,r]}}function Ge(t){var e=qe(t);return e.invert=qe(-t),e}function Ye(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),Q(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),Q(u*n-s*i)]},r}function We(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Xe(r,i),a=Xe(r,a),(o>0?ia)&&(i+=o*La)):(i=t+o*La,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-Ia+Aa&&(e=-Ia+Aa):e>Ia-Aa&&(e=Ia-Aa);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Ea/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=Z(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Ia]},r):rr}function er(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return ca(i)1&&J(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function lr(t,e){return t[0]-e[0]||t[1]-e[1]}function cr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ur(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,h=n[1]-c,f=(s*(l-c)-h*(i-a))/(h*o-s*u);return[i+f*o,l+f*u]}function hr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function fr(t){var e=Ko.pop()||new function(){Sr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function dr(t){_r(t),Xo.remove(t),Ko.push(t),Sr(t)}function pr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];dr(t);for(var l=a;l.circle&&ca(r-l.circle.x)Aa)s=s.L;else{if(!((i=a-function(t,e){var r=t.N;if(r)return gr(r,e);var n=t.site;return n.y===e?n.x:1/0}(s,o))>Aa)){n>-Aa?(e=s.P,r=s):i>-Aa?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=fr(t);if(Xo.insert(e,l),e||r){if(e===r)return _r(e),r=fr(e.site),Xo.insert(l,r),l.edge=r.edge=Mr(e.site,l.site),xr(e),void xr(r);if(r){_r(e),_r(r);var c=e.site,u=c.x,h=c.y,f=t.x-u,d=t.y-h,p=r.site,m=p.x-u,g=p.y-h,v=2*(f*g-d*m),y=f*f+d*d,b=m*m+g*g,x={x:(g*y-d*b)/v+u,y:(f*b-m*y)/v+h};kr(r.edge,c,p,x),l.edge=Mr(c,t,null,x),r.edge=Mr(t,p,null,x),xr(e),xr(r)}else l.edge=Mr(e.site,l.site)}}function gr(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,c=l-e;if(!c)return s;var u=s-n,h=1/a-1/c,f=u/c;return h?(-f+Math.sqrt(f*f-2*h*(u*u/(-2*c)-l+c/2+i-a/2)))/h+n:(n+s)/2}function vr(t){this.site=t,this.edges=[]}function yr(t){for(var e,r,n,i,a,o,s,l,c,u,h=t[0][0],f=t[1][0],d=t[0][1],p=t[1][1],m=Wo,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;oAa||ca(i-r)>Aa)&&(s.splice(o,0,new Tr(function(t,e,r){var n=new wr(t,null);return n.a=e,n.b=r,Yo.push(n),n}(a.site,u,ca(n-h)Aa?{x:h,y:ca(e-h)Aa?{x:ca(r-p)Aa?{x:f,y:ca(e-f)Aa?{x:ca(r-d)=-Sa)){var f=l*l+c*c,d=u*u+g*g,p=(g*f-c*d)/h,m=(l*d-u*f)/h,g=m+s,v=Qo.pop()||new function(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,b=Jo._;b;)if(v.y=s)return;if(f>p){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(f>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}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.xa&&(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:jr(r,n)})),a=es.lastIndex;return a=0&&!(r=$i.interpolators[n](t,e)););return r}function Ur(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(tn(r)+"rotate(",null,")")-2,x:jr(t,e)})):e&&r.push(tn(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(tn(r)+"skewX(",null,")")-2,x:jr(t,e)}):e&&r.push(tn(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(tn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:jr(t[0],e[0])},{i:i-2,x:jr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(tn(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function pn(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;++oi&&(n=r,i=e);return n}function Tn(t){return t.reduce(An,0)}function An(t,e){return t+e[1]}function Sn(t,e){return En(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function En(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 Ln(t){return[$i.min(t),$i.max(t)]}function Cn(t,e){return t.value-e.value}function In(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Pn(t,e){t._pack_next=e,e._pack_prev=t}function Dn(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 zn(t){function e(t){u=Math.min(t.x-t.r,u),h=Math.max(t.x+t.r,h),f=Math.min(t.y-t.r,f),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,h=-1/0,f=1/0,d=-1/0;if(r.forEach(On),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(jn(n,i,a=r[2]),e(a),In(n,a),n._pack_prev=a,In(a,i),i=n._pack_next,o=3;o2?Kn:Xn,l=n?nn:rn;return o=i(t,e,l,r),s=i(e,t,l,Br),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Jr)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ri(t,e)},a.tickFormat=function(e,r){return ni(t,e,r)},a.nice=function(e){return ti(t,e),i()},a.copy=function(){return Qn(t,e,r,n)},i()}function $n(t,e){return $i.rebind(t,e,"range","rangeRound","interpolate","clamp")}function ti(t,e){return Zn(t,Jn(ei(t,e)[2])),Zn(t,Jn(ei(t,e)[2])),t}function ei(t,e){null==e&&(e=10);var r=Yn(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 ri(t,e){return $i.range.apply($i,ei(t,e))}function ni(t,e,r){var n=ei(t,e);if(r){var i=$a.exec(r);if(i.shift(),"s"===i[8]){var a=$i.formatPrefix(Math.max(ca(n[0]),ca(n[1])));return i[7]||(i[7]="."+ii(a.scale(n[2]))),i[8]="f",r=$i.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+function(t,e){var r=ii(e[2]);return t in ds?Math.abs(r-ii(Math.max(ca(e[0]),ca(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],n)),r=i.join("")}else r=",."+ii(n[2])+"f";return $i.format(r)}function ii(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ai(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=Zn(n.map(i),r?Math:ms);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Yn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),h=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;f--)o.push(a(c)*f);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return ps;arguments.length<2?r=ps:"function"!=typeof r&&(r=$i.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function xi(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,c=-s*a,u=t[0]+l,h=t[1]+c,f=e[0]+l,d=e[1]+c,p=(u+f)/2,m=(h+d)/2,g=f-u,v=d-h,y=g*g+v*v,b=r-n,x=u*d-f*h,_=(v<0?-1:1)*Math.sqrt(Math.max(0,b*b*y-x*x)),w=(x*v-g*_)/y,M=(-x*g-v*_)/y,k=(x*v+g*_)/y,T=(-x*g+v*_)/y,A=w-p,S=M-m,E=k-p,L=T-m;return A*A+S*S>E*E+L*L&&(w=k,M=T),[[w-l,M-c],[w*r/b,M*r/b]]}function _i(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],h=-1,f=e.length,d=_t(r),p=_t(n);++h1?t.join("L"):t+"Z"}function Mi(t){return t.join("L")+"Z"}function ki(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 c=2;c9&&(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}function Di(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,h,f,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=kt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function Yi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Wi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function Xi(t){return t.toISOString()}function Zi(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=$i.bisect(Bs,n);return i==Bs.length?[e.year,ei(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Bs[i-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=Ji(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=Ji(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Yn(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],Ji(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Zi(t.copy(),e,r)},$n(n,t)}function Ji(t){return new Date(t)}function Ki(t){return JSON.parse(t.responseText)}function Qi(t){var e=ra.createRange();return e.selectNode(ra.body),e.createContextualFragment(t.responseText)}var $i={version:"3.5.17"},ta=[].slice,ea=function(t){return ta.call(t)},ra=this.document;if(ra)try{ea(ra.documentElement.childNodes)[0].nodeType}catch(t){ea=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}),ra)try{ra.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var na=this.Element.prototype,ia=na.setAttribute,aa=na.setAttributeNS,oa=this.CSSStyleDeclaration.prototype,sa=oa.setProperty;na.setAttribute=function(t,e){ia.call(this,t,e+"")},na.setAttributeNS=function(t,e,r){aa.call(this,t,e,r+"")},oa.setProperty=function(t,e,r){sa.call(this,t,e+"",r)}}$i.ascending=n,$i.descending=function(t,e){return et?1:e>=t?0:NaN},$i.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},$i.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},$i.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 l/(u-1)},$i.deviation=function(){var t=$i.variance.apply(this,arguments);return t?Math.sqrt(t):t};var la=o(n);$i.bisectLeft=la.left,$i.bisect=$i.bisectRight=la.right,$i.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},$i.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},$i.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},$i.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 ca=Math.abs;$i.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}(ca(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)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,h,f,d=-1,p=o.length,m=a[s++],g=new c;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t($i.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},$i.set=function(t){var e=new v;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}},$i.event=null,$i.requote=function(t){return t.replace(da,"\\$&")};var da=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,pa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},ma=function(t,e){return e.querySelector(t)},ga=function(t,e){return e.querySelectorAll(t)},va=function(t,e){var r=t.matches||t[b(t,"matchesSelector")];return(va=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(ma=function(t,e){return Sizzle(t,e)[0]||null},ga=Sizzle,va=Sizzle.matchesSelector),$i.selection=function(){return $i.select(ra.documentElement)};var ya=$i.selection.prototype=[];ya.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),xa.hasOwnProperty(r)?{space:xa[r],local:t}:t}},ya.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=$i.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ya.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=P(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},ya.sort=function(t){t=function(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.transition().duration(E)),e.call(t.event)}function o(){x&&x.domain(b.range().map(function(t){return(t-k.x)/k.k}).map(b.invert)),w&&w.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){L++||t({type:"zoomstart"})}function l(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=z.of(t,arguments),a=0,o=$i.select(r(t)).on(I,function(){a=1,i($i.mouse(t),u),l(n)}).on(P,function(){o.on(I,null).on(P,null),h(a),c(n)}),u=e($i.mouse(t)),h=Y(t);Cs.call(t),s(n)}function h(){function t(){var t=$i.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=$i.event.target;$i.select(e).on(x,o).on(_,f),w.push(e);for(var r=$i.event.changedTouches,n=0,i=r.length;n1){c=s[0];var u=s[1],h=c[0]-u[0],d=c[1]-u[1];v=h*h+d*d}}function o(){var t,e,r,a,o=$i.touches(p);Cs.call(p);for(var s=0,c=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++8?function(t){return t/r}:function(t){return t*r},symbol:t}});$i.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=$i.round(t,Et(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Qa[8+r/3]};var $a=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,to=$i.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=$i.round(t,Et(t,e))).toFixed(Math.max(0,Math.min(20,Et(t*(1+1e-15),e))))}}),eo=$i.time={},ro=Date;Lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){no.setUTCDate.apply(this._,arguments)},setDay:function(){no.setUTCDay.apply(this._,arguments)},setFullYear:function(){no.setUTCFullYear.apply(this._,arguments)},setHours:function(){no.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){no.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){no.setUTCMinutes.apply(this._,arguments)},setMonth:function(){no.setUTCMonth.apply(this._,arguments)},setSeconds:function(){no.setUTCSeconds.apply(this._,arguments)},setTime:function(){no.setTime.apply(this._,arguments)}};var no=Date.prototype;eo.year=Ct(function(t){return(t=eo.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),eo.years=eo.year.range,eo.years.utc=eo.year.utc.range,eo.day=Ct(function(t){var e=new ro(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),eo.days=eo.day.range,eo.days.utc=eo.day.utc.range,eo.dayOfYear=function(t){var e=eo.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=eo[t]=Ct(function(t){return(t=eo.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});eo[t+"s"]=r.range,eo[t+"s"].utc=r.utc.range,eo[t+"OfYear"]=function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)}}),eo.week=eo.sunday,eo.weeks=eo.sunday.range,eo.weeks.utc=eo.sunday.utc.range,eo.weekOfYear=eo.sundayOfYear;var io={"-":"",_:" ",0:"0"},ao=/^\s*\d+/,oo=/^%/;$i.locale=function(t){return{numberFormat:function(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:y;return function(t){var r=$a.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],h=r[7],f=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(f&&(f=+f.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":h=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,f=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||f||(d="g"),null!=f&&("g"==d?f=Math.max(1,Math.min(21,f)):"e"!=d&&"f"!=d||(f=Math.max(0,Math.min(20,f)))),d=to.get(d)||function(t){return t+""};var b=c&&h;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=$i.formatPrefix(t,f);t=l.scale(t),r=l.symbol+g}else t*=p;var x,_,w=(t=d(t,f)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(x=t,_=""):(x=t.substring(0,M),_=t.substring(M))}else x=t.substring(0,w),_=e+t.substring(w+1);!c&&h&&(x=a(x,1/0));var k=m.length+x.length+_.length+(b?0:i.length),T=k"===o?T+i+t:"^"===o?T.substring(0,k>>=1)+i+t+T.substring(k):i+(b?t:T+t))+r}}}(t),timeFormat:function(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=_[o in io?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}var n=t.dateTime,i=t.date,a=t.time,o=t.periods,s=t.days,l=t.shortDays,c=t.months,u=t.shortMonths;e.multi=(e.utc=function(t){function r(t){try{var e=new(ro=Lt);return e._=t,n(e)}finally{ro=Date}}var n=e(t);return r.parse=function(t){try{ro=Lt;var e=n.parse(t);return e&&e._}finally{ro=Date}},r.toString=n.toString,r}).multi=Jt;var h=$i.map(),f=Dt(s),d=zt(s),p=Dt(l),m=zt(l),g=Dt(c),v=zt(c),y=Dt(u),b=zt(u);o.forEach(function(t,e){h.set(t.toLowerCase(),e)});var x={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Pt(t.getDate(),e,2)},e:function(t,e){return Pt(t.getDate(),e,2)},H:function(t,e){return Pt(t.getHours(),e,2)},I:function(t,e){return Pt(t.getHours()%12||12,e,2)},j:function(t,e){return Pt(1+eo.dayOfYear(t),e,3)},L:function(t,e){return Pt(t.getMilliseconds(),e,3)},m:function(t,e){return Pt(t.getMonth()+1,e,2)},M:function(t,e){return Pt(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Pt(t.getSeconds(),e,2)},U:function(t,e){return Pt(eo.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Pt(eo.mondayOfYear(t),e,2)},x:e(i),X:e(a),y:function(t,e){return Pt(t.getFullYear()%100,e,2)},Y:function(t,e){return Pt(t.getFullYear()%1e4,e,4)},Z:Xt,"%":function(){return"%"}},_={a:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){f.lastIndex=0;var n=f.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=b.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,n){return r(t,x.c.toString(),e,n)},d:Vt,e:Vt,H:qt,I:qt,j:Ht,L:Wt,m:Ut,M:Gt,p:function(t,e,r){var n=h.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Yt,U:Ft,w:Ot,W:Rt,x:function(t,e,n){return r(t,x.x.toString(),e,n)},X:function(t,e,n){return r(t,x.X.toString(),e,n)},y:Nt,Y:jt,Z:Bt,"%":Zt};return e}(t)}};var so=$i.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});$i.format=so.numberFormat,$i.geo={},Kt.prototype={s:0,t:0,add:function(t){Qt(t,this.t,lo),Qt(lo.s,this.s,this),this.s?this.t+=lo.t:this.s=lo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var lo=new Kt;$i.geo.stream=function(t,e){t&&co.hasOwnProperty(t.type)?co[t.type](t,e):$t(t,e)};var co={Feature:function(t,e){$t(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ne([e*Pa,r*Pa]);if(v){var i=ae(v,n),a=ae([i[1],-i[0],0],i);le(a),a=ce(a);var o=e-p,l=o>0?1:-1,c=a[0]*Da*l,m=ca(o)>180;if(m^(l*pd&&(d=g)}else if(c=(c+360)%360-180,m^(l*pd&&(d=r);m?es(u,f)&&(f=e):s(e,f)>s(u,f)&&(u=e):f>=u?(ef&&(f=e)):e>p?s(u,e)>s(u,f)&&(f=e):s(e,f)>s(u,f)&&(u=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){x[0]=u,x[1]=f,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=ca(n)>180?n+(n>0?360:-360):n}else m=t,g=r;po.point(t,r),e(t,r)}function a(){po.lineStart()}function o(){i(m,g),po.lineEnd(),ca(y)>Aa&&(u=-(f=180)),x[0]=u,x[1]=f,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tAa?d=90:y<-Aa&&(h=-90),x[0]=u,x[1]=f}};return function(t){d=f=-(u=h=1/0),b=[],$i.geo.stream(t,_);if(i=b.length){b.sort(l);for(var e=1,r=[p=b[0]];es(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):r.push(p=a);for(var n,i,a,o=-1/0,p=(e=0,r[i=r.length-1]);e<=i;p=a,++e)a=r[e],(n=s(p[1],a[0]))>o&&(o=n,u=a[0],f=p[1])}return b=x=null,u===1/0||h===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,h],[f,d]]}}(),$i.geo.centroid=function(t){mo=go=vo=yo=bo=xo=_o=wo=Mo=ko=To=0,$i.geo.stream(t,Ao);var e=Mo,r=ko,n=To,i=e*e+r*r+n*n;return i0?Ea:-Ea,l=ca(a-r);ca(l-Ea)0?Ia:-Ia),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Ea&&(ca(r-i)Aa?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*Ia,n.point(-Ea,i),n.point(0,i),n.point(Ea,i),n.point(Ea,0),n.point(Ea,-i),n.point(0,-i),n.point(-Ea,-i),n.point(-Ea,0),n.point(-Ea,i);else if(ca(t[0]-e[0])>Aa){var a=t[0]=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],h=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,h-.238*c],[u+.455*c,h+.238*c]]).stream(l).point,n=o.translate([u-.307*c,h+.201*c]).clipExtent([[u-.425*c+Aa,h+.12*c+Aa],[u-.214*c-Aa,h+.234*c-Aa]]).stream(l).point,i=s.translate([u-.205*c,h+.212*c]).clipExtent([[u-.214*c+Aa,h+.166*c+Aa],[u-.115*c-Aa,h+.234*c-Aa]]).stream(l).point,t},t.scale(1070)};var Lo,Co,Io,Po,Do,zo,Oo={point:x,lineStart:x,lineEnd:x,polygonStart:function(){Co=0,Oo.lineStart=Le},polygonEnd:function(){Oo.lineStart=Oo.lineEnd=Oo.point=x,Lo+=ca(Co/2)}},Fo={point:function(t,e){tDo&&(Do=t),ezo&&(zo=e)},lineStart:x,lineEnd:x,polygonStart:x,polygonEnd:x},Ro={point:Ie,lineStart:Pe,lineEnd:De,polygonStart:function(){Ro.lineStart=ze},polygonEnd:function(){Ro.point=Ie,Ro.lineStart=Pe,Ro.lineEnd=De}};$i.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),$i.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Lo=0,$i.geo.stream(t,i(Oo)),Lo},t.centroid=function(t){return vo=yo=bo=xo=_o=wo=Mo=ko=To=0,$i.geo.stream(t,i(Ro)),To?[Mo/To,ko/To]:wo?[xo/wo,_o/wo]:bo?[vo/bo,yo/bo]:[NaN,NaN]},t.bounds=function(t){return Do=zo=-(Io=Po=1/0),$i.geo.stream(t,i(Fo)),[[Io,Po],[Do,zo]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||function(t){var e=Oe(function(e,r){return t([e*Da,r*Da])});return function(t){return Be(e(t))}}(t):y,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new function(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ce(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ce(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}:new function(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,La)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:x};return s}(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection($i.geo.albersUsa()).context(null)},$i.geo.transform=function(t){return{stream:function(e){var r=new Fe(e);for(var n in t)r[n]=t[n];return r}}},Fe.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},$i.geo.projection=je,$i.geo.projectionMutator=Ne,($i.geo.equirectangular=function(){return je(Ue)}).raw=Ue.invert=Ue,$i.geo.rotation=function(t){function e(e){return e=t(e[0]*Pa,e[1]*Pa),e[0]*=Da,e[1]*=Da,e}return t=He(t[0]%360*Pa,t[1]*Pa,t.length>2?t[2]*Pa:0),e.invert=function(e){return e=t.invert(e[0]*Pa,e[1]*Pa),e[0]*=Da,e[1]*=Da,e},e},Ve.invert=Ue,$i.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=He(-t[0]*Pa,-t[1]*Pa,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Da,t[1]*=Da}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=We((e=+n)*Pa,i*Pa),t):e},t.precision=function(n){return arguments.length?(r=We(e*Pa,(i=+n)*Pa),t):i},t.angle(90)},$i.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Pa,i=t[1]*Pa,a=e[1]*Pa,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),h=Math.cos(a);return Math.atan2(Math.sqrt((r=h*o)*r+(r=c*u-l*h*s)*r),l*u+c*h*s)},$i.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return $i.range(Math.ceil(a/g)*g,i,g).map(f).concat($i.range(Math.ceil(c/v)*v,l,v).map(d)).concat($i.range(Math.ceil(n/p)*p,r,p).filter(function(t){return ca(t%g)>Aa}).map(u)).concat($i.range(Math.ceil(s/m)*m,o,m).filter(function(t){return ca(t%v)>Aa}).map(h))}var r,n,i,a,o,s,l,c,u,h,f,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[f(a).concat(d(l).slice(1),f(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=Ze(s,o,90),h=Je(n,r,y),f=Ze(c,l,90),d=Je(a,i,y),t):y},t.majorExtent([[-180,-90+Aa],[180,90-Aa]]).minorExtent([[-180,-80-Aa],[180,80+Aa]])},$i.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=Ke,i=Qe;return t.distance=function(){return $i.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},$i.geo.interpolate=function(t,e){return function(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),c=i*Math.sin(t),u=o*Math.cos(r),h=o*Math.sin(r),f=2*Math.asin(Math.sqrt(tt(n-e)+i*o*tt(r-t))),d=1/Math.sin(f),p=f?function(t){var e=Math.sin(t*=f)*d,r=Math.sin(f-t)*d,n=r*l+e*u,i=r*c+e*h,o=r*a+e*s;return[Math.atan2(i,n)*Da,Math.atan2(o,Math.sqrt(n*n+i*i))*Da]}:function(){return[t*Da,e*Da]};return p.distance=f,p}(t[0]*Pa,t[1]*Pa,e[0]*Pa,e[1]*Pa)},$i.geo.length=function(t){return jo=0,$i.geo.stream(t,No),jo};var jo,No={sphere:x,point:x,lineStart:function(){function t(t,i){var a=Math.sin(i*=Pa),o=Math.cos(i),s=ca((t*=Pa)-e),l=Math.cos(s);jo+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;No.point=function(i,a){e=i*Pa,r=Math.sin(a*=Pa),n=Math.cos(a),No.point=t},No.lineEnd=function(){No.point=No.lineEnd=x}},lineEnd:x,polygonStart:x,polygonEnd:x},Bo=$e(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});($i.geo.azimuthalEqualArea=function(){return je(Bo)}).raw=Bo;var Uo=$e(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);($i.geo.azimuthalEquidistant=function(){return je(Uo)}).raw=Uo,($i.geo.conicConformal=function(){return Se(tr)}).raw=tr,($i.geo.conicEquidistant=function(){return Se(er)}).raw=er;var Vo=$e(function(t){return 1/t},Math.atan);($i.geo.gnomonic=function(){return je(Vo)}).raw=Vo,rr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Ia]},($i.geo.mercator=function(){return nr(rr)}).raw=rr;var Ho=$e(function(){return 1},Math.asin);($i.geo.orthographic=function(){return je(Ho)}).raw=Ho;var qo=$e(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});($i.geo.stereographic=function(){return je(qo)}).raw=qo,ir.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Ia]},($i.geo.transverseMercator=function(){var t=nr(ir),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=ir,$i.geom={},$i.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=_t(r),a=_t(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+h;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Aa)*Aa,y:Math.round(o(t,e)/Aa)*Aa,i:e}})}var n=ar,i=or,a=n,o=i,s=$o;return t?e(t):(e.links=function(t){return Ir(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return Ir(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(br),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,f=n>=u,d=f<<1|h;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),h?i=c:s=c,f?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,h,f,d,p,m,g,v,y,b=_t(s),x=_t(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),h=[],f=[],p=t.length,o)for(d=0;dv&&(v=u.x),u.y>y&&(y=u.y),h.push(u.x),f.push(u.y);else for(d=0;dv&&(v=_),w>y&&(y=w),h.push(_),f.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var T={leaf:!0,nodes:[],point:null,x:null,y:null};if(T.add=function(t){a(T,t,+b(t,++d),+x(t,d),m,g,v,y)},T.visit=function(t){Or(t,T,m,g,v,y)},T.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,h,f,d){if(!(u>a||h>o||f=_)<<1|e>=x,M=w+4;w=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ns.get(r)||rs,n=is.get(n)||y,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}(n(r.apply(null,ta.call(arguments,1))))},$i.interpolateHcl=function(t,e){t=$i.hcl(t),e=$i.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return at(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateHsl=function(t,e){t=$i.hsl(t),e=$i.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return nt(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateLab=function(t,e){t=$i.lab(t),e=$i.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return st(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateRound=Jr,$i.transform=function(t){var e=ra.createElementNS($i.ns.prefix.svg,"g");return($i.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Kr(r?r.matrix:as)})(t)},Kr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var as={a:1,b:0,c:0,d:1,e:0,f:0};$i.interpolateTransform=en,$i.layout={},$i.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=kt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return pn(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=vn,r=mn,n=gn;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(dn(e,function(t){t.children&&(t.value=0)}),pn(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},$i.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&((o=l[$i.bisect(h,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Ln,i=Sn;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=_t(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return En(t,e)}:_t(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},$i.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,pn(s,function(t){t.r=+u(t.value)}),pn(s,zn),n){var h=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;pn(s,function(t){t.r+=h}),pn(s,zn),pn(s,function(t){t.r-=h})}return Rn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=$i.layout.hierarchy().sort(Cn),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},fn(t,r)},$i.layout.tree=function(){function t(t,l){var c=i.call(this,t,l),u=c[0],h=function(t){var e,r={A:null,children:[t]},n=[r];for(;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 m=a(f,d)/2-f.x,g=o[0]/(d.x+a(d,f)/2+m),v=o[1]/(p.depth||1);dn(u,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return c}function e(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.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 i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+a(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+a(t._,n._));t.parent.A=function(t,e,r){if(e){for(var n,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,h=s.m,f=l.m;s=Un(s),i=Bn(i),s&&i;)l=Bn(l),(o=Un(o)).a=t,(n=s.z+h-i.z-c+a(s._,i._))>0&&(!function(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}(function(t,e,r){return t.a.parent===e.parent?t.a:r}(s,t,r),t,n),c+=n,u+=n),h+=s.m,c+=i.m,f+=l.m,u+=o.m;s&&!Un(o)&&(o.t=s,o.m+=h-u),i&&!Bn(l)&&(l.t=i,l.m+=c-f,r=t)}return r}(t,n,t.parent.A||r[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function n(t){t.x*=o[0],t.y=t.depth*o[1]}var i=$i.layout.hierarchy().sort(null).value(null),a=Nn,o=[1,1],s=null;return t.separation=function(e){return arguments.length?(a=e,t):a},t.size=function(e){return arguments.length?(s=null==(o=e)?n:null,t):s?null:o},t.nodeSize=function(e){return arguments.length?(s=null==(o=e)?null:n,t):s?o:null},fn(t,i)},$i.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;pn(l,function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(e),t.y=function(t){return 1+$i.max(t,function(t){return t.y})}(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Vn(l),h=Hn(l),f=u.x-r(u,h)/2,d=h.x+r(h,u)/2;return pn(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-f)/(d-f)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=$i.layout.hierarchy().sort(null).value(null),r=Nn,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},fn(t,e)},$i.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(a=h[s-1]),c.area+=a.area,"squarify"!==f||(o=function(t,e){var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;for(;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}(c,m))<=p?(h.pop(),p=o):(c.area-=c.pop().area,n(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(n(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function r(e){var i=e.children;if(i&&i.length){var a,o=u(e),s=i.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(n(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);i.forEach(r)}}function n(t,e,r,n){var i,a=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=$i.random.normal.apply($i,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=$i.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rh?0:1;if(c=Ca)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,b,x,_,w,M,k,T,A=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===xs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(S*=-1),c&&(S=Q(g/c*Math.sin(v))),t&&(A=Q(g/t*Math.sin(v)))),c){y=c*Math.cos(u+S),b=c*Math.sin(u+S),x=c*Math.cos(h-S),_=c*Math.sin(h-S);var L=Math.abs(h-u-2*S)<=Ea?0:1;if(S&&bi(y,b,x,_)===d^L){var C=(u+h)/2;y=c*Math.cos(C),b=c*Math.sin(C),x=_=null}}else y=b=0;if(t){w=t*Math.cos(h-A),M=t*Math.sin(h-A),k=t*Math.cos(u+A),T=t*Math.sin(u+A);var I=Math.abs(u-h+2*A)<=Ea?0:1;if(A&&bi(w,M,k,T)===1-d^I){var P=(u+h)/2;w=t*Math.cos(P),M=t*Math.sin(P),k=T=null}}else w=M=0;if(f>Aa&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ti,basis:Ei,"basis-open":function(t){if(t.length<4)return wi(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(Li(ks,a)+","+Li(ks,o)),--n;++nEa)+",1 "+e}function n(t,e,r,n){return"Q 0,0 "+n}var i=Ke,a=Qe,o=Oi,s=gi,l=vi;return t.radius=function(e){return arguments.length?(o=_t(e),t):o},t.source=function(e){return arguments.length?(i=_t(e),t):i},t.target=function(e){return arguments.length?(a=_t(e),t):a},t.startAngle=function(e){return arguments.length?(s=_t(e),t):s},t.endAngle=function(e){return arguments.length?(l=_t(e),t):l},t},$i.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,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(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Ke,r=Qe,n=Fi;return t.source=function(r){return arguments.length?(e=_t(r),t):e},t.target=function(e){return arguments.length?(r=_t(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},$i.svg.diagonal.radial=function(){var t=$i.svg.diagonal(),e=Fi,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]-Ia;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},$i.svg.symbol=function(){function t(t,n){return(Ts.get(e.call(this,t,n))||Ni)(r.call(this,t,n))}var e=ji,r=Ri;return t.type=function(r){return arguments.length?(e=_t(r),t):e},t.size=function(e){return arguments.length?(r=_t(e),t):r},t};var Ts=$i.map({circle:Ni,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*Ss)),r=e*Ss;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/As),r=e*As/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/As),r=e*As/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});$i.svg.symbolTypes=Ts.keys();var As=Math.sqrt(3),Ss=Math.tan(30*Pa);ya.transition=function(t){for(var e,r,n=Es||++Ps,i=qi(t),a=[],o=Ls||{time:Date.now(),ease:function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",h[1]-h[0])}function i(t){t.select(".extent").attr("y",f[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function a(){function a(){var t=$i.mouse(b),r=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||($i.event.altKey?(v||(v=[(h[0]+h[1])/2,(f[0]+f[1])/2]),L[0]=h[+(t[0]=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(u=0;u<_.length;++u)f=(x=_[u])[0],x[0]=x[1],x[1]=f;return _}},{"incremental-convex-hull":291,uniq:552}],125:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]};function a(t,e){return i[0]=t,i[1]=e,n[0]}e.exports.pack=a;function o(t){return n[0]=t,i[0]}e.exports.lo=o;function s(t){return n[0]=t,i[1]}e.exports.hi=s}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]};function l(t,e){return i[1]=t,i[0]=e,n[0]}e.exports.pack=l;function c(t){return n[0]=t,i[1]}e.exports.lo=c;function u(t){return n[0]=t,i[0]}e.exports.hi=u}else r=!1}if(!r){var h=new t(8);e.exports=function(t){return h.writeDoubleLE(t,0,!0),[h.readUInt32LE(0,!0),h.readUInt32LE(4,!0)]};function f(t,e){return h.writeUInt32LE(t,0,!0),h.writeUInt32LE(e,4,!0),h.readDoubleLE(0,!0)}e.exports.pack=f;function d(t){return h.writeDoubleLE(t,0,!0),h.readUInt32LE(0,!0)}e.exports.lo=d;function p(t){return h.writeDoubleLE(t,0,!0),h.readUInt32LE(4,!0)}e.exports.hi=p}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:78}],126:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=h&&c(ar.x)&&d(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=p(e,t);a(r,r.next)}}(m[o],r),r=a(r,r.next);return r}(t,e,u,r)),t.length>80*r){f=g=t[0],m=v=t[1];for(var _=r;_g&&(g=y),b>v&&(v=b);x=Math.max(g-f,v-m)}return o(u,h,r,f,m,x),h}function i(t,e,r,n,i){var a,o;if(i===y(t,e,r,n)>0)for(a=e;a=e;a-=n)o=m(a,t[a],t[a+1],o);return o&&h(o,o.next)&&(g(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!h(n,n.next)&&0!==u(n.prev,n,n.next))n=n.next;else{if(g(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,s,m){if(t){!m&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=l(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,s);for(var v,y,b=t;t.prev!==t.next;)if(v=t.prev,y=t.next,s?function(t,e,r,n){var i=t.prev,a=t,o=t.next;if(u(i,a,o)>=0)return!1;var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,d=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=l(s,h,e,r,n),m=l(f,d,e,r,n),g=t.nextZ;for(;g&&g.z<=m;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.nextZ}g=t.prevZ;for(;g&&g.z>=p;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}(t,n,i,s):function(t){var e=t.prev,r=t,n=t.next;if(u(e,r,n)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(c(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&u(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(v.i/r),e.push(t.i/r),e.push(y.i/r),g(t),t=y.next,b=y.next;else if((t=y)===b){m?1===m?o(t=function(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!h(i,a)&&f(i,n,n.next,a)&&d(i,a)&&d(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),g(n),g(n.next),n=t=a),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,s,2):2===m&&function(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&f(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&d(t,e)&&d(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(l,c)){var u=p(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}(t,e,r,n,i,s):o(a(t),e,r,n,i,s,1);break}}}function s(t,e){return t.x-e.x}function l(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function c(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function u(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function h(t,e){return t.x===e.x&&t.y===e.y}function f(t,e,r,n){return!!(h(t,e)&&h(r,n)||h(t,n)&&h(r,e))||u(t,e,r)>0!=u(t,e,n)>0&&u(r,n,t)>0!=u(r,n,e)>0}function d(t,e){return u(t.prev,t,t.next)<0?u(t,e,t.next)>=0&&u(t,t.prev,e)>=0:u(t,e,t.prev)<0||u(t,t.next,e)<0}function p(t,e){var r=new v(t.i,t.x,t.y),n=new v(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function m(t,e,r,n){var i=new v(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function g(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],128:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],131:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],132:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&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}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],133:[function(t,e,r){"use strict";function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";return"("+("=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?o(t.slice(1),"||"):"all"===e?o(t.slice(1),"&&"):"none"===e?c(o(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?c(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var a=i(t),o="$type"===t?h.indexOf(e):JSON.stringify(e);return(n?"typeof "+a+"=== typeof "+o+"&&":"")+a+r+o}function o(t,e){return t.map(n).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return h.indexOf(t)}));var r=JSON.stringify(e.sort(u)),n=i(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function u(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))};var h=["Unknown","Point","LineString","Polygon"]},{}],134:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){f=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var u=a.length-1,h=(e[r-1],0);h=0;--r)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--h)i.push(n(l[h-1],c[h-1],arguments[h])),a.push(0)}},l.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var f=r;f>0;--f){var d=n(c[f-1],u[f-1],arguments[f]);i.push(d),a.push((d-i[o++])*h)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,h=u>1e-6?1/u:0;this._time.push(t);for(var f=r;f>0;--f){var d=arguments[f];i.push(n(l[f-1],c[f-1],i[o++]+d)),a.push(d*h)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--h)i.push(n(l[h],c[h],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":67,"cubic-hermite":110}],135:[function(t,e,r){"use strict";var n=t("tiny-sdf"),i=t("optical-properties");e.exports=function(t){var e,r,o=(t=t||{}).canvas||document.createElement("canvas"),s=t.family||"sans-serif",l=t.shape||[512,512],c=t.step||[32,32],u=parseFloat(t.size)||16,h=t.chars||[32,126],f=Math.floor((c[0]-u)/2),d=t.radius||1.5*f,p=new n(u,f,d,0,s),m=null==t.align?"optical":t.align,g=null==t.fit||1==t.fit?.5:t.fit;if(Array.isArray(h)){if(2===h.length&&"number"==typeof h[0]&&"number"==typeof h[1]){var v=[];for(e=h[0],r=0;e<=h[1];e++)v[r++]=String.fromCharCode(e);h=v}}else h=String(h).split("");l=l.slice(),o.width=l[0],o.height=l[1];var y=o.getContext("2d");y.fillStyle="#000",y.fillRect(0,0,o.width,o.height),y.textBaseline="middle";var b=c[0],x=c[1],_=0,w=0,M=u/x,k=Math.min(h.length,Math.floor(l[0]/b)*Math.ceil(l[1]/x)),T=p.ctx.textAlign,A=p.buffer,S=p.middle;for(p.ctx.textAlign="center",p.buffer=p.size/2,e=0;el[0]-c[0]&&(_=0,w+=c[1])}return p.ctx.textAlign=T,p.buffer=A,p.middle=S,o};var a={}},{"optical-properties":472,"tiny-sdf":542}],136:[function(t,e,r){"use strict";function n(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 i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}function l(t,e){if(e.left){if(r=l(t,e.left))return r}var r;return(r=t(e.key,e.value))||(e.right?l(t,e.right):void 0)}function c(t,e,r,n){if(e(t,n.key)<=0){if(n.left){if(i=c(t,e,r,n.left))return i}var i;if(i=r(n.key,n.value))return i}if(n.right)return c(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 h(t,e){this.tree=t,this._stack=e}function f(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}e.exports=function(t){return new s(t||function(t,e){return te?1:0},null)};var d=0,p=1,m=s.prototype;Object.defineProperty(m,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(m,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(d,t,e,null,null,1));for(var h=l.length-2;h>=0;--h){i=l[h];c[h]<=0?l[h]=new n(i._color,i.key,i.value,l[h+1],i.right,i._count+1):l[h]=new n(i._color,i.key,i.value,i.left,l[h+1],i._count+1)}for(h=l.length-1;h>1;--h){var f=l[h-1];i=l[h];if(f._color===p||i._color===p)break;var m=l[h-2];if(m.left===f)if(f.left===i){if(!(g=m.right)||g._color!==d){if(m._color=d,m.left=f.right,f._color=p,f.right=m,l[h-2]=f,l[h-1]=i,o(m),o(f),h>=3){(v=l[h-3]).left===m?v.left=f:v.right=f}break}f._color=p,m.right=a(p,g),m._color=d,h-=1}else{if(!(g=m.right)||g._color!==d){if(f.right=i.left,m._color=d,m.left=i.right,i._color=p,i.left=f,i.right=m,l[h-2]=i,l[h-1]=f,o(m),o(f),o(i),h>=3){(v=l[h-3]).left===m?v.left=i:v.right=i}break}f._color=p,m.right=a(p,g),m._color=d,h-=1}else if(f.right===i){if(!(g=m.left)||g._color!==d){if(m._color=d,m.right=f.left,f._color=p,f.left=m,l[h-2]=f,l[h-1]=i,o(m),o(f),h>=3){(v=l[h-3]).right===m?v.right=f:v.left=f}break}f._color=p,m.left=a(p,g),m._color=d,h-=1}else{var g;if(!(g=m.left)||g._color!==d){if(f.left=i.right,m._color=d,m.right=i.left,i._color=p,i.right=f,i.left=m,l[h-2]=i,l[h-1]=f,o(m),o(f),o(i),h>=3){var v;(v=l[h-3]).right===m?v.right=i:v.left=i}break}f._color=p,m.left=a(p,g),m._color=d,h-=1}}return l[0]._color=p,new s(r,l[0])},m.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(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(m,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(m,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),m.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},m.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 h(this,n)},m.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 h(this,n)},m.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 h(this,n)},m.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 h(this,n)},m.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 h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},m.remove=function(t){var e=this.find(t);return e?e.remove():this},m.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 g=h.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new h(this.tree,this._stack.slice())},g.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if((r=e[e.length-1])._color===d){var h=e[e.length-2];h.left===r?h.left=null:h.right===r&&(h.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=p);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===d)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=p,r._color=p,s._color=p,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),void(t[l-1]=n);if(n.left&&n.left._color===d)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).left===r?c.left=s:c.right=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.right=a(d,n));r.right=a(d,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=d,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11&&((c=t[l-2]).right===r?c.right=n:c.left=n),void(t[l-1]=n);if(n.right&&n.right._color===d)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).right===r?c.right=s:c.left=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.left=a(d,n));r.left=a(d,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=d,o(r),o(n),l>1){var c;(c=t[l-2]).right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"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}),g.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(g,"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}}),g.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},g.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(g,"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}})},{}],137:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],138:[function(t,e,r){function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}(t)===e?t:t.reverse()}var s=t("geojson-area");e.exports=n},{"geojson-area":138}],140:[function(t,e,r){"use strict";function n(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,r,a,o,s,l,c){if(r/=e,a/=e,l>=r&&c<=a)return t;if(l>a||c=r&&d<=a)u.push(p);else if(!(f>a||d=e&&s<=r&&i.push(o)}return i}(m,r,a,o):function(t,e,r,i,a,o){for(var s=[],l=0;lr?(x.push(a(c,p,e),a(c,p,r)),o||(x=n(s,x,g,v,y))):d>=e&&x.push(a(c,p,e)):f>r?dr&&(x.push(a(c,p,r)),o||(x=n(s,x,g,v,y))));c=m[b-1],(f=c[i])>=e&&f<=r&&x.push(c),h=x[x.length-1],o&&h&&(x[0][0]!==h[0]||x[0][1]!==h[1])&&x.push(x[0]),n(s,x,g,v,y)}return s}(m,r,a,o,s,3===g);v.length&&u.push(i(p.tags,g,v,p.id))}}return u.length?u:null};var i=t("./feature")},{"./feature":142}],141:[function(t,e,r){"use strict";function n(t,e,r){if(null!==e.geometry){var o,l,c,u,h=e.geometry,f=h.type,d=h.coordinates,p=e.properties,m=e.id;if("Point"===f)t.push(s(p,1,[a(d)],m));else if("MultiPoint"===f)t.push(s(p,1,i(d),m));else if("LineString"===f)t.push(s(p,2,[i(d,r)],m));else if("MultiLineString"===f||"Polygon"===f){for(c=[],o=0;o1?1:n,[r,n,0]}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),b=this.tiles[y]=f(t,v,r,n,x,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,b.numFeatures,b.numPoints,b.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(b.source=t,l){if(e===p.maxZoom||e===l)continue;var w=1<1&&console.time("clipping");var M,k,T,A,S,E,L=.5*p.buffer/p.extent,C=.5-L,I=.5+L,P=1+L;M=k=T=A=null,S=u(t,v,r-L,r+I,0,a,b.min[0],b.max[0]),E=u(t,v,r+C,r+P,0,a,b.min[0],b.max[0]),S&&(M=u(S,v,n-L,n+I,1,o,b.min[1],b.max[1]),k=u(S,v,n+C,n+P,1,o,b.min[1],b.max[1])),E&&(T=u(E,v,n-L,n+I,1,o,b.min[1],b.max[1]),A=u(E,v,n+C,n+P,1,o,b.min[1],b.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(T||[],e+1,2*r+1,2*n),d.push(A||[],e+1,2*r+1,2*n+1))}else l&&(g=e)}return g},n.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,l=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var h,f=t,d=e,p=r;!h&&f>0;)f--,d=Math.floor(d/2),p=Math.floor(p/2),h=this.tiles[i(f,d,p)];if(!h||!h.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",f,d,p),s(h,a,n.buffer))return c.tile(h,a);o>1&&console.time("drilling down");var m=this.splitTile(h.source,f,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<1?(n=a,i=o):h>0&&(n+=c*h,i+=u*h)}return c=s-n,u=l-i,c*c+u*u}(t[r],t[s],t[l]))>n&&(a=r,n=i);n>o?(t[a][2]=n,c.push(s),c.push(a),s=a):(l=c.pop(),s=c.pop())}}},{}],145:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){for(var o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},s=0;sh)&&(f.push(s),t.numSimplified++),t.numPoints++;3===c&&function(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;io.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1])}return o}},{}],146:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}e.exports=function(t,e){var r=new i(t);return r.update(e),r};var s=t("./lib/text.js"),l=t("./lib/lines.js"),c=t("./lib/background.js"),u=t("./lib/cube.js"),h=t("./lib/ticks.js"),f=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(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,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(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,u=!1;if("bounds"in t)for(var f=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)f[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=f[d][p];if("ticks"in t){r=t.ticks,c=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=h.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});h.equal(r,this.ticks)?c=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(c=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new a,new a,new a],m=[0,0,0],g={model:f,view:f,projection:f};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],b=[0,0,0];d.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||f,i=t.view||f,a=t.projection||f,s=this.bounds,l=u(r,i,a,s),c=l.cubeEdges,h=l.axis,d=i[12],x=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*d+a[7]*x+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=c[k],this.lastCubeProps.axis[k]=h[k];var T=p;for(k=0;k<3;++k)o(p[k],k,this.bounds,c,h);e=this.gl;var A=m;for(k=0;k<3;++k)this.backgroundEnable[k]?A[k]=h[k]:A[k]=0;this._background.draw(r,i,a,s,A,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];h[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(E=0;E<2;++E){L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,T[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,T[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var I=n(v,T[k].primalMinor),P=n(y,T[k].mirrorMinor),D=this.lineTickLength;for(E=0;E<3;++E){var z=M/r[5*E];I[E]*=D[E]*z,P[E]*=D[E]*z}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,T[k].primalOffset,I,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,T[k].mirrorOffset,P,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){var O=T[k].primalMinor,F=n(b,T[k].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[k]&&(F[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],F,this.tickColor[k])}if(this.labelEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.labelPad[E]/r[5*E];F[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],F,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":150,"./lib/cube.js":151,"./lib/lines.js":152,"./lib/text.js":154,"./lib/ticks.js":155}],150:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,h=[0,0,0],f=[0,0,0],d=-1;d<=1;d+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),h[l]=d,f[l]=d;for(var p=-1;p<=1;p+=2){h[c]=p;for(var m=-1;m<=1;m+=2)h[u]=m,e.push(h[0],h[1],h[2],f[0],f[1],f[2]),s+=1}var g=c;c=u,u=g}var v=i(t,new Float32Array(e)),y=i(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),b=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),x=o(t);return x.attributes.position.location=0,x.attributes.normal.location=1,new n(t,v,b,x)};var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders").bg,s=n.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),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":153,"gl-buffer":157,"gl-vao":272}],151:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<h[y][1]&&(O=y));var F=-1;for(y=0;y<3;++y)(j=O^1<h[R][0]&&(R=j))}var N=m;N[0]=N[1]=N[2]=0,N[a.log2(F^O)]=O&F,N[a.log2(O^R)]=O&R;var B=7^R;B===_||B===z?(B=7^F,N[a.log2(R^B)]=B&R):N[a.log2(F^B)]=B&F;var U=g,V=_;for(k=0;k<3;++k)U[k]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 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 colorChannel = abs(normal);\n}","precision mediump 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}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":256}],154:[function(t,e,r){(function(r){"use strict";function n(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}e.exports=function(t,e,r,o,l,c){var u=i(t),h=a(t,[{buffer:u,size:3}]),f=s(t);f.attributes.position.location=0;var d=new n(t,f,u,h);return d.update(e,r,o,l,c),d};var i=t("gl-buffer"),a=t("gl-vao"),o=t("vectorize-text"),s=t("./shaders").text,l=window||r.global||{},c=l.__TEXT_CACHE||{};l.__TEXT_CACHE={};var u=n.prototype,h=[0,0];u.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},u.update=function(t,e,r,n,i){function a(t,e,r,n){var i=c[r];i||(i=c[r]={});var a=i[e];a||(a=i[e]=function(t,e){try{return o(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,h=a.cells,f=0,d=h.length;f=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],h=[0,0,0],f=[0,0,0],d=0;d<3;++d){h[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],r),f[d]=(s.length/3|0)-h[d],l[d]=s.length/3|0;for(var p=0;p=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var h=""+c;h.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.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 a(t,e){for(var r=o.malloc(t.length,e),n=t.length,i=0;i=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=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=o.malloc(t.size,r),u=l(n,t.shape);s.assign(u,t),this.length=i(this.gl,this.type,this.length,this.usage,e<0?n:n.subarray(0,t.size),e),o.free(n)}}else if(Array.isArray(t)){var h;h=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=i(this.gl,this.type,this.length,this.usage,e<0?h:h.subarray(0,t.length),e),o.free(h)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(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}},e.exports=function(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||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(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==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 a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}},{ndarray:468,"ndarray-ops":462,"typedarray-pool":550}],158:[function(t,e,r){e.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"}},{}],159:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":158}],160:[function(t,e,r){"use strict";function n(t,e,r,n){this.plot=t,this.shader=e,this.bufferHi=r,this.bufferLo=n,this.bounds=[1/0,1/0,-1/0,-1/0],this.numPoints=0,this.color=[0,0,0,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("typedarray-pool"),s=t("./lib/shaders");e.exports=function(t,e){var r=new n(t,i(t.gl,s.vertex,s.fragment),a(t.gl),a(t.gl));return r.update(e),t.addObject(r),r};var l=[[1,0,0,1,0,0],[1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,-1,0,0],[-1,0,0,1,0,0],[1,0,0,1,0,0],[1,0,-1,0,0,1],[1,0,-1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,-1],[1,0,1,0,0,1],[1,0,-1,0,0,1],[-1,0,-1,0,0,1],[-1,0,-1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,-1],[-1,0,1,0,0,1],[-1,0,-1,0,0,1],[0,1,1,0,0,0],[0,1,-1,0,0,0],[0,-1,-1,0,0,0],[0,-1,-1,0,0,0],[0,1,1,0,0,0],[0,-1,1,0,0,0],[0,1,0,-1,1,0],[0,1,0,-1,-1,0],[0,1,0,1,-1,0],[0,1,0,1,1,0],[0,1,0,-1,1,0],[0,1,0,1,-1,0],[0,-1,0,-1,1,0],[0,-1,0,-1,-1,0],[0,-1,0,1,-1,0],[0,-1,0,1,1,0],[0,-1,0,-1,1,0],[0,-1,0,1,-1,0]],c=n.prototype;c.draw=function(){var t=new Float32Array([0,0]),e=new Float32Array([0,0]),r=new Float32Array([0,0]),n=new Float32Array([0,0]),i=[1,1];return function(){var a=this.plot,o=this.shader,s=this.bounds,c=this.numPoints;if(c){var u=a.gl,h=a.dataBox,f=a.viewBox,d=a.pixelRatio,p=s[2]-s[0],m=s[3]-s[1],g=h[2]-h[0],v=h[3]-h[1],y=2*p/g,b=2*m/v,x=(s[0]-h[0]-.5*g)/p,_=(s[1]-h[1]-.5*v)/m;t[0]=y,t[1]=b,e[0]=y-t[0],e[1]=b-t[1],r[0]=x,r[1]=_,n[0]=x-r[0],n[1]=_-r[1];var w=f[2]-f[0],M=f[3]-f[1];i[0]=2*d/w,i[1]=2*d/M,o.bind(),o.uniforms.scaleHi=t,o.uniforms.scaleLo=e,o.uniforms.translateHi=r,o.uniforms.translateLo=n,o.uniforms.pixelScale=i,o.uniforms.color=this.color,this.bufferLo.bind(),o.attributes.positionLo.pointer(u.FLOAT,!1,16,0),this.bufferHi.bind(),o.attributes.positionHi.pointer(u.FLOAT,!1,16,0),o.attributes.pixelOffset.pointer(u.FLOAT,!1,16,8),u.drawArrays(u.TRIANGLES,0,c*l.length)}}}(),c.drawPick=function(t){return t},c.pick=function(){return null},c.update=function(t){var e,r,n,i=(t=t||{}).positions||[],a=t.errors||[],s=1;"lineWidth"in t&&(s=+t.lineWidth);var c=5;"capSize"in t&&(c=+t.capSize),this.color=(t.color||[0,0,0,1]).slice();var u=this.bounds=[1/0,1/0,-1/0,-1/0],h=this.numPoints=i.length>>1;for(e=0;e0&&(A*=_),S<0?S*=w:S>0&&(S*=M),g[b++]=f*(r-p+A),g[b++]=d*(n-m+S),g[b++]=s*T[2]+(c+s)*T[4],g[b++]=s*T[3]+(c+s)*T[5]}}for(e=0;e=1},u.isTransparent=function(){return this.opacity<1},u.drawTransparent=u.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var h=0;h<3;++h)e.lineWidth(this.lineWidth[h]),r.capSize=this.capSize[h]*u,this.lineCount[h]&&e.drawArrays(e.LINES,this.lineOffset[h],this.lineCount[h]);this.vao.unbind()};var h=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}();u.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m;(m=h.slice())[c]+=d[1][c],o.push(h[0],h[1],h[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":164,"gl-buffer":157,"gl-vao":272}],163:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&f.drawBuffersWEBGL(m[h]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=o(r,c,u,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=o(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=s(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=s(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=s(r,c,u,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var b=r.checkFramebufferStatus(r.FRAMEBUFFER);if(b!==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),v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),c=0;ca||r<0||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");var o=1;if("color"in(n=n||{})){if((o=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(o>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(o>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+o+" draw buffers")}}var s=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&o>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");s=t.FLOAT}else n.preferFloat&&o>0&&c&&(s=t.FLOAT);var u=!0;"depth"in n&&(u=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new l(t,e,r,s,o,u,g,i)};var h,f,d,p,m=null,g=l.prototype;Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return c(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,c(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,c(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),u.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]]}},u.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),n=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,f=this.bounds,d=f[0]=r[0],p=f[1]=n[0],m=1/((f[2]=r[r.length-1])-d),g=1/((f[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var b=(v-1)*(y-1)*(h.length>>>1);this.numVertices=b;for(var x=o.mallocUint8(4*b),_=o.mallocFloat32(2*b),w=o.mallocUint8(2*b),M=o.mallocUint32(b),k=0,T=0;T2&&!this.usingDashes){var b=this.mitreShader;this.lineBufferLo.bind(),b.attributes.aLo.pointer(l.FLOAT,!1,48,0),this.lineBufferHi.bind(),b.bind();var x=b.uniforms;this.setProjectionUniforms(x,a),x.color=u,x.radius=s*c,b.attributes.aHi.pointer(l.FLOAT,!1,48,0),l.drawArrays(l.POINTS,0,i/3|0)}}}}(),u.drawPick=function(){var t=[0,0,0,0];return function(e){var r=this.vertCount,n=this.numPoints;if(this.pickOffset=e,!r)return e+n;var i=this.setProjectionModel(),a=this.plot,o=this.width,s=a.gl,l=a.pickPixelRatio,c=this.pickShader,u=this.pickBuffer;t[0]=255&e,t[1]=e>>>8&255,t[2]=e>>>16&255,t[3]=e>>>24,c.bind();var h=c.uniforms;this.setProjectionUniforms(h,i),h.width=o*l,h.pickOffset=t;var f=c.attributes;return this.lineBufferHi.bind(),f.aHi.pointer(s.FLOAT,!1,16,0),f.dHi.pointer(s.FLOAT,!1,16,8),this.lineBufferLo.bind(),f.aLo.pointer(s.FLOAT,!1,16,0),u.bind(),f.pick0.pointer(s.UNSIGNED_BYTE,!1,8,0),f.pick1.pointer(s.UNSIGNED_BYTE,!1,8,4),s.drawArrays(s.TRIANGLES,0,r),e+n}}(),u.pick=function(t,e,r){var n=this.pickOffset,i=this.numPoints;if(r=n+i)return null;var a=r-n,o=this.data;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}},u.update=function(t){t=t||{};var e,r,n,i,a,c=this.plot.gl;this.color=(t.color||[0,0,1,1]).slice(),this.width=+(t.width||1),this.fill=(t.fill||[!1,!1,!1,!1]).slice(),this.fillColor=function(t){return t.map(function(t){return t.slice()})}(t.fillColor||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]);var u=t.dashes||[1],h=0;for(e=0;e1,this.dashPattern=o(c,s(f,[h,1,4],[1,0,0])),this.dashPattern.minFilter=c.NEAREST,this.dashPattern.magFilter=c.NEAREST,this.dashLength=h,l.free(f);var p=t.positions;this.data=p;var m=this.bounds;m[0]=m[1]=1/0,m[2]=m[3]=-1/0;var g=this.numPoints=p.length>>>1;if(0!==g){for(e=0;e1;){var k=--n;i=p[2*n],a=p[2*n+1];var T=k-1,A=p[2*T],S=p[2*T+1];if(!(isNaN(i)||isNaN(a)||isNaN(A)||isNaN(S))){M+=1,i=(i-m[0])/(m[2]-m[0]),a=(a-m[1])/(m[3]-m[1]);var E=(A=(A-m[0])/(m[2]-m[0]))-i,L=(S=(S-m[1])/(m[3]-m[1]))-a,C=k|1<<24,I=k-1,P=k,D=k-1|1<<24;v[--_]=-L,v[--_]=-E,v[--_]=a,v[--_]=i,x[--w]=C,x[--w]=I,v[--_]=L,v[--_]=E,v[--_]=S,v[--_]=A,x[--w]=P,x[--w]=D,v[--_]=-L,v[--_]=-E,v[--_]=S,v[--_]=A,x[--w]=P,x[--w]=D,v[--_]=L,v[--_]=E,v[--_]=S,v[--_]=A,x[--w]=P,x[--w]=D,v[--_]=-L,v[--_]=-E,v[--_]=a,v[--_]=i,x[--w]=C,x[--w]=I,v[--_]=L,v[--_]=E,v[--_]=a,v[--_]=i,x[--w]=C,x[--w]=I}}for(e=0;e 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 highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp 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 highp 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\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":256}],173:[function(t,e,r){"use strict";function n(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 i(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 a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(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.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=p(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 n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=s(e),a=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),u=f(new Array(1024),[256,1,4]),h=0;h<1024;++h)u.data[h]=255;var d=c(e,u);d.wrap=e.REPEAT;var g=new o(e,r,n,i,a,d);return g.update(t),g};var s=t("gl-buffer"),l=t("gl-vao"),c=t("gl-texture2d"),u=t("glsl-read-float"),h=t("binary-search-bounds"),f=t("ndarray"),d=t("./lib/shaders"),p=d.createShader,m=d.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v=o.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(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)},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e0){for(var b=0;b<24;++b)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var x,_;Array.isArray(o[0])?(x=o[e-1],_=o[e]):x=_=o,3===x.length&&(x=[x[0],x[1],x[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,x[0],x[1],x[2],x[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,x[0],x[1],x[2],x[3],y[0],y[1],y[2],v[0],v[1],v[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(d),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,h=i*l,f=i*c,d=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,b=s*u,x=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*x,t[1]=(f+b)*x,t[2]=(d-y)*x,t[3]=0,t[4]=(f-b)*_,t[5]=(1-(h+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(h+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,h=s+s,f=a*c,d=a*u,p=a*h,m=o*u,g=o*h,v=s*h,y=l*c,b=l*u,x=l*h,_=n[0],w=n[1],M=n[2],k=i[0],T=i[1],A=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+x)*_,t[2]=(p-b)*_,t[3]=0,t[4]=(d-x)*w,t[5]=(1-(f+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+b)*M,t[9]=(g-y)*M,t[10]=(1-(f+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*T+t[8]*A),t[13]=r[1]+T-(t[1]*k+t[5]*T+t[9]*A),t[14]=r[2]+A-(t[2]*k+t[6]*T+t[10]*A),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,h=n*s,f=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-h-p,t[1]=u+v,t[2]=f-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=f+g,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,h,f,d,p,m,g=e[0],v=e[1],y=e[2],b=a[0],x=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+h*m+f*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=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,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":195,"./mat3.js":198,"./vec3.js":202,"./vec4.js":203}],201:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=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},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,h=3*l*o,f=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*h+i[0]*f,t[1]=e[1]*c+r[1]*u+n[1]*h+i[1]*f,t[2]=e[2]*c+r[2]*u+n[2]*h+i[2]*f,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=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},i.transformMat3=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+h*-l-f*-s,t[1]=h*c+d*-s+f*-o-u*-l,t[2]=f*c+d*-l+u*-s-h*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=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.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":195}],203:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=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},i.subtract=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},i.sub=i.subtract,i.multiply=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},i.mul=i.multiply,i.divide=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},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=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},i.max=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},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=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},i.scaleAndAdd=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},i.distance=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)},i.dist=i.distance,i.squaredDistance=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},i.sqrDist=i.squaredDistance,i.length=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)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=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},i.normalize=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},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=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},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,h=c*i+l*n-o*a,f=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+h*-l-f*-s,t[1]=h*c+d*-s+f*-o-u*-l,t[2]=f*c+d*-l+u*-s-h*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[u]}return Math.abs(g-1)>.001?null:[h,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump 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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump 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}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],206:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,h,f,d,p,m,g,v,y,b,x,_,w,k,T,A,S){this.gl=t,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=u,this.triangleNormals=f,this.triangleUVs=h,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=b,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=x,this.pointVAO=T,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=A,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!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._model=M,this._view=M,this._projection=M,this._resolution=[1,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("gl-vao"),s=t("gl-texture2d"),l=t("normals"),c=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),h=t("ndarray"),f=t("colormap"),d=t("simplicial-complex-contour"),p=t("typedarray-pool"),m=t("./lib/shaders"),g=t("./lib/closest-point"),v=m.meshShader,y=m.wireShader,b=m.pointShader,x=m.pickShader,_=m.pointPickShader,w=m.contourShader,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=n.prototype;k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){(p=this.triShader).bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){(p=this.lineShader).bind(),p.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){(p=this.pointShader).bind(),p.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p;(p=this.contourShader).bind(),p.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||M,n=t.view||M,i=t.projection||M,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,pickId:this.pickId/255};if((l=this.pickShader).bind(),l.uniforms=s,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),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l;(l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},k.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;al[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],c.drawArrays(c.TRIANGLES,l[k],l[T]-l[k]))),y[n]&&M&&(e[1^n]-=A*d*b[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=A*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=A*d*m[n+2],kl[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],c.drawArrays(c.TRIANGLES,l[k],l[T]-l[k]))),y[n+2]&&M&&(e[1^n]+=A*d*b[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=x[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),c.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],h=a[c+2]-u,f=.5*(o[c+2]+o[c]),d=o[c+2]-o[c],p=l[c],m=l[c+2]-p,g=s[c],v=s[c+2]-g;e[c]=2*h/d*m/v,t[c]=2*(u-f)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],h=[-1/0],f=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),T=new Array(k),A=0;A=0;)S+=1;w[b]=S}var E=new Array(r.length);h(),d._relink=h,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,x,w),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":214,"./lib/create-attributes":215,"./lib/create-uniforms":216,"./lib/reflect":217,"./lib/runtime-reflect":218,"./lib/shader-cache":219}],214:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}(n.prototype=new Error).name="GLError",n.prototype.constructor=n,e.exports=n},{}],215:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){if((p=f.charCodeAt(f.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+h+": "+f);i(t,e,d[0],n,p,s,h)}else{if(!(f.indexOf("mat")>=0))throw new o("","Unknown data type for attribute "+h+": "+f);var p;if((p=f.charCodeAt(f.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+h+": "+f);a(t,e,d,n,p,s,h)}}}return s};var o=t("./GLError"),s=n.prototype;s.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(s,"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}})},{"./GLError":214}],216:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new o("","Unknown uniform data type for "+name+": "+r)}var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new o("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new o("","Unrecognized data type for vector "+name+": "+r)}}}function c(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,c(a,i)):r.push([a,i])}return r}function u(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a4)throw new o("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(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 o("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new o("","Unknown uniform data type for "+name+": "+t)}}(r[c].type)}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){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],f[p]):o.drawLine(e[0],m,e[2],m,d[p],f[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},h.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},h.removeObject=function(t){for(var e=this.objects,r=0;r0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function i(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!b&&U.autoResize){var t=x.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*U.pixelRatio),i=0|Math.ceil(r*U.pixelRatio);if(n!==x.width||i!==x.height){x.width=n,x.height=i;var a=x.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",O=!0}}}function r(){for(var t=I.length,e=z.length,r=0;r0&&0===D[e-1];)D.pop(),z.pop().dispose()}function g(){if(U.contextLost)return!0;_.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}function v(){if(!g()){e();var t=U.camera.tick();N.view=U.camera.matrix,O=O||t,F=F||t,E.pixelRatio=U.pixelRatio,C.pixelRatio=U.pixelRatio;var r=I.length,i=G[0],a=G[1];i[0]=i[1]=i[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;oM.distance)continue;for(var c=0;c>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),r=0;r>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,o),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/s,t[4]=2/l,t[6]=-2*o[0]/s-1,t[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=u<5,i.uniforms.pointSize=u,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var h=a.getParameter(a.BLEND),f=a.getParameter(a.DITHER);return h&&!this.blend&&a.disable(a.BLEND),f&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),h&&!this.blend&&a.enable(a.BLEND),f&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.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]]}}},{"./lib/shader":223,"gl-buffer":157,"gl-shader":224,"typedarray-pool":550}],232:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],h=e[2],f=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+h*m+f*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*h+l*m,t[3]=s*f+l*g,t}},{}],233:[function(t,e,r){"use strict";e.exports={vertex:"precision highp float;\n#define GLSLIFY 1\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nattribute vec2 positionHi, positionLo;\nattribute float size, border;\nattribute vec2 char, color;\n\n//this is 64-bit form of scale and translate\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform float pixelRatio;\nuniform vec4 viewBox;\nuniform sampler2D palette;\n\nvarying vec4 charColor, borderColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\n\nvoid main() {\n charColor = texture2D(palette, vec2(color.x / 255., 0));\n borderColor = texture2D(palette, vec2(color.y / 255., 0));\n\n gl_PointSize = size * pixelRatio;\n pointSize = size * pixelRatio;\n\n charId = char;\n borderWidth = border;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n\n pointCoord = viewBox.xy + (viewBox.zw - viewBox.xy) * (gl_Position.xy * .5 + .5);\n}\n",fragment:"precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D chars;\nuniform vec2 charsShape;\nuniform float charsStep, pixelRatio, charOffset;\n\nvarying vec4 borderColor;\nvarying vec4 charColor;\nvarying vec2 charId;\nvarying vec2 pointCoord;\nvarying float pointSize;\nvarying float borderWidth;\n\nvoid main() {\n\tvec2 pointUV = (pointCoord - gl_FragCoord.xy + pointSize * .5) / pointSize;\n\tpointUV.x = 1. - pointUV.x;\n\tvec2 texCoord = ((charId + pointUV) * charsStep) / charsShape;\n\tfloat dist = texture2D(chars, texCoord).r;\n\n\t//max-distance alpha\n\tif (dist < 1e-2)\n\t\tdiscard;\n\n\tfloat gamma = .0045 * charsStep / pointSize;\n\n //null-border case\n \tif (borderWidth * borderColor.a == 0.) {\n\t\tfloat charAmt = smoothstep(.748 - gamma, .748 + gamma, dist);\n\t\tgl_FragColor = vec4(charColor.rgb, charAmt*charColor.a);\n\t\treturn;\n\t}\n\n\tfloat dif = 5. * pixelRatio * borderWidth / pointSize;\n\tfloat borderLevel = .748 - dif * .5;\n\tfloat charLevel = .748 + dif * .5;\n\n\tfloat borderAmt = smoothstep(borderLevel - gamma, borderLevel + gamma, dist);\n\tfloat charAmt = smoothstep(charLevel - gamma, charLevel + gamma, dist);\n\n\tvec4 color = borderColor;\n\tcolor.a *= borderAmt;\n\n\tgl_FragColor = mix(color, charColor, charAmt);\n}\n",pickVertex:"precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 positionHi, positionLo;\nattribute vec4 id;\nattribute float size;\n\nuniform vec2 scaleHi, scaleLo, translateHi, translateLo;\nuniform vec4 pickOffset;\nuniform float pixelRatio;\n\nvarying vec4 fragColor;\n\n\nvec4 computePosition_1_0(vec2 posHi, vec2 posLo, vec2 scHi, vec2 scLo, vec2 trHi, vec2 trLo) {\n return vec4((posHi + trHi) * scHi\n \t\t\t//FIXME: this thingy does not give noticeable precision gain, need test\n + (posLo + trLo) * scHi\n + (posHi + trHi) * scLo\n + (posLo + trLo) * scLo\n , 0, 1);\n}\n\n\nvoid main() {\n vec4 fragId = id + pickOffset;\n\n fragId.y += floor(fragId.x / 256.0);\n fragId.x -= floor(fragId.x / 256.0) * 256.0;\n\n fragId.z += floor(fragId.y / 256.0);\n fragId.y -= floor(fragId.y / 256.0) * 256.0;\n\n fragId.w += floor(fragId.z / 256.0);\n fragId.z -= floor(fragId.z / 256.0) * 256.0;\n\n fragColor = fragId / 255.0;\n\n gl_PointSize = size * .25 * pixelRatio;\n\n gl_Position = computePosition_1_0(\n positionHi, positionLo,\n scaleHi, scaleLo,\n translateHi, translateLo);\n}\n",pickFragment:"precision lowp float;\n#define GLSLIFY 1\nvarying vec4 fragColor;\nvoid main() {\n gl_FragColor = fragColor;\n}\n"}},{}],234:[function(t,e,r){arguments[4][85][0].apply(r,arguments)},{dup:85}],235:[function(t,e,r){arguments[4][213][0].apply(r,arguments)},{"./lib/GLError":236,"./lib/create-attributes":237,"./lib/create-uniforms":238,"./lib/reflect":239,"./lib/runtime-reflect":240,"./lib/shader-cache":241,dup:213}],236:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{dup:214}],237:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":236,dup:215}],238:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{"./GLError":236,"./reflect":239,dup:216}],239:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],240:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],241:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":236,dup:219,"gl-format-compiler-error":166,"weakmap-shim":571}],242:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],h=a[o],f=o;f>t;){var d=r[f-1],p=n[2*(f-1)];if((d-s||l-p)>=0)break;r[f]=d,n[2*f]=p,n[2*f+1]=n[2*f-1],i[f]=i[f-1],a[f]=a[f-1],f-=1}r[f]=s,n[2*f]=l,n[2*f+1]=c,i[f]=u,a[f]=h}}function i(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function a(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function o(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],h=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=h}function s(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function l(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function u(t,e,r,f,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,b=y-m,x=y+m,_=g,w=b,M=y,k=x,T=v,A=t+1,S=e-1,E=0;l(_,w,r,f,d)&&(E=_,_=w,w=E),l(k,T,r,f,d)&&(E=k,k=T,T=E),l(_,M,r,f,d)&&(E=_,_=M,M=E),l(w,M,r,f,d)&&(E=w,w=M,M=E),l(_,k,r,f,d)&&(E=_,_=k,k=E),l(M,k,r,f,d)&&(E=M,M=k,k=E),l(w,T,r,f,d)&&(E=w,w=T,T=E),l(w,M,r,f,d)&&(E=w,w=M,M=E),l(k,T,r,f,d)&&(E=k,k=T,T=E);var L=r[w],C=f[2*w],I=f[2*w+1],P=d[w],D=p[w],z=r[k],O=f[2*k],F=f[2*k+1],R=d[k],j=p[k],N=_,B=M,U=T,V=g,H=y,q=v,G=r[N],Y=r[B],W=r[U];r[V]=G,r[H]=Y,r[q]=W;for(var X=0;X<2;++X){var Z=f[2*N+X],J=f[2*B+X],K=f[2*U+X];f[2*V+X]=Z,f[2*H+X]=J,f[2*q+X]=K}var Q=d[N],$=d[B],tt=d[U];d[V]=Q,d[H]=$,d[q]=tt;var et=p[N],rt=p[B],nt=p[U];p[V]=et,p[H]=rt,p[q]=nt,a(b,t,r,f,d,p),a(x,e,r,f,d,p);for(var it=A;it<=S;++it)if(c(it,L,C,0,P,r,f,d))it!==A&&i(it,A,r,f,d,p),++A;else if(!c(it,z,O,0,R,r,f,d))for(;;){if(c(S,z,O,0,R,r,f,d)){c(S,L,C,0,P,r,f,d)?(o(it,A,S,r,f,d,p),++A,--S):(i(it,S,r,f,d,p),--S);break}if(--S=Math.max(.9*d,32)){var b=c+s>>>1;l(g,v,h,f,b,u+1),f=b}l(g,v,h,f,y,u+1),f=y}}}var c=t.length>>>1;if(c<1)return[];for(var u=1/0,h=1/0,f=-1/0,d=-1/0,p=0;p=0;--_){t[2*_]=(t[2*_]-u)*v,t[2*_+1]=(t[2*_+1]-h)*y;var T=x[_];T!==M&&(w.push(new i(b*Math.pow(.5,T),_+1,k-(_+1))),k=_+1,M=T)}return w.push(new i(b*Math.pow(.5,T+1),0,k)),a.free(x),w}},{"./lib/sort":242,"typedarray-pool":550}],244:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s){this.plot=t,this.shader=e,this.pickShader=r,this.positionBuffer=n,this.sizeBuffer=i,this.colorBuffer=a,this.idBuffer=o,this.charBuffer=s,this.pointCount=0,this.pickOffset=0,this.points=null,this.scales=[],this.xCoords=[],this.charCanvas=document.createElement("canvas"),this.charTexture=d(this.plot.gl,this.charCanvas),this.charStep=400,this.charFit=.255,this.snapThreshold=1e4,this.paletteTexture=d(this.plot.gl,[256,1])}e.exports=function(t,e){var r=t.gl,i=new n(t,s(r,u.vertex,u.fragment),s(r,u.pickVertex,u.pickFragment),l(r),l(r),l(r),l(r),l(r));return i.update(e),t.addObject(i),i};var i,a,o,s=t("gl-shader"),l=t("gl-buffer"),c=t("typedarray-pool"),u=t("./lib/shaders"),h=t("snap-points-2d"),f=t("font-atlas-sdf"),d=t("gl-texture2d"),p=t("color-id"),m=t("ndarray"),g=t("clamp"),v=t("binary-search-bounds"),y=n.prototype,b=new Float32Array([0,0]),x=new Float32Array([0,0]),_=new Float32Array([0,0]),w=new Float32Array([0,0]),M=[0,0],k=[0,0,0,0];y.drawPick=function(t){var e=void 0!==t,r=this.plot,n=this.pointCount,s=n>this.snapThreshold;if(!n)return t;(function(){var t=this.plot,e=t.viewBox,r=t.dataBox,n=t.pixelRatio,s=r[2]-r[0],l=r[3]-r[1],c=2/s,u=2/l,h=-r[0]-.5*s,f=-r[1]-.5*l;b[0]=c,x[0]=c-b[0],b[1]=u,x[1]=u-b[1],_[0]=h,w[0]=h-_[0],_[1]=f,w[1]=f-_[1];var d=e[2]-e[0],p=e[3]-e[1];i=Math.min(s/d,l/p),M[0]=2*n/d,M[1]=2*n/p,a=r[0],o=r[2]}).call(this);var l=r.gl,c=e?this.pickShader:this.shader,u=l.isEnabled(l.BLEND);if(c.bind(),e){this.pickOffset=t;for(var h=0;h<4;++h)k[h]=t>>8*h&255;c.uniforms.pickOffset=k,this.idBuffer.bind(),c.attributes.id.pointer(l.UNSIGNED_BYTE,!1)}else l.blendFuncSeparate(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA,l.ONE,l.ONE_MINUS_SRC_ALPHA),l.blendColor(0,0,0,1),u||l.enable(l.BLEND),this.colorBuffer.bind(),c.attributes.color.pointer(l.UNSIGNED_BYTE,!1),this.charBuffer.bind(),c.attributes.char.pointer(l.UNSIGNED_BYTE,!1),c.uniforms.chars=this.charTexture.bind(0),c.uniforms.charsShape=[this.charCanvas.width,this.charCanvas.height],c.uniforms.charsStep=this.charStep,c.uniforms.palette=this.paletteTexture.bind(1);this.sizeBuffer.bind(),c.attributes.size.pointer(l.FLOAT,!1,8,0),e||c.attributes.border.pointer(l.FLOAT,!1,8,4),this.positionBuffer.bind(),c.attributes.positionHi.pointer(l.FLOAT,!1,16,0),c.attributes.positionLo.pointer(l.FLOAT,!1,16,8),c.uniforms.pixelRatio=r.pixelRatio,c.uniforms.scaleHi=b,c.uniforms.scaleLo=x,c.uniforms.translateHi=_,c.uniforms.translateLo=w,c.uniforms.viewBox=r.viewBox;var f=this.scales;if(s)for(var d=f.length-1;d>=0;d--){var p=f[d];if(!(p.pixelSize&&p.pixelSize<1.25*i&&d>1)){var m=p.offset,g=p.count+m,y=v.ge(this.xCoords,a,m,g-1),T=v.lt(this.xCoords,o,y,g-1)+1;T>y&&l.drawArrays(l.POINTS,y,T-y)}}else l.drawArrays(l.POINTS,0,n);if(e)return t+n;u?l.blendFunc(l.ONE,l.ONE_MINUS_SRC_ALPHA):l.disable(l.BLEND)},y.draw=y.drawPick,y.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]]}},y.update=function(t){var e=(t=t||{}).positions||[],r=t.colors||[],n=t.glyphs||[],i=t.sizes||[],a=t.borderWidths||[],o=t.borderColors||[],s=this.plot.gl,l=this.pointCount,u=l>this.snapThreshold;if(null!=t.positions){this.points=e,u=(l=this.points.length/2)>this.snapThreshold;var d=c.mallocFloat32(2*l),v=c.mallocFloat64(2*l),y=c.mallocUint32(l),b=c.mallocFloat32(4*l);v.set(this.points),u&&(this.i2idx&&c.free(this.i2idx),this.i2idx=c.mallocInt32(l),this.scales=h(v,this.i2idx,d)),this.pointCount=l;for(var x=0;xO&&(O=i[x]);var F=this.charStep;this.charStep=g(Math.ceil(4*O),128,768);var R=Object.keys(z),j=this.charStep,N=Math.floor(j/2),B=s.getParameter(s.MAX_TEXTURE_SIZE),U=B/j*(B/j),V=Math.min(B,j*R.length),H=Math.min(B,j*Math.ceil(j*R.length/B)),q=Math.floor(V/j);R.length>U&&console.warn("gl-scatter2d-fancy: number of characters is more than maximum texture size. Try reducing it."),this.chars&&this.chars+""==R+""&&this.charStep==F||(this.charCanvas=f({canvas:this.charCanvas,family:"sans-serif",size:N,shape:[V,H],step:[j,j],chars:R,align:!0,fit:this.charFit}),this.chars=R);for(x=0;x>>1,n=l.mallocInt32(r),i=l.mallocFloat32(r),a=l.mallocFloat64(2*r);if(a.set(this.points),this.snapPoints)this.scales=s(a,n,i,this.bounds);else{this.bounds=h(a,2),u(a,2,this.bounds);for(var o=0;o>8&255,v[2]=t>>16&255,v[3]=t>>24&255,n.uniforms.pickOffset=v,s.bind(),n.attributes.pickId.pointer(h.UNSIGNED_BYTE)):(n.uniforms.useWeight=1,this.weightBuffer.bind(),n.attributes.weight.pointer());var I=!0;if(this.snapPoints)for(var P=i.length-1;P>=0;P--){var D=i[P];if(!(D.pixelSize1)){var z=this.getVisibleRange(D),O=z[0],F=z[1];F>O&&h.drawArrays(h.POINTS,O,F-O),!e&&I&&(I=!1,n.uniforms.useWeight=0)}}else h.drawArrays(h.POINTS,0,this.pointCount);return t+this.pointCount},f.getVisibleRange=function(t){var e=this.plot.dataBox,r=this.bounds,n=this.pixelSize,i=this.size,a=this.plot.pixelRatio,s=r[2]-r[0];r[3],r[1];if(!t)for(var l=this.scales.length-1;l>=0&&((t=this.scales[l]).pixelSize1);l--);var c=this.xCoords,u=(e[0]-r[0]-n*i*a)/s,h=(e[2]-r[0]+n*i*a)/s,f=t.offset,d=t.count+f,p=o.ge(c,u,f,d-1);return[p,o.lt(c,h,p,d-1)+1]},f.drawPick=f.draw,f.pick=function(t,e,r){var n=r-this.pickOffset;return n<0||n>=this.pointCount?null:{object:this,pointId:n,dataCoord:[this.points[2*n],this.points[2*n+1]]}}},{"./lib/shader":245,"array-bounds":45,"array-normalize":46,"binary-search-bounds":246,"gl-buffer":157,"gl-shader":256,"snap-points-2d":248,"typedarray-pool":550}],250:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];if(r||(r=i[e]={}),t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(F[1])){var R=O;O=F,F=R,R=D,D=z,z=R;var j=I;I=P,P=j}O[0]<0&&(D[I]=-1),F[1]>0&&(z[P]=-1);var N=0,B=0;for(C=0;C<4;++C)N+=Math.pow(d[4*I+C],2),B+=Math.pow(d[4*P+C],2);D[I]/=Math.sqrt(N),z[P]/=Math.sqrt(B),f.axes[0]=D,f.axes[1]=z,f.fragClipBounds[0]=l(T,S[0],E,-1e8),f.fragClipBounds[1]=l(T,S[1],E,1e8),e.vao.draw(h.TRIANGLES,e.vertexCount),e.lineWidth>0&&(h.lineWidth(e.lineWidth),e.vao.draw(h.LINES,e.lineVertexCount,e.vertexCount))}}function u(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||v,s.view=n.view||v,s.projection=n.projection||v,b[0]=2/o.drawingBufferWidth,b[1]=2/o.drawingBufferHeight,s.screenSize=b,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}c(e,r,n,i),r.vao.unbind()}var h=t("gl-buffer"),f=t("gl-vao"),d=t("typedarray-pool"),p=t("gl-mat4/multiply"),m=t("./lib/shaders"),g=t("./lib/glyphs"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,r=m.createPerspective(e),n=m.createOrtho(e),i=m.createProject(e),o=m.createPickPerspective(e),s=m.createPickOrtho(e),l=m.createPickProject(e),c=h(e),u=h(e),d=h(e),p=h(e),g=new a(e,r,n,i,c,u,d,p,f(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return g.update(t),g};var y=a.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},y.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var b=[0,0],x=[0,0,0],_=[0,0,0],w=[0,0,0,1],M=[0,0,0,1],k=v.slice(),T=[0,0,0],A=[[0,0,0],[0,0,0]],S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];y.draw=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},y.drawTransparent=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},y.drawPick=function(t){u(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(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},y.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]},y.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(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,c=t.color,u=t.size,h=t.angle,f=t.lineColor,p=0,m=0,v=0,y=n.length;t:for(var b=0;b0&&(C[0]=-a[0]*(1+k[0][0]));var H=w.cells,q=w.positions;for(_=0;_0){var v=r*u;o.drawBox(h-v,f-v,d+v,f+v,a),o.drawBox(h-v,p-v,d+v,p+v,a),o.drawBox(h-v,f-v,h+v,p+v,a),o.drawBox(d-v,f-v,d+v,p+v,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)}},{"./lib/shaders":253,"gl-buffer":157,"gl-shader":256}],255:[function(t,e,r){"use strict";function n(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)}}e.exports=function(t,e){return new n(t,i(t,e),a.mallocUint8(e[0]*e[1]*4))};var i=t("gl-fbo"),a=t("typedarray-pool"),o=t("ndarray"),s=t("bit-twiddle").nextPow2,l=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),T=new Array(k),A=0;A=0;)S+=1;_[w]=S}var E=new Array(r.length);h(),d._relink=h,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,b,_),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":257,"./lib/create-attributes":258,"./lib/create-uniforms":259,"./lib/reflect":260,"./lib/runtime-reflect":261,"./lib/shader-cache":262}],257:[function(t,e,r){arguments[4][214][0].apply(r,arguments)},{dup:214}],258:[function(t,e,r){arguments[4][215][0].apply(r,arguments)},{"./GLError":257,dup:215}],259:[function(t,e,r){arguments[4][216][0].apply(r,arguments)},{"./GLError":257,"./reflect":260,dup:216}],260:[function(t,e,r){arguments[4][217][0].apply(r,arguments)},{dup:217}],261:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],262:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":257,dup:219,"gl-format-compiler-error":166,"weakmap-shim":571}],263:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],264:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":256}],265:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders/index");e.exports=function(t,e){function r(t,e,r,n,i,a){var o=[t,e,r,0,0,0,1];o[n+3]=1,o[n]=i,s.push.apply(s,o),o[6]=-1,s.push.apply(s,o),o[n]=a,s.push.apply(s,o),s.push.apply(s,o),o[6]=1,s.push.apply(s,o),o[n]=i,s.push.apply(s,o)}var s=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=i(t,s),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=o(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var h=new n(t,l,c,u);return h.update(e),h};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=n.prototype,c=[0,0,0],u=[0,0,0],h=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||s,o=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var f=c,d=u,p=0;p<3;++p)i&&i[p]<0?(f[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(f[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);h[0]=e.drawingBufferWidth,h[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,f,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=h;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":264,"gl-buffer":157,"gl-vao":272}],266:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\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 worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(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\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\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 (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\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_1_1(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 \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + 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",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\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 vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\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",s="precision mediump float;\n#define GLSLIFY 1\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 any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n 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";r.createShader=function(t){var e=n(t,i,a,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},r.createPickShader=function(t){var e=n(t,i,s,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},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":256}],267:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,h,f,d){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=s,this._contourShader=l,this._contourPickShader=c,this._contourBuffer=u,this._contourVAO=h,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=f,this._dynamicVAO=d,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=[y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0]),y(p.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.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}function i(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=F.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],x(l,t.model,l);var c=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function a(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||C,n.view=t.view||C,n.projection=t.projection||C,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.contourColor=this.contourColor[0],n.inverseModel=_(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var o=n.clipBounds[a],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[a][s],-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=N,n.vertexColor=this.vertexColor;var l=j;for(x(l,n.view,n.model),x(l,n.projection,l),_(l,l),a=0;a<3;++a)n.eyePosition[a]=l[12+a]/l[15];var c=l[15];for(a=0;a<3;++a)c+=this.lightPosition[a]*l[4*a+3];for(a=0;a<3;++a){var u=l[12+a];for(s=0;s<3;++s)u+=l[4*s+a]*this.lightPosition[s];n.lightPosition[a]=u/c}var h=i(n,this);if(h.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=h.projections[a],this._shader.uniforms.clipBounds=h.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(h.showContour&&!e){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(f.uniforms.permutation=P[a],r.lineWidth(this.contourWidth[a]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},z.pickSlots=1,z.setPickBase=function(t){this.pickId=t};var O=[0,0,0],F={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},R={model:C,view:C,projection:C,inverseModel:C.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,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},j=C.slice(),N=[1,0,0,0,1,0,0,0,1];z.draw=function(t){return a.call(this,t,!1)},z.drawTransparent=function(t){return a.call(this,t,!0)};var B={model:C,view:C,projection:C,inverseModel:C,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};z.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=B;r.model=t.model||C,r.view=t.view||C,r.projection=t.projection||C,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=N;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=i(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=P[o],n=0;n>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var h=u?a:1-a,f=0;f<2;++f)for(var d=i+u,p=s+f,m=h*(f?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=w.le(this.contourLevels[y],c[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]Math.abs(x-c[y])&&(v[y]+=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],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},z.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=s(t.contourWidth,Number)),"showContour"in t&&(this.showContour=s(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=s(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=c(t.contourColor)),"contourProject"in t&&(this.contourProject=s(t.contourProject,function(t){return s(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=c(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=s(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=s(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);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 n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(p.freeFloat(this._field[2].data),this._field[2].data=p.mallocFloat(u.nextPow2(n))),this._field[2]=y(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),o(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(p.freeFloat(this._field[a].data),this._field[a].data=p.mallocFloat(this._field[2].size)),this._field[a]=y(this._field[a].data,[i[0]+2,i[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(a=0;a<2;++a){var h=l[a];for(w=0;w<2;++w)if(h.shape[w]!==i[w])throw new Error("gl-surface: coords have incorrect shape");o(this._field[a],h)}}else if(t.ticks){var f=t.ticks;if(!Array.isArray(f)||2!==f.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var d=f[a];if((Array.isArray(d)||d.length)&&(d=y(d)),d.shape[0]!==i[a])throw new Error("gl-surface: invalid tick length");var x=y(d.data,i);x.stride[a]=d.stride[0],x.stride[1^a]=0,o(this._field[a],x)}}else{for(a=0;a<2;++a){var _=[0,0];_[a]=1,this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var w=0;w0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=p.mallocFloat(nt.length);for(a=0;ai||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 a(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}function o(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 s(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 l(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)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 l=s(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,l,e,r,n,i)}var c=t("ndarray"),u=t("ndarray-ops"),h=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(f||function(t){f=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],d=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],p=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return l(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return l(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=n(e)?e:e.raw;if(r)return function(t,e,r,n,i,o){var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,l,r,n,i,o)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var l=o(n,e.stride.slice()),f=0;"float32"===r?f=t.FLOAT:"float64"===r?(f=t.FLOAT,l=!1,r="float32"):"uint8"===r?f=t.UNSIGNED_BYTE:(f=t.UNSIGNED_BYTE,l=!1,r="uint8");var d=0;if(2===n.length)d=t.LUMINANCE,n=[n[0],n[1],1],e=c(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])d=t.ALPHA;else if(2===n[2])d=t.LUMINANCE_ALPHA;else if(3===n[2])d=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}f!==t.FLOAT||t.getExtension("OES_texture_float")||(f=t.UNSIGNED_BYTE,l=!1);var p,g,v=e.size;if(l)p=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[n[2],n[2]*n[0],1];g=h.malloc(v,r);var b=c(g,n,y,0);"float32"!==r&&"float64"!==r||f!==t.UNSIGNED_BYTE?u.assign(b,e):m(b,e),p=g.subarray(0,v)}var x=s(t);return t.texImage2D(t.TEXTURE_2D,0,d,n[0],n[1],0,d,f,p),l||h.free(g),new a(t,x,n[0],n[1],d,f)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var f=null,d=null,p=null,m=function(t,e){u.muls(t,e,255)},g=a.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&f.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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&&f.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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(),p.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(),p.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(p.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 i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),g.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},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.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)},g.setPixels=function(t,e,r,i){var a=this.gl;this.bind(),Array.isArray(e)?(i=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),i=i||0;var s=n(t)?t:t.raw;if(s){this._mipLevels.indexOf(i)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(i)):a.texSubImage2D(a.TEXTURE_2D,i,e,r,this.format,this.type,s)}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]>>>i||r+t.shape[0]>this._shape[0]>>>i||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,n,i,a,s,l){var f=l.dtype,d=l.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,g=0,v=o(d,l.stride.slice());if("float32"===f?p=t.FLOAT:"float64"===f?(p=t.FLOAT,v=!1,f="float32"):"uint8"===f?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,v=!1,f="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],l=c(l.data,d,[l.stride[0],l.stride[1],1],l.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||i!==t.LUMINANCE&&i!==t.ALPHA||(g=i),g!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,b=s.indexOf(n)<0;if(b&&s.push(n),p===a&&v)0===l.offset&&l.data.length===y?b?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data):b?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var x;x=a===t.FLOAT?h.mallocFloat32(y):h.mallocUint8(y);var _=c(x,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&a===t.UNSIGNED_BYTE?m(_,l):u.assign(_,l),b?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,x.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,x.subarray(0,y)),a===t.FLOAT?h.freeFloat32(x):h.freeUint8(x)}}(a,e,r,i,this.format,this.type,this._mipLevels,t)}}},{ndarray:468,"ndarray-ops":462,"typedarray-pool":550}],269:[function(t,e,r){"use strict";e.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;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],278:[function(t,e,r){e.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}},{}],279:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],280:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r-1?y:N.indexOf(t)>-1?v:g,e(I.join("")),C=l,E}return I.push(T),A=T,E+1}();break;case b:E=/[^\s]/g.test(T)?(e(I.join("")),C=l,E):(I.push(T),A=T,E+1);break;case l:I=I.length?[]:I,E="/"===A&&"*"===T?(O=L+E-1,C=u,A=T,E+1):"/"===A&&"/"===T?(O=L+E-1,C=h,A=T,E+1):"#"===T?(C=f,O=L+E,E):/\s/.test(T)?(C=b,O=L+E,E):(F=/\d/.test(T),R=/[^\w_]/.test(T),O=L+E,C=F?p:R?d:c,E)}if(r!==E)switch(j[r]){case"\n":z=0,++D;break;default:++z}}return L+=E,j=j.slice(E),P}function M(){return"\r"!==T&&"\n"!==T||"\\"===A?(I.push(T),A=T,E+1):(e(I.join("")),C=l,E)}function k(t){for(var r,n,a=0;;){if(r=i.indexOf(t.slice(0,t.length+a).join("")),n=i[r],-1===r){if(a--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),O+=n.length,(I=I.slice(n.length)).length}}var T,A,S,E=0,L=0,C=l,I=[],P=[],D=1,z=0,O=0,F=!1,R=!1,j="",N=a,B=n;return"300 es"===(t=t||{}).version&&(N=s,B=o),function(t){return P=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):(I.length&&e(I.join("")),C=x,e("(eof)"),P)}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,h=1,f=2,d=3,p=4,m=5,g=6,v=7,y=8,b=9,x=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":283,"./lib/builtins-300es":282,"./lib/literals":285,"./lib/literals-300es":284,"./lib/operators":286}],282:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.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"])},{"./builtins":283}],283:[function(t,e,r){e.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"]},{}],284:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","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"])},{"./literals":285}],285:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","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"]},{}],286:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],287:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=i.concat(r(t)),i=i.concat(r(null))}},{"./index":281}],288:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[f+0]&&n>=c[f+1]?(o[h]=!0,a.push(l[h])):o[h]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),h=s;h<=c;h++)for(var f=l;f<=u;f++){var d=this.d*f+h;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,h=r?i-1:0,f=r?-1:1,d=t[e+h];for(h+=f,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+h],h+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+h],h+=f,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=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=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(o++,l/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*l-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-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,c-=8);t[r+d-p]|=128*m}},{}],291:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return l(t.vertices,e.vertices)}function o(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=c[t];i||(i=c[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=s[t+1];return i||(i=s),n(i)}(t)),this.orient=i}e.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 a=t.slice(0,i+1),l=s.apply(void 0,a);if(0===l)throw new Error("Input not in general position");for(var c=new Array(i+1),u=0;u<=i;++u)c[u]=u;l<0&&(c[0]=1,c[1]=0);var h=new n(c,new Array(i+1),!1),f=h.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var p=c.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);f[u]=v,d[u]=v}for(d[i+1]=h,u=0;u<=i;++u){p=f[u].vertices;var y=f[u].adjacent;for(m=0;m<=i;++m){var b=p[m];if(b<0)y[m]=h;else for(var x=0;x<=i;++x)f[x].vertices.indexOf(b)<0&&(y[m]=f[x])}}var _=new o(i,a,d),w=!!e;for(u=i+1;u0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,h=0;h<=r;++h){var f=u[h];i[h]=f<0?e:a[f]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var h=c[u];if(!(h.lastVisited>=r)){var f=a[u];a[u]=t;var d=this.orient();if(a[u]=f,d<0){s=h;continue t}h.boundary?h.lastVisited=-r:h.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,h=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var f=[];h.length>0;){var d=(e=h.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var b=0,x=0;x<=o;++x)y[x]<0?(b=x,l[x]=t):l[x]=s[y[x]];if(this.orient()>0){y[b]=r,v.boundary=!1,c.push(v),h.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=d.slice(),M=p.slice(),k=new n(w,M,!0);u.push(k);var T=_.indexOf(e);if(!(T<0)){_[T]=k,M[m]=v,w[g]=-1,M[g]=e,p[g]=k,k.flip();for(x=0;x<=o;++x){var A=w[x];if(!(A<0||A===r)){for(var S=new Array(o-1),E=0,L=0;L<=o;++L){var C=w[L];C<0||L===x||(S[E++]=C)}f.push(new i(S,k,x))}}}}}}f.sort(a);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var h=o[0];o[0]=o[1],o[1]=h}e.push(o)}}return e}},{"robust-orientation":517,"simplicial-complex":528}],292:[function(t,e,r){"use strict";function n(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}function i(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 a(t,e){var r=p(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 o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?v:(r.splice(n,1),a(t,r),y)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,f),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},b.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);return 2===(o=this.left.remove(t))?(this.left=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return v;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);return 2===(o=this.right.remove(t))?(this.right=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:v;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(a=g.ge(this.leftPoints,t,f);athis.mid){if(this.right){var r;if(r=this.right.queryPoint(t,e))return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},b.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n;if(n=this.right.queryInterval(t,e,r))return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var x=m.prototype;x.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},x.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==v}return!1},x.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},x.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(x,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(x,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":67}],293:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+f)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(h+1)%2;(0===h?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===h?i>=s:a>=l)&&(c.push(m+1),c.push(f),c.push(g))}}return u}},{}],301:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),h=.5*Math.exp(2*u/3),f=.5*Math.sqrt(u*h*(l-h)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*h/l+f)),Math.min(o,Math.floor(r+(l-c)*h/l+f)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],302:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),h=s.pop(),f=s.pop();if(h-f<=o)for(var d=f;d<=h;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((f+h)/2),m=e[2*p],g=e[2*p+1];n(m,g,r,i)<=c&&l.push(t[p]);var v=(u+1)%2;(0===u?r-a<=m:i-a<=g)&&(s.push(f),s.push(p-1),s.push(v)),(0===u?r+a>=m:i+a>=g)&&(s.push(p+1),s.push(h),s.push(v))}}return l}},{}],303:[function(t,e,r){"use strict";function n(t,e){var r;if(u(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],h=c||void 0!==t.property,f=c||!h,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],g=0;g=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?function(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:477}],305:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:558}],306:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in f.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:f.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?h[c.type]:c}))}},{"../error/validation_error":305,"../util/extend":306,"../util/get_type":307,"./validate_array":310,"./validate_boolean":311,"./validate_color":312,"./validate_constants":313,"./validate_enum":314,"./validate_filter":315,"./validate_function":316,"./validate_layer":318,"./validate_number":320,"./validate_object":321,"./validate_source":323,"./validate_string":324}],310:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":305,"../util/get_type":307}],314:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":305,"../util/unbundle_jsonlint":308}],315:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var h=2;h=8&&(h&&!t.valueSpec["property-function"]?d.push(new n(t.key,t.value,"property functions not supported")):f&&!t.valueSpec["zoom-function"]&&d.push(new n(t.key,t.value,"zoom functions not supported"))),d}},{"../error/validation_error":305,"../util/get_type":307,"./validate":309,"./validate_array":310,"./validate_number":320,"./validate_object":321}],317:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":305,"./validate_string":324}],318:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,h=t.style,f=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":305,"../util/get_type":307}],321:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],h=i(r);if("object"!==h)return[new n(e,r,"object expected, %s found",h)];for(var f in r){var d=f.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+f,value:r[f],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:f})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[f],'unknown property "%s"',f))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":305,"../util/get_type":307,"./validate":309}],322:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":305,"./validate":309}],323:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":305,"../util/unbundle_jsonlint":308,"./validate_enum":314,"./validate_object":321}],324:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":305,"../util/get_type":307}],325:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":326,"./validate/validate":309,"./validate/validate_constants":313,"./validate/validate_filter":315,"./validate/validate_glyphs_url":317,"./validate/validate_layer":318,"./validate/validate_layout_property":319,"./validate/validate_paint_property":322,"./validate/validate_source":323}],326:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":327}],327:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],328:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],329:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":443}],330:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},a=0;a1?p.name+x:p.name]=m[x]*g}}},n.VertexArrayType=function(t){return new c({members:t,alignment:4})},n.ElementArrayType=function(t){return new c({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":441,"../util/util":443,"./array_group":329,"./bucket/circle_bucket":331,"./bucket/fill_bucket":332,"./bucket/line_bucket":333,"./bucket/symbol_bucket":334,"./buffer_group":336,assert:48,"feature-filter":133}],331:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,(n.prototype=a.inherit(i,{})).addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var h=this.prepareArrayGroup("circle",4),f=h.layoutVertexArray,d=this.addCircleVertex(f,c,u,-1,-1);this.addCircleVertex(f,c,u,1,-1),this.addCircleVertex(f,c,u,1,1),this.addCircleVertex(f,c,u,-1,1),h.elementArray.emplaceBack(d,d+1,d+2),h.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":443,"../bucket":330,"../load_geometry":338}],332:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,(n.prototype=a.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(f-1,f),i.push(h.x),i.push(h.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],h=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!h){this.distance=0;var f,d,p,m,g,v,y,b=r,x=h?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,h&&(f=t[a-2],g=c.sub(f)._unit()._perp());for(var w=0;w0){var S=f.dist(d);if(S>2*o){var E=f.sub(f.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?b:x;if(L&&"round"===C&&(Tn&&(C="bevel"),"bevel"===C&&(T>2&&(C="flipbevel"),T100)M=g.clone();else{var I=m.x*g.y-m.y*g.x>0?-1:1,P=T*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(P*I)}this.addCurrentVertex(f,this.distance,M,0,0,!1),this.addCurrentVertex(f,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var D=m.x*g.y-m.y*g.x>0,z=-Math.sqrt(T*T-1);if(D?(y=0,v=z):(v=0,y=z),_||this.addCurrentVertex(f,this.distance,m,v,y,!1),"fakeround"===C){for(var O,F=Math.floor(8*(.5-(k-.5))),R=0;R=0;j--)O=m.mult((j+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(f,this.distance,O,D)}p&&this.addCurrentVertex(f,this.distance,g,-v,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(f,this.distance,m,0,0,!1),p&&this.addCurrentVertex(f,this.distance,g,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(f,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(f,this.distance,g,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(f,this.distance,m,0,0,!1),this.addCurrentVertex(f,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(f,this.distance,g,-1,-1,!0),this.addCurrentVertex(f,this.distance,g,0,0,!1)));if(A&&w2*o){var B=f.add(p.sub(f)._mult(o/N)._round());this.distance+=B.dist(f),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),f=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,h=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&h.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":443,"../bucket":330,"../load_geometry":338}],334:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),h=t("../../symbol/shaping"),f=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=h.shapeText,b=h.shapeIcon,x=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,(n.prototype=m.inherit(o,{})).serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var h="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,f=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,v=24*a["text-letter-spacing"],x=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var I=C||x;this.addSymbolInstance(L,A,e,r,this.layer,I,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,h,g,b,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,b=p.br,x=p.tex,_=p.anchorPoint,w=Math.max(h+Math.log(p.minScale)/Math.LN2,f),M=Math.min(h+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===f&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),T=i(u,_.x,_.y,g.x,g.y,x.x,x.y,w,M,f,k);i(u,_.x,_.y,v.x,v.y,x.x+x.w,x.y,w,M,f,k),i(u,_.x,_.y,y.x,y.y,x.x,x.y+x.h,w,M,f,k),i(u,_.x,_.y,b.x,b.y,x.x+x.w,x.y+x.h,w,M,f,k),c.emplaceBack(T,T+1,T+2),c.emplaceBack(T+1,T+2,T+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),T>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(D,z,O,F,k,T,A,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":392,"../../symbol/clip_line":394,"../../symbol/collision_feature":396,"../../symbol/get_anchors":398,"../../symbol/mergelines":401,"../../symbol/quads":402,"../../symbol/resolve_text":403,"../../symbol/shaping":404,"../../util/token":442,"../../util/util":443,"../bucket":330,"../load_geometry":338,"point-geometry":485}],335:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=l.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||f.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":443,"./bucket":330,assert:48}],339:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],340:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":443}],341:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":340}],342:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,h=t("gl-matrix"),f=h.vec4,d=h.mat4,p=h.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.locationCoordinate(this.center)._zoomTo(e),i=new a(n.column-.5,n.row-.5);return c.cover(e,[this.pointCoordinate(new a(0,0))._zoomTo(e),this.pointCoordinate(new a(this.width,0))._zoomTo(e),this.pointCoordinate(new a(this.width,this.height))._zoomTo(e),this.pointCoordinate(new a(0,this.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return i.dist(t)-i.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];f.transformMat4(e,e,this.pixelMatrixInverse),f.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,h=e[2]/n,d=r[2]/i,p=h===d?0:(0-h)/(d-h),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return f.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":330,"../source/tile_coord":370,"../util/interpolate":437,"../util/util":443,"./coordinate":339,"./lng_lat":340,"gl-matrix":194,"point-geometry":485}],343:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,h,f,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&x,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":364,"./create_uniform_pragmas":345}],347:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,f>>16),s.uniform2f(o.u_pixel_coord_lower,65535&h,65535&f),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}var i=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){var a=t.gl;a.enable(a.STENCIL_TEST);var o;if(o=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"],t.isOpaquePass===o){t.setDepthSublayer(1);for(var s=0;s0?1-1/(1.001-t):-t}(r.paint["raster-saturation"])),a.uniform1f(l.u_contrast_factor,function(t){return t>0?1/(1-t):1+t}(r.paint["raster-contrast"])),a.uniform3fv(l.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var c,u,h=o.source&&o.source.findLoadedParent(n,0,{}),f=function(t,e,r,n){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=n.coveringZoomLevel(t.source),h=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||h?(a[0]=i.clamp(l,0,1),a[1]=1-a[0]):(a[0]=i.clamp(1-c,0,1),a[1]=1-a[0])}var f=r.paint["raster-opacity"];return a[0]*=f,a[1]*=f,a}(o,h,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o.texture),a.activeTexture(a.TEXTURE1),h?(a.bindTexture(a.TEXTURE_2D,h.texture),c=Math.pow(2,h.coord.z-o.coord.z),u=[o.coord.x*c%1,o.coord.y*c%1]):(a.bindTexture(a.TEXTURE_2D,o.texture),f[1]=0);a.uniform2fv(l.u_tl_parent,u||[0,0]),a.uniform1f(l.u_scale_parent,c||1),a.uniform1f(l.u_buffer_scale,1),a.uniform1f(l.u_opacity0,f[0]),a.uniform1f(l.u_opacity1,f[1]),a.uniform1i(l.u_image0,0),a.uniform1i(l.u_image1,1);var d=o.boundsBuffer||t.rasterBoundsBuffer;(o.boundsVAO||t.rasterBoundsVAO).bind(a,l,d),a.drawArrays(a.TRIANGLE_STRIP,0,d.length)}(t,e,r,l)}a.depthFunc(a.LEQUAL)}}var i=t("../util/util"),a=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new a({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":441,"../util/util":443}],353:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,l,c,u,h,f,d,p,m,g){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],355:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":330,"../data/buffer":335,"../source/pixels_to_tile_units":364,"../source/source_cache":368,"../util/browser":427,"../util/struct_array":441,"../util/util":443,"./create_uniform_pragmas":345,"./draw_background":346,"./draw_circle":347,"./draw_debug":349,"./draw_fill":350,"./draw_line":351,"./draw_raster":352,"./draw_symbol":353,"./frame_history":354,"./painter/use_program":357,"./vertex_array_object":358,"gl-matrix":194}],357:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),h=o[t],f="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":330,"../util/evented":435,"../util/util":443,"resolve-url":510}],360:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),h.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),h=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(h,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":426,"../util/util":443,"./geojson_wrapper":361,"./vector_tile_worker_source":372,"geojson-rewind":139,"geojson-vt":143,supercluster:538,"vt-pbf":565}],361:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},h=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rh-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var b=f.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,u=0;u=0&&v[1].y>=0){for(var y=[],b=0;b=0&&t%1==0),s(!isNaN(e)&&e>=0&&e%1==0),s(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,h=e.dx<0,f=a;fu.dy&&(l=c,c=u,u=l),c.dy>h.dy&&(l=c,c=h,h=l),u.dy>h.dy&&(l=u,u=h,h=l),c.dy&&a(h,c,n,o,s),u.dy&&a(h,u,n,o,s)}var s=t("assert"),l=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<0;a--)i+=(e&(n=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var o,l;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":435,"../util/mapbox":440,"../util/util":443,"./load_tilejson":363}],372:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new s(t);i.abort=this.loadVectorData(t,function(t,a){return delete this.loading[r][n],t?e(t):a?(i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][n]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=i.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":426,"./worker_tile":375,pbf:479,"vector-tile":559}],373:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,h=t("../render/draw_raster").RasterBoundsArray,f=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new h;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new f(e.serialize(),h.serialize(),f.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":330,"../data/buffer":335,"../geo/lng_lat":340,"../render/draw_raster":352,"../render/vertex_array_object":358,"../util/ajax":426,"../util/evented":435,"../util/util":443,"./tile_coord":370,"point-geometry":485}],374:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)b(E,z[e]);x()}}function b(t,e){if(e.populateArrays(T,j,R),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=u.create({layer:w,index:I++,childLayers:e[P],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var D=[],z=this.symbolBuckets=[],O=[];A.bucketLayerIDs={};for(var F in L)0!==(k=L[F]).features.length&&(A.bucketLayerIDs[k.index]=k.childLayers.map(s),D.push(k),"symbol"===k.type?z.push(k):O.push(k));var R={},j={},N=0;if(z.length>0){for(_=z.length-1;_>=0;_--)z[_].updateIcons(R),z[_].updateFont(j);for(var B in j)j[B]=Object.keys(j[B]).map(Number);R=Object.keys(R),r.send("get glyphs",{uid:this.uid,stacks:j},function(t,e){j=e,y(t)}),R.length?r.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)b(0,O[_]);if(0===z.length)return x()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),h=s.filter(i);return{result:{buckets:h.map(a),collisionTile:u.data},transferables:o(h).concat(u.transferables)}}},{"../data/bucket":330,"../data/feature_index":337,"../symbol/collision_box":395,"../symbol/collision_tile":397,"../symbol/symbol_instances":406,"../symbol/symbol_quads":407,"../util/dictionary_coder":433,"../util/util":443}],376:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],377:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":426,"../util/browser":427,"../util/evented":435,"../util/mapbox":440}],378:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":443,"./style_function":381,csscolorparser:109}],379:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire("error",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?h.getJSON(f(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),h=t("../util/ajax"),f=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),b=t("../source/source_cache"),x=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new b(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);return!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,h*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),h/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:h,to:a,toScale:1,t:n}}}(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var o=[],s=this.value.stops,l=0;l=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=h.dist(f)}return!0}},{}],394:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s=i&&f.x>=i||(h.x>=i?h=new n(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round():f.x>=i&&(f=new n(i,h.y+(f.y-h.y)*((i-h.x)/(f.x-h.x)))._round()),h.y>=a&&f.y>=a||(h.y>=a?h=new n(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round():f.y>=a&&(f=new n(h.x+(f.x-h.x)*((a-h.y)/(f.y-h.y)),a)._round()),l&&h.equals(l[l.length-1])||(l=[h],o.push(l)),l.push(f)))))}return o}},{"point-geometry":485}],395:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":441,"../util/util":443,"point-geometry":485}],396:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var h=o.top*s-l,f=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=f-h,g=p-d;if(m>0)if(m=Math.max(10*s,m),u){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,h,p,f,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),h=-a/2,f=this.boxes,d=r,p=n+1,m=h;do{if(--p<0)return f;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return f;g=e[p].dist(e[p+1])}var b=y-m,x=e[p],_=e[p+1].sub(x)._unit()._mult(b)._add(x)._round(),w=i/2/Math.max(Math.abs(y-h)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return f}},{}],397:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),k=new i(c.x2,c.y1).matMult(w),T=new i(c.x1,c.y2).matMult(w),A=new i(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,T.x,A.x),_.y1=Math.min(M.y,k.x,T.x,A.x),_.x2=Math.max(M.x,k.x,T.x,A.x),_.y2=Math.max(M.y,k.x,T.x,A.x),_.maxScale=c.maxScale}else _=c;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),h=this.tempCollisionBox;h.anchorX=u.x,h.anchorY=u.y,h.x1=0,h.y1=0,h.x2=r-t,h.y2=n-e,h.maxScale=a,a=h.maxScale;for(var f=[u.x+h.x1/a,u.y+h.y1/a*this.yStretch,u.x+h.x2/a,u.y+h.y2/a*this.yStretch],d=this.grid.query(f[0],f[1],f[2],f[3]),p=this.ignoredGrid.query(f[0],f[1],f[2],f[3]),m=0;m=a&&(o[y][b]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var h=Math.min(Math.max(s,l),Math.max(c,u)),f=i.maxScale,d=r.maxScale;return h>f&&(h=f),h>d&&(h=d),h>t&&h>=i.placementScale&&(t=h),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&T=0&&A=0&&v+d<=p){var S=new a(T,A,M,b)._round();s&&!o(t,S,c,s,l)||y.push(S)}}g+=w}return h||y.length||u||(y=n(t,g/2,r,s,l,c,u,!0,f)),y}var i=t("../util/interpolate"),a=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,i,a,o,s,l,c){var u=i?.6*o*s:0,h=Math.max(i?i.right-i.left:0,a?a.right-a.left:0),f=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return e-h*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);o(i,function(t,r){for(var i=!t&&new s(new c(new Uint8Array(r))),a=0;an&&null!==h){var b=g[h+1].x;m=Math.max(b,m);for(var x=h+1;x<=v;x++)g[x].y+=r,g[x].x-=b;if(c){var _=h;a[g[h].codePoint]&&_--,i(g,e,d,_,c)}d=h+1,h=null,f+=b,p++}o[y.codePoint]&&(h=v)}var w=g[g.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;i(g,e,d,g.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(h?(clearTimeout(h),h=null,o("dblclick",e)):h=setTimeout(r,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){n.mousePos(l,t).equals(u)&&o("click",t)},!1),l.addEventListener("dblclick",function(t){o("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){c=t,t.preventDefault()},!1)}},{"../util/dom":429,"./handler/box_zoom":414,"./handler/dblclick_zoom":415,"./handler/drag_pan":416,"./handler/drag_rotate":417,"./handler/keyboard":418,"./handler/scroll_zoom":419,"./handler/touch_zoom_rotate":420,"point-geometry":485}],409:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&p.lng<0?p.lng+=360:c.center.lng<0&&p.lng>0&&(p.lng-=360));var y=c.zoomScale(m-h),b=c.point,x="center"in t?c.project(p).sub(u.div(y)):b,_=c.worldSize,w=t.curve,M=Math.max(c.width,c.height),k=M/y,T=x.sub(b).mag();if("minZoom"in t){var A=n.clamp(Math.min(t.minZoom,h,m),c.minZoom,c.maxZoom),S=M/c.zoomScale(A-h);w=Math.sqrt(S/T*2)}var E=w*w,L=r(0),C=function(t){return s(L)/s(L+w*t)},I=function(t){return M*((s(L)*function(t){return a(t)/s(t)}(L+w*t)-a(L))/E)/T},P=(r(1)-L)/w;if(Math.abs(T)<1e-6){if(Math.abs(M-k)<1e-6)return this.easeTo(t);var D=k=0)return!1;return!0})).join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":429,"../../util/util":443,"./control":411}],411:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":435,"../../util/util":443}],412:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":427,"../../util/dom":429,"../../util/util":443,"./control":411}],413:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":429,"../../util/util":443,"./control":411}],414:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":341,"../../util/dom":429,"../../util/util":443}],415:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],416:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,h=l.mult(-u/2);this._map.panBy(h,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":429,"../../util/util":443}],417:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=h*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":429,"../../util/util":443,"point-geometry":485}],418:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],419:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),c=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":427,"../../util/dom":429,"../../util/util":443}],420:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&a!==s){var h=.15*l/c;Math.abs(h)>2.5&&(h=h>0?2.5:-2.5);var f=1e3*Math.abs(h/(12*.15)),d=a+h*f/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:f,easing:o,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":429,"../../util/util":443}],421:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":443}],422:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),h=t("../style/animation_loop"),f=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),b=t("point-geometry"),x=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new h,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new x(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new b(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new b(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new b(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(b.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof b||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[b.convert([0,0]),b.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof b||"number"==typeof t[0]){e=[b.convert(t)]}else{var r=[b.convert(t[0]),b.convert(t[1])];e=[r[0],new b(r[1].x,r[0].y),r[1],new b(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new f(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":340,"../geo/lng_lat_bounds":341,"../geo/transform":342,"../render/painter":356,"../style/animation_loop":376,"../style/style":379,"../util/browser":427,"../util/canvas":428,"../util/dom":429,"../util/evented":435,"../util/util":443,"./bind_handlers":408,"./camera":409,"./control/attribution":410,"./hash":421,"point-geometry":485}],423:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":340,"../util/dom":429,"point-geometry":485}],424:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)r.appendChild(e);return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":340,"../util/dom":429,"../util/evented":435,"../util/util":443}],425:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],426:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":328}],428:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":443,"mapbox-gl-supported":328}],429:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var u=0;u=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i(e.y-t.y)*(r.x-t.x)}function a(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}(t,e[i-1],e[i])e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function s(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var n=0;n=3)for(var u=0;u1){if(n(t,e))return!0;for(var i=0;ithis.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],440:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}var a=t("./config"),o=t("./browser"),s=t("url"),l=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=s.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==s.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=s.parse(t);if("mapbox:"!==r.protocol)return t;return n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=s.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,s.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=s.parse(t,!0);if(!e)return t;if("mapbox:"!==s.parse(e).protocol)return t;var i=o.supportsWebp?".webp":"$1",c=o.devicePixelRatio>=2||512===r?"@2x":"";return s.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,c+i),query:function(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?l.extend({},t,{access_token:a.ACCESS_TOKEN}):t}(n.query)})}},{"./browser":427,"./config":432,"./util":443,url:554}],441:[function(t,e,r){"use strict";function n(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function a(t){return h[t].BYTES_PER_ELEMENT}function o(t){return t.toLowerCase()}function s(t,e){var r="this._pos"+a(t.type).toFixed(0)+" + "+(t.offset/a(t.type)+e).toFixed(0);return"this._structArray."+o(t.type)+"["+r+"]"}function l(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function c(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var u=t("assert");e.exports=function(t){function e(){l.apply(this,arguments)}function r(){c.apply(this,arguments),this.members=e.prototype.members}var d=JSON.stringify(t);if(f[d])return f[d];void 0===t.alignment&&(t.alignment=1);var p=0,m=0,g=["Uint8"];return(e.prototype=Object.create(l.prototype)).members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},u(r.name.length),u(r.type in h),g.indexOf(r.type)<0&&g.push(r.type);var n=a(r.type);m=Math.max(m,n),r.offset=p=i(p,Math.max(t.alignment,n));for(var o=0;othis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},c.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":339,unitbezier:553}],444:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],445:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],446:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ip[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":448,"gl-mat4/clone":176,"gl-mat4/create":177,"gl-mat4/determinant":178,"gl-mat4/invert":182,"gl-mat4/transpose":192,"gl-vec3/cross":273,"gl-vec3/dot":274,"gl-vec3/length":275,"gl-vec3/normalize":277}],448:[function(t,e,r){e.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}},{}],449:[function(t,e,r){function n(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var a=t("gl-vec3/lerp"),o=t("mat4-recompose"),s=t("mat4-decompose"),l=t("gl-mat4/determinant"),c=t("quat-slerp"),u=n(),h=n(),f=n();e.exports=function(t,e,r,n){if(0===l(e)||0===l(r))return!1;var i=s(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),d=s(r,h.translate,h.scale,h.skew,h.perspective,h.quaternion);return!(!i||!d||(a(f.translate,u.translate,h.translate,n),a(f.skew,u.skew,h.skew,n),a(f.scale,u.scale,h.scale,n),a(f.perspective,u.perspective,h.perspective,n),c(f.quaternion,u.quaternion,h.quaternion,n),o(t,f.translate,f.scale,f.skew,f.perspective,f.quaternion),0))}},{"gl-mat4/determinant":178,"gl-vec3/lerp":276,"mat4-decompose":447,"mat4-recompose":450,"quat-slerp":498}],450:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.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}},{"gl-mat4/create":177,"gl-mat4/fromRotationTranslation":180,"gl-mat4/identity":181,"gl-mat4/multiply":184,"gl-mat4/scale":190,"gl-mat4/translate":191}],451:[function(t,e,r){"use strict";function n(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]}var i=t("binary-search-bounds"),a=t("mat4-interpolate"),o=t("gl-mat4/invert"),s=t("gl-mat4/rotateX"),l=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),h=t("gl-mat4/translate"),f=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];e.exports=function(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=n.prototype;p.recalcMatrix=function(t){var e=this._time,r=i.le(e,t),n=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=s[l++];else{var u=e[r+1]-e[r],h=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)h[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&h[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)n[c]=h[c];else a(n,h,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],f(m,m);var g=this.computedInverse;o(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var b=this.computedCenter,x=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)b[c]=v[c]-n[2+4*c]*x}},p.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=1,s.pop();s.push(l)}r=new Array(s.length+o.length-2);for(var h=0,f=(i=0,o.length);i0;--d)r[h++]=s[d];return r};var n=t("robust-orientation")[3]},{"robust-orientation":517}],453:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==m.alt,m.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==m.shift,m.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==m.control,m.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==m.meta,m.meta=!!t.metaKey),e}function i(t,i){var a=n.x(i),o=n.y(i);"buttons"in i&&(t=0|i.buttons),(t!==f||a!==d||o!==p||r(i))&&(f=0|t,d=a||0,p=o||0,e&&e(f,d,p,m))}function a(t){i(0,t)}function o(){(f||d||p||m.shift||m.alt||m.meta||m.control)&&(d=p=0,f=0,m.shift=m.alt=m.control=m.meta=!1,e&&e(0,0,0,m))}function s(t){r(t)&&e&&e(f,d,p,m)}function l(t){0===n.buttons(t)?i(0,t):i(f,t)}function c(t){i(f|n.buttons(t),t)}function u(t){i(f&~n.buttons(t),t)}function h(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var f=0,d=0,p=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;h();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return g},set:function(e){e?h():g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))},enumerable:!0},buttons:{get:function(){return f},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":455}],454:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-o.left,r[1]=a-o.top,r}},{}],455:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.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;k=k-1&m)x.push(_+"["+T+"+"+g(k)+"]");for(x.push(v(0)),k=0;k=0;--e)L(e,0);var r=[];for(e=0;e0){",f(S[t]),"=1;"),P(t-1,e|1<0&&H.push(s(N,S[B-1])+"*"+o(S[B-1])),R.push(d(N,S[B])+"=("+H.join("-")+")|0")}for(N=0;N=0;--N)q.push(o(S[N]));R.push(k+"=("+q.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",T+"=0"),R.push(p(0)+"=0");for(B=1;B<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 a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return b(t.vertex,t.cell,t.phase,i,r,o)};var _="V",w="P",M="N",k="Q",T="X",A="T"},{"typedarray-pool":550}],458:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":114}],459:[function(t,e,r){"use strict";function n(t){if(t in o)return o[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){for(a.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");for(a.push("){grad",r,"(src.pick(",s.join(),")",c),l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",f.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",h,",src.pick(",f.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",h,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",h,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",h,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",h,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join();if(v=s[r])return v;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],l=0;l<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:o,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":111}],463:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":464,ndarray:468}],464:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":111}],465:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[a.mallocUint8,a.freeUint8];case"uint16":return[a.mallocUint16,a.freeUint16];case"uint32":return[a.mallocUint32,a.freeUint32];case"int8":return[a.mallocInt8,a.freeInt8];case"int16":return[a.mallocInt16,a.freeInt16];case"int32":return[a.mallocInt32,a.freeInt32];case"float32":return[a.mallocFloat,a.freeFloat];case"float64":return[a.mallocDouble,a.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",h,"*n",h].join("")):s.push(["d",d,"=s",d].join("")),h=d);var p;0!=(p=t.length-1-l)&&(f>0?s.push(["e",p,"=s",p,"-e",f,"*n",f,",f",p,"=",c[p],"-f",f,"*n",f].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),f=p)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",o,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+a);var g=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var h=[],f=1;f1){for(o.push("dptr=0;sptr=ptr"),f=t.length-1;f>=0;--f)0!==(d=t[f])&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),f=t.length-1;f>=1;--f)o.push("sptr+=e"+f,"dptr+=f"+f,"}");for(o.push("dptr=cptr;sptr=cptr-s0"),f=t.length-1;f>=0;--f)0!==(d=t[f])&&o.push(["for(i",d,"=0;i",d,"=0;--f)0!==(d=t[f])&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));return o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c?new Function("malloc","free",o.join("\n"))(c[0],c[1]):new Function(o.join("\n"))()}(t,e);return g(v,function(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function s(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function l(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function c(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i)0!==(o=t[i])&&_.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function h(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function f(e,r){var n="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++T;u(o,[n,i],!1,["comp=",s("ptr0"),"-",s("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else _.push(["if(",s(a(n)),">",s(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?c([e,r],!1,l("ptr0",s("ptr1"))):_.push(l(a(e),s(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++T;u(i,[r],!0,[e,"=",s("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",s(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?c([e,r],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(c([e,r,n],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?c([e,r],!0,[l("ptr0",s("ptr1")),"\n",l("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(l(a(e),s(a(r))),l(a(r),"pivot"+n))}function b(e,r){_.push(["if((",r,"-",e,")<=",o,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function x(e,r,n){t.length>1?(_.push(["__l",++T,":while(true){"].join("")),c([e],!0,["if(",s("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",T,"}"].join("")),_.push(n,"}")):_.push(["while(",s(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),T=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var A=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?c(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",s("ptr1"),"\n","pivot2[pivot_ptr]=",s("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",s("ptr0"),"\n","y=",s("ptr2"),"\n","z=",s("ptr4"),"\n",l("ptr5","x"),"\n",l("ptr6","y"),"\n",l("ptr7","z")].join("")):_.push(["pivot1=",s(a("el2")),"\n","pivot2=",s(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",s(a("el1")),"\n","y=",s(a("el3")),"\n","z=",s(a("el5")),"\n",l(a("index1"),"x"),"\n",l(a("index3"),"y"),"\n",l(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),x("less",1,"++less"),x("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k?new Function("insertionSort","malloc","free",_.join("\n"))(r,k[0],k[1]):new Function("insertionSort",_.join("\n"))(r)}(t,e,v))}},{"typedarray-pool":550}],466:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.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}},{"./lib/compile_sort.js":465}],467:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":114,"ndarray-linear-interpolate":461}],468:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");return new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],i)}var o=t("iota-array"),s=t("is-buffer"),l="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var o=i-1,u=1;o>=0;--o)r[o]=u,u*=e[o]}if(void 0===n)for(n=0,o=0;o>>0;e.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)}},{"double-bits":125}],470:[function(t,e,r){r.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 x=i[c],_=1/Math.sqrt(g*y);for(b=0;b<3;++b){var w=(b+1)%3,M=(b+2)%3;x[b]+=_*(v[w]*m[M]-v[M]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),b=0;b<3;++b)x[b]*=_;else for(b=0;b<3;++b)x[b]=0}return i},r.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;for(c=0;c<3;++c)f[c]*=d;i[o]=f}return i}},{}],471:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;lr;)i-=e;return n=i,[r/e,n/e]}(p.subarray(a,a+4*m),4))[0]!==h[1]){for(b||(b=r),x=r,e=h[0];ew&&(w=h[1]),k[r]=h}for(o=0,l=0,s=0,r=0;rM&&(M=d);return{center:[c,u],bounds:[_,b,w,x+1],radius:Math.sqrt(M)}}(r)}function i(t,e){return t*t+e*e}e.exports=n;var a=document.createElement("canvas"),o=a.getContext("2d");a.width=200,a.height=200,n.canvas=a},{}],473:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a,o,s,l,c){var u=e+a+c;if(h>0){var h=Math.sqrt(u+1);t[0]=.5*(o-l)/h,t[1]=.5*(s-n)/h,t[2]=.5*(r-a)/h,t[3]=.5*h}else{var f=Math.max(e,a,c);h=Math.sqrt(2*f-u+1),e>=f?(t[0]=.5*h,t[1]=.5*(i+r)/h,t[2]=.5*(s+n)/h,t[3]=.5*(o-l)/h):a>=f?(t[0]=.5*(r+i)/h,t[1]=.5*h,t[2]=.5*(l+o)/h,t[3]=.5*(s-n)/h):(t[0]=.5*(n+s)/h,t[1]=.5*(o+l)/h,t[2]=.5*h,t[3]=.5*(r-i)/h)}return t}},{}],474:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=s([r]),this.center=s(e),this.rotation=s(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)}e.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),a(r=[].slice.call(r,0,4),r);var i=new o(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 s=t("filtered-vector"),l=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),u=t("gl-mat4/invert"),h=t("./lib/quatFromFrame"),f=o.prototype;f.lastT=function(){return Math.max(this.radius.lastT(),this.center.lastT(),this.rotation.lastT())},f.recalcMatrix=function(t){this.radius.curve(t),this.center.curve(t),this.rotation.curve(t);var e=this.computedRotation;a(e,e);var r=this.computedMatrix;c(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,h=0;h<3;++h)u+=r[l+4*h]*i[h];r[12+l]=-u}},f.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},f.idle=function(t){this.center.idle(t),this.radius.idle(t),this.rotation.idle(t)},f.flush=function(t){this.center.flush(t),this.radius.flush(t),this.rotation.flush(t)},f.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],h=a[4],f=a[8],d=u*o+h*s+f*l,p=n(u-=o*d,h-=s*d,f-=l*d);u/=p,h/=p,f/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,b=m*u+g*h+v*f,x=n(m-=y*o+b*u,g-=y*s+b*h,v-=y*l+b*f);m/=x,g/=x,v/=x;var _=u*e+o*r,w=h*e+s*r,M=f*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},f.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],h=o[5],f=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*u,v=e*l+r*h,y=e*c+r*f,b=-(p*y-m*v),x=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(b,2)-Math.pow(x,2)-Math.pow(_,2))),M=i(b,x,_,w);M>1e-6?(b/=M,x/=M,_/=M,w/=M):(b=x=_=0,w=1);var k=this.computedRotation,T=k[0],A=k[1],S=k[2],E=k[3],L=T*w+E*b+A*_-S*x,C=A*w+E*x+S*b-T*_,I=S*w+E*_+T*x-A*b,P=E*w-T*b-A*x-S*_;if(a){b=d,x=p,_=m;var D=Math.sin(a)/n(b,x,_);b*=D,x*=D,_*=D,P=P*(w=Math.cos(e))-(L=L*w+P*b+C*_-I*x)*b-(C=C*w+P*x+I*b-L*_)*x-(I=I*w+P*_+L*x-C*b)*_}var z=i(L,C,I,P);z>1e-6?(L/=z,C/=z,I/=z,P/=z):(L=C=I=0,P=1),this.rotation.set(t,L,C,I,P)},f.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;l(i,e,r,n);var o=this.computedRotation;h(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,c=0;c<3;++c)s+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(s,1e-6))),this.center.set(t,r[0],r[1],r[2])},f.translate=function(t,e,r,n){this.center.move(t,e||0,r||0,n||0)},f.setMatrix=function(t,e){var r=this.computedRotation;h(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;u(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),this.radius.idle(t)}else this.center.idle(t),this.radius.idle(t)},f.setDistance=function(t,e){e>0&&this.radius.set(t,Math.log(e))},f.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},f.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])]},f.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]}},f.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)}},{"./lib/quatFromFrame":473,"filtered-vector":134,"gl-mat4/fromQuat":179,"gl-mat4/invert":182,"gl-mat4/lookAt":183}],475:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":509}],476:[function(t,e,r){e.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}},{}],477:[function(t,e,r){(function(t){function e(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:function(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?function(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=d.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&function(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,i,e)},writePackedSVarint:function(t,e){this.writeMessage(t,a,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,o,e)},writePackedDouble:function(t,e){this.writeMessage(t,s,e)},writePackedFixed32:function(t,e){this.writeMessage(t,c,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,u,e)},writePackedFixed64:function(t,e){this.writeMessage(t,h,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,f,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":478}],480:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":293,"typedarray-pool":550}],482:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t,e){var r=c[e][t[e]];r.splice(r.indexOf(t),1)}function i(t,i,a){for(var o,s,l,u=0;u<2;++u)if(c[u][i].length>0){o=c[u][i][0],l=u;break}s=o[1^l];for(var h=0;h<2;++h)for(var f=c[h][i],d=0;d0&&(o=p,s=m,l=h)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=i(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],h=t,f=s[1],d=i(u,h,!0);if(n(e[u],e[h],e[f],e[d])<0)break;s.push(t),l=i(u,h)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;u0;){c[0][u].length;var m=a(u,d);o(0,m)?p.push.apply(p,m):(p.length>0&&f.push(p),p=m)}p.length>0&&f.push(p)}return f};var n=t("compare-angle")},{"compare-angle":101}],483:[function(t,e,r){"use strict";e.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 c=r[d];for(s=0;s0})).length,g=new Array(m),v=new Array(m);for(d=0;d0;){var j=O.pop(),N=E[j];c(N,function(t,e){return t-e});var B,U=N.length,V=F[j];for(0===V&&(B=[q=p[j]]),d=0;d=0)&&(F[H]=1^V,O.push(H),0===V)){var q;r(q=p[H])||(q.reverse(),B.push(q))}}0===V&&R.push(B)}return R};var i=t("edges-to-adjacency-list"),a=t("planar-dual"),o=t("point-in-big-polygon"),s=t("two-product"),l=t("robust-sum"),c=t("uniq"),u=t("./lib/trim-leaves")},{"./lib/trim-leaves":483,"edges-to-adjacency-list":128,"planar-dual":482,"point-in-big-polygon":486,"robust-sum":522,"two-product":548,uniq:552}],485:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],486:[function(t,e,r){function n(){return!0}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var s=i.key,l=o(r,s[0],s[1]);if(s[0][0]0))return 0;a=-1,i=i.right}else if(l>0)i=i.left;else{if(!(l<0))return 0;a=1,i=i.right}}return a}}(g.slabs,g.coordinates);return 0===n.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(i(n),v)};var o=t("robust-orientation")[3],s=t("slab-decomposition"),l=t("interval-tree-1d"),c=t("binary-search-bounds")},{"binary-search-bounds":67,"interval-tree-1d":292,"robust-orientation":517,"slab-decomposition":534}],487:[function(t,e,r){function n(t,e,r){var n=i.segments(t),a=i.segments(e),o=r(i.combine(n,a));return i.polygon(o)}var i,a=t("./lib/build-log"),o=t("./lib/epsilon"),s=t("./lib/intersecter"),l=t("./lib/segment-chainer"),c=t("./lib/segment-selector"),u=t("./lib/geojson"),h=!1,f=o();i={buildLog:function(t){return!0===t?h=a():!1===t&&(h=!1),!1!==h&&h.list},epsilon:function(t){return f.epsilon(t)},segments:function(t){var e=s(!0,f,h);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:s(!1,f,h).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:c.union(t.combined,h),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:c.intersect(t.combined,h),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:c.difference(t.combined,h),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:c.differenceRev(t.combined,h),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:c.xor(t.combined,h),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,f,h),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(i,t)},polygonToGeoJSON:function(t){return u.fromPolygon(i,f,t)},union:function(t,e){return n(t,e,i.selectUnion)},intersect:function(t,e){return n(t,e,i.selectIntersect)},difference:function(t,e){return n(t,e,i.selectDifference)},differenceRev:function(t,e){return n(t,e,i.selectDifferenceRev)},xor:function(t,e){return n(t,e,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),e.exports=i},{"./lib/build-log":488,"./lib/epsilon":489,"./lib/geojson":490,"./lib/intersecter":491,"./lib/segment-chainer":493,"./lib/segment-selector":494}],488:[function(t,e,r){e.exports=function(){function t(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}var e,r=0,n=!1;return e={list:[],segmentId:function(){return r++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,n){return t("temp_status",{seg:e,above:r,below:n})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,n){return t("status",{seg:e,above:r,below:n})},vert:function(r){return r===n?e:(n=r,t("vert",{x:r}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}}}},{}],489:[function(t,e,r){e.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-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],490:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}if(e.length<=0)return t.segments({inverted:!1,regions:[]});for(var n=r(e[0]),i=1;i0})}function s(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var h=e.linesIntersect(o,s,c,u);if(!1===h){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var f=e.pointsSame(o,c),d=e.pointsSame(s,u);if(f&&d)return n;var p=!f&&e.pointBetween(o,c,u),m=!d&&e.pointBetween(s,c,u);if(f)return m?l(n,s):l(t,u),n;p&&(d||(m?l(n,s):l(t,u)),l(n,o))}else 0===h.alongA&&(-1===h.alongB?l(t,c):0===h.alongB?l(t,h.pt):1===h.alongB&&l(t,u)),0===h.alongB&&(-1===h.alongA?l(n,o):0===h.alongA?l(n,h.pt):1===h.alongA&&l(n,s));return!1}for(var c=n.create(),h=[];!u.isEmpty();){var f=u.getHead();if(r&&r.vert(f.pt[0]),f.isStart){r&&r.segmentNew(f.seg,f.primary);var d=o(f),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(f.seg,!!p&&p.seg,!!m&&m.seg);var g=function(){if(p){var t=s(f,p);if(t)return t}return!!m&&s(f,m)}();if(g&&(t?(v=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=f.seg.myFill,r&&r.segmentUpdate(g.seg),f.other.remove(),f.remove()),u.getHead()!==f){r&&r.rewind(f.seg);continue}if(t){var v;v=null===f.seg.myFill.below||f.seg.myFill.above!==f.seg.myFill.below,f.seg.myFill.below=m?m.seg.myFill.above:i,f.seg.myFill.above=v?!f.seg.myFill.below:f.seg.myFill.below}else if(null===f.seg.otherFill){var y;y=m?f.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:f.primary?a:i,f.seg.otherFill={above:y,below:y}}r&&r.status(f.seg,!!p&&p.seg,!!m&&m.seg),f.other.status=d.insert(n.node({ev:f}))}else{var b=f.status;if(null===b)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(c.exists(b.prev)&&c.exists(b.next)&&s(b.prev.ev,b.next.ev),r&&r.statusRemove(b.ev.seg),b.remove(),!f.primary){var x=f.seg.myFill;f.seg.myFill=f.seg.otherFill,f.seg.otherFill=x}h.push(f.seg)}u.getHead().remove()}return r&&r.done(),h}var u=n.create();return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=c?(x=1,y=c+2*f+p):y=f*(x=-f/c)+p):(x=0,d>=0?(_=0,y=p):-d>=h?(_=1,y=h+2*d+p):y=d*(_=-d/h)+p);else if(_<0)_=0,f>=0?(x=0,y=p):-f>=c?(x=1,y=c+2*f+p):y=f*(x=-f/c)+p;else{var w=1/b;y=(x*=w)*(c*x+u*(_*=w)+2*f)+_*(u*x+h*_+2*d)+p}else{var M,k,T,A;x<0?(k=h+d)>(M=u+f)?(T=k-M)>=(A=c-2*u+h)?(x=1,_=0,y=c+2*f+p):y=(x=T/A)*(c*x+u*(_=1-x)+2*f)+_*(u*x+h*_+2*d)+p:(x=0,k<=0?(_=1,y=h+2*d+p):d>=0?(_=0,y=p):y=d*(_=-d/h)+p):_<0?(k=c+f)>(M=u+d)?(T=k-M)>=(A=c-2*u+h)?(_=1,x=0,y=h+2*d+p):y=(x=1-(_=T/A))*(c*x+u*_+2*f)+_*(u*x+h*_+2*d)+p:(_=0,k<=0?(x=1,y=c+2*f+p):f>=0?(x=0,y=p):y=f*(x=-f/c)+p):(T=h+d-u-f)<=0?(x=0,_=1,y=h+2*d+p):T>=(A=c-2*u+h)?(x=1,_=0,y=c+2*f+p):y=(x=T/A)*(c*x+u*(_=1-x)+2*f)+_*(u*x+h*_+2*d)+p}var S=1-x-_;for(l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]);return n+a((t=t.replace(C,".")).split("."),e).join(".")}function s(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(e+=z((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=z(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:x}function u(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function h(t,e,r){var n=0;for(t=r?D(t/k):t>>1,t+=D(t/e);t>P*w>>1;n+=x)t=D(t/P);return D(n+(P+1)*t/(t+M))}function f(t){var e,r,n,a,o,s,u,f,d,p,m=[],g=t.length,v=0,y=A,M=T;for((r=t.lastIndexOf(S))<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a=g&&i("invalid-input"),((f=c(t.charCodeAt(a++)))>=x||f>D((b-v)/s))&&i("overflow"),v+=f*s,d=u<=M?_:u>=M+w?w:u-M,!(fD(b/(p=x-d))&&i("overflow"),s*=p;M=h(v-o,e=m.length+1,0==o),D(v/e)>b-y&&i("overflow"),y+=D(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,c,f,d,p,m,g,v,y,M,k=[];for(g=(t=s(t)).length,e=A,r=0,o=T,l=0;l=e&&mD((b-r)/(v=n+1))&&i("overflow"),r+=(c-e)*v,e=c,l=0;lb&&i("overflow"),m==e){for(f=r,d=x;p=d<=o?_:d>=o+w?w:d-o,!(f= 0x80 (not a basic code point)","invalid-input":"Invalid input"},P=x-_,D=Math.floor,z=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:f,encode:d,toASCII:function(t){return o(t,function(t){return L.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return o(t,function(t){return E.test(t)?f(t.slice(4).toLowerCase()):t})}},p&&m)if(e.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],498:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":232}],499:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(h=m.substr(0,g),f=m.substr(g+1)):(h=m,f=""),d=decodeURIComponent(h),p=decodeURIComponent(f),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],500:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne?1:0};a>r;){if(a-r>600){var s=a-r+1,l=e-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-l*u/s+h)),Math.min(a,Math.floor(e+(s-l)*u/s+h)),o)}var f=t[e],d=r,p=a;for(i(t,r,e),o(t[a],f)>0&&i(t,r,a);d0;)p--}0===o(t[r],f)?i(t,r,p):i(t,++p,a),p<=e&&(r=p+1),e<=p&&(a=p-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],503:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":86,"compare-cell":102,"compare-oriented-cell":103}],508:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){"use strict";function t(t){return"undefined"!=typeof btoa?btoa(t):"base64:"+t}function e(t){var e=new Error("(regl) "+t);throw console.error(e),e}function r(t,r){t||e(r)}function n(t){return t?": "+t:""}function i(t,r,i){r.indexOf(t)<0&&e("invalid value"+n(i)+". must be one of: "+r)}function a(t,e){for(t+="";t.length1&&e===r&&('"'===e||"'"===e))return['"'+y(t.substr(1,t.length-2))+'"'];var n=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(t);if(n)return b(t.substr(0,n.index)).concat(b(n[1])).concat(b(t.substr(n.index+n[0].length)));var i=t.split(".");if(1===i.length)return['"'+y(t)+'"'];for(var a=[],o=0;o0,"invalid pixel ratio")):n=(i=a).canvas:e=a:Mt.raise("invalid arguments to regl"),e&&("canvas"===e.nodeName.toLowerCase()?n=e:r=e),!i){if(!n){Mt("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var d=function(t,e,r){function n(){var e=window.innerWidth,n=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();e=a.right-a.left,n=a.bottom-a.top}i.width=r*e,i.height=r*n,ct(i.style,{width:e+"px",height:n+"px"})}var i=document.createElement("canvas");return ct(i.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(i),t===document.body&&(i.style.position="absolute",ct(t.style,{margin:0,padding:0})),window.addEventListener("resize",n,!1),n(),{canvas:i,onDestroy:function(){window.removeEventListener("resize",n),t.removeChild(i)}}}(r||document.body,0,c);if(!d)return null;n=d.canvas,f=d.onDestroy}i=function(t,e){function r(r){try{return t.getContext(r,e)}catch(t){return null}}return r("webgl")||r("experimental-webgl")||r("webgl-experimental")}(n,o)}return i?{gl:i,canvas:n,container:r,extensions:s,optionalExtensions:l,pixelRatio:c,profile:u,onDone:h,onDestroy:f}:(f(),h("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function k(t){return!!t&&"object"==typeof t&&Array.isArray(t.shape)&&Array.isArray(t.stride)&&"number"==typeof t.offset&&t.shape.length===t.stride.length&&(Array.isArray(t.data)||lt(t.data))}function T(t,e){for(var r=Array(t),n=0;n65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1}function S(t){var e=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(t),r=jt[A(e)>>2];return r.length>0?r.pop():new ArrayBuffer(e)}function E(t){jt[A(t.byteLength)>>2].push(t)}function L(t,e,r,n,i,a){for(var o=a,s=0;s>>31<<15,a=(n<<1>>>24)-127,o=n>>13&1023;if(a<-24)e[r]=i;else if(a<-14){var s=-14-a;e[r]=i+(o+1024>>s)}else e[r]=a>15?i+31744:i+(a+15<<10)+o}return e}function O(t){return Array.isArray(t)||lt(t)}function F(t){return"[object "+t+"]"}function R(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function j(t){if(!Array.isArray(t))return!1;return!(0===t.length||!O(t[0]))}function N(t){return Object.prototype.toString.call(t)}function B(t){return N(t)===wr}function U(t){if(!t)return!1;var e=N(t);return Ar.indexOf(e)>=0||(R(t)||j(t)||k(t))}function V(t){return 0|st[Object.prototype.toString.call(t)]}function H(t,e){return Nt.allocType(t.type===Pe?Xe:t.type,e)}function q(t,e){t.type===Pe?(t.data=z(e),Nt.freeType(e)):t.data=e}function G(t,e,r,n,i,a){var o;if(o=void 0!==Er[t]?Er[t]:_r[t]*Sr[e],a&&(o*=6),i){for(var s=0,l=r;l>=1;)s+=o*l*l,l/=2;return s}return o*r*n}function Y(t,e,r,n,i,a,o){function s(){this.internalformat=ge,this.format=ge,this.type=Ge,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=0,this.width=0,this.height=0,this.channels=0}function l(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function c(t,n){if("object"==typeof n&&n){if("premultiplyAlpha"in n&&(Mt.type(n.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=n.premultiplyAlpha),"flipY"in n&&(Mt.type(n.flipY,"boolean","invalid texture flip"),t.flipY=n.flipY),"alignment"in n&&(Mt.oneOf(n.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=n.alignment),"colorSpace"in n&&(Mt.parameter(n.colorSpace,F,"invalid colorSpace"),t.colorSpace=F[n.colorSpace]),"type"in n){var i=n.type;Mt(e.oes_texture_float||!("float"===i||"float32"===i),"you must enable the OES_texture_float extension in order to use floating point textures."),Mt(e.oes_texture_half_float||!("half float"===i||"float16"===i),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),Mt(e.webgl_depth_texture||!("uint16"===i||"uint32"===i||"depth stencil"===i),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Mt.parameter(i,Y,"invalid texture type"),t.type=Y[i]}var a=t.width,o=t.height,s=t.channels,l=!1;"shape"in n?(Mt(Array.isArray(n.shape)&&n.shape.length>=2,"shape must be an array"),a=n.shape[0],o=n.shape[1],3===n.shape.length&&(s=n.shape[2],Mt(s>0&&s<=4,"invalid number of channels"),l=!0),Mt(a>=0&&a<=r.maxTextureSize,"invalid width"),Mt(o>=0&&o<=r.maxTextureSize,"invalid height")):("radius"in n&&(a=o=n.radius,Mt(a>=0&&a<=r.maxTextureSize,"invalid radius")),"width"in n&&(a=n.width,Mt(a>=0&&a<=r.maxTextureSize,"invalid width")),"height"in n&&(o=n.height,Mt(o>=0&&o<=r.maxTextureSize,"invalid height")),"channels"in n&&(s=n.channels,Mt(s>0&&s<=4,"invalid number of channels"),l=!0)),t.width=0|a,t.height=0|o,t.channels=0|s;var c=!1;if("format"in n){var u=n.format;Mt(e.webgl_depth_texture||!("depth"===u||"depth stencil"===u),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),Mt.parameter(u,W,"invalid texture format");var h=t.internalformat=W[u];t.format=rt[h],u in Y&&("type"in n||(t.type=Y[u])),u in X&&(t.compressed=!0),c=!0}!l&&c?t.channels=_r[t.format]:l&&!c?t.channels!==xr[t.format]&&(t.format=t.internalformat=xr[t.channels]):c&&l&&Mt(t.channels===_r[t.format],"number of channels inconsistent with specified format")}}function u(e){t.pixelStorei(pr,e.flipY),t.pixelStorei(mr,e.premultiplyAlpha),t.pixelStorei(gr,e.colorSpace),t.pixelStorei(dr,e.unpackAlignment)}function h(){s.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function f(t,e){var n=null;if(U(e)?n=e:e&&(Mt.type(e,"object","invalid pixel data type"),c(t,e),"x"in e&&(t.xOffset=0|e.x),"y"in e&&(t.yOffset=0|e.y),U(e.data)&&(n=e.data)),Mt(!t.compressed||n instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),e.copy){Mt(!n,"can not specify copy and data field for the same texture");var a=i.viewportWidth,o=i.viewportHeight;t.width=t.width||a-t.xOffset,t.height=t.height||o-t.yOffset,t.needsCopy=!0,Mt(t.xOffset>=0&&t.xOffset=0&&t.yOffset0&&t.width<=a&&t.height>0&&t.height<=o,"copy texture read out of bounds")}else if(n){if(lt(n))t.channels=t.channels||4,t.data=n,"type"in e||t.type!==Ge||(t.type=V(n));else if(R(n))t.channels=t.channels||4,function(t,e){var r=e.length;switch(t.type){case Ge:case Ye:case We:case Xe:var n=Nt.allocType(t.type,r);n.set(e),t.data=n;break;case Pe:t.data=z(e);break;default:Mt.raise("unsupported texture type, must specify a typed array")}}(t,n),t.alignment=1,t.needsFree=!0;else if(k(n)){var s=n.data;Array.isArray(s)||t.type!==Ge||(t.type=V(s));var l,u,h,f,d,p,m=n.shape,g=n.stride;3===m.length?(h=m[2],p=g[2]):(Mt(2===m.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),l=m[0],u=m[1],f=g[0],d=g[1],t.alignment=1,t.width=l,t.height=u,t.channels=h,t.format=t.internalformat=xr[h],t.needsFree=!0,function(t,e,r,n,i,a){for(var o=t.width,s=t.height,l=t.channels,c=H(t,o*s*l),u=0,h=0;h=0,"oes_texture_float extension not enabled"):t.type===Pe&&Mt(r.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function d(e,r,i){var a=e.element,o=e.data,s=e.internalformat,l=e.format,c=e.type,h=e.width,f=e.height;u(e),a?t.texImage2D(r,i,l,l,c,a):e.compressed?t.compressedTexImage2D(r,i,s,h,f,0,o):e.needsCopy?(n(),t.copyTexImage2D(r,i,l,e.xOffset,e.yOffset,h,f,0)):t.texImage2D(r,i,l,h,f,0,l,c,o)}function p(e,r,i,a,o){var s=e.element,l=e.data,c=e.internalformat,h=e.format,f=e.type,d=e.width,p=e.height;u(e),s?t.texSubImage2D(r,o,i,a,h,f,s):e.compressed?t.compressedTexSubImage2D(r,o,i,a,c,d,p,l):e.needsCopy?(n(),t.copyTexSubImage2D(r,o,i,a,e.xOffset,e.yOffset,d,p)):t.texSubImage2D(r,o,i,a,d,p,h,f,l)}function m(){return nt.pop()||new h}function g(t){t.needsFree&&Nt.freeType(t.data),h.call(t),nt.push(t)}function v(t,e,r){var n=t.images[0]=m();t.mipmask=1,n.width=t.width=e,n.height=t.height=r,n.channels=t.channels=4}function y(t,e){var r=null;if(U(e))l(r=t.images[0]=m(),t),f(r,e),t.mipmask=1;else if(c(t,e),Array.isArray(e.mipmap))for(var n=e.mipmap,i=0;i>=i,r.height>>=i,f(r,n[i]),t.mipmask|=1<=0&&(t.genMipmaps=!0)}if("mag"in e){var i=e.mag;Mt.parameter(i,P),t.magFilter=P[i]}var a=t.wrapS,o=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(Mt.parameter(s,I),a=o=I[s]):Array.isArray(s)&&(Mt.parameter(s[0],I),Mt.parameter(s[1],I),a=I[s[0]],o=I[s[1]])}else{if("wrapS"in e){var l=e.wrapS;Mt.parameter(l,I),a=I[l]}if("wrapT"in e){var c=e.wrapT;Mt.parameter(c,I),o=I[c]}}if(t.wrapS=a,t.wrapT=o,"anisotropic"in e){var u=e.anisotropic;Mt("number"==typeof u&&u>=1&&u<=r.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var h=!1;switch(typeof e.mipmap){case"string":Mt.parameter(e.mipmap,C,"invalid mipmap hint"),t.mipmapHint=C[e.mipmap],t.genMipmaps=!0,h=!0;break;case"boolean":h=t.genMipmaps=e.mipmap;break;case"object":Mt(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,h=!0;break;default:Mt.raise("invalid mipmap type")}!h||"min"in e||(t.minFilter=ir)}}function T(r,n){t.texParameteri(n,er,r.minFilter),t.texParameteri(n,tr,r.magFilter),t.texParameteri(n,Ze,r.wrapS),t.texParameteri(n,Je,r.wrapT),e.ext_texture_filter_anisotropic&&t.texParameteri(n,fr,r.anisotropic),r.genMipmaps&&(t.hint(lr,r.mipmapHint),t.generateMipmap(n))}function A(e){s.call(this),this.mipmask=0,this.internalformat=ge,this.id=at++,this.refCount=1,this.target=e,this.texture=t.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new w,o.profile&&(this.stats={size:0})}function S(e){t.activeTexture(yr),t.bindTexture(e.target,e.texture)}function E(){var e=ut[0];e?t.bindTexture(e.target,e.texture):t.bindTexture(de,null)}function L(e){var r=e.texture;Mt(r,"must not double destroy texture");var n=e.unit,i=e.target;n>=0&&(t.activeTexture(yr+n),t.bindTexture(i,null),ut[n]=null),t.deleteTexture(r),e.texture=null,e.params=null,e.pixels=null,e.refCount=0,delete ot[e.id],a.textureCount--}var C={"don't care":cr,"dont care":cr,nice:hr,fast:ur},I={repeat:Ke,clamp:Qe,mirror:$e},P={nearest:rr,linear:nr},D=ct({mipmap:sr,"nearest mipmap nearest":ir,"linear mipmap nearest":ar,"nearest mipmap linear":or,"linear mipmap linear":sr},P),F={none:0,browser:vr},Y={uint8:Ge,rgba4:ke,rgb565:Ae,"rgb5 a1":Te},W={alpha:ve,luminance:be,"luminance alpha":xe,rgb:ye,rgba:ge,rgba4:_e,"rgb5 a1":we,rgb565:Me},X={};e.ext_srgb&&(W.srgb=Ce,W.srgba=Ie),e.oes_texture_float&&(Y.float32=Y.float=Xe),e.oes_texture_half_float&&(Y.float16=Y["half float"]=Pe),e.webgl_depth_texture&&(ct(W,{depth:Ee,"depth stencil":Le}),ct(Y,{uint16:Ye,uint32:We,"depth stencil":Se})),e.webgl_compressed_texture_s3tc&&ct(X,{"rgb s3tc dxt1":De,"rgba s3tc dxt1":ze,"rgba s3tc dxt3":Oe,"rgba s3tc dxt5":Fe}),e.webgl_compressed_texture_atc&&ct(X,{"rgb atc":Re,"rgba atc explicit alpha":je,"rgba atc interpolated alpha":Ne}),e.webgl_compressed_texture_pvrtc&&ct(X,{"rgb pvrtc 4bppv1":Be,"rgb pvrtc 2bppv1":Ue,"rgba pvrtc 4bppv1":Ve,"rgba pvrtc 2bppv1":He}),e.webgl_compressed_texture_etc1&&(X["rgb etc1"]=qe);var Z=Array.prototype.slice.call(t.getParameter(fe));Object.keys(X).forEach(function(t){var e=X[t];Z.indexOf(e)>=0&&(W[t]=e)});var J=Object.keys(W);r.textureFormats=J;var K=[];Object.keys(W).forEach(function(t){var e=W[t];K[e]=t});var Q=[];Object.keys(Y).forEach(function(t){var e=Y[t];Q[e]=t});var $=[];Object.keys(P).forEach(function(t){var e=P[t];$[e]=t});var tt=[];Object.keys(D).forEach(function(t){var e=D[t];tt[e]=t});var et=[];Object.keys(I).forEach(function(t){var e=I[t];et[e]=t});var rt=J.reduce(function(t,e){var r=W[e];return r===be||r===ve||r===be||r===xe||r===Ee||r===Le?t[r]=r:r===we||e.indexOf("rgba")>=0?t[r]=ge:t[r]=ye,t},{}),nt=[],it=[],at=0,ot={},st=r.maxTextureUnits,ut=Array(st).map(function(){return null});return ct(A.prototype,{bind:function(){this.bindCount+=1;var e=this.unit;if(e<0){for(var r=0;r0)continue;n.unit=-1}ut[r]=this,e=r;break}e>=st&&Mt.raise("insufficient number of texture units"),o.profile&&a.maxTextureUnits>c)-a,u.height=u.height||(s.height>>c)-o,Mt(s.type===u.type&&s.format===u.format&&s.internalformat===u.internalformat,"incompatible format for texture.subimage"),Mt(a>=0&&o>=0&&a+u.width<=s.width&&o+u.height<=s.height,"texture.subimage write out of bounds"),Mt(s.mipmask&1<>l;++l)t.texImage2D(de,l,s.format,n>>l,a>>l,0,s.format,s.type,null);return E(),o.profile&&(s.stats.size=G(s.internalformat,s.type,n,a,!1,!1)),i},i._reglType="texture2d",i._texture=s,o.profile&&(i.stats=s.stats),i.destroy=function(){s.decRef()},i},createCube:function(e,n,i,s,u,h){function d(t,e,n,i,a,s){var u,h=k.texInfo;for(w.call(h),u=0;u<6;++u)L[u]=x();if("number"!=typeof t&&t)if("object"==typeof t)if(e)y(L[0],t),y(L[1],e),y(L[2],n),y(L[3],i),y(L[4],a),y(L[5],s);else if(M(h,t),c(k,t),"faces"in t){var f=t.faces;for(Mt(Array.isArray(f)&&6===f.length,"cube faces must be a length 6 array"),u=0;u<6;++u)Mt("object"==typeof f[u]&&!!f[u],"invalid input for cube map face"),l(L[u],k),y(L[u],f[u])}else for(u=0;u<6;++u)y(L[u],t);else Mt.raise("invalid arguments to cube map");else{var p=0|t||1;for(u=0;u<6;++u)v(L[u],p,p)}for(l(k,L[0]),h.genMipmaps?k.mipmask=(L[0].width<<1)-1:k.mipmask=L[0].mipmask,Mt.textureCube(k,h,L,r),k.internalformat=L[0].internalformat,d.width=L[0].width,d.height=L[0].height,S(k),u=0;u<6;++u)b(L[u],me+u);for(T(h,pe),E(),o.profile&&(k.stats.size=G(k.internalformat,k.type,d.width,d.height,h.genMipmaps,!0)),d.format=K[k.internalformat],d.type=Q[k.type],d.mag=$[h.magFilter],d.min=tt[h.minFilter],d.wrapS=et[h.wrapS],d.wrapT=et[h.wrapT],u=0;u<6;++u)_(L[u]);return d}var k=new A(pe);ot[k.id]=k,a.cubeCount++;var L=new Array(6);return d(e,n,i,s,u,h),d.subimage=function(t,e,r,n,i){Mt(!!e,"must specify image data"),Mt("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var a=0|r,o=0|n,s=0|i,c=m();return l(c,k),c.width=0,c.height=0,f(c,e),c.width=c.width||(k.width>>s)-a,c.height=c.height||(k.height>>s)-o,Mt(k.type===c.type&&k.format===c.format&&k.internalformat===c.internalformat,"incompatible format for texture.subimage"),Mt(a>=0&&o>=0&&a+c.width<=k.width&&o+c.height<=k.height,"texture.subimage write out of bounds"),Mt(k.mipmask&1<>i;++i)t.texImage2D(me+n,i,k.format,r>>i,r>>i,0,k.format,k.type,null);return E(),o.profile&&(k.stats.size=G(k.internalformat,k.type,d.width,d.height,!1,!0)),d}},d._reglType="textureCube",d._texture=k,o.profile&&(d.stats=k.stats),d.destroy=function(){k.decRef()},d},clear:function(){for(var e=0;e>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;n<6;++n)t.texImage2D(me+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);T(e.texInfo,e.target)})}}}function W(t,e,r){return Ir[t]*e*r}function X(){this.state=0,this.x=0,this.y=0,this.z=0,this.w=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=Kr,this.offset=0,this.stride=0,this.divisor=0}function Z(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;r1)for(var m=0;mt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);Ct(l).forEach(e),l={},Ct(c).forEach(e),c={},h.forEach(function(e){t.deleteProgram(e.program)}),h.length=0,u={},r.shaderCount=0},program:function(t,e,i){Mt.command(t>=0,"missing vertex shader",i),Mt.command(e>=0,"missing fragment shader",i);var a=u[e];a||(a=u[e]={});var o=a[t];return o||(o=new function(t,e){this.id=f++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(e,t),r.shaderCount++,s(o,i),a[t]=o,h.push(o)),o},restore:function(){l={},c={};for(var t=0;t=0&&l=0&&c0&&u+l<=n.framebufferWidth,"invalid width for read pixels"),Mt(h>0&&h+c<=n.framebufferHeight,"invalid height for read pixels"),r();var d=u*h*4;return f||(s===nn?f=new Uint8Array(d):s===on&&(f=f||new Float32Array(d))),Mt.isTypedArray(f,"data buffer for regl.read() must be a typedarray"),Mt(f.byteLength>=d,"data buffer for regl.read() too small"),t.pixelStorei(an,4),t.readPixels(l,c,u,h,rn,s,f),f}return function(t){return t&&"framebuffer"in t?function(t){var r;return e.setFBO({framebuffer:t.framebuffer},function(){r=o(t)}),r}(t):o(t)}}function K(t){return Array.prototype.slice.call(t)}function Q(t){return K(t).join("")}function $(t){return Array.isArray(t)||lt(t)||k(t)}function tt(t){return t.sort(function(t,e){return t===Vn?-1:e===Vn?1:t=1,n>=2,e)}if(r===mn){var i=t.data;return new et(i.thisDep,i.contextDep,i.propDep,e)}return new et(r===pn,r===dn,r===fn,e)}function at(t,e,r,n,i,a,o,s,l,c,u,h,f,d,p){function m(t){return t.replace(".","_")}function g(t,e,r){var n=m(t);V.push(t),U[n]=B[n]=!!r,H[n]=e}function v(t,e,r){var n=m(t);V.push(t),Array.isArray(r)?(B[n]=r.slice(),U[n]=r.slice()):B[n]=U[n]=r,q[n]=e}function y(){var t=function(){function t(){var t=[],e=[];return ct(function(){t.push.apply(t,K(arguments))},{def:function(){var n="v"+r++;return e.push(n),arguments.length>0&&(t.push(n,"="),t.push.apply(t,K(arguments)),t.push(";")),n},toString:function(){return Q([e.length>0?"var "+e+";":"",Q(t)])}})}function e(){function e(t,e){n(t,e,"=",r.def(t,e),";")}var r=t(),n=t(),i=r.toString,a=n.toString;return ct(function(){r.apply(r,K(arguments))},{def:r.def,entry:r,exit:n,save:e,set:function(t,n,i){e(t,n),r(t,n,"=",i,";")},toString:function(){return i()+a()}})}var r=0,n=[],i=[],a=t(),o={};return{global:a,link:function(t){for(var e=0;e=0,'unknown parameter "'+t+'"',c.commandStr)})}var e=[qn,Gn,Yn,Wn,Xn,Jn,Zn,Kn,Hn].concat(V);t(f),t(d)});var p=function(t,e){var r=t.static,n=t.dynamic;if(qn in r){var i=r[qn];return i?(i=s.getFramebuffer(i),Mt.command(i,"invalid framebuffer object"),nt(function(t,e){var r=t.link(i),n=t.shared;e.set(n.framebuffer,".next",r);var a=n.context;return e.set(a,"."+Qn,r+".width"),e.set(a,"."+$n,r+".height"),r})):nt(function(t,e){var r=t.shared;e.set(r.framebuffer,".next","null");var n=r.context;return e.set(n,"."+Qn,n+"."+ri),e.set(n,"."+$n,n+"."+ni),"null"})}if(qn in n){var a=n[qn];return it(a,function(t,e){var r=t.invoke(e,a),n=t.shared,i=n.framebuffer,o=e.def(i,".getFramebuffer(",r,")");Mt.optional(function(){t.assert(e,"!"+r+"||"+o,"invalid framebuffer object")}),e.set(i,".next",o);var s=n.context;return e.set(s,"."+Qn,o+"?"+o+".width:"+s+"."+ri),e.set(s,"."+$n,o+"?"+o+".height:"+s+"."+ni),o})}return null}(t),g=function(t,e,r){function n(t){if(t in i){var n=i[t];Mt.commandType(n,"object","invalid "+t,r.commandStr);var o,s,l=!0,c=0|n.x,u=0|n.y;return"width"in n?(o=0|n.width,Mt.command(o>=0,"invalid "+t,r.commandStr)):l=!1,"height"in n?(s=0|n.height,Mt.command(s>=0,"invalid "+t,r.commandStr)):l=!1,new et(!l&&e&&e.thisDep,!l&&e&&e.contextDep,!l&&e&&e.propDep,function(t,e){var r=t.shared.context,i=o;"width"in n||(i=e.def(r,".",Qn,"-",c));var a=s;return"height"in n||(a=e.def(r,".",$n,"-",u)),[c,u,i,a]})}if(t in a){var h=a[t],f=it(h,function(e,r){var n=e.invoke(r,h);Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)});var i=e.shared.context,a=r.def(n,".x|0"),o=r.def(n,".y|0"),s=r.def('"width" in ',n,"?",n,".width|0:","(",i,".",Qn,"-",a,")"),l=r.def('"height" in ',n,"?",n,".height|0:","(",i,".",$n,"-",o,")");return Mt.optional(function(){e.assert(r,s+">=0&&"+l+">=0","invalid "+t)}),[a,o,s,l]});return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new et(e.thisDep,e.contextDep,e.propDep,function(t,e){var r=t.shared.context;return[0,0,e.def(r,".",Qn),e.def(r,".",$n)]}):null}var i=t.static,a=t.dynamic,o=n(Vn);if(o){var s=o;o=new et(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=s.append(t,e),n=t.shared.context;return e.set(n,"."+ti,r[2]),e.set(n,"."+ei,r[3]),r})}return{viewport:o,scissor_box:n(Un)}}(t,p,c),v=function(t,e){function r(t,r){if(t in n){var a=0|n[t];return Mt.command(!r||a>=0,"invalid "+t,e.commandStr),nt(function(t,e){return r&&(t.OFFSET=a),a})}if(t in i){var s=i[t];return it(s,function(e,n){var i=e.invoke(n,s);return r&&(e.OFFSET=i,Mt.optional(function(){e.assert(n,i+">=0","invalid "+t)})),i})}return r&&o?nt(function(t,e){return t.OFFSET="0",0}):null}var n=t.static,i=t.dynamic,o=function(){if(Wn in n){var t=n[Wn];$(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),Mt.command(t,"invalid elements",e.commandStr));var r=nt(function(e,r){if(t){var n=e.link(t);return e.ELEMENTS=n,n}return e.ELEMENTS=null,null});return r.value=t,r}if(Wn in i){var o=i[Wn];return it(o,function(t,e){var r=t.shared,n=r.isBufferArgs,i=r.elements,a=t.invoke(e,o),s=e.def("null"),l=e.def(n,"(",a,")"),c=t.cond(l).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return Mt.optional(function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")}),e.entry(c),e.exit(t.cond(l).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s})}return null}(),s=r(Jn,!0);return{elements:o,primitive:function(){if(Xn in n){var t=n[Xn];return Mt.commandParameter(t,Jt,"invalid primitve",e.commandStr),nt(function(e,r){return Jt[t]})}if(Xn in i){var r=i[Xn];return it(r,function(t,e){var n=t.constants.primTypes,i=t.invoke(e,r);return Mt.optional(function(){t.assert(e,i+" in "+n,"invalid primitive, must be one of "+Object.keys(Jt))}),e.def(n,"[",i,"]")})}return o?rt(o)?o.value?nt(function(t,e){return e.def(t.ELEMENTS,".primType")}):nt(function(){return Oi}):new et(o.thisDep,o.contextDep,o.propDep,function(t,e){var r=t.ELEMENTS;return e.def(r,"?",r,".primType:",Oi)}):null}(),count:function(){if(Zn in n){var t=0|n[Zn];return Mt.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),nt(function(){return t})}if(Zn in i){var r=i[Zn];return it(r,function(t,e){var n=t.invoke(e,r);return Mt.optional(function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")}),n})}if(o){if(rt(o)){if(o)return s?new et(s.thisDep,s.contextDep,s.propDep,function(t,e){var r=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return Mt.optional(function(){t.assert(e,r+">=0","invalid vertex offset/element buffer too small")}),r}):nt(function(t,e){return e.def(t.ELEMENTS,".vertCount")});var a=nt(function(){return-1});return Mt.optional(function(){a.MISSING=!0}),a}var l=new et(o.thisDep||s.thisDep,o.contextDep||s.contextDep,o.propDep||s.propDep,function(t,e){var r=t.ELEMENTS;return t.OFFSET?e.def(r,"?",r,".vertCount-",t.OFFSET,":-1"):e.def(r,"?",r,".vertCount:-1")});return Mt.optional(function(){l.DYNAMIC=!0}),l}return null}(),instances:r(Kn,!1),offset:s}}(t,c),y=function(t,e){var r=t.static,i=t.dynamic,a={};return V.forEach(function(t){function o(e,n){if(t in r){var o=e(r[t]);a[s]=nt(function(){return o})}else if(t in i){var l=i[t];a[s]=it(l,function(t,e){return n(t,e,t.invoke(e,l))})}}var s=m(t);switch(t){case An:case vn:case gn:case On:case _n:case Bn:case Cn:case Pn:case Dn:case kn:return o(function(r){return Mt.commandType(r,"boolean",t,e.commandStr),r},function(e,r,n){return Mt.optional(function(){e.assert(r,"typeof "+n+'==="boolean"',"invalid flag "+t,e.commandStr)}),n});case wn:return o(function(r){return Mt.commandParameter(r,Qi,"invalid "+t,e.commandStr),Qi[r]},function(e,r,n){var i=e.constants.compareFuncs;return Mt.optional(function(){e.assert(r,n+" in "+i,"invalid "+t+", must be one of "+Object.keys(Qi))}),r.def(i,"[",n,"]")});case Mn:return o(function(t){return Mt.command(O(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t},function(t,e,r){return Mt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===2&&typeof "+r+'[0]==="number"&&typeof '+r+'[1]==="number"&&'+r+"[0]<="+r+"[1]","depth range must be a 2d array")}),[e.def("+",r,"[0]"),e.def("+",r,"[1]")]});case xn:return o(function(t){Mt.commandType(t,"object","blend.func",e.commandStr);var r="srcRGB"in t?t.srcRGB:t.src,n="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,a="dstAlpha"in t?t.dstAlpha:t.dst;return Mt.commandParameter(r,Ji,s+".srcRGB",e.commandStr),Mt.commandParameter(n,Ji,s+".srcAlpha",e.commandStr),Mt.commandParameter(i,Ji,s+".dstRGB",e.commandStr),Mt.commandParameter(a,Ji,s+".dstAlpha",e.commandStr),Mt.command(-1===Ki.indexOf(r+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+r+", "+i+")",e.commandStr),[Ji[r],Ji[i],Ji[n],Ji[a]]},function(e,r,n){function i(i,o){var s=r.def('"',i,o,'" in ',n,"?",n,".",i,o,":",n,".",i);return Mt.optional(function(){e.assert(r,s+" in "+a,"invalid "+t+"."+i+o+", must be one of "+Object.keys(Ji))}),s}var a=e.constants.blendFuncs;Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid blend func, must be an object")});var o=i("src","RGB"),s=i("dst","RGB");Mt.optional(function(){var t=e.constants.invalidBlendCombinations;e.assert(r,t+".indexOf("+o+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")});var l=r.def(a,"[",o,"]"),c=r.def(a,"[",i("src","Alpha"),"]");return[l,r.def(a,"[",s,"]"),c,r.def(a,"[",i("dst","Alpha"),"]")]});case bn:return o(function(r){return"string"==typeof r?(Mt.commandParameter(r,R,"invalid "+t,e.commandStr),[R[r],R[r]]):"object"==typeof r?(Mt.commandParameter(r.rgb,R,t+".rgb",e.commandStr),Mt.commandParameter(r.alpha,R,t+".alpha",e.commandStr),[R[r.rgb],R[r.alpha]]):void Mt.commandRaise("invalid blend.equation",e.commandStr)},function(e,r,n){var i=e.constants.blendEquations,a=r.def(),o=r.def(),s=e.cond("typeof ",n,'==="string"');return Mt.optional(function(){function r(t,r,n){e.assert(t,n+" in "+i,"invalid "+r+", must be one of "+Object.keys(R))}r(s.then,t,n),e.assert(s.else,n+"&&typeof "+n+'==="object"',"invalid "+t),r(s.else,t+".rgb",n+".rgb"),r(s.else,t+".alpha",n+".alpha")}),s.then(a,"=",o,"=",i,"[",n,"];"),s.else(a,"=",i,"[",n,".rgb];",o,"=",i,"[",n,".alpha];"),r(s),[a,o]});case yn:return o(function(t){return Mt.command(O(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),T(4,function(e){return+t[e]})},function(t,e,r){return Mt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","blend.color must be a 4d array")}),T(4,function(t){return e.def("+",r,"[",t,"]")})});case Fn:return o(function(t){return Mt.commandType(t,"number",s,e.commandStr),0|t},function(t,e,r){return Mt.optional(function(){t.assert(e,"typeof "+r+'==="number"',"invalid stencil.mask")}),e.def(r,"|0")});case Rn:return o(function(r){Mt.commandType(r,"object",s,e.commandStr);var n=r.cmp||"keep",i=r.ref||0,a="mask"in r?r.mask:-1;return Mt.commandParameter(n,Qi,t+".cmp",e.commandStr),Mt.commandType(i,"number",t+".ref",e.commandStr),Mt.commandType(a,"number",t+".mask",e.commandStr),[Qi[n],i,a]},function(t,e,r){var n=t.constants.compareFuncs;return Mt.optional(function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(r+"&&typeof ",r,'==="object"'),i('!("cmp" in ',r,")||(",r,".cmp in ",n,")")}),[e.def('"cmp" in ',r,"?",n,"[",r,".cmp]",":",Hi),e.def(r,".ref|0"),e.def('"mask" in ',r,"?",r,".mask|0:-1")]});case jn:case Nn:return o(function(r){Mt.commandType(r,"object",s,e.commandStr);var n=r.fail||"keep",i=r.zfail||"keep",a=r.zpass||"keep";return Mt.commandParameter(n,$i,t+".fail",e.commandStr),Mt.commandParameter(i,$i,t+".zfail",e.commandStr),Mt.commandParameter(a,$i,t+".zpass",e.commandStr),[t===Nn?Ri:Fi,$i[n],$i[i],$i[a]]},function(e,r,n){function i(i){return Mt.optional(function(){e.assert(r,'!("'+i+'" in '+n+")||("+n+"."+i+" in "+a+")","invalid "+t+"."+i+", must be one of "+Object.keys($i))}),r.def('"',i,'" in ',n,"?",a,"[",n,".",i,"]:",Hi)}var a=e.constants.stencilOps;return Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[t===Nn?Ri:Fi,i("fail"),i("zfail"),i("zpass")]});case In:return o(function(t){Mt.commandType(t,"object",s,e.commandStr);var r=0|t.factor,n=0|t.units;return Mt.commandType(r,"number",s+".factor",e.commandStr),Mt.commandType(n,"number",s+".units",e.commandStr),[r,n]},function(e,r,n){return Mt.optional(function(){e.assert(r,n+"&&typeof "+n+'==="object"',"invalid "+t)}),[r.def(n,".factor|0"),r.def(n,".units|0")]});case Sn:return o(function(t){var r=0;return"front"===t?r=Fi:"back"===t&&(r=Ri),Mt.command(!!r,s,e.commandStr),r},function(t,e,r){return Mt.optional(function(){t.assert(e,r+'==="front"||'+r+'==="back"',"invalid cull.face")}),e.def(r,'==="front"?',Fi,":",Ri)});case Ln:return o(function(t){return Mt.command("number"==typeof t&&t>=n.lineWidthDims[0]&&t<=n.lineWidthDims[1],"invalid line width, must positive number between "+n.lineWidthDims[0]+" and "+n.lineWidthDims[1],e.commandStr),t},function(t,e,r){return Mt.optional(function(){t.assert(e,"typeof "+r+'==="number"&&'+r+">="+n.lineWidthDims[0]+"&&"+r+"<="+n.lineWidthDims[1],"invalid line width")}),r});case En:return o(function(t){return Mt.commandParameter(t,ea,s,e.commandStr),ea[t]},function(t,e,r){return Mt.optional(function(){t.assert(e,r+'==="cw"||'+r+'==="ccw"',"invalid frontFace, must be one of cw,ccw")}),e.def(r+'==="cw"?'+ji+":"+Ni)});case Tn:return o(function(t){return Mt.command(O(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map(function(t){return!!t})},function(t,e,r){return Mt.optional(function(){t.assert(e,t.shared.isArrayLike+"("+r+")&&"+r+".length===4","invalid color.mask")}),T(4,function(t){return"!!"+r+"["+t+"]"})});case zn:return o(function(t){Mt.command("object"==typeof t&&t,s,e.commandStr);var r="value"in t?t.value:1,n=!!t.invert;return Mt.command("number"==typeof r&&r>=0&&r<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[r,n]},function(t,e,r){return Mt.optional(function(){t.assert(e,r+"&&typeof "+r+'==="object"',"invalid sample.coverage")}),[e.def('"value" in ',r,"?+",r,".value:1"),e.def("!!",r,".invert")]})}}),a}(t,c),b=function(t){function r(t){if(t in i){var r=e.id(i[t]);Mt.optional(function(){u.shader(ta[t],r,Mt.guessCommand())});var n=nt(function(){return r});return n.id=r,n}if(t in a){var o=a[t];return it(o,function(e,r){var n=e.invoke(r,o),i=r.def(e.shared.strings,".id(",n,")");return Mt.optional(function(){r(e.shared.shader,".shader(",ta[t],",",i,",",e.command,");")}),i})}return null}var n,i=t.static,a=t.dynamic,o=r(Yn),s=r(Gn),l=null;return rt(o)&&rt(s)?(l=u.program(s.id,o.id),n=nt(function(t,e){return t.link(l)})):n=new et(o&&o.thisDep||s&&s.thisDep,o&&o.contextDep||s&&s.contextDep,o&&o.propDep||s&&s.propDep,function(t,e){var r,n=t.shared.shader;r=o?o.append(t,e):e.def(n,".",Yn);var i=n+".program("+(s?s.append(t,e):e.def(n,".",Gn))+","+r;return Mt.optional(function(){i+=","+t.command}),e.def(i+")")}),{frag:o,vert:s,progVar:n,program:l}}(t);h(Vn),h(m(Un));var x=Object.keys(y).length>0,_={framebuffer:p,draw:v,shader:b,state:y,dirty:x};return _.profile=function(t){var e,r=t.static,n=t.dynamic;if(Hn in r){var i=!!r[Hn];(e=nt(function(t,e){return i})).enable=i}else if(Hn in n){var a=n[Hn];e=it(a,function(t,e){return t.invoke(e,a)})}return e}(t),_.uniforms=function(t,e){var r=t.static,n=t.dynamic,i={};return Object.keys(r).forEach(function(t){var n,a=r[t];if("number"==typeof a||"boolean"==typeof a)n=nt(function(){return a});else if("function"==typeof a){var o=a._reglType;"texture2d"===o||"textureCube"===o?n=nt(function(t){return t.link(a)}):"framebuffer"===o||"framebufferCube"===o?(Mt.command(a.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),n=nt(function(t){return t.link(a.color[0])})):Mt.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else O(a)?n=nt(function(e){return e.global.def("[",T(a.length,function(r){return Mt.command("number"==typeof a[r]||"boolean"==typeof a[r],"invalid uniform "+t,e.commandStr),a[r]}),"]")}):Mt.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);n.value=a,i[t]=n}),Object.keys(n).forEach(function(t){var e=n[t];i[t]=it(e,function(t,r){return t.invoke(r,e)})}),i}(o,c),_.attributes=function(t,r){var n=t.static,a=t.dynamic,o={};return Object.keys(n).forEach(function(t){var a=n[t],s=e.id(t),l=new F;if($(a))l.state=cn,l.buffer=i.getBuffer(i.create(a,ai,!1,!0)),l.type=0;else{var c=i.getBuffer(a);if(c)l.state=cn,l.buffer=c,l.type=0;else if(Mt.command("object"==typeof a&&a,"invalid data for attribute "+t,r.commandStr),a.constant){var u=a.constant;l.buffer="null",l.state=un,"number"==typeof u?l.x=u:(Mt.command(O(u)&&u.length>0&&u.length<=4,"invalid constant for attribute "+t,r.commandStr),sn.forEach(function(t,e){e=0,'invalid offset for attribute "'+t+'"',r.commandStr);var f=0|a.stride;Mt.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',r.commandStr);var d=0|a.size;Mt.command(!("size"in a)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',r.commandStr);var p=!!a.normalized,m=0;"type"in a&&(Mt.commandParameter(a.type,Ut,"invalid type for attribute "+t,r.commandStr),m=Ut[a.type]);var g=0|a.divisor;"divisor"in a&&(Mt.command(0===g||j,'cannot specify divisor for attribute "'+t+'", instancing not supported',r.commandStr),Mt.command(g>=0,'invalid divisor for attribute "'+t+'"',r.commandStr)),Mt.optional(function(){var e=r.commandStr,n=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(a).forEach(function(r){Mt.command(n.indexOf(r)>=0,'unknown parameter "'+r+'" for attribute pointer "'+t+'" (valid parameters are '+n+")",e)})}),l.buffer=c,l.state=cn,l.size=d,l.normalized=p,l.type=m||c.dtype,l.offset=h,l.stride=f,l.divisor=g}}o[t]=nt(function(t,e){var r=t.attribCache;if(s in r)return r[s];var n={isStream:!1};return Object.keys(l).forEach(function(t){n[t]=l[t]}),l.buffer&&(n.buffer=t.link(l.buffer),n.type=n.type||n.buffer+".dtype"),r[s]=n,n})}),Object.keys(a).forEach(function(t){var e=a[t];o[t]=it(e,function(r,n){function i(t){n(c[t],"=",a,".",t,"|0;")}var a=r.invoke(n,e),o=r.shared,s=o.isBufferArgs,l=o.buffer;Mt.optional(function(){r.assert(n,a+"&&(typeof "+a+'==="object"||typeof '+a+'==="function")&&('+s+"("+a+")||"+l+".getBuffer("+a+")||"+l+".getBuffer("+a+".buffer)||"+s+"("+a+'.buffer)||("constant" in '+a+"&&(typeof "+a+'.constant==="number"||'+o.isArrayLike+"("+a+".constant))))",'invalid dynamic attribute "'+t+'"')});var c={isStream:n.def(!1)},u=new F;u.state=cn,Object.keys(u).forEach(function(t){c[t]=n.def(""+u[t])});var h=c.buffer,f=c.type;return n("if(",s,"(",a,")){",c.isStream,"=true;",h,"=",l,".createStream(",ai,",",a,");",f,"=",h,".dtype;","}else{",h,"=",l,".getBuffer(",a,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',a,"){",c.state,"=",un,";","if(typeof "+a+'.constant === "number"){',c[sn[0]],"=",a,".constant;",sn.slice(1).map(function(t){return c[t]}).join("="),"=0;","}else{",sn.map(function(t,e){return c[t]+"="+a+".constant.length>="+e+"?"+a+".constant["+e+"]:0;"}).join(""),"}}else{","if(",s,"(",a,".buffer)){",h,"=",l,".createStream(",ai,",",a,".buffer);","}else{",h,"=",l,".getBuffer(",a,".buffer);","}",f,'="type" in ',a,"?",o.glTypes,"[",a,".type]:",h,".dtype;",c.normalized,"=!!",a,".normalized;"),i("size"),i("offset"),i("stride"),i("divisor"),n("}}"),n.exit("if(",c.isStream,"){",l,".destroyStream(",h,");","}"),c})}),o}(r,c),_.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=nt(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=it(e,function(t,r){return t.invoke(r,e)})}),n}(l),_}function x(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a);var o=r[a];i(n,".",a,"=",o.append(t,e),";")}),e(i)}function _(t,e,r,n){var i,a=t.shared,o=a.gl,s=a.framebuffer;N&&(i=e.def(a.extensions,".webgl_draw_buffers"));var l,c=t.constants,u=c.drawBuffer,h=c.backBuffer;l=r?r.append(t,e):e.def(s,".next"),n||e("if(",l,"!==",s,".cur){"),e("if(",l,"){",o,".bindFramebuffer(",Xi,",",l,".framebuffer);"),N&&e(i,".drawBuffersWEBGL(",u,"[",l,".colorAttachments.length]);"),e("}else{",o,".bindFramebuffer(",Xi,",null);"),N&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",l,";"),n||e("}")}function w(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,s=n.current,l=n.next,c=t.cond(s,".dirty");V.forEach(function(e){var n=m(e);if(!(n in r.state)){var u,h;if(n in o){u=o[n],h=a[n];var f=T(B[n].length,function(t){return c.def(u,"[",t,"]")});c(t.cond(f.map(function(t,e){return t+"!=="+h+"["+e+"]"}).join("||")).then(i,".",q[n],"(",f,");",f.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";"))}else{u=c.def(l,".",n);var d=t.cond(u,"!==",s,".",n);c(d),n in H?d(t.cond(u).then(i,".enable(",H[n],");").else(i,".disable(",H[n],");"),s,".",n,"=",u,";"):d(i,".",q[n],"(",u,");",s,".",n,"=",u,";")}}}),0===Object.keys(r.state).length&&c(s,".dirty=false;"),e(c)}function M(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;tt(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(H[i]){var u=H[i];rt(l)?e(s,c?".enable(":".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(O(c)){var h=a[i];e(s,".",q[i],"(",c,");",c.map(function(t,e){return h+"["+e+"]="+t}).join(";"),";")}else e(s,".",q[i],"(",c,");",o,".",i,"=",c,";")}})}function k(t,e){j&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function A(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(p,".count+=",i,";"):t(p,".count++;"),d&&(n?t(u=e.def(),"=",g,".getNumPendingQueries();"):t(g,".beginQuery(",p,");"))}function s(t){t(p,".cpuTime+=",a(),"-",c,";"),d&&(n?t(g,".pushScopeStats(",u,",",g,".getNumPendingQueries(),",p,");"):t(g,".endQuery();"))}function l(t){var r=e.def(m,".profile");e(m,".profile=",t,";"),e.exit(m,".profile=",r,";")}var c,u,h,f=t.shared,p=t.stats,m=f.current,g=f.timer,v=r.profile;if(v){if(rt(v))return void(v.enable?(o(e),s(e.exit),l("true")):l("false"));l(h=v.append(t,e))}else h=e.def(m,".profile");var y=t.block();o(y),e("if(",h,"){",y,"}");var b=t.block();s(b),e.exit("if(",h,"){",b,"}")}function S(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(ra))return;var c=t.scopeAttrib(s);Mt.optional(function(){t.assert(e,c+".state","missing attribute "+s)}),o={},Object.keys(new F).forEach(function(t){o[t]=e.def(c,".",t)})}!function(r,n,i){function o(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;if(r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",p.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",ai,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",p.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),j){var o=i.divisor;e("if(",u,".divisor!==",o,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,o],");",u,".divisor=",o,";}")}}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",sn.map(function(t,e){return u+"."+t+"!=="+d[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",d,");",sn.map(function(t,e){return u+"."+t+"="+d[e]+";"}).join(""),"}")}var l=a.gl,c=e.def(r,".location"),u=e.def(a.attributes,"[",c,"]"),h=i.state,f=i.buffer,d=[i.x,i.y,i.z,i.w],p=["buffer","normalized","offset","stride"];h===cn?o():h===un?s():(e("if(",h,"===",cn,"){"),o(),e("}else{"),s(),e("}"))}(t.link(n),function(t){switch(t){case bi:case Mi:case Si:return 2;case xi:case ki:case Ei:return 3;case _i:case Ti:case Li:return 4;default:return 1}}(n.info.type),o)})}function E(t,r,n,i,a){for(var o,s=t.shared,l=s.gl,c=0;c1?T(x,function(t){return u+"["+t+"]"}):u);r(");")}}function L(t,e,r,n){function i(i){var a=u[i];return a?a.contextDep&&n.contextDynamic||a.propDep?a.append(t,r):a.append(t,e):e.def(c,".",i)}function a(){function t(){r(g,".drawElementsInstancedANGLE(",[f,p,v,d+"<<(("+v+"-"+ln+")>>1)",m],");")}function e(){r(g,".drawArraysInstancedANGLE(",[f,d,p,m],");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[f,p,v,d+"<<(("+v+"-"+ln+")>>1)"]+");")}function e(){r(l+".drawArrays("+[f,d,p]+");")}h?y?t():(r("if(",h,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,h=function(){var i,a=u.elements,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o)):i=o.def(c,".",Wn),i&&o("if("+i+")"+l+".bindBuffer("+oi+","+i+".buffer.buffer);"),i}(),f=i(Xn),d=i(Jn),p=function(){var i,a=u.count,o=e;return a?((a.contextDep&&n.contextDynamic||a.propDep)&&(o=r),i=a.append(t,o),Mt.optional(function(){a.MISSING&&t.assert(e,"false","missing vertex count"),a.DYNAMIC&&t.assert(o,i+">=0","missing vertex count")})):(i=o.def(c,".",Zn),Mt.optional(function(){t.assert(o,i+">=0","missing vertex count")})),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,g;j&&(m=i(Kn),g=t.instancing);var v=h+".type",y=u.elements&&rt(u.elements);j&&("number"!=typeof m||m>=0)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function C(t,e,r,n,i){var a=y(),o=a.proc("body",i);return Mt.optional(function(){a.commandStr=e.commandStr,a.command=a.link(e.commandStr)}),j&&(a.instancing=o.def(a.shared.extensions,".angle_instanced_arrays")),t(a,o,r,n),a.compile().body}function I(t,e,r,n){k(t,e),S(t,e,r,n.attributes,function(){return!0}),E(t,e,r,n.uniforms,function(){return!0}),L(t,e,e,r)}function P(t,e,r,n){function i(){return!0}t.batchId="a1",k(t,e),S(t,e,r,n.attributes,i),E(t,e,r,n.uniforms,i),L(t,e,e,r)}function D(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}k(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();if(e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&x(t,u,r.context),r.needsFramebuffer&&_(t,u,r.framebuffer),M(t,u,r.state,i),r.profile&&i(r.profile)&&A(t,u,r,!1,!0),n)S(t,c,r,n.attributes,a),S(t,u,r,n.attributes,i),E(t,c,r,n.uniforms,a),E(t,u,r,n.uniforms,i),L(t,c,u,r);else{var h=t.global.def("{}"),f=r.shader.progVar.append(t,u),d=u.def(f,".id"),p=u.def(h,"[",d,"]");u(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link(function(e){return C(P,t,r,e,2)}),"(",f,");}",p,".call(this,a0[",s,"],",s,");")}}function z(t,e,r){var n=e.static[r];if(n&&function(t){if("object"==typeof t&&!O(t)){for(var e=Object.keys(t),r=0;r0&&r(t.shared.current,".dirty=true;")}(o,s),function(t,r){function n(e){var n=r.shader[e];n&&i.set(a.shader,"."+e,n.append(t,i))}var i=t.proc("scope",3);t.batchId="a2";var a=t.shared,o=a.current;x(t,i,r.context),r.framebuffer&&r.framebuffer.append(t,i),tt(Object.keys(r.state)).forEach(function(e){var n=r.state[e].append(t,i);O(n)?n.forEach(function(r,n){i.set(t.next[e],"["+n+"]",r)}):i.set(a.next,"."+e,n)}),A(t,i,r,!0,!0),[Wn,Jn,Zn,Kn,Xn].forEach(function(e){var n=r.draw[e];n&&i.set(a.draw,"."+e,""+n.append(t,i))}),Object.keys(r.uniforms).forEach(function(n){i.set(a.uniforms,"["+e.id(n)+"]",r.uniforms[n].append(t,i))}),Object.keys(r.attributes).forEach(function(e){var n=r.attributes[e].append(t,i),a=t.scopeAttrib(e);Object.keys(new F).forEach(function(t){i.set(a,"."+t,n[t])})}),n(Gn),n(Yn),Object.keys(r.state).length>0&&(i(o,".dirty=true;"),i.exit(o,".dirty=true;")),i("a1(",t.shared.context,",a0,",t.batchId,");")}(o,s),function(t,e){function r(t){return t.contextDep&&i||t.propDep}var n=t.proc("batch",2);t.batchId="0",k(t,n);var i=!1,a=!0;Object.keys(e.context).forEach(function(t){i=i||e.context[t].propDep}),i||(x(t,n,e.context),a=!1);var o=e.framebuffer,s=!1;o?(o.propDep?i=s=!0:o.contextDep&&i&&(s=!0),s||_(t,n,o)):_(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(i=!0),w(t,n,e),M(t,n,e.state,function(t){return!r(t)}),e.profile&&r(e.profile)||A(t,n,e,!1,"a1"),e.contextDep=i,e.needsContext=a,e.needsFramebuffer=s;var l=e.shader.progVar;if(l.contextDep&&i||l.propDep)D(t,n,e,null);else{var c=l.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)D(t,n,e,e.shader.program);else{var u=t.global.def("{}"),h=n.def(c,".id"),f=n.def(u,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",u,"[",h,"]=",t.link(function(r){return C(D,t,e,r,2)}),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(o,s),o.compile()}}}function ot(t,e){for(var r=0;r=0&&(0|t)===t||e("invalid parameter type, ("+t+")"+n(r)+". must be a nonnegative integer")},oneOf:i,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var s=t.getShaderInfoLog(e),c=i===t.FRAGMENT_SHADER?"fragment":"vertex";p(n,"string",c+" shader source must be a string",o);var u=h(n,o),f=function(t){var e=[];return t.split("\n").forEach(function(t){if(!(t.length<5)){var r=/^ERROR\:\s+(\d+)\:(\d+)\:\s*(.*)$/.exec(t);r?e.push(new l(0|r[1],0|r[2],r[3].trim())):t.length>0&&e.push(new l("unknown",0,t))}}),e}(s);!function(t,e){e.forEach(function(e){var r=t[e.file];if(r){var n=r.index[e.line];if(n)return n.errors.push(e),void(r.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)})}(u,f),Object.keys(u).forEach(function(t){function e(t,e){n.push(t),i.push(e||"")}var r=u[t];if(r.hasErrors){var n=[""],i=[""];e("file number "+t+": "+r.name+"\n","color:red;text-decoration:underline;font-weight:bold"),r.lines.forEach(function(t){if(t.errors.length>0){e(a(t.number,4)+"| ","background-color:yellow; font-weight:bold"),e(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var r=0;t.errors.forEach(function(n){var i=n.message,o=/^\s*\'(.*)\'\s*\:\s*(.*)$/.exec(i);if(o){var s=o[1];switch(i=o[2],s){case"assign":s="="}r=Math.max(t.line.indexOf(s,r),0)}else r=0;e(a("| ",6)),e(a("^^^",r+3)+"\n","font-weight:bold"),e(a("| ",6)),e(i+"\n","font-weight:bold")}),e(a("| ",6)+"\n")}else e(a(t.number,4)+"| "),e(t.line+"\n","color:red")}),"undefined"!=typeof document?(i[0]=n.join("%c"),console.log.apply(console,i)):console.log(n.join(""))}}),r.raise("Error compiling "+c+" shader, "+u[0].name)}},linkError:function(t,e,n,i,a){if(!t.getProgramParameter(e,t.LINK_STATUS)){var o=t.getProgramInfoLog(e),s=h(n,a),l='Error linking program with vertex shader, "'+h(i,a)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+l+"\n%c"+o,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(l+"\n"+o),r.raise(l)}},callSite:u,saveCommandRef:f,saveDrawInfo:function(t,e,r,n){function i(t){return t?n.id(t):0}function a(t,e){Object.keys(e).forEach(function(e){t[n.id(e)]=!0})}f(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var o=t._uniformSet={};a(o,e.static),a(o,e.dynamic);var s=t._attributeSet={};a(s,r.static),a(s,r.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,r){t.texture?i(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):i(t.renderbuffer._renderbuffer.format,r,"unsupported renderbuffer format for attachment")},guessCommand:c,texture2D:function(t,e,n){var i,a=e.width,o=e.height,s=e.channels;r(a>0&&a<=n.maxTextureSize&&o>0&&o<=n.maxTextureSize,"invalid texture shape"),t.wrapS===ht&&t.wrapT===ht||r(g(a)&&g(o),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==a&&1!==o&&r(t.minFilter!==dt&&t.minFilter!==mt&&t.minFilter!==pt&&t.minFilter!==gt,"min filter requires mipmap"):(r(g(a)&&g(o),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(a<<1)-1,"missing or incomplete mipmap data")),e.type===vt&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(t.minFilter===ft&&t.magFilter===ft,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var l=e.images;for(i=0;i<16;++i)if(l[i]){var c=a>>i,u=o>>i;r(e.mipmask&1<0&&a<=i.maxTextureSize&&o>0&&o<=i.maxTextureSize,"invalid texture shape"),r(a===o,"cube map must be square"),r(e.wrapS===ht&&e.wrapT===ht,"wrap mode not supported by cube map");for(var l=0;l>h,p=o>>h;r(c.mipmask&1<=2,"invalid renderbuffer shape"),a=0|d[0],o=0|d[1]}else"radius"in f&&(a=o=0|f.radius),"width"in f&&(a=0|f.width),"height"in f&&(o=0|f.height);"format"in f&&(Mt.parameter(f.format,s,"invalid renderbuffer format"),u=s[f.format])}else"number"==typeof e?(a=0|e,o="number"==typeof n?0|n:a):e?Mt.raise("invalid arguments to renderbuffer constructor"):a=o=1;if(Mt(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),a!==h.width||o!==h.height||u!==h.format)return c.width=h.width=a,c.height=h.height=o,h.format=u,t.bindRenderbuffer(Lr,h.renderbuffer),t.renderbufferStorage(Lr,u,a,o),i.profile&&(h.stats.size=W(h.format,h.width,h.height)),c.format=l[h.format],c}var h=new a(t.createRenderbuffer());return u[h.id]=h,n.renderbufferCount++,c(e,o),c.resize=function(e,n){var a=0|e,o=0|n||a;return a===h.width&&o===h.height?c:(Mt(a>0&&o>0&&a<=r.maxRenderbufferSize&&o<=r.maxRenderbufferSize,"invalid renderbuffer size"),c.width=h.width=a,c.height=h.height=o,t.bindRenderbuffer(Lr,h.renderbuffer),t.renderbufferStorage(Lr,h.format,a,o),i.profile&&(h.stats.size=W(h.format,h.width,h.height)),c)},c._reglType="renderbuffer",c._renderbuffer=h,i.profile&&(c.stats=h.stats),c.destroy=function(){h.decRef()},c},clear:function(){Ct(u).forEach(o)},restore:function(){Ct(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(Lr,e.renderbuffer),t.renderbufferStorage(Lr,e.format,e.width,e.height)}),t.bindRenderbuffer(Lr,null)}}},Dr=36160,zr=36161,Or=3553,Fr=34069,Rr=36064,jr=36096,Nr=36128,Br=33306,Ur=36053,Vr=6402,Hr=[6408],qr=[];qr[6408]=4;var Gr=[];Gr[5121]=1,Gr[5126]=4,Gr[36193]=2;var Yr=33189,Wr=36168,Xr=34041,Zr=[32854,32855,36194,35907,34842,34843,34836],Jr={};Jr[Ur]="complete",Jr[36054]="incomplete attachment",Jr[36057]="incomplete dimensions",Jr[36055]="incomplete, missing attachment",Jr[36061]="unsupported";var Kr=5126,Qr=35632,$r=35633,tn=35718,en=35721,rn=6408,nn=5121,an=3333,on=5126,sn="xyzw".split(""),ln=5121,cn=1,un=2,hn=0,fn=1,dn=2,pn=3,mn=4,gn="dither",vn="blend.enable",yn="blend.color",bn="blend.equation",xn="blend.func",_n="depth.enable",wn="depth.func",Mn="depth.range",kn="depth.mask",Tn="colorMask",An="cull.enable",Sn="cull.face",En="frontFace",Ln="lineWidth",Cn="polygonOffset.enable",In="polygonOffset.offset",Pn="sample.alpha",Dn="sample.enable",zn="sample.coverage",On="stencil.enable",Fn="stencil.mask",Rn="stencil.func",jn="stencil.opFront",Nn="stencil.opBack",Bn="scissor.enable",Un="scissor.box",Vn="viewport",Hn="profile",qn="framebuffer",Gn="vert",Yn="frag",Wn="elements",Xn="primitive",Zn="count",Jn="offset",Kn="instances",Qn=qn+"Width",$n=qn+"Height",ti=Vn+"Width",ei=Vn+"Height",ri="drawingBufferWidth",ni="drawingBufferHeight",ii=[xn,bn,Rn,jn,Nn,zn,Vn,Un,In],ai=34962,oi=34963,si=3553,li=34067,ci=2884,ui=3042,hi=3024,fi=2960,di=2929,pi=3089,mi=32823,gi=32926,vi=32928,yi=5126,bi=35664,xi=35665,_i=35666,wi=5124,Mi=35667,ki=35668,Ti=35669,Ai=35670,Si=35671,Ei=35672,Li=35673,Ci=35674,Ii=35675,Pi=35676,Di=35678,zi=35680,Oi=4,Fi=1028,Ri=1029,ji=2304,Ni=2305,Bi=32775,Ui=32776,Vi=519,Hi=7680,qi=0,Gi=1,Yi=32774,Wi=513,Xi=36160,Zi=36064,Ji={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},Ki=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Qi={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},$i={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},ta={frag:35632,vert:35633},ea={cw:ji,ccw:Ni},ra=new et(!1,!1,!1,function(){}),na=34918,ia=34919,aa=35007,oa=function(t,e){function r(t){o.push(t)}function n(t){l.push(t)}function i(t,e,r){var n=l.pop()||new function(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null};n.startQueryIndex=t,n.endQueryIndex=e,n.sum=0,n.stats=r,c.push(n)}var a=e.ext_disjoint_timer_query;if(!a)return null;var o=[],s=[],l=[],c=[],u=[],h=[];return{beginQuery:function(t){var e=o.pop()||a.createQueryEXT();a.beginQueryEXT(aa,e),s.push(e),i(s.length-1,s.length,t)},endQuery:function(){a.endQueryEXT(aa)},pushScopeStats:i,update:function(){var t,e,i=s.length;if(0!==i){h.length=Math.max(h.length,i+1),u.length=Math.max(u.length,i+1),u[0]=0,h[0]=0;var o=0;for(t=0,e=0;e=0;--t){var r=H[t];r&&r(S,null,0)}p.flush(),_&&_.update()}function r(){!K&&H.length>0&&(K=St.next(e))}function n(){K&&(St.cancel(e),K=null)}function i(t){t.preventDefault(),g=!0,n(),q.forEach(function(t){t()})}function a(t){p.getError(),g=!1,v.restore(),O.restore(),L.restore(),F.restore(),R.restore(),j.restore(),_&&_.restore(),N.procs.refresh(),r(),G.forEach(function(t){t()})}function o(t){function e(t){var e={},r={};return Object.keys(t).forEach(function(n){var i=t[n];At.isDynamic(i)?r[n]=At.unbox(i,n):e[n]=i}),{dynamic:r,static:e}}Mt(!!t,"invalid args to regl({...})"),Mt.type(t,"object","invalid args to regl({...})");var r=e(t.context||{}),n=e(t.uniforms||{}),i=e(t.attributes||{}),a=e(function(t){function e(t){if(t in r){var e=r[t];delete r[t],Object.keys(e).forEach(function(n){r[t+"."+n]=e[n]})}}var r=ct({},t);return delete r.uniforms,delete r.attributes,delete r.context,"stencil"in r&&r.stencil.op&&(r.stencil.opBack=r.stencil.opFront=r.stencil.op,delete r.stencil.op),e("blend"),e("depth"),e("cull"),e("stencil"),e("polygonOffset"),e("scissor"),e("sample"),r}(t)),o={gpuTime:0,cpuTime:0,count:0},s=N.compile(a,i,n,r,o),l=s.draw,c=s.batch,u=s.scope,h=[];return ct(function(t,e){var r;if(g&&Mt.raise("context lost"),"function"==typeof t)return u.call(this,null,t,0);if("function"==typeof e){if("number"==typeof t){for(r=0;r0)return c.call(this,function(t){for(;h.length=0,"cannot cancel a frame twice"),H[r]=e}}}function c(){var t=U.viewport,e=U.scissor_box;t[0]=t[1]=e[0]=e[1]=0,S.viewportWidth=S.framebufferWidth=S.drawingBufferWidth=t[2]=e[2]=p.drawingBufferWidth,S.viewportHeight=S.framebufferHeight=S.drawingBufferHeight=t[3]=e[3]=p.drawingBufferHeight}function u(){S.tick+=1,S.time=f(),c(),N.procs.poll()}function h(){c(),N.procs.refresh(),_&&_.update()}function f(){return(Et()-w)/1e3}var d=M(t);if(!d)return null;var p=d.gl,m=p.getContextAttributes(),g=p.isContextLost(),v=function(t,e){function r(e){Mt.type(e,"string","extension name must be string");var r,i=e.toLowerCase();try{r=n[i]=t.getExtension(i)}catch(t){}return!!r}for(var n={},i=0;i0){var l;if(Array.isArray(e[0])){s=qt(e);for(var c=1,u=1;u0)if("number"==typeof t[0]){var i=Nt.allocType(d.dtype,t.length);P(i,t),f(i,n),Nt.freeType(i)}else if(Array.isArray(t[0])||lt(t[0])){r=qt(t);var a=Ht(t,r,d.dtype);f(a,n),Nt.freeType(a)}else Mt.raise("invalid buffer data")}else if(lt(t))f(t,n);else if(k(t)){r=t.shape;var o=t.stride,s=0,l=0,c=0,u=0;1===r.length?(s=r[0],l=1,c=o[0],u=0):2===r.length?(s=r[0],l=r[1],c=o[0],u=o[1]):Mt.raise("invalid shape");var p=Array.isArray(t.data)?d.dtype:I(t.data),m=Nt.allocType(p,s*l);D(m,t.data,s,l,c,u,t.offset),f(m,n),Nt.freeType(m)}else Mt.raise("invalid data for buffer subdata");return h},r.profile&&(h.stats=d.stats),h.destroy=function(){o(d)},h},createStream:function(t,e){var r=c.pop();return r||(r=new n(t)),r.bind(),a(r,e,Yt,0,1,!1),r},destroyStream:function(t){c.push(t)},clear:function(){Ct(l).forEach(o),c.forEach(o)},getBuffer:function(t){return t&&t._buffer instanceof n?t._buffer:null},restore:function(){Ct(l).forEach(function(e){e.buffer=t.createBuffer(),t.bindBuffer(e.type,e.buffer),t.bufferData(e.type,e.persistentData||e.byteLength,e.usage)})},_initBuffer:a}}(p,b,d),C=function(t,e,r,n){function i(t){this.id=l++,s[this.id]=this,this.buffer=t,this.primType=$t,this.vertCount=0,this.type=0}function a(n,i,a,o,s,l,c){if(n.buffer.bind(),i){var u=c;c||lt(i)&&(!k(i)||lt(i.data))||(u=e.oes_element_index_uint?ae:ne),r._initBuffer(n.buffer,i,a,u,3)}else t.bufferData(oe,l,a),n.buffer.dtype=h||ee,n.buffer.usage=a,n.buffer.dimension=3,n.buffer.byteLength=l;var h=c;if(!c){switch(n.buffer.dtype){case ee:case te:h=ee;break;case ne:case re:h=ne;break;case ae:case ie:h=ae;break;default:Mt.raise("unsupported type for element array")}n.buffer.dtype=h}n.type=h,Mt(h!==ae||!!e.oes_element_index_uint,"32 bit element buffers not supported, enable oes_element_index_uint first");var f=s;f<0&&(f=n.buffer.byteLength,h===ne?f>>=1:h===ae&&(f>>=2)),n.vertCount=f;var d=o;if(o<0){d=$t;var p=n.buffer.dimension;1===p&&(d=Kt),2===p&&(d=Qt),3===p&&(d=$t)}n.primType=d}function o(t){n.elementsCount--,Mt(null!==t.buffer,"must not double destroy elements"),delete s[t.id],t.buffer.destroy(),t.buffer=null}var s={},l=0,c={uint8:ee,uint16:ne};e.oes_element_index_uint&&(c.uint32=ae),i.prototype.bind=function(){this.buffer.bind()};var u=[];return{create:function(t,e){function s(t){if(t)if("number"==typeof t)l(t),u.primType=$t,u.vertCount=0|t,u.type=ee;else{var e=null,r=le,n=-1,i=-1,o=0,h=0;Array.isArray(t)||lt(t)||k(t)?e=t:(Mt.type(t,"object","invalid arguments for elements"),"data"in t&&(e=t.data,Mt(Array.isArray(e)||lt(e)||k(e),"invalid data for element buffer")),"usage"in t&&(Mt.parameter(t.usage,Vt,"invalid element buffer usage"),r=Vt[t.usage]),"primitive"in t&&(Mt.parameter(t.primitive,Jt,"invalid element buffer primitive"),n=Jt[t.primitive]),"count"in t&&(Mt("number"==typeof t.count&&t.count>=0,"invalid vertex count for elements"),i=0|t.count),"type"in t&&(Mt.parameter(t.type,c,"invalid buffer type"),h=c[t.type]),"length"in t?o=0|t.length:(o=i,h===ne||h===re?o*=2:h!==ae&&h!==ie||(o*=4))),a(u,e,r,n,i,o,h)}else l(),u.primType=$t,u.vertCount=0,u.type=ee;return s}var l=r.create(null,oe,!0),u=new i(l._buffer);return n.elementsCount++,s(t),s._reglType="elements",s._elements=u,s.subdata=function(t,e){return l.subdata(t,e),s},s.destroy=function(){o(u)},s},createStream:function(t){var e=u.pop();return e||(e=new i(r.create(null,oe,!0,!1)._buffer)),a(e,t,se,-1,-1,0,0),e},destroyStream:function(t){u.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){Ct(s).forEach(o)}}}(p,x,L,b),z=function(t,e,r,n,i){for(var a=r.maxAttributes,o=new Array(a),s=0;s=Fr&&e=2,"invalid shape for framebuffer"),c=P[0],d=P[1]}else"radius"in I&&(c=d=I.radius),"width"in I&&(c=I.width),"height"in I&&(d=I.height);("color"in I||"colors"in I)&&(y=I.color||I.colors,Array.isArray(y)&&Mt(1===y.length||s,"multiple render targets not supported")),y||("colorCount"in I&&(A=0|I.colorCount,Mt(A>0,"invalid color buffer count")),"colorTexture"in I&&(M=!!I.colorTexture,k="rgba4"),"colorType"in I&&(T=I.colorType,M?(Mt(e.oes_texture_float||!("float"===T||"float32"===T),"you must enable OES_texture_float in order to use floating point framebuffer objects"),Mt(e.oes_texture_half_float||!("half float"===T||"float16"===T),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===T||"float16"===T?(Mt(e.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),k="rgba16f"):"float"!==T&&"float32"!==T||(Mt(e.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),k="rgba32f"),Mt.oneOf(T,w,"invalid color type")),"colorFormat"in I&&(k=I.colorFormat,x.indexOf(k)>=0?M=!0:_.indexOf(k)>=0?M=!1:M?Mt.oneOf(I.colorFormat,x,"invalid color format for texture"):Mt.oneOf(I.colorFormat,_,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(C=!(!I.depthTexture&&!I.depthStencilTexture),Mt(!C||e.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?p=I.depth:(S=I.depth,g=!1)),"stencil"in I&&("boolean"==typeof I.stencil?g=I.stencil:(E=I.stencil,p=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?p=g=I.depthStencil:(L=I.depthStencil,p=!1,g=!1))}else c=d=1;var D=null,z=null,O=null,F=null;if(Array.isArray(y))D=y.map(u);else if(y)D=[u(y)];else for(D=new Array(A),a=0;a=0||D[a].renderbuffer&&Zr.indexOf(D[a].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+a+" is invalid"),D[a]&&D[a].texture){var j=qr[D[a].texture._texture.format]*Gr[D[a].texture._texture.type];null===R?R=j:Mt(R===j,"all color attachments much have the same number of bits per pixel.")}return l(z,c,d),Mt(!z||z.texture&&z.texture._texture.format===Vr||z.renderbuffer&&z.renderbuffer._renderbuffer.format===Yr,"invalid depth attachment for framebuffer object"),l(O,c,d),Mt(!O||O.renderbuffer&&O.renderbuffer._renderbuffer.format===Wr,"invalid stencil attachment for framebuffer object"),l(F,c,d),Mt(!F||F.texture&&F.texture._texture.format===Xr||F.renderbuffer&&F.renderbuffer._renderbuffer.format===Xr,"invalid depth-stencil attachment for framebuffer object"),m(o),o.width=c,o.height=d,o.colorAttachments=D,o.depthAttachment=z,o.stencilAttachment=O,o.depthStencilAttachment=F,i.color=D.map(f),i.depth=f(z),i.stencil=f(O),i.depthStencil=f(F),i.width=o.width,i.height=o.height,v(o),i}var o=new p;return a.framebufferCount++,i(t,n),ct(i,{resize:function(t,e){Mt(b.next!==o,"can not resize a framebuffer which is currently in use");var r=0|t,n=0|e||r;if(r===o.width&&n===o.height)return i;for(var a=o.colorAttachments,s=0;s=2,"invalid shape for framebuffer"),Mt(p[0]===p[1],"cube framebuffer must be square"),l=p[0]}else"radius"in d&&(l=0|d.radius),"width"in d?(l=0|d.width,"height"in d&&Mt(d.height===l,"must be square")):"height"in d&&(l=0|d.height);("color"in d||"colors"in d)&&(c=d.color||d.colors,Array.isArray(c)&&Mt(1===c.length||o,"multiple render targets not supported")),c||("colorCount"in d&&(f=0|d.colorCount,Mt(f>0,"invalid color buffer count")),"colorType"in d&&(Mt.oneOf(d.colorType,w,"invalid color type"),h=d.colorType),"colorFormat"in d&&(u=d.colorFormat,Mt.oneOf(d.colorFormat,x,"invalid color format for texture"))),"depth"in d&&(s.depth=d.depth),"stencil"in d&&(s.stencil=d.stencil),"depthStencil"in d&&(s.depthStencil=d.depthStencil)}else l=1;var m;if(c)if(Array.isArray(c))for(m=[],r=0;r0&&(s.depth=a[0].depth,s.stencil=a[0].stencil,s.depthStencil=a[0].depthStencil),a[r]?a[r](s):a[r]=y(s)}return ct(i,{width:l,height:l,color:m})}var a=Array(6);return i(t),ct(i,{faces:a,resize:function(t){var e,n=0|t;if(Mt(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===i.width)return i;var o=i.color;for(e=0;e=0},read:B,destroy:function(){H.length=0,n(),V&&(V.removeEventListener(ha,i),V.removeEventListener(fa,a)),O.clear(),j.clear(),R.clear(),F.clear(),C.clear(),L.clear(),_&&_.clear(),W.forEach(function(t){t()})},_gl:p,_refresh:h,poll:function(){u(),_&&_.update()},now:f,stats:b});return d.onDone(null,$),$}})},{}],509:[function(t,e,r){"use strict";var n,i="";e.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,r)}},{}],510:[function(t,e,r){!function(t,n){"object"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",i(t.slice(0,e)),",",i(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function o(t){return!0&t?"-":""}function s(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===n?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?i[t]:i)}var i=t("robust-determinant"),a=6,o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:d(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],c=r[1]-n[1],u=t[2]-n[2],h=e[2]-n[2],f=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,b=a*s,x=u*(d-m)+h*(g-v)+f*(y-b),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(h)+(Math.abs(y)+Math.abs(b))*Math.abs(f));return x>_||-x>_?x:p(t,e,r,n)}];!function(){for(;m.length<=f;)m.push(s(m.length));for(var t=[],r=["slow"],n=0;n<=f;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=f;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&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),c=r[i],u=n[i],h=Math.min(c,u);if(Math.max(c,u)=n?(i=f,(c+=1)=n?(i=f,(c+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(h=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(h,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],524:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],525:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":70,"reduce-simplicial-complex":507}],526:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,a=new Array(t+1);a[0]=[[]];for(var o=1;o<=t;++o)for(var s=a[o]=i(o),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--o){o>1,s=n(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(i=o-1)}return a}function l(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==n(t[g],o)););}return r}function c(t,e){if(e<0)return[];for(var r=[],n=(1<>>u&1&&c.push(i[u]);e.push(c)}return a(e)},r.skeleton=c,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=l(t);if(!(r>=0&&e0){var t=T[0];return o(0,S-1),S-=1,c(0),t}return-1}function f(t,e){var r=T[t];return b[r]===e?t:(b[r]=-1/0,u(t),h(),b[r]=e,S+=1,u(S-1))}function d(t){if(!x[t]){x[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),A[e]>=0&&f(A[e],a(e)),A[r]>=0&&f(A[r],a(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!x[n]||i<0||i===n)break;if(n=i,i=t[n],!x[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),b=new Array(m),x=new Array(m),_=0;_>1;_>=0;--_)c(_);for(;;){var E=h();if(E<0||b[E]>r)break;d(E)}var L=[];for(_=0;_=0&&r>=0&&e!==r){var n=A[e],i=A[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":517,"simplicial-complex":530}],533:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var a=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?a-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],a=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=i(r,a,s),c=i(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=i(s,o,a),c=i(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var i=t("robust-orientation")},{"robust-orientation":517}],534:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=a(t.right,e))return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}e.exports=function(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?h(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var c=this.horizontal[e];if(c.length>0){var f=l.ge(c,t[1],i);if(f=c.length)return n;d=c[f]}}if(d.start)if(o){var p=u(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":533,"binary-search-bounds":67,"functional-red-black-tree":136,"robust-orientation":517}],535:[function(t,e,r){"use strict";function n(t,e){var r=o(a(t,e),[e[e.length-1]]);return r[r.length-1]}function i(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||o>0&&u<0){var h=i(s,u,l,o);r.push(h),a.push(h.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}},e.exports.positive=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r},e.exports.negative=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}},{"robust-dot-product":514,"robust-sum":522}],536:[function(t,e,r){!function(){"use strict";function t(e){return function(e,r){var i,a,o,s,l,c,u,h,f,d=1,p=e.length,m="";for(a=0;a=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}n.json.test(s[8])?m+=i:(!n.number.test(s[8])||h&&!s[3]?f="":(f=h?"+":"-",i=i.toString().replace(n.sign,"")),c=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",u=s[6]-(f+i).length,l=s[6]&&u>0?c.repeat(u):"",m+=s[5]?f+i+l:"0"===c?f+l+i:l+f+i)}return m}(function(t){if(i[t])return i[t];var e,r=t,a=[],o=0;for(;r;){if(null!==(e=n.text.exec(r)))a.push(e[0]);else if(null!==(e=n.modulo.exec(r)))a.push("%");else{if(null===(e=n.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],l=e[2],c=[];if(null===(c=n.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=n.key_access.exec(l)))s.push(c[1]);else{if(null===(c=n.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(e)}r=r.substring(e[0].length)}return i[t]=a}(e),arguments)}function e(e,r){return t.apply(null,[e].concat(r||[]))}var n={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:/^[\+\-]/},i=Object.create(null);void 0!==r&&(r.sprintf=t,r.vsprintf=e),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},{}],537:[function(t,e,r){"use strict";e.exports=function(t){function e(e){var r=[e],c=[e];for(n[e]=i[e]=u,a[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(o[e]=0&&l[e].push(s[m])}o[e]=p}else{if(i[e]===n[e]){var g=[],v=[],y=0;for(p=r.length-1;p>=0;--p){var b=r[p];if(a[b]=!1,g.push(b),v.push(l[b]),y+=l[b].length,s[b]=h.length,b===e){r.length=p;break}}h.push(g);var x=new Array(y);for(p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function u(t){return t.x}function h(t){return t.y}var f=t("kdbush");e.exports=function(t){return new n(t)},n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(i);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var o=+Date.now();this.trees[a+1]=f(n,u,h,this.options.nodeSize,Float32Array),n=this._cluster(n,a),e&&console.log("z%d: %d clusters in %dms",a,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=f(n,u,h,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(s(t[0]),l(t[3]),s(t[2]),l(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){h.length>0&&f.push("}}");var d="vExtra"+h.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),f=["function ",d,"(m,",l.join(),"){switch(m){"],h.push(f)}f.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,b=0;bb)&&!(c&1<<_)!=!(c&1<0&&(T="+"+g[x]+"*c");var A=p[x].length/y*.5,S=.5+v[x]/y*.5;k.push("d"+x+"-"+S+"-"+A+"*("+p[x].join("+")+T+")/("+m[x].join("+")+")")}f.push("a.push([",k.join(),"]);","break;")}a.push("}},"),h.length>0&&f.push("}}");var E=[];for(c=0;c<1<0&&(h+=.02);var d=new Float32Array(u),p=0,m=-.5*h;for(f=0;f=0?1.2:1))}function i(t,e,r,n,i,o,s){for(var l=0;l1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;t=_(t,360),e=_(e,100),r=_(r,100);if(0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(e.h,i,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=x(n),{ok:s,format:e.format||l,r:D(255,z(r.r,0)),g:D(255,z(r.g,0)),b:D(255,z(r.b,0)),a:n}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=P(100*this._a)/100,this._format=n.format||i.format,this._gradientType=n.gradientType,this._r<1&&(this._r=P(this._r)),this._g<1&&(this._g=P(this._g)),this._b<1&&(this._b=P(this._b)),this._ok=i.ok,this._tc_id=I++}function n(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n,i,a=z(t,e,r),o=D(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;)i.h=(i.h+a)%360,o.push(r(i));return o}function b(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function x(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=D(r,z(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function w(t){return D(1,z(0,t))}function M(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function T(t){return t<=1&&(t=100*t+"%"),t}function A(e){return t.round(255*parseFloat(e)).toString(16)}function S(t){return M(t)/255}function E(t){return!!j.CSS_UNIT.exec(t)}var L=/^\s+/,C=/\s+$/,I=0,P=t.round,D=t.min,z=t.max,O=t.random;r.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 e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=x(t),this._roundA=P(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=P(360*t.h),r=P(100*t.s),n=P(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=P(360*t.h),r=P(100*t.s),i=P(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return a(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=[k(P(t).toString(16)),k(P(e).toString(16)),k(P(r).toString(16)),k(A(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:P(this._r),g:P(this._g),b:P(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+P(this._r)+", "+P(this._g)+", "+P(this._b)+")":"rgba("+P(this._r)+", "+P(this._g)+", "+P(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:P(100*_(this._r,255))+"%",g:P(100*_(this._g,255))+"%",b:P(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+P(100*_(this._r,255))+"%, "+P(100*_(this._g,255))+"%, "+P(100*_(this._b,255))+"%)":"rgba("+P(100*_(this._r,255))+"%, "+P(100*_(this._g,255))+"%, "+P(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+o(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},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 r(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(u,arguments)},brighten:function(){return this._applyModification(h,arguments)},darken:function(){return this._applyModification(f,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(b,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:T(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:O(),g:O(),b:O()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=function(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(n)).level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,c=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=r(e[u]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var F=r.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"},R=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(F),j=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],544:[function(t,e,r){"use strict";function n(t,e){var r=a(getComputedStyle(t).getPropertyValue(e));return r[0]*i(r[1],t)}function i(t,e){switch(e=e||document.body,t=(t||"px").trim().toLowerCase(),e!==window&&e!==document||(e=document.body),t){case"%":return e.clientHeight/100;case"ch":case"ex":return function(t,e){var r=document.createElement("div");r.style["font-size"]="128"+t,e.appendChild(r);var i=n(r,"font-size")/128;return e.removeChild(r),i}(t,e);case"em":return n(e,"font-size");case"rem":return n(document.body,"font-size");case"vw":return window.innerWidth/100;case"vh":return window.innerHeight/100;case"vmin":return Math.min(window.innerWidth,window.innerHeight)/100;case"vmax":return Math.max(window.innerWidth,window.innerHeight)/100;case"in":return o;case"cm":return o/2.54;case"mm":return o/25.4;case"pt":return o/72;case"pc":return o/6}return 1}var a=t("parse-unit");e.exports=i;var o=96},{"parse-unit":476}],545:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.topojson=t.topojson||{})}(this,function(t){"use strict";function e(t,e){var n=e.id,i=e.bbox,a=null==e.properties?{}:e.properties,o=r(t,e);return null==n&&null==i?{type:"Feature",properties:a,geometry:o}:null==i?{type:"Feature",id:n,properties:a,geometry:o}:{type:"Feature",id:n,bbox:i,properties:a,geometry:o}}function r(t,e){function r(t,e){e.length&&e.pop();for(var r=h[t<0?~t:t],n=0,i=r.length;n1)n=function(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(o);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":!function(t){t.forEach(a)}(t.arcs)}}var s,l=[],c=[];return o(e),c.forEach(null==r?function(t){l.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var i,s,l=1,u=a(n[0]);lu&&(s=n[0],n[0]=n[l],n[l]=s,u=i);return n})}}var a=function(t){return t},o=function(t){if(null==(e=t.transform))return a;var e,r,n,i=e.scale[0],o=e.scale[1],s=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+s,t[1]=(n+=t[1])*o+l,t}},s=function(t){function e(t){l[0]=t[0],l[1]=t[1],s(l),l[0]h&&(h=l[0]),l[1]f&&(f=l[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,s=o(t),l=new Array(2),c=1/0,u=c,h=-c,f=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++eh&&(h=l[0]),l[1]f&&(f=l[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,h,f]}return n},l=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},c=function(t,e){function r(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}var n={},i={},a={},o=[],s=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++s],e[s]=r,e[n]=i)}),e.forEach(function(e){var r,n,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,n=i[l]){delete i[n.start];var c=n===r?r:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[r.start]=a[r.end]=r;else if(r=i[l])if(delete i[r.start],r.unshift(e),r.start=s,n=a[s]){delete a[n.end];var u=n===r?r:n.concat(r);i[u.start=n.start]=a[u.end=r.end]=u}else i[r.start]=a[r.end]=r;else i[(r=[e]).start=s]=a[r.end=l]=r}),r(a,i),r(i,a),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=s(t),o=a[0],l=(a[2]-o)/(e-1)||1,c=a[1],u=(a[3]-c)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,s=t.length,h=t[0],f=h[0]=Math.round((h[0]-o)/l),d=h[1]=Math.round((h[1]-c)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return h(i,i),i}function o(t,e,r,n,i,a,o,l){this.center=s(r),this.up=s(n),this.right=s(i),this.radius=s([a]),this.angle=s([o,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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),h(r,r),i=[].slice.call(i,0,3),h(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];u(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):h(i,i),s=n(p[0],p[1],p[2]);var m=f(r,p)/s,g=f(i,p)/s;c=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)};var s=t("filtered-vector"),l=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),u=t("gl-vec3/cross"),h=t("gl-vec3/normalize"),f=t("gl-vec3/dot"),d=o.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,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];var s=Math.sqrt(i),l=0;for(o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;var c=Math.sqrt(l);for(o=0;o<3;++o)r[o]/=c;var f=this.computedToward;u(f,e,r),h(f,f);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),b=Math.sin(m),x=this.computedCenter,_=g*y,w=v*y,M=b,k=-g*b,T=-v*b,A=y,S=this.computedEye,E=this.computedMatrix;for(o=0;o<3;++o){var L=_*r[o]+w*f[o]+M*e[o];E[4*o+1]=k*r[o]+T*f[o]+A*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],I=E[5],P=E[9],D=E[2],z=E[6],O=E[10],F=I*O-P*z,R=P*D-C*O,j=C*z-I*D,N=n(F,R,j);F/=N,R/=N,j/=N,E[0]=F,E[4]=R,E[8]=j;for(o=0;o<3;++o)S[o]=x[o]+E[2+4*o]*d;for(o=0;o<3;++o){l=0;for(var B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[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 a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,p);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],h=a[4],f=a[8],d=u*o+h*s+f*l,p=n(u-=o*d,h-=s*d,f-=l*d),m=(u/=p)*e+o*r,g=(h/=p)*e+s*r,v=(f/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),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,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var c=e[o],u=e[o+4],h=e[o+8];if(a){var f=Math.abs(c),d=Math.abs(u),p=Math.abs(h),m=Math.max(f,d,p);f===m?(c=c<0?-1:1,u=h=0):p===m?(h=h<0?-1:1,c=u=0):(u=u<0?-1:1,c=h=0)}else{var g=n(c,u,h);c/=g,u/=g,h/=g}var v=e[s],y=e[s+4],b=e[s+8],x=v*c+y*u+b*h,_=n(v-=c*x,y-=u*x,b-=h*x),w=u*(b/=_)-h*(y/=_),M=h*(v/=_)-c*b,k=c*y-u*v,T=n(w,M,k);w/=T,M/=T,k/=T,this.center.jump(t,q,G,Y),this.radius.idle(t),this.up.jump(t,c,u,h),this.right.jump(t,v,y,b);var A,S;if(2===o){var E=e[1],L=e[5],C=e[9],I=E*v+L*y+C*b,P=E*w+L*M+C*k;A=F<0?-Math.PI/2:Math.PI/2,S=Math.atan2(P,I)}else{var D=e[2],z=e[6],O=e[10],F=D*c+z*u+O*h,R=D*v+z*y+O*b,j=D*w+z*M+O*k;A=Math.asin(i(F)),S=Math.atan2(j,R)}this.angle.jump(t,S,A),this.recalcMatrix(t);var N=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var H=V[15],q=V[12]/H,G=V[13]/H,Y=V[14]/H,W=Math.exp(this.computedRadius[0]);this.center.jump(t,q-N*W,G-B*W,Y-U*W)},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,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],h=e[1]-r[1],f=e[2]-r[2],d=n(u,h,f);if(!(d<1e-6)){u/=d,h/=d,f/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,b=n(m-=y*o,g-=y*s,v-=y*l);if(!(b<.01&&(m=s*f-l*h,g=l*u-o*f,v=o*h-s*u,(b=n(m,g,v))<1e-6))){m/=b,g/=b,v/=b,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var x=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(x,_,w),k=o*u+s*h+l*f,T=m*u+g*h+v*f,A=(x/=M)*u+(_/=M)*h+(w/=M)*f,S=Math.asin(i(k)),E=Math.atan2(A,T),L=this.angle._state,C=L[L.length-1],I=L[L.length-2];C%=2*Math.PI;var P=Math.abs(C+2*Math.PI-E),D=Math.abs(C-E),z=Math.abs(C-2*Math.PI-E);P0?r.pop():new ArrayBuffer(t)}function o(t){return new Uint8Array(a(t),0,t)}function s(t){return new Uint16Array(a(2*t),0,t)}function l(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function u(t){return new Int16Array(a(2*t),0,t)}function h(t){return new Int32Array(a(4*t),0,t)}function f(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function p(t){return b?new Uint8ClampedArray(a(t),0,t):o(t)}function m(t){return new DataView(a(t),0,t)}function g(t){t=v.nextPow2(t);var e=v.log2(t),r=w[e];return r.length>0?r.pop():new n(t)}var v=t("bit-twiddle"),y=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var b="undefined"!=typeof Uint8ClampedArray,x=e.__TYPEDARRAY_POOL;x.UINT8C||(x.UINT8C=y([32,0])),x.BUFFER||(x.BUFFER=y([32,0]));var _=x.DATA,w=x.BUFFER;r.free=function(t){if(n.isBuffer(t))w[v.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|v.log2(e);_[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){i(t.buffer)},r.freeArrayBuffer=i,r.freeBuffer=function(t){w[v.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return o(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return c(t);case"int16":return u(t);case"int32":return h(t);case"float":case"float32":return f(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return g(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=o,r.mallocUint16=s,r.mallocUint32=l,r.mallocInt8=c,r.mallocInt16=u,r.mallocInt32=h,r.mallocFloat32=r.mallocFloat=f,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=p,r.mallocDataView=m,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)x.UINT8[t].length=0,x.UINT16[t].length=0,x.UINT32[t].length=0,x.INT8[t].length=0,x.INT16[t].length=0,x.INT32[t].length=0,x.FLOAT[t].length=0,x.DOUBLE[t].length=0,x.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":68,buffer:78,dup:126}],551:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],554:[function(t,e,r){"use strict";function n(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function i(t,e,r){if(t&&o.isObject(t)&&t instanceof n)return t;var i=new n;return i.parse(t,e,r),i}var a=t("punycode"),o=t("./util");r.parse=i,r.resolve=function(t,e){return i(t,!1,!0).resolve(e)},r.resolveObject=function(t,e){return t?i(t,!1,!0).resolveObject(e):e},r.format=function(t){return o.isString(t)&&(t=i(t)),t instanceof n?t.format():n.prototype.format.call(t)},r.Url=n;var s=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),h=["'"].concat(u),f=["%","/","?",";","#"].concat(h),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},b=t("querystring");n.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?D+="x":D+=P[z];if(!D.match(p)){var F=C.slice(0,T),R=C.slice(T+1),j=P.match(m);j&&(F.push(j[1]),R.unshift(j[2])),R.length&&(u="/"+R.join(".")+u),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=a.toASCII(this.hostname));var N=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+N,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[w])for(T=0,I=h.length;T0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=M.slice(-1)[0],A=(r.host||t.host||M.length>1)&&("."===T||".."===T)||""===T,S=0,E=M.length;E>=0;E--)"."===(T=M[E])?M.splice(E,1):".."===T?(M.splice(E,1),S++):S&&(M.splice(E,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),A&&"/"!==M.join("/").substr(-1)&&M.push("");var L=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=L?"":M.length?M.shift():"";var C;(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(_=_||r.host&&M.length)&&!L&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":555,punycode:497,querystring:501}],555:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],556:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],557:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],558:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),h(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&x(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return p(i)||(i=s(t,i,n)),i}var a=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(h(e))return t.stylize(""+e,"boolean");if(f(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),v=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),b(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(x(e)){var _=e.name?": "+e.name:"";return t.stylize("[Function"+_+"]","special")}if(g(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(y(e))return t.stylize(Date.prototype.toString.call(e),"date");if(b(e))return l(e)}var w="",k=!1,T=["{","}"];if(u(e)&&(k=!0,T=["[","]"]),x(e)){w=" [Function"+(e.name?": "+e.name:"")+"]"}if(g(e)&&(w=" "+RegExp.prototype.toString.call(e)),y(e)&&(w=" "+Date.prototype.toUTCString.call(e)),b(e)&&(w=" "+l(e)),0===o.length&&(!k||0==e.length))return T[0]+w+T[1];if(n<0)return g(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var A;return A=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(A,w,T)}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),l||(t.seen.indexOf(c.value)<0?(l=f(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+l.split("\n").map(function(t){return" "+t}).join("\n")):l=t.stylize("[Circular]","special")),m(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+l}function u(t){return Array.isArray(t)}function h(t){return"boolean"==typeof t}function f(t){return null===t}function d(t){return"number"==typeof t}function p(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return v(t)&&"[object RegExp]"===_(t)}function v(t){return"object"==typeof t&&null!==t}function y(t){return v(t)&&"[object Date]"===_(t)}function b(t){return v(t)&&("[object Error]"===_(t)||t instanceof Error)}function x(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!p(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":561}],563:[function(t,e,r){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":564}],564:[function(t,e,r){"use strict";function n(t,e,r,n){var i=function(t,e){var r=a(t,128);return e?s(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,n),o=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;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}var o=t("pbf"),s=t("./vector-tile-pb"),l=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new l(t[r].features),e[r].name=r;return n({layers:e})},e.exports.GeoJSONWrapper=l},{"./lib/geojson_wrapper":566,"./vector-tile-pb":567,pbf:479}],566:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e=0?e[o]:a})},has___:{value:i(function(e){var i=n(e);return i?r in i:t.indexOf(e)>=0})},set___:{value:i(function(i,a){var o,s=n(i);return s?s[r]=a:(o=t.indexOf(i))>=0?e[o]=a:(o=t.length,e[o]=a,t[o]=i),this})},delete___:{value:i(function(i){var a,o,s=n(i);return s?r in s&&delete s[r]:!((a=t.indexOf(i))<0||(o=t.length-1,t[a]=void 0,e[a]=e[o],t[a]=t[o],t.length=o,e.length=o,0))})}})};x.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 s?function(){function r(){this instanceof x||a();var e,r=new s,n=void 0,l=!1;return e=o?function(t,e){return r.set(t,e),r.has(t)||(n||(n=new x),n.set(t,e)),this}:function(t,e){if(l)try{r.set(t,e)}catch(r){n||(n=new x),n.set___(t,e)}else r.set(t,e);return this},Object.create(x.prototype,{get___:{value:i(function(t,e){return n?r.has(t)?r.get(t):n.get___(t,e):r.get(t,e)})},has___:{value:i(function(t){return r.has(t)||!!n&&n.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!r.delete(t);return n?n.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=x.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=x)}}()},{}],569:[function(t,e,r){var n=t("./hidden-store.js");e.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)}}},{"./hidden-store.js":570}],570:[function(t,e,r){e.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}},{}],571:[function(t,e,r){var n=t("./create-store.js");e.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}}}},{"./create-store.js":569}],572:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":148}],573:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,a=this._validateYear(t,i.local.invalidyear),s=f[a-f[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(n=o.newDate(l,c,u)).add(4-(n.dayOfWeek()||7),"d");var h=this.toJD(t,e,r)-n.toJD();return 1+Math.floor(h/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=h[t-h[0]];if(e>(r>>13?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,i.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var a=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{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");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=h[o.year-h[0]],d=u>>13;c=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var p=0;p>9&4095,v=m>>5&15,y=31&m,b=new Date(g,v-1,y+l);return a.year=b.getFullYear(),a.month=1+b.getMonth(),a.day=b.getDate(),a}(t,s,r,a);return o.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=o.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=n||{}}var o=f[i.year-f[0]],s=i.year<<9|i.month<<5|i.day;a.year=s>=o?i.year:i.year-1;var l,c=(o=f[a.year-f[0]])>>9&4095,u=o>>5&15,d=31&o,p=new Date(c,u-1,d),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-p)/864e5);var g,v=h[a.year-h[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l>13;return!b||g=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:a[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var a={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":590,"object-assign":471}],579:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":590,"object-assign":471}],580:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main");t("object-assign")(n.prototype=new a.baseCalendar,{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,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.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,a.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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+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)}}),a.calendars.hebrew=n},{"../main":590,"object-assign":471}],581:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":590,"object-assign":471}],582:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),i.calendars.julian=n},{"../main":590,"object-assign":471}],583:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main");t("object-assign")(n.prototype=new o.baseCalendar,{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,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);t%=400,t+=t<0?400:0;return 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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":590,"object-assign":471}],584:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.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)}}),i.calendars.nanakshahi=n},{"../main":590,"object-assign":471}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),r=e.year(),n=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;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,c)},_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,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/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=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),h=t-this.toJD(l,u,1)+1;return this.newDate(l,u,h)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":590,"object-assign":471}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.taiwan=n},{"../main":590,"object-assign":471}],588:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.thai=n},{"../main":590,"object-assign":471}],589:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth).toJD()-24e5+.5,n=0,o=0;or)return a[n]-a[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),o=12*(n.year()-1)+n.month()-15292;return n.day()+a[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,o=Math.floor((i-1)/12),s=o+1,l=i-12*o,c=e-a[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var a=[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]},{"../main":590,"object-assign":471}],590:[function(t,e,r){function n(){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 i(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.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]}}}),l(i.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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,c.local.invalidDate||c.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),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":471}],591:[function(t,e,r){var n=t("object-assign"),i=t("./main");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=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;b+n1}),u=function(t,e,r,n){var i=""+e;if(c(t,n))for(;i.length1},b=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(T).match(o);if(!s)throw(i.local.missingNumberAt||i.regionalOptions[""].missingNumberAt).replace(/\{0\}/,T);return T+=s[0].length,parseInt(s[0],10)},x=this,_=function(){if("function"==typeof l){y("m");var t=l.call(x,e.substring(T));return T+=t.length,t}return b("m")},w=function(t,r,n,a){for(var o=y(t,a)?n:r,s=0;s-1){d=1,p=m;for(var E=this.daysInMonth(f,d);p>E;E=this.daysInMonth(f,d))d++,p-=E}return h>-1?this.fromJD(h):this.newDate(f,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,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":590,"object-assign":471}],592:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":111}],593:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":592}],594:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),h=c("clicktoshow");if(!u&&!h)return e;a(t,e,r,c);for(var f=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},g=0;g<2;g++){var v=d[g],y=i.coerceRef(t,e,m,v,"","paper");if(i.coercePosition(e,m,c,y,v,.5),f){var b="a"+v,x=i.coerceRef(t,e,m,b,"pixel");"pixel"!==x&&x!==y&&(x=e[b]="pixel");var _="pixel"===x?p[g]:.4;i.coercePosition(e,m,c,x,b,_)}c(v+"anchor"),c(v+"shift")}if(n.noneOrAll(t,e,["x","y"]),f&&n.noneOrAll(t,e,["ax","ay"]),h){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":738,"../../plots/cartesian/axes":785,"./attributes":596,"./common_defaults":599}],595:[function(t,e,r){"use strict";e.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}]},{}],596:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},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:"calcIfAutorange"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":790,"../../plots/font_attributes":810,"./arrow_paths":595}],597:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,s=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=1,s[t.yref]=1});for(var l in s){var c=a.getFromId(t,l);if(c&&c.autorange)return i.syncOrAsync([o,n],t)}}}},{"../../lib":738,"../../plots/cartesian/axes":785,"./draw":602}],598:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s,l,c,u=t._fullLayout.annotations,h=[],f=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,i=n(t,e),o=i.on,s=i.off.concat(i.explicitOff),l={};if(o.length||s.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var a=j.selectAll("a");if(1===a.size()&&a.text()===j.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(z.node())}var c=C.select(".annotation-text-math-group"),f=!c.empty(),v=h.bBox((f?c:j).node()),y=v.width,L=v.height,P=e.width||y,R=e.height||L,N=Math.round(P+2*D),B=Math.round(R+2*D);e._w=P,e._h=R;for(var U=!1,V=["x","y"],H=0;H1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;q=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],q=_.l+_.w*Y):(Y=1-e[Z],q=_.t+_.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=q;var st=e["a"+Z];X=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=q+st,G=X+st),at.text=at.tail+X;var lt=x["x"===Z?"width":"height"];if("paper"===J&&(at.head=l.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*r(W,nt),at.text=q+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)C.remove();else{var ht=0,ft=0;if("left"!==e.align&&(ht=(P-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ft=(R-L)*("middle"===e.valign?.5:1)),f)c.select("svg").attr({x:D+ht-1,y:D+ft}).call(h.setClipUrl,O?M:null);else{var dt=D+ft-v.top,pt=D+ht-v.left;j.call(d.positionText,pt,dt).call(h.setClipUrl,O?M:null)}F.select("rect").call(h.setRect,D,D,P,R),z.call(h.setRect,I/2,I/2,N-I,B-I),C.call(h.setTranslate,Math.round(k.x.text-N/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+T+","+k.x.text+","+k.y.text+")"});var mt=function(r,a){A.selectAll(".annotation-arrow-g").remove();var c=k.x.head,f=k.y.head,d=k.x.tail+r,p=k.y.tail+a,v=k.x.text+r,y=k.y.text+a,x=l.rotationXYMatrix(T,v,y),M=l.apply2DTransform(x),E=l.apply2DTransform2(x),L=+z.attr("width"),I=+z.attr("height"),P=v-.5*L,D=P+L,O=y-.5*I,F=O+I,R=[[P,O,P,F],[P,F,D,F],[D,F,D,O],[D,O,P,O]].map(E);if(!R.reduce(function(t,e){return t^!!l.segmentsIntersect(c,f,c+1e6,f+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=l.segmentsIntersect(d,p,c,f,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var j=e.arrowwidth,N=e.arrowcolor,B=e.arrowside,U=A.append("g").style({opacity:u.opacity(N)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+f).style("stroke-width",j+"px").call(u.stroke,u.rgb(N));if(g(V,B,e),w.annotationPosition&&V.node().parentNode&&!n){var H=c,q=f;if(e.standoff){var G=Math.sqrt(Math.pow(c-d,2)+Math.pow(f-p,2));H+=e.standoff*(d-c)/G,q+=e.standoff*(p-f)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-H)+","+(p-q),transform:"translate("+H+","+q+")"}).style("stroke-width",j+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),gd:t,prepFn:function(){var t=h.getTranslate(C);W=t.x,X=t.y,Y={},i&&i.autorange&&(Y[i._name+".autorange"]=!0),s&&s.autorange&&(Y[s._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(W,X),a=n[0]+t,o=n[1]+r;C.call(h.setTranslate,a,o),Y[b+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,Y[b+".y"]=s?s.p2r(s.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(Y[b+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[b+".ay"]=s.p2r(s.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+T+","+a+","+o+")"})},doneFn:function(){o.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),E){var gt,vt;m.init({element:C.node(),gd:t,prepFn:function(){vt=S.attr("transform"),gt={}},moveFn:function(t,r){var a="pointer";if(e.showarrow)e.axref===e.xref?gt[b+".ax"]=i.p2r(i.r2p(e.ax)+t):gt[b+".ax"]=e.ax+t,e.ayref===e.yref?gt[b+".ay"]=s.p2r(s.r2p(e.ay)+r):gt[b+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)gt[b+".x"]=e.x+t/i._m;else{var o=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-o/2;gt[b+".x"]=m.align(l+t/_.w,o,0,1,e.xanchor)}if(s)gt[b+".y"]=e.y+r/s._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;gt[b+".y"]=m.align(u-r/_.h,c,0,1,e.yanchor)}i&&s||(a=m.getCursor(i?.5:gt[b+".x"],s?.5:gt[b+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+vt}),p(C,a)},doneFn:function(){p(C),o.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}var y,b,x=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,b=n+".annotations["+r+"]"):(y="annotation",b="annotations["+r+"]"),x._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+x._uid+"_ann"+r;if(e._input&&!1!==e.visible){var k={x:{},y:{}},T=+e.textangle||0,A=x._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=A.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:a.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();f.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:x._hoverlayer.node(),outerContainer:x._paper.node(),gd:t})}).on("mouseout",function(){f.loneUnhover(x._hoverlayer.node())});var I=e.borderwidth,P=e.borderpad,D=I+P,z=C.append("rect").attr("class","bg").style("stroke-width",I+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),O=e.width||e.height,F=x._topclips.selectAll("#"+M).data(O?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),F.exit().remove();var R=e.font,j=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?j.call(d.makeEditable,{delegate:C,gd:t}).call(c).on("edit",function(r){e.text=r,this.call(c);var n={};n[b+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),s&&s.autorange&&(n[s._name+".autorange"]=!0),o.relayout(t,n)}):j.call(c)}else a.selectAll("#"+M).remove()}var a=t("d3"),o=t("../../plotly"),s=t("../../plots/plots"),l=t("../../lib"),c=t("../../plots/cartesian/axes"),u=t("../color"),h=t("../drawing"),f=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,b=d.backoff*m+r.standoff,x=p.backoff*g+r.startstandoff;if("line"===f.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var _=l.x-c.x,w=l.y-c.y;if(u=Math.atan2(w,_),h=u+Math.PI,b&&x&&b+x>Math.sqrt(_*_+w*w))return void o();if(b){if(b*b>_*_+w*w)return void o();var M=b*Math.cos(u),k=b*Math.sin(u);c.x+=M,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(x){if(x*x>_*_+w*w)return void o();var T=x*Math.cos(u),A=x*Math.sin(u);l.x-=T,l.y-=A,t.attr({x1:l.x,y1:l.y})}}else if("path"===f.nodeName){var S=f.getTotalLength(),E="";if(S1){c=!0;break}}c?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))}}},{"../../plots/gl3d/project":835,"../annotations/draw":602}],609:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);1!==n.getAlpha()&&(n=i(o.combine(t,c)));return(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e0?E>=O:E<=O));L++)E>R&&E0?E>=O:E<=O));L++)E>C[0]&&E1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[K+X,K+G-X],et.setScale();var st=A._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");et._axislayer=st.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ut,ht=S.l+(k.x+Y)*S.w,ft=et.titlefont.size;ut="top"===k.titleside?(1-(K+G-X))*S.h+S.t+3+.75*ft:(1-(K+X))*S.h+S.t-3-.25*ft,T(et._id+"title",{attributes:{x:ht,y:ut,"text-anchor":"start"}})}var dt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),a=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+et._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=parseInt(r.node().style.fontSize,10)*v),o?(ct=d.bBox(o).height)>s&&(a[1]-=(ct-s)/2):r.node()&&!r.classed(w.jsPlaceholder)&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===k.titleside)et.domain[1]-=ct/S.h,a[1]*=-1;else{et.domain[0]+=ct/S.h;var c=g.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(S.h*(1-et.domain[1]))+")"),et._axislayer.attr("transform","translate(0,"+Math.round(-S.t)+")");var h=st.select(".cbfills").selectAll("rect.cbfill").data(P);h.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),h.exit().remove(),h.each(function(t,e){var r=[0===e?C[0]:(P[e]+P[e-1])/2,e===P.length-1?C[1]:(P[e]+P[e+1])/2].map(et.c2p).map(Math.round);e!==P.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=z(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var f=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?I:[]);return f.enter().append("path").classed(w.cbline,!0),f.exit().remove(),f.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+k.line.width/2%1)+"h"+V).call(d.lineGroupStyle,k.line.width,D(t),k.line.dash)}),et._axislayer.selectAll("g."+et._id+"tick,path").remove(),et._pos=Z+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),et.side="right",u.syncOrAsync([function(){return l.doTicks(t,et,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=et.titlefont.size,r=et._offset+et._length/2,i=S.l+(et.position||0)*S.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));T("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:k.titleside,offsetLeft:S.l,offsetTop:0,maxShift:A.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var r=V+k.outlinewidth/2+d.bBox(et._axislayer.node()).width;if((N=lt.select("text")).node()&&!N.classed(w.jsPlaceholder)){var n,i=lt.select(".h"+et._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(k.titleside)?d.bBox(i).width:d.bBox(lt.node()).right-Z-S.l,r=Math.max(r,n)}var a=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,s=Q-$;st.select(".cbbg").attr({x:Z-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:$-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:$+k.ypad+("top"===k.titleside?ct:0),width:Math.max(V,2),height:Math.max(s-2*k.ypad-ct,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var l=({center:.5,right:1}[k.xanchor]||0)*a;st.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:a*({right:1,center:.5}[k.xanchor]||0),r:a*({left:1,center:.5}[k.xanchor]||0),t:s*({bottom:1,middle:.5}[k.yanchor]||0),b:s*({top:1,middle:.5}[k.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition){var pt,mt,gt;c.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),f(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),mt=c.align(J+t/S.w,H,0,1,k.xanchor),gt=c.align(K-e/S.h,G,0,1,k.yanchor);var r=c.getCursor(mt,gt,k.xanchor,k.yanchor);f(st,r)},doneFn:function(){f(st),void 0!==mt&&void 0!==gt&&a.restyle(t,{"colorbar.x":mt,"colorbar.y":gt},M().index)}})}return dt}A._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":738,"./flip_scale":625,"./scales":632}],621:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":727,"./attributes":619,"./scales.js":632}],622:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":632}],623:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var h=u.prefix,f=u.cLetter,d=h.slice(0,h.length-1),p=h?i.nestedProperty(t,d).get()||{}:t,m=h?i.nestedProperty(e,d).get()||{}:e,g=p[f+"min"],v=p[f+"max"],y=p.colorscale;c(h+f+"auto",!(n(g)&&n(v)&&g=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],626:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":622,"./is_valid_scale_array":630,"./scales":632}],627:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],634:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.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]}},{"../../lib":738}],635:[function(t,e,r){"use strict";function n(){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 i(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t("mouse-event-offset"),o=t("has-hover"),s=t("../../plotly"),l=t("../../lib"),c=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),h=e.exports={};h.align=t("./align"),h.getCursor=t("./cursor");var f=t("./unhover");h.unhover=f.wrapped,h.unhoverRaw=f.raw,h.init=function(t){function e(e){x._dragged=!1,x._dragging=!0;var s=i(e);return f=s[0],d=s[1],y=e.target,v=e,b=e.buttons&&2===e.buttons||e.ctrlKey,(p=(new Date).getTime())-x._mouseDownTimew&&(_=Math.max(_-1,1)),x._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(_,v),!b){var n;try{n=new MouseEvent("click",e)}catch(t){var c=i(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,c[0],c[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}y.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&s.plot(t)}(x),x._dragged=!1,l.pauseEvent(e)}x._dragged=!1}var f,d,p,m,g,v,y,b,x=t.gd,_=1,w=u.DBLCLICKDELAY,M=t.element;x._mouseDownTime||(x._mouseDownTime=0),M.style.pointerEvents="all",M.onmousedown=e,M.ontouchstart=e},h.coverSlip=n},{"../../constants/interactions":716,"../../lib":738,"../../plotly":780,"../../plots/cartesian/constants":790,"./align":633,"./cursor":634,"./unhover":636,"has-hover":289,"mouse-event-offset":454}],636:[function(t,e,r){"use strict";var n=t("../../lib/events"),i=t("../../lib/throttle"),a=t("../../lib/get_graph_div"),o=t("../fx/constants"),s=e.exports={};s.wrapped=function(t,e,r){t=a(t),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&&!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}))}},{"../../lib/events":726,"../../lib/get_graph_div":733,"../../lib/throttle":762,"../fx/constants":650}],637:[function(t,e,r){"use strict";r.dash={valType:"string",values:["solid","dot","dash","longdash","dashdot","longdashdot"],dflt:"solid",editType:"style"}},{}],638:[function(t,e,r){"use strict";function n(t,e){var r=t%100;return _.symbolFuncs[r](e)+(t>=200?k:"")}function i(t,e,r,n){var i=l.select(t.node().parentNode),a=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",o=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=n?n/.8+1:0,c=(m.lineCount(t)-1)*v+1,u=S[o]*s,h=.75*r+S[a]*s+(S[a]-1)*c*r/2;t.attr("text-anchor",o),i.attr("transform","translate("+u+","+h+")")}function a(t,e){var r=t.ts||e.textfont.size;return c(r)&&r>0?r:0}function o(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],c=Math.pow(i*i+a*a,E/2),u=Math.pow(o*o+s*s,E/2),h=(u*u*i-c*c*o)*n,f=(u*u*a-c*c*s)*n,d=3*u*(c+u),p=3*c*(c+u);return[[l.round(e[0]+(d&&h/d),2),l.round(e[1]+(d&&f/d),2)],[l.round(e[0]-(p&&h/p),2),l.round(e[1]-(p&&f/p),2)]]}function s(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var l=t("d3"),c=t("fast-isnumeric"),u=t("tinycolor2"),h=t("../../registry"),f=t("../color"),d=t("../colorscale"),p=t("../../lib"),m=t("../../lib/svg_text_utils"),g=t("../../constants/xmlns_namespaces"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../constants/interactions").DESELECTDIM,b=t("../../traces/scatter/subtypes"),x=t("../../traces/scatter/make_bubble_size_func"),_=e.exports={};_.font=function(t,e,r,n){p.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(f.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,i){t.call(_.setPosition,e,r).call(_.setSize,n,i)},_.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(c(i)&&c(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},_.translatePoints=function(t,e,r){t.each(function(t){var n=l.select(this);_.translatePoint(t,n,e,r)})},_.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(e){var i=e[0].trace,a=i.xcalendar,o=i.ycalendar;t.selectAll(".point,.textpoint").each(function(t){_.hideOutsideRangePoint(t,l.select(this),r,n,a,o)})})}},_.crispRound=function(t,e,r){return e&&c(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";f.stroke(e,n||a.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,o=n||i.dash||"";l.select(this).call(f.stroke,r||i.color).call(_.dashLine,o,a)})},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.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},_.singleFillStyle=function(t){var e=(((l.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(f.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=l.select(this);try{r.call(f.fill,e[0].trace.fillcolor)}catch(e){p.error(e,t),r.remove()}})};var w=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolList=[],Object.keys(w).forEach(function(t){var e=w[t];_.symbolList=_.symbolList.concat([e.n,t,e.n+100,t+"-open"]),_.symbolNames[e.n]=t,_.symbolFuncs[e.n]=e.f,e.needLine&&(_.symbolNeedLines[e.n]=!0),e.noDot?_.symbolNoDot[e.n]=!0:_.symbolList=_.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"])});var M=_.symbolNames.length,k="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";_.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=M||t>=400?0:Math.floor(Math.max(t,0))};var T={x1:1,x2:0,y1:0,y2:0},A={x1:0,x2:0,y1:1,y2:0};_.gradient=function(t,e,r,n,i,a){var o=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],p.identity);o.exit().remove(),o.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=l.select(this);"horizontal"===n?t.attr(T):"vertical"===n&&t.attr(A),t.attr("id",r);var e=u(i),o=u(a);t.append("stop").attr({offset:"0%","stop-color":f.tinyRGB(o),"stop-opacity":o.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":f.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},_.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},_.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;!function(t,e,r,i,a,o,s,l){if(h.traceIs(r,"symbols")){var c=x(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:b.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var i=_.symbolNumber(t.mx||o.symbol)||0;return t.om=i%200>=100,n(i,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var u,d,p,m=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,u=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?f.defaultLine:s.color,Array.isArray(o.color)&&(u=f.defaultLine,m=!0),u="mc"in t?t.mcc=i(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(f.stroke,u).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=o.gradient,v=t.mgt;if(v?m=!0:v=g&&g.type,v&&"none"!==v){var y=t.mgc;y?m=!0:y=g.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(_.gradient,l,w,v,u,y)}else e.call(f.fill,u);p&&e.call(f.stroke,d)}}(t,e,r,i,a,s,s.line,o)},_.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=_.tryColorscale(n,""),a=_.tryColorscale(n,"line");t.each(function(t){_.singlePointStyle(t,l.select(this),e,i,a,r)})}},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},s=i.marker||{},c=a.opacity,u=o.opacity,d=s.opacity,p=void 0!==u,m=void 0!==d;t.each(function(t){var e,r=l.select(this),n=t.mo,i=void 0!==n;(i||p||m)&&(t.selected?p&&(e=u):e=m?d:y*(i?n:c)),void 0!==e&&r.style("opacity",e)});var g=o.color,v=s.color;(g||v)&&t.each(function(t){var e,r=l.select(this);t.selected?g&&(e=g):v&&(e=v),e&&f.fill(r,e)});var b=o.size,x=s.size,w=void 0!==b,M=void 0!==x;h.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=l.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?b/2:i:M?x/2:i,r.attr("d",n(_.symbolNumber(o),e)),t.mrc2=e})}},_.tryColorscale=function(t,e){var r=e?p.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?d.makeColorScaleFunc(d.extractScale(n,r.cmin,r.cmax)):p.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};_.textPointStyle=function(t,e,r){t.each(function(t){var n=l.select(this),o=p.extractOption(t,e,"tx","text");if(o){var s=t.tp||e.textposition,c=a(t,e);n.call(_.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).text(o).call(m.convertToTspans,r).call(i,s,c,t.mrc)}else n.remove()})},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},n=e.unselected||{};t.each(function(t){var o,s=l.select(this),c=t.tc||e.textfont.color,u=t.tp||e.textposition,h=a(t,e),d=(r.textfont||{}).color,p=(n.textfont||{}).color;t.selected?d&&(o=d):p?o=p:d||(o=f.addOpacity(c,y)),o&&f.fill(s,o),i(s,u,h,t.mrc2||t.mrc)})}};var E=.5;_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(_.savedBBoxes={},C=0),r&&(_.savedBBoxes[r]=v),C++,p.extendFlat({},v)},_.setClipUrl=function(t,e){if(e){var r="#"+e,n=l.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},_.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}},_.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+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.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}},_.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+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var I=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=l.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),o=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(I);t=1===e&&1===r?[]:["translate("+a+","+o+")","scale("+e+","+r+")","translate("+-a+","+-o+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":711,"../../constants/interactions":716,"../../constants/xmlns_namespaces":719,"../../lib":738,"../../lib/svg_text_utils":761,"../../registry":861,"../../traces/scatter/make_bubble_size_func":1071,"../../traces/scatter/subtypes":1076,"../color":613,"../colorscale":628,"./symbol_defs":639,d3:123,"fast-isnumeric":132,tinycolor2:543}],639:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0}}},{d3:123}],640:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],641:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=[];if(a.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(a),u=0;u0;t.each(function(t){var u,h=t[0].trace,f=h.error_x||{},d=h.error_y||{};h.ids&&(u=function(t){return t.id});var p=o.hasMarkers(h)&&h.marker.maxdisplayed>0;d.visible||f.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,u);if(m.exit().remove(),t.length){f.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(m,e.layerClipId),m.each(function(t){var e=n.select(this),a=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,s,l);if(!p||t.vis){var o;if(d.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var u=d.width;o="M"+(a.x-u)+","+a.yh+"h"+2*u+"m-"+u+",0V"+a.ys,a.noYS||(o+="m-"+u+",0h"+2*u);var h=e.select("path.yerror");!h.size()?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(h=h.transition().duration(r.duration).ease(r.easing)),h.attr("d",o)}if(f.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var m=(f.copy_ystyle?d:f).width;o="M"+a.xh+","+(a.y-m)+"v"+2*m+"m0,-"+m+"H"+a.xs,a.noXS||(o+="m0,-"+m+"v"+2*m);var g=e.select("path.xerror");!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1076,"../drawing":638,d3:123,"fast-isnumeric":132}],646:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.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)})}},{"../color":613,d3:123}],647:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":810}],648:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||i.identity,Array.isArray(t)&&(e[0][r]=n(t))}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){function e(t){return function(e){return i.coerceHoverinfo({hoverinfo:e},{_module:t._module},o)}}for(var r=t.calcdata,o=t._fullLayout,s=0;s=0&&r.indexK.width||J<0||J>K.height)return g.unhoverRaw(t,e)}if(z="xval"in e?b.flat(f,e.xval):b.p2c(S,Z),O="yval"in e?b.flat(f,e.yval):b.p2c(E,J),!l(z[0])||!l(O[0]))return u.warn("Fx.hover failed",e,t),g.unhoverRaw(t,e)}var Q=1/0;for(R=0;RY&&(W.splice(0,Y),Q=W[0].distance)}if(0===W.length)return g.unhoverRaw(t,e);W.sort(function(t,e){return t.distance-e.distance});var nt=t._hoverdata,it=[];for(F=0;F1,st=i(W,{hovermode:D,rotateLabels:ot,bgColor:m.combine(_.plot_bgcolor||m.background,_.paper_bgcolor),container:_._hoverlayer,outerContainer:_._paperdiv,commonLabelOpts:_.hoverlabel},t);if(function(t,e,r){function n(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--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}var i,a,o,s,l,c,u,h=0,f=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?M:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});for(;!i&&h<=t.length;){for(h++,i=!0,s=0;s.01&&m.pmin===g.pmin&&m.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),f.splice(s+1,1),u=0,l=d.length-1;l>=0;l--)u+=d[l].dp;for(o=u/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;i=!1}else s++}f.forEach(n)}for(s=f.length-1;s>=0;s--){var v=f[s];for(l=v.length-1;l>=0;l--){var y=v[l],b=t[y.i];b.offset=y.dp,b.del=y.del}}}(W,ot?"xa":"ya",_),a(st,ot),e.target&&e.target.tagName){var lt=y.getComponentMethod("annotations","hasClickToShow")(t,it);d(s.select(e.target),lt?"pointer":"")}e.target&&!n&&o(t,e,nt)&&(nt&&t.emit("plotly_unhover",{event:e,points:nt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:z,yvals:O}))}function i(t,e,r){var n,i=e.hovermode,a=e.rotateLabels,o=e.bgColor,l=e.container,c=e.outerContainer,u=e.commonLabelOpts||{},h=e.fontFamily||x.HOVERFONT,d=e.fontSize||x.HOVERFONTSIZE,g=t[0],v=g.xa,y=g.ya,b="y"===i?"yLabel":"xLabel",w=g[b],M=(String(w)||"").split(" ")[0],k=c.node().getBoundingClientRect(),T=k.top,E=k.width,L=k.height,C=g.distance<=x.MAXDIST&&("x"===i||"y"===i);for(n=0;n-1&&n.length>v&&(n=v>3?n.substr(0,v-3)+"...":n.substr(0,v))}void 0!==t.extraText&&(l+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(l+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(l+="y: "+t.yLabel+"
"),l+=(l?"z: ":"")+t.zLabel):C&&t[i+"Label"]===w?l=t[("x"===i?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(l=t.yLabel):l=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(l+=(l?"
":"")+t.text),""===l&&(""===n&&e.remove(),l=n);var y=e.select("text.nums").call(p.font,t.fontFamily||h,t.fontSize||d,t.fontColor||g).text(l).attr("data-notex",1).call(f.positionText,0,0).call(f.convertToTspans,r),b=e.select("text.name"),x=0;n&&n!==l?(b.call(p.font,t.fontFamily||h,t.fontSize||d,u).text(n).attr("data-notex",1).call(f.positionText,0,0).call(f.convertToTspans,r),x=b.node().getBoundingClientRect().width+2*S):(b.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:g});var M,k,I=y.node().getBoundingClientRect(),P=t.xa._offset+(t.x0+t.x1)/2,D=t.ya._offset+(t.y0+t.y1)/2,z=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),F=I.width+A+S+x;t.ty0=T-I.top,t.bx=I.width+2*S,t.by=I.height+2*S,t.anchor="start",t.txwidth=I.width,t.tx2width=x,t.offset=0,a?(t.pos=P,M=D+O/2+F<=L,k=D-O/2-F>=0,"top"!==t.idealAlign&&M||!k?M?(D+=O/2,t.anchor="start"):t.anchor="middle":(D-=O/2,t.anchor="end")):(t.pos=D,M=P+z/2+F<=E,k=P-z/2-F>=0,"left"!==t.idealAlign&&M||!k?M?(P+=z/2,t.anchor="start"):t.anchor="middle":(P-=z/2,t.anchor="end")),y.attr("text-anchor",t.anchor),x&&b.attr("text-anchor",t.anchor),e.attr("transform","translate("+P+","+D+")"+(a?"rotate("+_+")":""))}),D}function a(t,e){t.each(function(t){var r=s.select(this);if(t.del)r.remove();else{var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(A+S),l=o+a*(t.txwidth+S),c=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,l-=t.tx2width/2),e&&(u*=-T,c=t.offset*k),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*A+c)+","+(A+u)+"v"+(t.by/2-A)+"h"+n*t.bx+"v-"+t.by+"H"+(n*A+c)+"V"+(u-A)+"Z"),i.call(f.positionText,o+c,u+t.ty0-t.by/2+S),t.tx2width&&(r.select("text.name").call(f.positionText,l+a*S+c,u+t.ty0-t.by/2+S),r.select("rect").call(p.setRect,l+(a-1)*t.tx2width/2+c,u-t.by/2-1,t.tx2width,t.by+2))}})}function o(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}var s=t("d3"),l=t("fast-isnumeric"),c=t("tinycolor2"),u=t("../../lib"),h=t("../../lib/events"),f=t("../../lib/svg_text_utils"),d=t("../../lib/override_cursor"),p=t("../drawing"),m=t("../color"),g=t("../dragelement"),v=t("../../plots/cartesian/axes"),y=t("../../registry"),b=t("./helpers"),x=t("./constants"),_=x.YANGLE,w=Math.PI*_/180,M=1/Math.sin(w),k=Math.cos(w),T=Math.sin(w),A=x.HOVERARROWSIZE,S=x.HOVERTEXTPAD;r.hover=function(t,e,r,i){t=u.getGraphDiv(t),u.throttle(t._fullLayout._uid+x.HOVERID,x.HOVERMINTIME,function(){n(t,e,r,i)})},r.loneHover=function(t,e){var r={color:t.color||m.defaultLine,x0:t.x0||t.x||0,x1:t.x1||t.x||0,y0:t.y0||t.y||0,y1:t.y1||t.y||0,xLabel:t.xLabel,yLabel:t.yLabel,zLabel:t.zLabel,text:t.text,name:t.name,idealAlign:t.idealAlign,borderColor:t.borderColor,fontFamily:t.fontFamily,fontSize:t.fontSize,fontColor:t.fontColor,trace:{index:0,hoverinfo:""},xa:{_offset:0},ya:{_offset:0},index:0},n=s.select(e.container),o=e.outerContainer?s.select(e.outerContainer):n,l={hovermode:"closest",rotateLabels:!1,bgColor:e.bgColor||m.background,container:n,outerContainer:o},c=i([r],l,e.gd);return a(c,l.rotateLabels),c.node()}},{"../../lib":738,"../../lib/events":726,"../../lib/override_cursor":749,"../../lib/svg_text_utils":761,"../../plots/cartesian/axes":785,"../../registry":861,"../color":613,"../dragelement":635,"../drawing":638,"./constants":650,"./helpers":652,d3:123,"fast-isnumeric":132,tinycolor2:543}],654:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r,i){r("hoverlabel.bgcolor",(i=i||{}).bgcolor),r("hoverlabel.bordercolor",i.bordercolor),r("hoverlabel.namelength",i.namelength),n.coerceFont(r,"hoverlabel.font",i.font)}},{"../../lib":738}],655:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../dragelement"),o=t("./helpers"),s=t("./layout_attributes");e.exports={moduleType:"component",name:"fx",constants:t("./constants"),schema:{layout:s},attributes:t("./attributes"),layoutAttributes:s,supplyLayoutGlobalDefaults:t("./layout_global_defaults"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),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:t("./hover").hover,unhover:a.unhover,loneHover:t("./hover").loneHover,loneUnhover:function(t){var e=i.isD3Selection(t)?t:n.select(t);e.selectAll("g.hovertext").remove(),e.selectAll(".spikeline").remove()},click:t("./click")}},{"../../lib":738,"../dragelement":635,"./attributes":647,"./calc":648,"./click":649,"./constants":650,"./defaults":651,"./helpers":652,"./hover":653,"./layout_attributes":656,"./layout_defaults":657,"./layout_global_defaults":658,d3:123}],656:[function(t,e,r){"use strict";var n=t("./constants"),i=t("../../plots/font_attributes")({editType:"none"});i.family.dflt=n.HOVERFONT,i.size.dflt=n.HOVERFONTSIZE,e.exports={dragmode:{valType:"enumerated",values:["zoom","pan","select","lasso","orbit","turntable"],dflt:"zoom",editType:"modebar"},hovermode:{valType:"enumerated",values:["x","y","closest",!1],editType:"modebar"},hoverlabel:{bgcolor:{valType:"color",editType:"none"},bordercolor:{valType:"color",editType:"none"},font:i,namelength:{valType:"integer",min:-1,dflt:15,editType:"none"},editType:"none"}}},{"../../plots/font_attributes":810,"./constants":650}],657:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("dragmode");var o;e._has("cartesian")?(e._isHoriz=function(t){for(var e=!0,r=0;r=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],665:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":810,"../color/attributes":612}],666:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],667:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,h,f,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var b=t.xaxis;b&&b.rangeslider&&b.rangeslider.visible?(c=0,h="left",u=1.1,f="bottom"):(c=0,h="left",u=-.1,f="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",h),l("y",u),l("yanchor",f),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":738,"../../plots/layout_attributes":837,"../../registry":861,"./attributes":665,"./helpers":671}],668:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*b;if(o){var l=d.bBox(o);n=l.height,i=l.width,d.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),u=m.lineCount(c),h=c.node();n=s*u,i=h?d.bBox(h).width:0;var f=s*(.3+(1-u)/2);m.positionText(c,40,f)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,o=h.traceIs(a,"pie"),s=a.index,u=o?n.label:a.name,f=t.selectAll("text.legendtext").data([0]);f.enter().append("text").classed("legendtext",!0),f.attr("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.edits.legendText&&!o?f.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(o.type))u[(a=n.trace.transforms)[a.length-1].direction+".name"]=t;else if(h.hasTransform(o,"groupby")){var f=h.getTransformIndices(o,"groupby"),d=f[f.length-1],p=c.keyedContainer(o,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),u=p.constructUpdate()}else u.name=t;return l.restyle(e,u,s)}):f.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(p.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){g(t,e,n)},k):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,g(t,e,n))}})}function a(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=w.isGrouped(i),l=0;if(i.width=0,i.height=0,w.isVertical(i))o&&e.each(function(t,e){d.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;d.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),l=40;else if(o){for(var c=[i.width],u=e.data(),h=0,f=u.length;ha+_-M,r.each(function(t){var e=t[0],r=g?40+t[0].width:b;a+x+M+r>n.width-(n.margin.r+n.margin.l)&&(x=0,v+=y,i.height=i.height+y,y=0),d.setTranslate(this,a+x,5+a+e.height/2+v),i.width+=M+r,i.height=Math.max(i.height,e.height),x+=M+r,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];s.select(this).select(".legendtoggle").call(d.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+l,r.height)})}function o(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center");var n="top";M.isBottomAnchor(e)?n="bottom":M.isMiddleAnchor(e)&&(n="middle"),u.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/plots"),h=t("../../registry"),f=t("../dragelement"),d=t("../drawing"),p=t("../color"),m=t("../../lib/svg_text_utils"),g=t("./handle_click"),v=t("./constants"),y=t("../../constants/interactions"),b=t("../../constants/alignment").LINE_SPACING,x=t("./get_legend_data"),_=t("./style"),w=t("./helpers"),M=t("./anchor_utils"),k=y.DBLCLICKDELAY;e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(d.setTranslate,0,e),L.call(d.setRect,j,t,v.scrollBarWidth,v.scrollBarHeight),A.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,m="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,b=r.showlegend&&x(t.calcdata,y),w=r.hiddenlabels||[];if(!r.showlegend||!b.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+m).remove(),void u.autoMargin(t,"legend");var T=r._infolayer.selectAll("g.legend").data([0]);T.enter().append("g").attr({class:"legend","pointer-events":"all"});var A=r._topdefs.selectAll("#"+m).data([0]);A.enter().append("clipPath").attr("id",m).append("rect");var S=T.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(p.stroke,y.bordercolor),S.call(p.fill,y.bgcolor),S.style("stroke-width",y.borderwidth+"px");var E=T.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var L=T.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(p.fill,"#808BA4");var C=E.selectAll("g.groups").data(b);C.enter().append("g").attr("class","groups"),C.exit().remove();var I=C.selectAll("g.traces").data(c.identity);I.enter().append("g").attr("class","traces"),I.exit().remove(),I.call(_,t).style("opacity",function(t){var e=t[0].trace;return h.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){s.select(this).call(n,t).call(i,t)});var P=0!==T.enter().size();P&&(a(t,C,I),o(t));var D=r.width,z=r.height;a(t,C,I),y.height>z?function(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center"),u.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}(t):o(t);var O=r._size,F=O.l+O.w*y.x,R=O.t+O.h*(1-y.y);M.isRightAnchor(y)?F-=y.width:M.isCenterAnchor(y)&&(F-=y.width/2),M.isBottomAnchor(y)?R-=y.height:M.isMiddleAnchor(y)&&(R-=y.height/2);var j=y.width,N=O.w;j>N?(F=O.l,j=N):(F+j>D&&(F=D-j),F<0&&(F=0),j=Math.min(D-F,y.width));var B=y.height,U=O.h;B>U?(R=O.t,B=U):(R+B>z&&(R=z-B),R<0&&(R=0),B=Math.min(z-R,y.height)),d.setTranslate(T,F,R);var V,H,q=B-v.scrollBarHeight-2*v.scrollBarMargin,G=y.height-B;if(y.height<=B||t._context.staticPlot)S.attr({width:j-y.borderwidth,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),d.setTranslate(E,0,0),A.select("rect").attr({width:j-2*y.borderwidth,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),E.call(d.setClipUrl,m);else{V=v.scrollBarMargin,H=E.attr("data-scroll")||0,S.attr({width:j-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),A.select("rect").attr({width:j-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-H}),E.call(d.setClipUrl,m),P&&e(V,H),T.on("wheel",null),T.on("wheel",function(){H=c.constrain(E.attr("data-scroll")-s.event.deltaY/q*G,-G,0),e(V=v.scrollBarMargin-H/G*q,H),0!==H&&H!==-G&&s.event.preventDefault()}),L.on(".drag",null),E.on(".drag",null);var Y=s.behavior.drag().on("drag",function(){V=c.constrain(s.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+q),H=-(V-v.scrollBarMargin)/q*G,e(V,H)});L.call(Y),E.call(Y)}if(t._context.edits.legendPosition){var W,X,Z,J;T.classed("cursor-move",!0),f.init({element:T.node(),gd:t,prepFn:function(){var t=d.getTranslate(T);Z=t.x,J=t.y},moveFn:function(t,e){var r=Z+t,n=J+e;d.setTranslate(T,r,n),W=f.align(r,0,O.l,O.l+O.w,y.xanchor),X=f.align(n,0,O.t+O.h,O.t,y.yanchor)},doneFn:function(){void 0!==W&&void 0!==X&&l.relayout(t,{"legend.x":W,"legend.y":X})},clickFn:function(e,n){var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===e?T._clickTimeout=setTimeout(function(){g(i,t,e)},k):2===e&&(T._clickTimeout&&clearTimeout(T._clickTimeout),g(i,t,e)))}})}}}},{"../../constants/alignment":711,"../../constants/interactions":716,"../../lib":738,"../../lib/svg_text_utils":761,"../../plotly":780,"../../plots/plots":846,"../../registry":861,"../color":613,"../dragelement":635,"../drawing":638,"./anchor_utils":664,"./constants":666,"./get_legend_data":669,"./handle_click":670,"./helpers":671,"./style":673,d3:123}],669:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+h;l.push(n),s[n]=[[r]],h++}}var a,o,s={},l=[],c=!1,u={},h=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],h=u.trace,f=l.hasMarkers(h),d=l.hasText(h),p=l.hasLines(h);if(f||d||p){var m={},g={};f&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(h,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(f?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),f&&(s[0].mrc=3);var b=v.selectAll("g.pointtext").data(d?s:[]);b.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),b.exit().remove(),b.selectAll("text").call(o.textPointStyle,c,e)})}},{"../../lib":738,"../../registry":861,"../../traces/pie/style_one":1040,"../../traces/scatter/subtypes":1076,"../color":613,"../drawing":638,d3:123}],674:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=f.list(t,null,!0),h="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),i(y,r);f&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var b=function(t){for(var e=a.list({_fullLayout:t},null,!0),r=0;r0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;ad&&(d=h)));return d>=f?[f,d]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sq&&n>G&&!t.shiftKey?h.getCursor(i/r,1-a/n):"move";f(e,o),H=o.split("-")[0]}function c(n,o){if("path"===r.type){var s=function(t){return U(N(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};j&&"date"===j.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else d[b]=r.x0=U(m+n),d[x]=r.y0=V(g+o),d[_]=r.x1=U(v+n),d[w]=r.y1=V(y+o);e.attr("d",i(t,r))}function u(n,o){if("path"===r.type){var s=function(t){return U(N(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};j&&"date"===j.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else{var c=~H.indexOf("n")?M+o:M,u=~H.indexOf("s")?k+o:k,h=~H.indexOf("w")?T+n:T,f=~H.indexOf("e")?A+n:A;u-c>G&&(d[S]=r[I]=V(c),d[E]=r[P]=V(u)),f-h>q&&(d[L]=r[D]=U(h),d[C]=r[z]=U(f))}e.attr("d",i(t,r))}var d,m,g,v,y,b,x,_,w,M,k,T,A,S,E,L,C,I,P,D,z,O,F,R,j,N,B,U,V,H,q=10,G=10,Y={element:e.node(),gd:t,prepFn:function(e){R=l.getFromId(t,r.xref),j=l.getFromId(t,r.yref),N=p.getDataToPixel(t,R),B=p.getDataToPixel(t,j,!0),U=p.getPixelToData(t,R),V=p.getPixelToData(t,j,!0);var i="shapes["+n+"]";"path"===r.type?(O=r.path,F=i+".path"):(m=N(r.x0),g=B(r.y0),v=N(r.x1),y=B(r.y1),b=i+".x0",x=i+".y0",_=i+".x1",w=i+".y1");ml&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),s.log("Ignoring extra params in segment "+t)),i+c})}(e.path,n,a);var f=n(e.x0),m=n(e.x1),g=a(e.y0),v=a(e.y1);if("line"===o)return"M"+f+","+g+"L"+m+","+v;if("rect"===o)return"M"+f+","+g+"H"+m+"V"+v+"H"+f+"Z";var y=(f+m)/2,b=(g+v)/2,x=Math.abs(y-f),_=Math.abs(b-g),w="A"+x+","+_,M=y+x+","+b;return"M"+M+w+" 0 1,1 "+(y+","+(b-_))+w+" 0 0,1 "+M+"Z"}function a(t,e,r){return t.replace(d.segmentRE,function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),h=t("../dragelement"),f=t("../../lib/setcursor"),d=t("./constants"),p=t("./helpers");e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r0)){n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font);n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.steps;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":738,"../../plots/array_container_defaults":782,"./attributes":699,"./constants":700}],702:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-M.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=M.currentValueInset,i="left"}a.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(x.font,e.currentvalue.font).text(o).call(_.convertToTspans,e.gd);var s=_.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*k;return _.positionText(a,n,l),a}}function a(t,e,r){var n=t.selectAll("rect."+M.gripRectClass).data([0]);n.enter().append("rect").classed(M.gripRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:M.gripWidth,height:M.gripHeight,rx:M.gripRadius,ry:M.gripRadius}).call(b.stroke,r.bordercolor).call(b.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function o(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(x.font,r.font).text(e.step.label).call(_.convertToTspans,r.gd),n}function s(t,e){var r=t.selectAll("g."+M.labelsClass).data([0]);r.enter().append("g").classed(M.labelsClass,!0);var n=r.selectAll("g."+M.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(M.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=v.select(this);r.call(o,t,e),x.setTranslate(r,d(e,t.fraction),M.tickOffset+e.ticklen+e.font.size*k+M.labelOffset+e.currentValueTotalHeight)})}function l(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&c(t,e,r,a,!0,i)}function c(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(f,r,r.active/(r.steps.length-1),o),e.call(i,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&y.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function u(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=v.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+M.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),o.call(b.fill,t.activebgcolor);var s=p(t,v.mouse(i)[0]);l(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=p(t,v.mouse(i)[0]);l(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(b.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function h(t,e){var r=t.selectAll("rect."+M.tickRectClass).data(e.steps);r.enter().append("rect").classed(M.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=v.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(b.fill,e.tickcolor),x.setTranslate(i,d(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?M.tickOffset:M.minorTickOffset)+e.currentValueTotalHeight)})}function f(t,e,r,n){var i=t.select("rect."+M.gripRectClass),a=d(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*M.gripWidth)+","+e.currentValueTotalHeight+")")}}function d(t,e){return t.inputAreaStart+M.stepInset+(t.inputAreaLength-2*M.stepInset)*Math.min(1,Math.max(0,e))}function p(t,e){return Math.min(1,Math.max(0,(e-M.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*M.stepInset-2*t.inputAreaStart)))}function m(t,e,r){var n=t.selectAll("rect."+M.railTouchRectClass).data([0]);n.enter().append("rect").classed(M.railTouchRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,M.tickOffset+r.ticklen+r.labelHeight)}).call(b.fill,r.bgcolor).attr("opacity",0),x.setTranslate(n,0,r.currentValueTotalHeight)}function g(t,e){var r=t.selectAll("rect."+M.railRectClass).data([0]);r.enter().append("rect").classed(M.railRectClass,!0);var n=e.inputAreaLength-2*M.railInset;r.attr({width:n,height:M.railWidth,rx:M.railRadius,ry:M.railRadius,"shape-rendering":"crispEdges"}).call(b.stroke,e.bordercolor).call(b.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),x.setTranslate(r,M.railInset,.5*(e.inputAreaWidth-M.railWidth)+e.currentValueTotalHeight)}var v=t("d3"),y=t("../../plots/plots"),b=t("../color"),x=t("../drawing"),_=t("../../lib/svg_text_utils"),w=t("../legend/anchor_utils"),M=t("./constants"),k=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[M.name],n=[],i=0;i0?[0]:[]);if(l.enter().append("g").classed(M.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0),e.call(i,r).call(g,r).call(s,r).call(h,r).call(m,t,r).call(a,t,r),x.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(f,r,r.active/(r.steps.length-1),!1),e.call(i,r)}(t,v.select(this),e)}})}}},{"../../constants/alignment":711,"../../lib/svg_text_utils":761,"../../plots/plots":846,"../color":613,"../drawing":638,"../legend/anchor_utils":664,"./constants":700,d3:123}],703:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":699,"./constants":700,"./defaults":701,"./draw":702}],704:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),h=t("../../constants/interactions"),f=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){function d(t){s.syncOrAsync([p,m],t)}function p(e){return e.attr("transform",M?"rotate("+[M.rotate,w.x,w.y]+") translate(0, "+M.offset+")":null),e.style({"font-family":A,"font-size":n.round(S,2)+"px",fill:c.rgb(E),opacity:L*c.opacity(E),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&I){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=i(_.pad)?_.pad:2,u=l.bBox(e.node()),h={left:0,top:0,right:T.width,bottom:T.height},f=_.maxShift||(h[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(f<0)r=f;else{var d=_.offsetLeft||0,p=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[a])+c))}),r=Math.min(f,r)}if(r>0||f<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,b=r.placeholder,x=r.traceIndex,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,T=t._fullLayout,A=v.titlefont.family,S=v.titlefont.size,E=v.titlefont.color,L=1,C=!1,I=v.title.trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var P=t._context.edits[g];""===I?L=0:I.replace(f," % ")===b.replace(f," % ")&&(L=.2,C=!0,P||(I=""));var D=I||P;k||(k=T._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var z=k.selectAll("text").data(D?[0]:[]);z.enter().append("text"),z.text(I).attr("class",e),z.exit().remove(),D&&(z.call(d),P&&(I?z.on(".opacity",null):(L=0,C=!0,z.text(b).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)})),z.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==x?a.restyle(t,y,e,x):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),z.classed("js-placeholder",C))}},{"../../constants/interactions":716,"../../lib":738,"../../lib/svg_text_utils":761,"../../plotly":780,"../../plots/plots":846,"../color":613,"../drawing":638,d3:123,"fast-isnumeric":132}],705:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"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:{_isLinkedToArray:"button",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",dflt:""},execute:{valType:"boolean",dflt:!0}},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,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":727,"../../plot_api/edit_types":769,"../../plots/font_attributes":810,"../../plots/pad_attributes":845,"../color/attributes":612}],706:[function(t,e,r){"use strict";e.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:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],707:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,o,r,n)}n("visible",function(t,e){function r(t,e){return i.coerce(n,a,l,t,e)}var n,a,o=t.buttons||[],s=e.buttons=[];for(var c=0;c0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.buttons;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":738,"../../plots/array_container_defaults":782,"./attributes":705,"./constants":706}],708:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e){return+t.attr(M.menuIndexAttrName)===e._index}function a(t,e,r,n,i,a,l,c){e._input.active=e.active=l,"buttons"===e.type?s(t,n,null,null,e):"dropdown"===e.type&&(i.attr(M.menuIndexAttrName,"-1"),o(t,n,i,a,e),c||s(t,n,i,a,e))}function o(t,e,r,n,a){var o=e.selectAll("g."+M.headerClassName).data([0]);o.enter().append("g").classed(M.headerClassName,!0).style("pointer-events","all");var c=a.active,u=a.buttons[c]||M.blankHeaderOpts,h={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},g={width:a.headerWidth,height:a.headerHeight};o.call(l,a,u,t).call(p,a,h,g);var v=e.selectAll("text."+M.headerArrowClassName).data([0]);v.enter().append("text").classed(M.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(b.font,a.font).text(M.arrowSymbol[a.direction]),v.attr({x:a.headerWidth-M.arrowOffsetX+a.pad.l,y:a.headerHeight/2+M.textOffsetY+a.pad.t}),o.on("click",function(){r.call(m),r.attr(M.menuIndexAttrName,i(r,a)?-1:String(a._index)),s(t,e,r,n,a)}),o.on("mouseover",function(){o.call(f)}),o.on("mouseout",function(){o.call(d,a)}),b.setTranslate(e,a.lx,a.ly)}function s(t,e,r,n,i){r||(r=e).attr("pointer-events","all");var o=function(t){return-1==+t.attr(M.menuIndexAttrName)}(r)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?M.dropdownButtonClassName:M.buttonClassName,c=r.selectAll("g."+s).data(o),u=c.enter().append("g").classed(s,!0),m=c.exit();"dropdown"===i.type?(u.attr("opacity","0").transition().attr("opacity","1"),m.transition().attr("opacity","0").remove()):m.remove();var y=0,b=0,x=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(x?b=i.headerHeight+M.gapButtonHeader:y=i.headerWidth+M.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(b=-M.gapButtonHeader+M.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-M.gapButtonHeader+M.gapButton-i.openWidth);var _={x:i.lx+y+i.pad.l,y:i.ly+b+i.pad.t,yPad:M.gapButton,xPad:M.gapButton,index:0},w={l:_.x+i.borderwidth,t:_.y+i.borderwidth};c.each(function(o,s){var u=g.select(this);u.call(l,i,o,t).call(p,i,_),u.on("click",function(){g.event.defaultPrevented||(a(t,i,0,e,r,n,s),o.execute&&v.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:i,button:o,active:i.active}))}),u.on("mouseover",function(){u.call(f)}),u.on("mouseout",function(){u.call(d,i),c.call(h,i)})}),c.call(h,i),x?(w.w=Math.max(i.openWidth,i.headerWidth),w.h=_.y-w.t):(w.w=_.x-w.l,w.h=Math.max(i.openHeight,i.headerHeight)),w.direction=i.direction,n&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,h=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(c.enter().append("g").classed(M.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,T=n.barLength+2*n.barPad,A=n.barWidth+2*n.barPad,S=p,E=g+v;E+A>c&&(E=c-A);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=L.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:E,width:T,height:A}),this._hbarXMin=S+T/2,this._hbarTranslateMax=w-T):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>M,I=n.barWidth+2*n.barPad,P=n.barLength+2*n.barPad,D=p+m,z=g;D+I>l&&(D=l-I);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),C?(this.vbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:D,y:z,width:I,height:P}),this._vbarYMin=z+P/2,this._vbarTranslateMax=M-P):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=u-.5,j=C?h+I+.5:h+.5,N=f-.5,B=k?d+A+.5:d+.5,U=s._topdefs.selectAll("#"+F).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(R),y:Math.floor(N),width:Math.ceil(j)-Math.floor(R),height:Math.ceil(B)-Math.floor(N)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||C){var V=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var H=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(H),C&&this.vbar.on(".drag",null).call(H)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":738,"../color":613,"../drawing":638,d3:123}],711:[function(t,e,r){"use strict";e.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},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],712:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],713:[function(t,e,r){"use strict";for(var n=t("../lib/extend").extendFlat,i={circle:{unicode:"\u25cf"},square:{unicode:"\u25a0"},diamond:{unicode:"\u25c6"},cross:{unicode:"\u271a"},x:{unicode:"\u274c"},"triangle-up":{unicode:"\u25b2"},"triangle-down":{unicode:"\u25bc"},"triangle-left":{unicode:"\u25c4"},"triangle-right":{unicode:"\u25ba"},"triangle-ne":{unicode:"\u25e5"},"triangle-nw":{unicode:"\u25e4"},"triangle-se":{unicode:"\u25e2"},"triangle-sw":{unicode:"\u25e3"},pentagon:{unicode:"\u2b1f"},hexagon:{unicode:"\u2b22"},hexagon2:{unicode:"\u2b23"},star:{unicode:"\u2605"},"diamond-tall":{unicode:"\u2666"},bowtie:{unicode:"\u29d3"},"diamond-x":{unicode:"\u2756"},"cross-thin":{unicode:"+",noBorder:!0},asterisk:{unicode:"\u2733",noBorder:!0},"y-up":{unicode:"\u2144",noBorder:!0},"y-down":{unicode:"Y",noBorder:!0},"line-ew":{unicode:"\u2500",noBorder:!0},"line-ns":{unicode:"\u2502",noBorder:!0}},a={},o=Object.keys(i),s=0;s","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],719:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],720:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.32.0",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":604,"./components/annotations3d":609,"./components/fx":655,"./components/images":663,"./components/legend":672,"./components/rangeselector":684,"./components/rangeslider":690,"./components/shapes":697,"./components/sliders":703,"./components/updatemenus":709,"./fonts/mathjax_config":721,"./lib/queue":752,"./locale-en":767,"./locale-en-us":766,"./plot_api/plot_schema":774,"./plot_api/register":775,"./plot_api/set_plot_config":776,"./plot_api/to_image":778,"./plot_api/validate":779,"./plotly":780,"./snapshot":866,"./snapshot/download":863,"./traces/scatter":1066,d3:123,"es6-promise":129}],721:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],722:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":717,"fast-isnumeric":132}],723:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):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){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(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?(Math.abs(t)>180&&(t-=360*Math.round(t/360)),e.set(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}function s(t){return t.formatDate("yyyy")}var l=t("d3"),c=t("fast-isnumeric"),u=t("./loggers"),h=t("./mod"),f=t("../constants/numerical"),d=f.BADNUM,p=f.ONEDAY,m=f.ONEHOUR,g=f.ONEMIN,v=f.ONESEC,y=f.EPOCHJD,b=t("../registry"),x=l.time.format.utc,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,w=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,M=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?b.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:b.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?b.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var k,T;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*g)>=k&&t<=T?t:d;if("string"!=typeof t&&"number"!=typeof t)return d;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?w:_);if(!s)return d;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),h=Number(s[7]||0),f=Number(s[9]||0),x=Number(s[11]||0);if(i){if(2===l.length)return d;l=Number(l);var A;try{var S=b.getComponentMethod("calendars","getCal")(e);if(o){var E="i"===c.charAt(c.length-1);c=parseInt(c,10),A=S.newDate(l,S.toMonthIndex(l,c,E),u)}else A=S.newDate(l,Number(c),u)}catch(t){return d}return A?(A.toJD()-y)*p+h*m+f*g+x*v:d}l=2===l.length?(Number(l)+2e3-M)%100+M:Number(l),c-=1;var L=new Date(Date.UTC(2e3,c,u,h,f));return L.setUTCFullYear(l),L.getUTCMonth()!==c?d:L.getUTCDate()!==u?d:L.getTime()+x*v},k=r.MIN_MS=r.dateTime2ms("-9999"),T=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==d};var A=90*p,S=3*m,E=5*g;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=k&&t<=T))return d;e||(e=0);var i,o,s,l,c,u,f=Math.floor(10*h(t+.05,1)),_=Math.round(t-f/10);if(n(r)){var w=Math.floor(_/p)+y,M=Math.floor(h(t,p));try{i=b.getComponentMethod("calendars","getCal")(r).fromJD(w).formatDate("yyyy-mm-dd")}catch(t){i=x("G%Y-%m-%d")(new Date(_))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=k+p&&t<=T-p))return d;var e=Math.floor(10*h(t+.05,1)),r=new Date(Math.round(t-e/10));return a(l.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return u.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return u.error("unrecognized date",t),e;return t};var L=/%\d?f/g,C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,i,a){var l,c;if(a=n(a)&&a,e)return function(t,e,r,i){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 a=new Date(Math.floor(e+.05));if(n(i))try{t=b.getComponentMethod("calendars","worldCalFmt")(t,e,i)}catch(t){return"Invalid"}return r(t)(a)}(e,t,i,a);if(a)try{var u=Math.floor((t+.05)/p)+y,h=b.getComponentMethod("calendars","getCal")(a).fromJD(u);"y"===r?c=s(h):"m"===r?c=function(t){return t.formatDate("M yyyy")}(h):"d"===r?(l=s(h),c=function(t){return t.formatDate("M d")}(h)):(l=function(t){return t.formatDate("M d, yyyy")}(h),c=o(t,r))}catch(t){return"Invalid"}else{var f=new Date(Math.floor(t+.05));"y"===r?c=i("%Y")(f):"m"===r?c=i("%b %Y")(f):"d"===r?(l=i("%Y")(f),c=i("%b %-d")(f)):(l=i("%b %-d, %Y")(f),c=o(t,r))}return c+(l?"\n"+l:"")};var I=3*p;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=h(t,p);if(t=Math.round(t-i),r)try{var a=Math.round(t/p)+y,o=b.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-y)*p+i}catch(e){u.error("invalid ms "+t+" in calendar "+r)}var l=new Date(t+I);return l.setUTCMonth(l.getUTCMonth()+e)+i-I},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&b.getComponentMethod("calendars","getCal")(e),h=0;h0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+h*m}}function i(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}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,h=a-e,f=l-o,d=c-s,p=u*u+h*h,m=f*f+d*d,g=Math.min(i(u,h,p,o-t,s-e),i(u,h,p,l-t,c-e),i(f,d,m,t-o,e-s),i(f,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),h=t.getPointAtLength(a(r,e)),f={x:(4*h.x+i.x+c.x)/6,y:(4*h.y+i.y+c.y)/6,theta:u};return o[r]=f,f},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===h&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,h=t.getTotalLength(),f=h,d=n(u);d;){if((u+=d+r)>f)return;d=n(u)}for(d=n(f);d;){if(f-=d+r,u>f)return;d=n(f)}return{min:u,max:f,len:f-u,total:h,isClosed:0===u&&f===h&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,h=0,f=0,d=s;h0?d=i:f=i,h++}return a}},{"./mod":745}],733:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],734:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(o(t))return u;var e=s(t);return e.length?e:u}function a(t){return o(t)?t:h}var o=t("fast-isnumeric"),s=t("color-rgba"),l=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,u=s(c),h=1;e.exports=function(t,e,r){var o,c,f,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,c=g?function(t,e){return void 0===t[e]?u:s(o(t[e]))}:i,f=v?function(t,e){return void 0===t[e]?h:a(t[e])}:a,g||v)for(var b=0;b=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}(t))))}},{"../constants/string_mappings":718,"superscript-text":539}],737:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],738:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var h=t("./search");l.findBin=h.findBin,l.sorterAsc=h.sorterAsc,l.sorterDes=h.sorterDes,l.distinctVals=h.distinctVals,l.roundUp=h.roundUp;var f=t("./stats");l.aggNums=f.aggNums,l.len=f.len,l.mean=f.mean,l.variance=f.variance,l.stdev=f.stdev,l.interp=f.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./geometry2d");l.segmentsIntersect=p.segmentsIntersect,l.segmentDistance=p.segmentDistance,l.getTextLocation=p.getTextLocation,l.clearLocationCache=p.clearLocationCache,l.getVisibleSegment=p.getVisibleSegment,l.findPointOnPath=p.findPointOnPath;var m=t("./extend");l.extendFlat=m.extendFlat,l.extendDeep=m.extendDeep,l.extendDeepAll=m.extendDeepAll,l.extendDeepNoArrays=m.extendDeepNoArrays;var g=t("./loggers");l.log=g.log,l.warn=g.warn,l.error=g.error;var v=t("./regex");l.counterRegex=v.counter;var y=t("./throttle");l.throttle=y.throttle,l.throttleDone=y.done,l.clearThrottle=y.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.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,c=new Array(l),u=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]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n=0&&t%1==0}function a(e){return void 0!==e&&e1?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};var _=/%{([^\s%{}]*)}/g,w=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(_,function(t,n){return w.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n}},{"../constants/numerical":717,"./clean_number":722,"./coerce":723,"./dates":724,"./ensure_array":725,"./extend":727,"./filter_unique":728,"./filter_visible":729,"./geometry2d":732,"./get_graph_div":733,"./identity":737,"./is_array":739,"./is_plain_object":740,"./keyed_container":741,"./localize":742,"./loggers":743,"./matrix":744,"./mod":745,"./nested_property":746,"./noop":747,"./notifier":748,"./push_unique":751,"./regex":753,"./relative_attr":754,"./relink_private":755,"./search":756,"./stats":759,"./throttle":762,"./to_log_range":763,d3:123,"fast-isnumeric":132}],739:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],740:[function(t,e,r){"use strict";e.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)===Object.prototype}},{}],741:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],h.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,c(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}(d)):h[e[u]]=n}}function o(t,e){var r=e;return l(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}var l=t("fast-isnumeric"),c=t("./is_array"),u=t("./is_plain_object"),h=t("../plot_api/container_array_match");e.exports=function(t,e){if(l(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),s=0;so||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,h,f,d,p,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(h,g)||c>Math.max(f,v)))if(cu||Math.abs(n(o,f))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":717,"./matrix":744}],751:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else 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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,h=0,f=e.length,d=0,p=f>1?(e[f-1]-e[0])/(f-1):1;for(u=p>=0?r?n:i:r?o:a,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);h90&&l.log("Long binary search..."),h-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":132}],760:[function(t,e,r){"use strict";var n=t("color-rgba");e.exports=function(t){var e=n(t);return e.length?e:[0,0,0,1]}},{"color-rgba":96}],761:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t,e,r){var n="math-output-"+c.randstr([],64),i=l.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(function(t){return t.replace(p,"\\lt ").replace(m,"\\gt ")}(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=l.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function a(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function o(t,e){function r(){p++;var e=document.createElementNS(u.svg,"tspan");l.select(e).attr({class:"line",dy:p*f+"em"}),t.appendChild(e),s=e;var r=d;if(d=[{node:e}],r.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),s=d[d.length-1].node}else c.log("Ignoring unexpected end tag .",e)}e=function(t){return function(t,e){if(!t)return"";for(var r=0;r|>|>)/g,g={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},v={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},b="\u200b",x=["http:","https:","mailto:","",void 0,":"],_=new RegExp("]*)?/?>","g"),w=Object.keys(h.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:h.entityToUnicode[t]}}),M=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,T=/<(\/?)([^ >]*)(\s+(.*))?>/i,A=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,E=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,I=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(_," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=l.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){!function(){var r=l.select(i).select(".svg-container"),a=r.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12);a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(s(t,r,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=l.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;l.select(this).transition().duration(0).remove(),l.select(document).on("mouseup",null),o.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,l.select(document).on("mouseup",function(){if(l.event.target===t)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===l.event.which?(i._editing=!1,t.style({opacity:1}),l.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),l.select(this).call(s(t,r,e)))}).on("keydown",function(){13===l.event.which&&this.blur()}).call(n)}(),t.style({opacity:0});var r,a=c.attr("class");(r=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(r).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}var i=e.gd,a=e.delegate,o=l.dispatch("edit","input","cancel"),c=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():c.on("click",r),l.rebind(t,o,"on")}},{"../constants/alignment":711,"../constants/string_mappings":718,"../constants/xmlns_namespaces":719,"../lib":738,d3:123}],762:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e?a():o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],763:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.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}},{"fast-isnumeric":132}],764:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":812,"topojson-client":545}],765:[function(t,e,r){"use strict";e.exports=function(t,e){if(t instanceof Float32Array)return function(t,e){for(var r=new Float32Array(e),n=0;n0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),h=t("../plots/plots"),f=t("../plots/cartesian/axis_ids"),d=f.cleanId,p=f.getFromTrace,m=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;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 i=(h.subplotsRegistry.cartesian||{}).attrRegex,o=(h.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(A.x=1.02,A.xanchor="left"):A.x<-2&&(A.x=-.02,A.xanchor="right"),A.y>3?(A.y=1.02,A.yanchor="bottom"):A.y<-2&&(A.y=-.02,A.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),m.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s1&&o.warn("Full array edits are incompatible with other edits",h);var y=r[""][""];if(u(y))e.set(null);else{if(!Array.isArray(y))return o.warn("Unrecognized full array edit value",h,y),!0;e.set(y)}return!m&&(f(g,v),d(t),!0)}var b,x,_,w,M,k,T,A=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,h).get(),C=[],I=-1,P=E.length;for(b=0;bE.length-(T?0:1))o.warn("index out of range",h,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",h,_),u(k)?C.push(_):T?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",h,_,k),-1===I&&(I=_);else for(x=0;x=0;b--)E.splice(C[b],1),L&&L.splice(C[b],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(f(g,v),p!==a){var D;if(-1===I)D=A;else{for(P=Math.max(E.length,P),D=[],b=0;b=I);b++)D.push(_);for(b=I;b=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 s(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]),o(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&o(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function l(t,e,r,n,i,s){!function(t,e,r,n){var i=v.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!v.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");o(t,r,"indices");for(var a in 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,c,u,h=function(t,e,r,n){var i,o,s,l,c,u=v.isPlainObject(n),h=[];Array.isArray(r)||(r=[r]),r=a(r,t.data.length-1);for(var f in e)for(var d=0;d=0&&uY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(N+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(N+".range[0]",Math.log(Z)/Math.LN10),r(N+".range[1]",Math.log(J)/Math.LN10)):(r(N+".range[0]",Math.pow(10,Z)),r(N+".range[1]",Math.pow(10,J)))}else r(N+".autorange",!0);x.getComponentMethod("annotations","convertCoords")(t,U,L,r),x.getComponentMethod("images","convertCoords")(t,U,L,r)}else r(N+".autorange",!0),r(N+".range",null);v.nestedProperty(u,N+"._inputRange").set(null)}else if(F.match(z.AX_NAME_PATTERN)){var K=v.nestedProperty(u,S).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),x.getComponentMethod("annotations","convertCoords")(t,K,Q,r),x.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=C.containerArrayMatch(S);if($){a=$.array,o=$.index;var tt=$.property,et=(v.nestedProperty(l,a)||[])[o]||{},rt=et,nt=H||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===o?(it?M.calc=!0:D.update(M,nt),it=!1):""===tt&&(rt=L,C.isAddVal(L)?T[S]=null:C.isRemoveVal(L)?(T[S]=et,rt=et):v.warn("unrecognized full object value",e)),it&&(n(rt,"x")||n(rt,"y"))?M.calc=!0:D.update(M,nt),d[a]||(d[a]={});var at=d[a][o];at||(at=d[a][o]={}),at[tt]=L,delete e[S]}else"reverse"===F?(B.range?B.range.reverse():(r(N+".autorange",!0),B.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):((!u._has("gl2d")&&!u._has("regl")||"dragmode"!==S||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&H?D.update(M,H):M.calc=!0,E.set(L))}}for(a in d){C.applyContainerArrayChanges(t,v.nestedProperty(l,a),d[a],M)||(M.plot=!0)}var ot=u._axisConstraintGroups||[];for(b in A)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=v.getGraphDiv(t),!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=w.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(e){if(0!==e.length){for(var s=0;so._timeToNext&&function(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,w.transition(t,e.frame.data,e.frame.layout,I.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(o._animationRaf),o._animationRaf=null}()};e()}()}}function h(t){return Array.isArray(s)?p>=s.length?t.transitionOpts=s[p]:t.transitionOpts=s[0]:t.transitionOpts=s,p++,t}var f,d,p=0,m=[],g=void 0===e||null===e,y=Array.isArray(e);if(!g&&!y&&v.isPlainObject(e))m.push({type:"object",data:h(v.extendFlat({},e))});else if(g||-1!==["string","number"].indexOf(typeof e))for(f=0;f0&&__)&&M.push(d);m=M}}m.length>0?u(m):(t.emit("plotly_animated"),l())})},g.addFrames=function(t,e,r){t=v.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=l.length+2*e.length,h=[];for(i=e.length-1;i>=0;i--)if(v.isPlainObject(e[i])){var f=(c[e[i].name]||{}).name,d=e[i].name;f&&d&&"number"==typeof d&&c[f]&&(n++,v.warn('addFrames: overwriting frame "'+c[f].name+'" with a frame whose name of type "number" also equates to "'+f+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&v.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),h.push({frame:w.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}h.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(a=h[i].frame).name&&v.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=w.modifyFrames,l=w.modifyFrames,c=[t,o],u=[t,a];return b&&b.add(t,s,c,l,u),w.modifyFrames(t,a)},g.purge=function(t){var e=(t=v.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return w.cleanPlot([],{},r,e),w.purge(t),y.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":613,"../components/drawing":638,"../components/errorbars":644,"../constants/xmlns_namespaces":719,"../lib":738,"../lib/events":726,"../lib/queue":752,"../lib/svg_text_utils":761,"../plotly":780,"../plots/cartesian/axis_ids":788,"../plots/cartesian/constants":790,"../plots/cartesian/constraints":792,"../plots/cartesian/graph_interact":794,"../plots/plots":846,"../plots/polar":849,"../registry":861,"./edit_types":769,"./helpers":770,"./manage_arrays":771,"./plot_schema":774,"./subroutines":777,d3:123,"fast-isnumeric":132,"has-hover":289}],773:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],774:[function(t,e,r){"use strict";function n(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function a(){var t,e,r={};b(r,f);for(t in c.subplotsRegistry)if((e=c.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)s(r,e,"xaxis"),s(r,e,"yaxis");else{s(r,e,"subplot"===e.attr?e.name:e.attr)}r=function(t){return y(t,{radialaxis:g.radialaxis,angularaxis:g.angularaxis}),y(t,g.layout),t}(r);for(t in c.componentsRegistry){var n=(e=c.componentsRegistry[t]).schema;if(n&&(n.subplots||n.layout)){var i=n.subplots;if(i&&i.xaxis&&!i.yaxis)for(var a in i.xaxis)delete r.yaxis[a]}else e.layoutAttributes&&l(r,e.layoutAttributes,e.name)}return{layoutAttributes:o(r)}}function o(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):u.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[_];if(!n)return;delete t[_],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function s(t,e,r){var n=u.nestedProperty(t,r),i=b({},e.layoutAttributes);i[x]=!0,n.set(i)}function l(t,e,r){var n=u.nestedProperty(t,r);n.set(b(n.get()||{},e))}var c=t("../registry"),u=t("../lib"),h=t("../plots/attributes"),f=t("../plots/layout_attributes"),d=t("../plots/frame_attributes"),p=t("../plots/animation_attributes"),m=t("../plots/polar/area_attributes"),g=t("../plots/polar/axis_attributes"),v=t("./edit_types"),y=u.extendFlat,b=u.extendDeepAll,x="_isSubplotObj",_="_isLinkedToArray",w=[x,_,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=x,r.IS_LINKED_TO_ARRAY=_,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=w,r.get=function(){var t={};c.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:m},r={}):r=(e=c.modules[t]._module).basePlotModule;var n={};n.type=null,b(n,h),b(n,e.attributes),r.attributes&&b(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:o(n)};if(e.layoutAttributes){var a={};b(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}(e)});var e={};return Object.keys(c.transformsRegistry).forEach(function(t){e[t]=function(t){var e=c.transformsRegistry[t],r=b({},e.attributes);return Object.keys(c.componentsRegistry).forEach(function(e){var n=c.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){l(r,n.schema.transforms[t][e],e)})}),{attributes:o(r)}}(t)}),{defs:{valObjects:u.valObjectMeta,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:v.traces,layout:v.layout},impliedEdits:{}},traces:t,layout:a(),transforms:e,frames:function(){var t={frames:u.extendDeepAll({},d)};return o(t),t.frames}(),animation:o(p)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===w.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||u.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,a,o){i=i.slice(0,o).concat([r]);if(e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[o-1]&&("ticktext"===r||"tickvals"===r))){var s=function(t){return t.join(".")}(i),l=u.nestedProperty(t,s).get();Array.isArray(l)&&n.push(s)}}var n=[],i=[];if(r.crawl(h,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,o=0;o=t.transforms.length)return!1;a=(r=(c.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=m[o];else{var u=t._module;if(u||(u=(c.modules[t.type||h.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(a=r&&r[o])){var f=u.basePlotModule;f&&f.attributes&&(a=f.attributes[o])}a||(a=h[o])}return n(a,e,s)},r.getLayoutValObject=function(t,e){return n(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var a=e.plotgroup.selectAll(".bg").data(i);a.enter().append("rect").classed("bg",!0),a.exit().remove(),a.each(function(){e.bg=a;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=l._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){l._plots[t].bg=o.select(this)}),x.each(function(t){function r(t){return"M"+k+","+t+"H"+T}function o(t){return"M"+y._offset+","+t+"h"+y._length}function s(t){return"M"+t+","+I+"V"+C}function c(t){return"M"+t+","+b._offset+"v"+b._length}function p(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}var v=l._plots[t],y=v.xaxis,b=v.yaxis;v.bg&&m&&v.bg.call(f.setRect,y._offset-u,b._offset-u,y._length+2*u,b._length+2*u).call(h.fill,l.plot_bgcolor).style("stroke-width",0),v.clipId="clip"+l._uid+t+"plot";var x=l._clips.selectAll("#"+v.clipId).data([0]);x.enter().append("clipPath").attr({class:"plotclip",id:v.clipId}).append("rect"),x.selectAll("rect").attr({width:y._length,height:b._length}),f.setTranslate(v.plot,y._offset,b._offset);var _,w;for(v._hasClipOnAxisFalse?(_=null,w=v.clipId):(_=v.clipId,w=null),f.setClipUrl(v.plot,_),i=0;i1&&d.push(a("object","layout"))),l.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&i<=10||e>=15*T)t._tickround="d";else if(e>=S&&i<=16||e>=A)t._tickround="M";else if(e>=E&&i<=19||e>=S)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(p(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);p(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),u=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(u)>3&&(l(t.exponentformat)&&!c(u)?t._tickexponent=3*Math.round((u-1)/3):t._tickexponent=u)}else t._tickround=null}function s(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t){return"SI"===t||"B"===t}function c(t){return t>14||t<-15}function u(t,e,r,n){var i=t<0,a=e._tickround,s=r||e.exponentformat||"B",u=e._tickexponent,h=P.getTickFormat(e),f=e.separatethousands;if(n){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:p(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(d),a=(Number(d._tickround)||0)+4,u=d._tickexponent,e.hoverformat&&(h=e.hoverformat)}if(h)return e._numFormat(h)(t).replace(/-/g,L);var m=Math.pow(10,-a)/2;if("none"===s&&(u=0),(t=Math.abs(t))"+b+"":"B"===s&&9===u?t+="B":l(s)&&(t+=V[u/3+5])}return i?L+t:t}function h(t,e){for(var r=0;r2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},P.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&h/u>f&&(l=o,c=s,f=h/u);if(n===i){var m=n-1,v=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,v]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,v)]:[m,v]}else f&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-f*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),f=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-f*l.pad,c.val+f*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),g.simpleMap(r,t.l2r||Number)},P.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=P.getAutoRange(t),t._r=t.range.slice(),t._rl=g.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},P.saveRangeInitial=function(t,e){for(var r=P.list(t,"",!0),n=!1,i=0;i=f?d=!1:s.val>=c&&s.pad<=f&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:x&&0===c?0:f})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=h?d=!1:s.val<=u&&s.pad<=h&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:x&&0===u?0:h})}}}if((t.autorange||!!g.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,h,f,d,m,v,y=e.length,b=r.padded?.05*t._length:0,x=r.tozero&&("linear"===t.type||"-"===t.type);b&&"domain"===t.constrain&&t._inputDomain&&(b*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var _=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),M=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),T=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=y-1;a>5;a--)i(a)}},P.autoBin=function(t,e,r,n,i){var a=g.aggNums(Math.min,null,t),o=g.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:a-.5,end:o+.5,size:1,_count:o-a+1};var s;if(r)s=(o-a)/r;else{var l=g.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*g.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*g.stdev(t)/Math.pow(t.length,n?.25:.4)),p(s)||(s=1)}var h;h="log"===e.type?{type:"linear",range:[a,o]}:{type:e.type,range:g.simpleMap([a,o],e.c2r,0,i),calendar:i},P.setConvert(h),P.autoTicks(h,s);var f,d,m=P.tickIncrement(P.tickFirst(h),h.dtick,"reverse",i);if("number"==typeof h.dtick)f=(m=function(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,c=0,u=0;u.3*h||a(n)||a(i))){var f=r.dtick/2;t+=t+f.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=P.tickIncrement(t,"M6","reverse")+1.5*T:a.exactMonths>.8?t=P.tickIncrement(t,"M1","reverse")+15.5*T:t-=T/2;var s=P.tickIncrement(t,r);if(s<=n)return s}return t}(m,t,h.dtick,a,i)),f=m,d=0;f<=o;)f=P.tickIncrement(f,h.dtick,!1,i),d++;return{start:e.c2r(m,0,i),end:e.c2r(f,0,i),size:h.dtick,_count:d}},P.calcTicks=function(t){var e=g.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=g.constrain(t._length/r,4,9)+1)),"array"===t.tickmode&&(n*=100),P.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),o(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=g.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),h=Math.max(l,c),f=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e=l:h<=l)&&!(a.length>u||h===c);h=P.tickIncrement(h,t.dtick,i,t.calendar))c=h,a.push(h);t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var f=new Array(a.length),d=0;dM?(e/=M,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="M"+12*a(e,r,F)):n>k?(e/=k,t.dtick="M"+a(e,1,R)):n>T?(t.dtick=a(e,T,N),t.tick0=g.dateTick0(t.calendar,!0)):n>A?t.dtick=a(e,A,R):n>S?t.dtick=a(e,S,j):n>E?t.dtick=a(e,E,j):(r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,r,F))}else if("log"===t.type){t.tick0=0;var i=g.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(i[1]-i[0])<1){var o=1.5*Math.abs((i[1]-i[0])/e);e=Math.abs(Math.pow(10,i[1])-Math.pow(10,i[0]))/o,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick="L"+a(e,r,F)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):(t.tick0=0,r=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),t.dtick=a(e,r,F));if(0===t.dtick&&(t.dtick=1),!p(t.dtick)&&"string"!=typeof t.dtick){var s=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(s)}},P.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(p(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return g.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?U:B,l=t+.01*i,c=g.roundUp(g.mod(l,1),s,r);return Math.floor(l)+Math.log(d.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},P.tickFirst=function(t){var e=t.r2l||Number,r=g.simpleMap(t.range,e),n=r[1]"+o,t._prevDateHead=o)),e.text=s}(t,o,r,f):"log"===t.type?function(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=u(Math.pow(10,o),t,i,n);else if(p(a)||"D"===a.charAt(0)&&g.mod(o+.01,1)<.1){var h=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||l(t.exponentformat)&&c(h)?(e.text=0===h?1:1===h?"10":h>1?"10"+h+"":"10"+L+-h+"",e.fontSize*=1.25):(e.text=u(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,g.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var f=String(e.text).charAt(0);"0"!==f&&"1"!==f||("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*(o<0?.5:.25)))}}(t,o,0,f,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=u(e.x,t,i,n)}(t,o,0,f,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o},P.hoverLabelText=function(t,e,r){if(r!==C&&r!==e)return P.hoverLabelText(t,e)+" - "+P.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=P.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":L+i:i};var V=["f","p","n","\u03bc","m","","k","M","G","T"];P.getTickFormat=function(t){function e(t){return"string"!=typeof t?t:Number(t.replace("M",""))*k}function r(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function n(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function i(t,e){var n=null===e[0],i=null===e[1],a=r(t,e[0])>=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}var a,o;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(a=0;a1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":861,"./constants":790}],789:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],790:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":738}],791:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;oo*v)||_)for(r=0;rI&&DL&&(L=D);h/=(L-E)/(2*C),E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=T.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}(at,dt,X,Z,pt="M0,0H"+J+"V"+K+"H0V0"),yt=function(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:g.background,stroke:g.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}(at,X,Z),o(at)}function j(e,r){function n(){gt="",ft.r=ft.l,ft.t=ft.b,yt.attr("d","M0,0Z")}if(t._transitioningWithDuration)return!1;var i=Math.max(0,Math.min(J,e+ut)),a=Math.max(0,Math.min(K,r+ht)),o=Math.abs(i-ut),s=Math.abs(a-ht);ft.l=Math.min(ut,i),ft.r=Math.max(ut,i),ft.t=Math.min(ht,a),ft.b=Math.max(ht,a),et?o>L||s>L?(gt="xy",o/J>s/K?(s=o*K/J,ht>a?ft.t=ht-s:ft.b=ht+s):(o=s*J/K,ut>i?ft.l=ut-o:ft.r=ut+o),yt.attr("d",c(ft))):n():!$||s.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),e.transition().style("opacity",1).duration(200))}(vt,yt,ft,pt,mt,dt),mt=!0}function N(){if(Math.min(ft.h,ft.w)<2*E)return s(t);"xy"!==gt&&"x"!==gt||i(Y,ft.l/J,ft.r/J,bt,rt),"xy"!==gt&&"y"!==gt||i(W,(K-ft.b)/K,(K-ft.t)/K,bt,nt),s(t),H(),C&&t.data&&t._context.showTips&&(p.notifier(p._(t,"Double-click to zoom back out"),"long"),C=!1)}function B(e){function r(t,e,r){if(!t.fixedrange){var n=p.simpleMap(t.range,t.r2l),i=n[0]+(n[1]-n[0])*e;t.range=n.map(function(e){return t.l2r(i+(e-i)*r)})}}if(t._context.scrollZoom||it._enablescrollzoom){if(t._transitioningWithDuration)return p.pauseEvent(e);var n=t.querySelector(".plotly");if(F(),!(n.scrollHeight-n.clientHeight>10||n.scrollWidth-n.clientWidth>10)){clearTimeout(_t);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=Mt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(O||et){for(O||(l=.5),a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(F(),"ew"===Q||"ns"===$)return Q&&a(Y,e),$&&a(W,r),q([Q?-e:0,$?-r:0,J,K]),void V($,Q);if(et&&Q&&$){var i="w"===Q==("n"===$)?1:-1,o=(e/J+i*r/K)/2;e=o*J,r=i*o*K}"w"===Q?e=n(Y,0,e):"e"===Q?e=n(Y,1,-e):Q||(e=0),"n"===$?r=n(W,1,r):"s"===$?r=n(W,0,-r):$||(r=0);var s="w"===Q?e:0,l="n"===$?r:0;if(et){var c;if(!Q&&1===$.length){for(c=0;c rect").call(v.setTranslate,s,l).call(v.setScale,a,o);var E=g.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");g.plot.call(v.setTranslate,T,S).call(v.setScale,1/a,1/o),E.selectAll(".point").call(v.setPointGroupScale,a,o),E.selectAll(".textpoint").call(v.setTextPointsScale,a,o),E.call(v.hideOutsideRangePoints,g)}}}var G,Y,W,X,Z,J,K,Q,$,tt,et,rt,nt,it=t._fullLayout,at=t._fullLayout._zoomlayer,ot=z+O==="nsew",st=1===(z+O).length;F();var lt=function(t,e,r,n,i,a,o){var s=t.draglayer.selectAll("."+e).data([0]);return s.enter().append("rect").classed("drag",!0).classed(e,!0).style({fill:"transparent","stroke-width":0}).attr("data-subplot",t.id),s.call(v.setRect,n,i,a,o).call(b,r),s.node()}(e,z+O+"drag",tt,r,I,P,D);if(!$&&!Q&&!l(it.dragmode))return lt.onmousedown=null,lt.style.pointerEvents=ot?"all":"none",lt;var ct={element:lt,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;ot?e.shiftKey?"pan"===i?i="zoom":l(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan",ct.minDrag="lasso"===i?1:void 0,"zoom"===i?(ct.moveFn=j,ct.doneFn=N,ct.minDrag=1,R(0,r,n)):"pan"===i?(ct.moveFn=U,ct.doneFn=H,o(at)):l(i)&&(ct.xaxes=Y,ct.yaxes=W,T(e,r,n,ct,i))},clickFn:function(r,n){if(s(t),2!==r||st||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(Q?Y:[]).concat($?W:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;ru[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":738,"fast-isnumeric":132}],801:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.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)]}},{"../../constants/alignment":711}],802:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function h(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function b(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function x(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=x,t.p2l=_,t.c2p="log"===t.type?function(t,e){return x(r(t,e))}:x,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=h,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(h(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=b,t.r2c=function(e){var r=b(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=b,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e){e||(e="range");var r,n,i=o.nestedProperty(t,e).get();if(n="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:p.DFLTRANGEX,n=n.slice(),i&&2===i.length)for("date"===t.type&&(i[0]=o.cleanDate(i[0],d,t.calendar),i[1]=o.cleanDate(i[1],d,t.calendar)),r=0;r<2;r++)if("date"===t.type){if(!o.isDateTime(i[r],t.calendar)){t[e]=n;break}if(t.r2l(i[0])===t.r2l(i[1])){var s=o.constrain(t.r2l(i[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);i[0]=t.l2r(s-1e3),i[1]=t.l2r(s+1e3);break}}else{if(!a(i[r])){if(!a(i[1-r])){t[e]=n;break}i[r]=i[1-r]*(r?10:.1)}if(i[r]<-f?i[r]=-f:i[r]>f&&(i[r]=f),i[0]===i[1]){var l=Math.max(1,Math.abs(1e-6*i[0]));i[0]-=l,i[1]+=l}}else o.nestedProperty(t,e).set(n)},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:i.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:i.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":717,"../../lib":738,"./axis_ids":788,"./constants":790,d3:123,"fast-isnumeric":132}],804:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);r("tickprefix")&&r("showtickprefix",s);r("ticksuffix")&&r("showticksuffix",s);if(r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){function r(t,e){return n.coerce(s,l,i.tickformatstops,t,e)}var a=t.tickformatstops,o=e.tickformatstops=[];if(Array.isArray(a))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var h=u.charAt(0),f=u.substr(1);((f=n(f)?Number(f):0)<=0||!("date"===o&&"M"===h&&f===Math.round(f)||"log"===o&&"L"===h||"log"===o&&"D"===h&&(1===f||2===f)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":717,"../../lib":738,"fast-isnumeric":132}],807:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(t){var e=t.xaxis,r=t.yaxis;d._defs.select("#"+t.clipId+"> 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 h(e,r){var n,i,l,c=m[e.xaxis._id],u=m[e.yaxis._id],h=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,h[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var f=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],h[2]=e.xaxis._length*(1-r+r*p/f)}else h[0]=0,h[2]=e.xaxis._length;if(u){i=(n=t._fullLayout[u.axisName])._r,l=u.to,h[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var g=i[1]-i[0],v=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],h[3]=e.yaxis._length*(1-r+r*v/g)}else h[1]=0,h[3]=e.yaxis._length;!function(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,k,T).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,E,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}function f(){x=Date.now();for(var e=Math.min(1,(x-b)/r.duration),n=w(e),a=0;ar.duration?(!function(){for(var e={},r=0;r0?".":"")+i;l.isPlainObject(a)?o(a,e,s,n+1):e(s,i,a)}})}var s=t("../plotly"),l=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(c)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(c){n(t,c,o.cache),o.check=function(){if(s){var e=n(t,c,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],h=0;hn*Math.PI/180}return!1},r.getPath=function(){return i.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(m.precision),n&&r.clipAngle(n-m.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var h=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],f=e.lonaxis,d=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(f.range,d.range);u.fitExtent(h,p);var g=this.bounds=u.getBounds(p),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var b=this.graphDiv,x=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!c){var T=u?o.projRotate:[k,0,0];M=r("projection.rotation.lon",T[0]),r("projection.rotation.lat",T[1]),r("projection.rotation.roll",T[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}var A,S;if(c?(A=-96.6,S=38.7):(A=u?k:M,S=(x[0]+x[1])/2),r("center.lon",A),r("center.lat",S),h){r("projection.parallels",o.projParallels||[0,60])}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":853,"../constants":812,"./layout_attributes":817}],817:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../constants"),a=t("../../../plot_api/edit_types").overrideAll,o={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=a({domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(i.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(i.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:i.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:i.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:i.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:i.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:o,lataxis:o},"plot","from-root")},{"../../../components/color/attributes":612,"../../../plot_api/edit_types":769,"../constants":812}],818:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!M.hasOwnProperty(e.type))return null;var i=M[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){return t>1?S:t<-1?-S:Math.asin(t)}function a(t){return t>1?0:t<-1?A:Math.acos(t)}function o(t,e){var r=(2+S)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>k;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(A*(4+A))*t*(1+Math.cos(e)),2*Math.sqrt(A/(4+A))*Math.sin(e)]}function s(t,e){function r(r,n){var i=P(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?P:e===1/0?l:(r.invert=function(r,n){var i=P.invert(r/t,n);return i[0]*=e,i},r)}function l(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function c(t,e){return[3*t/(2*A)*Math.sqrt(A*A/3-e*e),e]}function u(t,e){return[t,1.25*Math.log(Math.tan(A/4+.4*e))]}function h(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>k&&--i>0);return e/2}}function f(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function d(t,e){var r,n=Math.min(18,36*Math.abs(e)/A),i=Math.floor(n),a=n-i,o=(r=z[i])[0],s=r[1],l=(r=z[++i])[0],c=r[1],u=(r=z[Math.min(19,++i)])[0],h=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?S:-S)*(c+a*(h-s)/2+a*a*(h-2*c+s)/2)]}function p(t,e){return[t*Math.cos(e),e]}function m(t,e){var r=Math.cos(e),n=function(t){return t?t/Math.sin(t):1}(a(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function g(t,e){var r=m(t,e);return[(r[0]+t/S)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&v.hasOwnProperty(t.type)?v[t.type]:r)(t,n)};var v={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},y=[],b=[],x={point:function(t,e){y.push([t,e])},result:function(){var t=y.length?y.length<2?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y}:null;return y=[],t}},_={lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){y.length&&(b.push(y),y=[])},result:function(){var t=b.length?b.length<2?{type:"LineString",coordinates:b[0]}:{type:"MultiLineString",coordinates:b}:null;return b=[],t}},w={polygonStart:n,lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){var t=y.length;if(t){do{y.push(y[0].slice())}while(++t<4);b.push(y),y=[]}},polygonEnd:n,result:function(){if(!b.length)return null;var t=[],e=[];return b.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(f-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),b=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},M={Point:x,MultiPoint:x,LineString:_,MultiLineString:_,Polygon:w,MultiPolygon:w,Sphere:w},k=1e-6,T=k*k,A=Math.PI,S=A/2,E=(Math.sqrt(A),A/180),L=180/A,C=t.geo.projection,I=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=a[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],l}function n(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a=0;--r){var h;o=180*(h=a[1][r])[0][0]/A,s=180*h[0][1]/A,l=180*h[1][1]/A,c=180*h[2][0]/A,u=180*h[2][1]/A,e.push(n([[c-1e-6,u-1e-6],[c-1e-6,l+1e-6],[o+1e-6,l+1e-6],[o+1e-6,s-1e-6]],30))}return{type:"Polygon",coordinates:[t.merge(e)]}}(),l)},i},o.lobes=function(t){return arguments.length?(a=t.map(function(t){return t.map(function(t){return[[t[0][0]*A/180,t[0][1]*A/180],[t[1][0]*A/180,t[1][1]*A/180],[t[2][0]*A/180,t[2][1]*A/180]]})}),i=a.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),o):a.map(function(t){return t.map(function(t){return[[180*t[0][0]/A,180*t[0][1]/A],[180*t[1][0]/A,180*t[1][1]/A],[180*t[2][0]/A,180*t[2][1]/A]]})})},o},o.invert=function(t,e){var r=.5*e*Math.sqrt((4+A)/A),n=i(r),a=Math.cos(n);return[t/(2/Math.sqrt(A*(4+A))*(1+a)),i((n+r*(a+2))/(2+S))]},(t.geo.eckert4=function(){return C(o)}).raw=o;var P=t.geo.azimuthalEqualArea.raw;l.invert=function(t,e){var r=2*i(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=I(s),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=s,c.invert=function(t,e){return[2/3*A*t/Math.sqrt(A*A/3-e*e),e]},(t.geo.kavrayskiy7=function(){return C(c)}).raw=c,u.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*A]},(t.geo.miller=function(){return C(u)}).raw=u,h(A);var D=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=a(n)),e*Math.sin(n)]}var a=h(r);return n.invert=function(n,a){var o=i(a/e);return[n/(t*Math.cos(o)),i((2*o+Math.sin(2*o))/r)]},n}(Math.SQRT2/S,Math.SQRT2,A);(t.geo.mollweide=function(){return C(D)}).raw=D,f.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>k&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return C(f)}).raw=f;var z=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];z.forEach(function(t){t[1]*=1.0144}),d.invert=function(t,e){var r=e/S,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=z[a][1],s=z[a+1][1],l=z[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,h=2*(Math.abs(r)-s)/c,f=u/c,d=h*(1-f*h*(1-2*f*h));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=z[a][1],s=z[a+1][1],l=z[Math.min(19,a+2)][1],n-=(p=(e>=0?S:-S)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*L}while(Math.abs(p)>T&&--m>0);break}}while(--a>=0);var g=z[a][0],v=z[a+1][0],y=z[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*E]},(t.geo.robinson=function(){return C(d)}).raw=d,p.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return C(p)}).raw=p,m.invert=function(t,e){if(!(t*t+4*e*e>A*A+k)){var r=t,n=e,i=25;do{var o,s=Math.sin(r),l=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),h=Math.cos(n),f=Math.sin(2*n),d=u*u,p=h*h,m=l*l,g=1-p*c*c,v=g?a(h*c)*Math.sqrt(o=1/g):o=0,y=2*v*h*l-t,b=v*u-e,x=o*(p*m+v*h*c*d),_=o*(.5*s*f-2*v*u*l),w=.25*o*(f*l-v*u*p*s),M=o*(d*c+v*m*h),T=_*w-M*x;if(!T)break;var S=(b*_-y*M)/T,E=(y*w-b*x)/T;r-=S,n-=E}while((Math.abs(S)>k||Math.abs(E)>k)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return C(m)}).raw=m,g.invert=function(t,e){var r=t,n=e,i=25;do{var o,s=Math.cos(n),l=Math.sin(n),c=Math.sin(2*n),u=l*l,h=s*s,f=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-h*d*d,v=g?a(s*d)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*s*p+r/S)-t,b=.5*(v*l+n)-e,x=.5*o*(h*m+v*s*d*u)+.5/S,_=o*(f*c/4-v*l*p),w=.125*o*(c*p-v*l*h*f),M=.5*o*(u*d+v*m*s)+.5,T=_*w-M*x,A=(b*_-y*M)/T,E=(y*w-b*x)/T;r-=A,n-=E}while((Math.abs(A)>k||Math.abs(E)>k)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return C(g)}).raw=g}},{}],819:[function(t,e,r){"use strict";function n(t,e){return d.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,r){function n(t,e){var r=p.nestedProperty(s,t);r.get()!==e&&(r.set(e),p.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function a(t,e){function r(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}var a=n(0,e);return a.on("zoomstart",function(){d.select(this).style(v)}).on("zoom",function(){e.scale(d.event.scale).translate(d.event.translate),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,r)}),a}function o(t,e){function r(t){return e.invert(t)}function a(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var o,s,l,c,u,h,f,p,m=n(0,e),g=2;return m.on("zoomstart",function(){d.select(this).style(v),o=d.mouse(this),s=e.rotate(),l=e.translate(),c=s,u=r(o)}).on("zoom",function(){if(h=d.mouse(this),function(t){var n=e(r(t));return Math.abs(n[0]-t[0])>g||Math.abs(n[1]-t[1])>g}(o))return m.scale(e.scale()),void m.translate(e.translate());e.scale(d.event.scale),e.translate([l[0],d.event.translate[1]]),u?r(h)&&(p=r(h),f=[c[0]+(p[0]-u[0]),s[1],s[2]],e.rotate(f),c=f):u=r(o=h),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,a)}),m}function s(t,e){function r(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var a,o={r:e.rotate(),k:e.scale()},s=n(0,e),u=function(t){var e=0,r=arguments.length,n=[];for(;++em?(a=(f>0?90:-90)-p,i=0):(a=Math.asin(f/m)*g-p,i=Math.sqrt(m*m-f*f));var v=180-a-2*p,y=(Math.atan2(d,u)-Math.atan2(l,i))*g,b=(Math.atan2(d,u)-Math.atan2(l,-i))*g,x=c(r[0],r[1],a,y),_=c(r[0],r[1],v,b);return x<=_?[a,y,r[2]]:[v,b,r[2]]}(v,a,n);isFinite(b[0])&&isFinite(b[1])&&isFinite(b[2])||(b=n),e.rotate(b),n=b}}else a=l(e,t=s);!function(t){t({type:"zoom"})}(u.of(this,arguments))}),function(t){p++||t({type:"zoomstart"})}(u.of(this,arguments))}).on("zoomend",function(){d.select(this).style(y),b.call(s,"zoom",null),function(t){--p||t({type:"zoomend"})}(u.of(this,arguments)),i(t,e,r)}).on("zoom.redraw",function(){t.render()}),d.rebind(s,u,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*m,r=t[1]*m,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function c(t,e,r,n){var i=u(r-t),a=u(n-e);return Math.sqrt(i*i+a*a)}function u(t){return(t%360+540)%360-180}function h(t,e,r){var n=r*m,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function f(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(s)*_*(u>=0?1:-1),c.boxEnd[1]h[3]&&(c.boxEnd[1]=h[3],c.boxEnd[0]=c.boxStart[0]+(h[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(u)/_*(s>=0?1:-1),c.boxEnd[0]h[2]&&(c.boxEnd[0]=h[2],c.boxEnd[1]=c.boxStart[1]+(h[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(s=c.boxStart[0]!==c.boxEnd[0],u=c.boxStart[1]!==c.boxEnd[1],s||u?(s&&(a(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,r?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)f[p+2]&&(f[p]=-1,f[p+2]=1),(d=this[x[p]])._length=o.viewBox[p+2]-o.viewBox[p],s.doAutoRange(d),d.setScale();y(l),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,h*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":38,"mouse-change":453,"mouse-event-offset":454,"mouse-wheel":456,"right-now":511}],826:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return i.validate(t[e],c[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":613,"../../../lib":738,"../../../registry":861,"../../subplot_defaults":853,"./axis_defaults":829,"./layout_attributes":832}],832:[function(t,e,r){"use strict";function n(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"}}var i=t("./axis_attributes"),a=t("../../../lib/extend").extendFlat,o=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[o("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:a(n(0,0,1),{}),center:a(n(0,0,0),{}),eye:a(n(1.25,1.25,1.25),{}),editType:"camera"},domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"plot"},{valType:"number",min:0,max:1,editType:"plot"}],dflt:[0,1],editType:"plot"},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:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":738,"../../../lib/extend":727,"./axis_attributes":828}],833:[function(t,e,r){"use strict";function n(){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]}var i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=i(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new n;return e.merge(t),e}},{"../../../lib/str2rgbarray":760}],834:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var h=l[o[u]];if(h._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(h._length)===1/0)c[u]=[];else{h.range[0]=r[u].lo/t.dataScale[u],h.range[1]=r[u].hi/t.dataScale[u],h._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),h.range[0]===h.range[1]&&(h.range[0]-=1,h.range[1]+=1);var f=h.tickmode;if("auto"===h.tickmode){h.tickmode="linear";var d=h.nticks||i.constrain(h._length/40,4,9);n.autoTicks(h,Math.abs(h.range[1]-h.range[0])/d)}for(var p=n.calcTicks(h),m=0;mf[1][s]?d[s]=1:f[1][s]===f[0][s]?d[s]=1:d[s]=1/(f[1][s]-f[0][s]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var A=m[1][a]-m[0][a];m[0][a]-=A/32,m[1][a]+=A/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){var L=y[c=(l=u[k[a]]).type];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=E;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var I=u.aspectratio;C=[I.x,I.y,I.z]}u.aspectratio.x=h.aspectratio.x=C[0],u.aspectratio.y=h.aspectratio.y=C[1],u.aspectratio.z=h.aspectratio.z=C[2],this.glplot.aspect=C;var P=u.domain||null,D=e._size||null;if(P&&D){var z=this.container.style;z.position="absolute",z.left=D.l+P.x[0]*D.w+"px",z.top=D.t+(1-P.y[1])*D.h+"px",z.width=D.w*(P.x[1]-P.x[0])+"px",z.height=D.h*(P.y[1]-P.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),s(this.glplot.camera)},M.setCamera=function(t){this.glplot.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(t))},M.saveCamera=function(t){function e(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 r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}var a=t("../../lib"),o=t("./convert_text_opts"),s=n.prototype;s.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},s.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},s.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":a.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":a.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":a.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=o(n.textposition,n.iconsize);a.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),a.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},s.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":738,"./convert_text_opts":839}],842:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../font_attributes"),o=t("../../traces/scatter/attributes").textposition,s=t("../../plot_api/edit_types").overrideAll,l=a({});l.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=s({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:l,textposition:n.extendFlat({},o,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":613,"../../lib":738,"../../plot_api/edit_types":769,"../../traces/scatter/attributes":1054,"../font_attributes":810}],843:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){function r(t,e){return i.coerce(n,a,o.layers,t,e)}var n,a,s=t.layers||[],l=e.layers=[];for(var c=0;c=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(){p.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()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=i.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],f=t.data||[];t._transitionData||p.createTransitionData(t),n._dfltTitle={plot:h(t,"Click to enter Plot title"),x:h(t,"Click to enter X axis title"),y:h(t,"Click to enter Y axis title"),colorbar:h(t,"Click to enter Colorscale title")},n._traceWord=h(t,"trace");var d=function(t){function e(t){for(var e=!0,r=0;r=0)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),h=c.left+c.right,f=c.bottom+c.top,d=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(m.width-h)),i=Math.round(d*(m.height-f))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var v=p.layoutAttributes.width.min,y=p.layoutAttributes.height.min;n1,x=!e.height&&Math.abs(r.height-i)>1;(x||b)&&(b&&(r.width=n),x&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand){u.base={l:{val:0,size:i},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}};for(var h in u){var f=u[h].l||{},d=u[h].b||{},p=f.val,m=f.size,g=d.val,v=d.size;for(var y in u){if(a(m)&&u[y].r){var b=u[y].r.val,x=u[y].r.size;if(b>p){var _=(m*b+(x-e.width)*p)/(b-p),w=(x*(1-p)+(m-e.width)*(1-b))/(b-p);_>=0&&w>=0&&_+w>i+s&&(i=_,s=w)}}if(a(v)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>g){var T=(v*M+(k-e.height)*g)/(M-g),A=(k*(1-g)+(v-e.height)*(1-M))/(M-g);T>=0&&A>=0&&T+A>c+l&&(c=T,l=A)}}}}}if(r.l=Math.round(i),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(u.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var s,l,c=0,h=0,p=t._fullLayout._basePlotModules,m=!1;if(r)for(l=0;l=0;o--)if(x[o].enabled){r._indexToPoints=x[o]._indexToPoints;break}i&&i.calc&&(b=i.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:d,y:d}]),b[0].t||(b[0].t={}),b[0].trace=r,p[a]=b}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r){function n(t){for(var e=[],r=0;r=0?f.angularAxis.domain:n.extent(M),E=Math.abs(M[1]-M[0]);T&&!k&&(E=0);var L=S.slice();A&&k&&(L[1]+=E);var C=f.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),f.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var I=f.angularAxis.ticksStep||(L[1]-L[0])/(C*(f.minorTicks+1));w&&(I=Math.max(Math.round(I),1)),L[2]||(L[2]=I);var P=n.range.apply(this,L);if(P=P.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===f.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=A?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var D=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),z=this.appendChild(this.ownerDocument.importNode(D.documentElement,!0));t=n.select(z)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,F=t.select(".chart-group"),R={fill:"none",stroke:f.tickColor},j={"font-size":f.font.size,"font-family":f.font.family,fill:f.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+f.font.outlineColor}).join(",")};if(f.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[b,f.margin.top]+")"}).style({display:"block"});var N=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:N,reverseOrder:f.legend.reverseOrder})})();var B=O.node().getBBox();b=Math.min(f.width-B.width-f.margin.left-f.margin.right,f.height-f.margin.top-f.margin.bottom)/2,b=Math.max(10,b),_=[f.margin.left+b,f.margin.top+b],r.range([0,b]),u.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[_[0]+b,_[1]-b]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:f.width,height:f.height}).style({opacity:f.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(f.width-(f.margin.left+f.margin.right+2*b+(B?B.width:0)))/2,(f.height-(f.margin.top+f.margin.bottom+2*b))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),f.title){var V=t.select("g.title-group text").style(j).text(f.title),H=V.node().getBBox();V.attr({x:_[0]-H.width/2,y:_[1]-b-20})}var q=t.select(".radial.axis-group");if(f.radialAxis.gridLinesVisible){var G=q.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(R),G.attr("r",r),G.exit().remove()}q.select("circle.outside-circle").attr({r:b}).style(R);var Y=t.select("circle.background-circle").attr({r:b}).style({fill:f.backgroundColor,stroke:f.stroke});if(f.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);q.call(W).attr({transform:"rotate("+f.radialAxis.orientation+")"}),q.selectAll(".domain").style(R),q.selectAll("g>text").text(function(t,e){return this.textContent+f.radialAxis.ticksSuffix}).style(j).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===f.radialAxis.tickOrientation?"rotate("+-f.radialAxis.orientation+") translate("+[0,j["font-size"]]+")":"translate("+[0,j["font-size"]]+")"}}),q.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(P),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+c(t)+")"}}).style({display:f.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(f.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(f.minorTicks+1)==0)}).style(R),Z.selectAll(".minor").style({stroke:f.minorTickColor}),X.select("line.grid-line").attr({x1:f.tickLength?b-f.tickLength:0,x2:b}).style({display:f.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(j);var J=X.select("text.axis-text").attr({x:b+f.labelOffset,dy:a+"em",transform:function(t,e){var r=c(t),n=b+f.labelOffset,i=f.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:f.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(f.minorTicks+1)!=0?"":w?w[t]+f.angularAxis.ticksSuffix:t+f.angularAxis.ticksSuffix}).style(j);f.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(f.minorTicks+1)!=0?"":f.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[b+K,f.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(p);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),p[0]||Q){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=f.orientation,n.direction=f.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!k){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ct.attr({x2:-b,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-f.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(b+12,r+180);ot.text(o.util.round(rt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(Y).radius);var i=o.util.convertToCartesian(n,f.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,h=this.getBoundingClientRect(),f=t.node().getBoundingClientRect(),d=[h.left+h.width/2-U[0]-f.left,h.top+h.height/2-U[1]-f.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},f.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},f.getLiveConfig=function(){return u},f.getinputConfig=function(){return c},f.radialScale=function(t){return r},f.angularScale=function(t){return s},f.svg=function(){return t},n.rebind(f,h,"on"),f},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var h=t.angularScale.range(),f=Math.abs(h[1]-h[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-f/2}).endAngle(function(t){return f/2}).innerRadius(function(e){return t.radialScale(l+(e[2]||0))}).outerRadius(function(e){return t.radialScale(l+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(e,r){return"rotate("+(t.orientation+s(e[0])+90)+")"}})};var p={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(p).each(c[t.geometryType]),g.exit().remove(),m.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],o.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,h=u?r.height:c*o.length,f=s.classed("legend-group",!0).selectAll("svg").data([0]),d=f.enter().append("svg").attr({width:300,height:h+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),g=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,h]);if(u){var v=f.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),f.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var y=f.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){return function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()}(t.symbol,c)},fill:function(t,e){return m(e)}}),y.exit().remove()}var b=n.svg.axis().scale(g).orient("right"),x=f.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(b);return x.selectAll(".domain").style({fill:"none",stroke:"none"}),x.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),x.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",h=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(h);var f=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*f+l,g=d.height+2*f;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*f]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../constants/alignment":711,"../../lib":738,d3:123}],851:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(h=i),n.select(n.select(h).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(h),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,h,f=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){f.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){f.undo()},e.redo=function(){f.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../components/color":613,"../../lib":738,"./micropolar":850,"./undo_manager":852,d3:123}],852:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":613,"../../subplot_defaults":853,"./axis_defaults":857,"./layout_attributes":859}],859:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("./axis_attributes"),a=t("../../../plot_api/edit_types").overrideAll;e.exports=a({domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:i,baxis:i,caxis:i},"plot","from-root")},{"../../../components/color/attributes":612,"../../../plot_api/edit_types":769,"./axis_attributes":856}],860:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=l._,u=t("../../components/color"),h=t("../../components/drawing"),f=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),m=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),b=t("../cartesian/select"),x=t("../cartesian/constants");e.exports=n;var _=n.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*b?i=(a=b)*w:a=(i=y)/w,o=g*i/y,s=v*a/b,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=x,l.xaxis={type:"linear",range:[_+2*k-x,x-_-2*M],domain:[p-o/2,p+o/2],_id:"x"},f(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[_,x-M-k],domain:[m-s/2,m+s/2],_id:"y"},f(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var T=l.yaxis.domain[0],A=l.aaxis=d({},t.aaxis,{visible:!0,range:[_,x-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[T,T+s*w],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});f(A,l.graphDiv._fullLayout),A.setScale();var S=l.baxis=d({},t.baxis,{visible:!0,range:[x-_-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});f(S,l.graphDiv._fullLayout),S.setScale(),A._counteraxis=S;var E=l.caxis=d({},t.caxis,{visible:!0,range:[x-_-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[T,T+s*w],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});f(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var I="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",I),l.clipDefRelative.select("path").attr("transform",null);var P="translate("+(r-S._offset)+","+(n+a)+")";l.layers.baxis.attr("transform",P),l.layers.bgrid.attr("transform",P);var D="translate("+(r+i/2)+","+n+")rotate(30)translate(0,-"+A._offset+")";l.layers.aaxis.attr("transform",D),l.layers.agrid.attr("transform",D);var z="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,-"+E._offset+")";l.layers.caxis.attr("transform",z),l.layers.cgrid.attr("transform",z),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",A.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,A.linecolor||"#000").style("stroke-width",(A.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),h.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(m.doTicks(e,n,!0),m.doTicks(e,i,!0),m.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));y.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:c(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var s=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;y.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:c(e,"Click to enter Component B title"),attributes:{x:this.x0-s,y:this.y0+this.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),y.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:c(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+s,y:this.y0+this.h+.83*a.titlefont.size+s,"text-anchor":"middle"}})}};var M=x.MINZOOM/2+.87,k="m-0.87,.5h"+M+"v3h-"+(M+5.2)+"l"+(M/2+2.6)+",-"+(.87*M+4.5)+"l2.6,1.5l-"+M/2+","+.87*M+"Z",T="m0.87,.5h-"+M+"v3h"+(M+5.2)+"l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-2.6,1.5l"+M/2+","+.87*M+"Z",A="m0,1l"+M/2+","+.87*M+"l2.6,-1.5l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-"+(M/2+2.6)+","+(.87*M+4.5)+"l2.6,1.5l"+M/2+",-"+.87*M+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;_.initInteractions=function(){function t(t,e){return 1-e/O.h}function e(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function r(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function n(n,i){var a=m+n,o=y+i,s=Math.max(0,Math.min(1,t(0,y),t(0,o))),l=Math.max(0,Math.min(1,e(m,y),e(a,o))),c=Math.max(0,Math.min(1,r(m,y),r(a,o))),u=(s/2+c)*O.w,h=(1-s/2-l)*O.w,f=(u+h)/2,d=h-u,p=(1-s)*O.h,g=p-d/w;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),z.transition().style("opacity",1).duration(200),P=!0)}function a(){if(i(R),L!==_){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t),E&&R.data&&R._context.showTips&&(l.notifier(c(R,"Double-click to zoom back out"),"long"),E=!1)}}function f(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m,i=[(L={a:_.a-n,b:_.b+(r+n)/2,c:_.c-(r-n)/2}).a,L.b,L.c].sort(),a=i.indexOf(L.a),o=i.indexOf(L.b),s=i.indexOf(L.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),L={a:i[a],b:i[o],c:i[s]},e=(_.a-L.a)*O.yaxis._m,t=(_.c-L.c-_.b+L.b)*O.xaxis._m);var l="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",l);var c="translate("+-t+","+-e+")";O.clipDefRelative.select("path").attr("transform",c),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(h.hideOutsideRangePoints,O)}function d(){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t)}function p(){j.selectAll(".select-outline").remove()}var m,y,_,M,L,C,I,P,D,z,O=this,F=O.layers.plotbg.select("path").node(),R=O.graphDiv,j=R._fullLayout._zoomlayer,N={element:F,gd:R,plotinfo:{xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(t,e,r){N.xaxes=[O.xaxis],N.yaxes=[O.yaxis];var i=R._fullLayout.dragmode;t.shiftKey&&(i="pan"===i?"zoom":"pan"),N.minDrag="lasso"===i?1:void 0,"zoom"===i?(N.moveFn=n,N.doneFn=a,function(t,e,r){var n=F.getBoundingClientRect();m=e-n.left,y=r-n.top,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,M=O.aaxis.range[1]-_.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),I="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",P=!1,D=j.append("path").attr("class","zoombox").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",I),z=j.append("path").attr("class","zoombox-corners").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}(0,e,r)):"pan"===i?(N.moveFn=f,N.doneFn=d,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,p()):"select"!==i&&"lasso"!==i||b(t,e,r,N,i)},clickFn:function(t,e){if(i(R),2===t){var r={};r[O.id+".aaxis.min"]=0,r[O.id+".baxis.min"]=0,r[O.id+".caxis.min"]=0,R.emit("plotly_doubleclick",null),s.relayout(R,r)}v.click(R,e,O.id)}};F.onmousemove=function(t){v.hover(R,t,O.id),R._fullLayout._lasthover=F,R._fullLayout._hoversubplot=O.id},F.onmouseout=function(t){R._dragging||g.unhover(R,t)},g.init(N)}},{"../../components/color":613,"../../components/dragelement":635,"../../components/drawing":638,"../../components/fx":655,"../../components/titles":704,"../../lib":738,"../../lib/extend":727,"../../plotly":780,"../cartesian/axes":785,"../cartesian/constants":790,"../cartesian/select":802,"../cartesian/set_convert":803,"../plots":846,d3:123,tinycolor2:543}],861:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=a.extendFlat,s=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,l=t.layout,c=s([],a),u=s({},l,n(e.tileClass)),h=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var f=Object.keys(u);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(w),w=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}(w),w=w.replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},{"../components/color":613,"../components/drawing":638,"../constants/xmlns_namespaces":719,"../lib":738,d3:123}],870:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&E>0&&(S<=F&&E<=R||S<=R&&E<=F||("h"===M?F>=S*(R/E):R>=E*(F/S)))?m="inside":(m="outside",T.remove(),T=null)}else m="inside";if(!T&&(T=d(e,k,"outside"===m?I:C),A=p.bBox(T.node()),S=A.width,E=A.height,S<=0||E<=0))T.remove();else{var j;j="outside"===m?function(t,e,r,n,a,o,s){var l,c="h"===o?Math.abs(n-r):Math.abs(e-t);c>2*w&&(l=w);var u=1;s&&(u="h"===o?Math.min(1,c/a.height):Math.min(1,c/a.width));var h,f,d,p,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2;h=u*a.width,f=u*a.height,"h"===o?er?(d=(t+e)/2,p=n+l+f/2):(d=(t+e)/2,p=n-l-f/2);return i(m,g,d,p,u,!1)}(l,c,u,h,A,M,"both"===g.constraintext||"outside"===g.constraintext):function(t,e,r,n,a,o,s){var l,c,u,h,f,d=a.width,p=a.height,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*w&&y>2*w?(v-=2*(f=w),y-=2*f):f=0;var b,x;d<=v&&p<=y?(b=!1,x=1):d<=y&&p<=v?(b=!0,x=1):dr?(u=(t+e)/2,h=n-f-c/2):(u=(t+e)/2,h=n+f+c/2);return i(m,g,u,h,x,b)}(l,c,u,h,A,M,"both"===g.constraintext||"inside"===g.constraintext),T.attr("transform",j)}}}function i(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");return"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function a(t,e,r,n){var i=o((e=e||{}).family,r),a=o(e.size,r),l=o(e.color,r);return{family:s(t.family,i,n.family),size:function(t,e,r){if(c(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&ei;if(!a)return e}return void 0!==r?r:t.dflt}(t.size,a,n.size),color:function(t,e,r){return u(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function o(t,e){var r;return Array.isArray(t)?e=2?h(t):t>e?Math.ceil(t):Math.floor(t)}var g,v,y,b,x=r.p+(p?f[s]:f),_=x+r.w,w=r.b,M=w+r.s;if("h"===u.orientation?(y=a.c2p(x,!0),b=a.c2p(_,!0),g=i.c2p(w,!0),v=i.c2p(M,!0),r.ct=[v,(y+b)/2]):(g=i.c2p(x,!0),v=i.c2p(_,!0),y=a.c2p(w,!0),b=a.c2p(M,!0),r.ct=[(g+v)/2,b]),c(g)&&c(v)&&c(y)&&c(b)&&g!==v&&y!==b){var k=(r.mlw+1||u.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,T=l.round(k/2%1,2);if(!t._context.staticPlot){var A=d.opacity(r.mc||u.marker.color)<1||k>.01?h:m;v=A(v,g=A(g,v)),b=A(b,y=A(y,b))}var S=l.select(this);S.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+g+","+y+"V"+b+"H"+v+"V"+y+"Z"),n(t,S,e,s,g,v,y,b)}else l.select(this).remove()})}),s.call(m.plot,e)}},{"../../components/color":613,"../../components/drawing":638,"../../components/errorbars":644,"../../lib":738,"../../lib/svg_text_utils":761,"./attributes":871,d3:123,"fast-isnumeric":132,tinycolor2:543}],879:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;ru+s||!p(l))&&(f=!0,c(h,t))}for(var i=r.traces,a=d(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,h=[l,u],f=!1,g=0;g1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){function e(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}var r,a=n.select(this);a.classed("bartext-inside")?r=s.insidetextfont:a.classed("bartext-outside")&&(r=s.outsidetextfont),r||(r=s.textfont),i.font(a,e("family"),e("size"),e("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":638,"../../components/errorbars":644,d3:123}],883:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":613,"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627}],884:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":612,"../../lib/extend":727,"../scatter/attributes":1054}],885:[function(t,e,r){"use strict";function n(t,e){return t.v-e.v}function i(t){return t.v}var a=t("fast-isnumeric"),o=t("../../lib"),s=o._,l=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,c,u,h,f,d=t._fullLayout,p=l.getFromId(t,e.xaxis||"x"),m=l.getFromId(t,e.yaxis||"y"),g=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=p,u="x",h=m,f="y"):(c=m,u="y",h=p,f="x");var y=c.makeCalcdata(e,u),b=function(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||a(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;var l=r.d2c(s,0,t[e+"calendar"]);return n.map(function(){return l})}(e,f,h,y,d[v]),x=o.distinctVals(b),_=x.vals,w=x.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var C=A[r].sort(n),I=C.map(i),P=I.length,D={pos:_[r],pts:C};D.min=I[0],D.max=I[P-1],D.mean=o.mean(I,P),D.sd=o.stdev(I,P,D.mean),D.q1=o.interp(I,.25),D.med=o.interp(I,.5),D.q3=o.interp(I,.75),D.lf=Math.min(D.q1,I[Math.min(o.findBin(2.5*D.q1-1.5*D.q3,I,!0)+1,P-1)]),D.uf=Math.max(D.q3,I[Math.max(o.findBin(2.5*D.q3-1.5*D.q1,I),0)]),D.lo=4*D.q1-3*D.q3,D.uo=4*D.q3-3*D.q1,g.push(D)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r0?(g[0].t={num:d[v],dPos:w,posLetter:f,valLetter:u,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},d[v]++,g):[{t:{empty:!0}}]}},{"../../lib":738,"../../plots/cartesian/axes":785,"fast-isnumeric":132}],886:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a=r("y"),s=r("x");if(a&&a.length)i="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",r("y0")}o.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function i(t,e,r,n){var i=n.prefix,o=a.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",o||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),a.coerceSelectionMarkerOpacity(e,r)}var a=t("../../lib"),o=t("../../registry"),s=t("../../components/color"),l=t("./attributes");e.exports={supplyDefaults:function(t,e,r,o){function c(r,n){return a.coerce(t,e,l,r,n)}n(t,e,c,o),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",s.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),i(t,e,c,{prefix:"box"}))},handleSampleDefaults:n,handlePointsDefaults:i}},{"../../components/color":613,"../../lib":738,"../../registry":861,"./attributes":884}],887:[function(t,e,r){"use strict";function n(t,e,r,n){var i,c,u,h,f,d,p,m,g,v=t.cd,y=t.xa,b=t.ya,x=v[0].trace,_=v[0].t,w="violin"===x.type,M=[],k="closest"!==n||w?_.bdPos:2.5*_.bdPos,T=function(t){return t.pos+_.bPos-d};w&&"both"!==x.side?("positive"===x.side&&(g=function(t){var e=T(t);return s.inbox(e,e+k)}),"negative"===x.side&&(g=function(t){var e=T(t);return s.inbox(e-k,e)})):g=function(t){var e=T(t);return s.inbox(e-k,e+k)};var A;A=w?function(t){return s.inbox(t.span[0]-f,t.span[1]-f)}:function(t){return s.inbox(t.min-f,t.max-f)},"h"===x.orientation?(f=e,d=r,p=A,m=g,i="y",u=b,c="x",h=y):(f=r,d=e,p=g,m=A,i="x",u=y,c="y",h=b);var S=s.getDistanceFunction(n,p,m);if(s.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],L=x.line.color,C=(x.marker||{}).color;l.opacity(L)&&x.line.width?t.color=L:l.opacity(C)&&x.boxpoints?t.color=C:t.color=x.fillcolor,t[i+"0"]=u.c2p(E.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(E.pos+_.bPos+_.bdPos,!0),a.tickText(u,u.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var I={},P=["med","min","q1","q3","max"];(x.boxmean||(x.meanline||{}).visible)&&P.push("mean"),(x.boxpoints||x.points)&&P.push("lf","uf");for(var D=0;Dt.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*o,u=o*f,m=[],g=0;if(r.jitter){if(0===o)for(g=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(c.translatePoints,a,o)}function o(t,e,r,n){var i,a,o=e.pos,c=e.val,u=n.bPos,h=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(l.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+u,!0)+h,n=o.c2p(t.pos+u-i,!0)+h,l=o.c2p(t.pos+u+a,!0)+h,f=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?s.select(this).attr("d","M"+f+","+n+"V"+l+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+f+","+n+"L"+p+","+e+"Z":"")):s.select(this).attr("d","M"+n+","+f+"H"+l+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+f+"L"+e+","+p+"Z":""))})}var s=t("d3"),l=t("../../lib"),c=t("../../components/drawing"),u=2e9,h=5,f=.01;e.exports={plot:function(t,e,r){var n=t._fullLayout,l=e.xaxis,c=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e=t[0],r=e.t,u=e.trace,h=e.node3=s.select(this),f=n._numBoxes,d="group"===n.boxmode&&f>1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?f:1),m=d?2*r.dPos*((r.num+.5)/f-.5)*(1-n.boxgap):0,g=p*u.whiskerwidth;if(!0!==u.visible||r.empty)s.select(this).remove();else{var v,y;"h"===u.orientation?(v=c,y=l):(v=l,y=c),r.bPos=m,r.bdPos=p,r.wdPos=g,i(h,{pos:v,val:y},u,r),u.boxpoints&&a(h,{x:l,y:c},u,r),u.boxmean&&o(h,{pos:v,val:y},u,r)}})},plotBoxAndWhiskers:i,plotPoints:a,plotBoxMean:o}},{"../../components/drawing":638,"../../lib":738,d3:123}],892:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,I=E>0?Math.ceil:Math.floor,P=E>0?Math.min:Math.max,D=E>0?Math.max:Math.min,z=C(A+L),O=I(S-L),F=[[u=T(A)]];for(i=z;i*E=0;i--)a[u-i]=t[h][i],o[u-i]=e[h][i];for(s.push({x:a,y:o,bicubic:l}),i=h,a=[],o=[];i>=0;i--)a[h-i]=t[i][0],o[h-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],907:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,h,f,d,p,g,v=[],y=[],b={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(z-2,i))),s=i-o,b.length=z,b.crossLength=D,b.xy=function(e){return t.evalxy([],e,i)},b.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(f=t.dxydi([],n-1,o,0,s),v.push(l[0]+f[0]/3),y.push(l[1]+f[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(h[0]-d[0]/3),y.push(h[1]-d[1]/3)),v.push(h[0]),y.push(h[1]),l=h;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(D-2,n))),u=n-c,b.length=D,b.crossLength=z,b.xy=function(e){return t.evalxy([],n,e)},b.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],c,i-1,u,1),v.push(h[0]-g[0]/3),y.push(h[1]-g[1]/3)),v.push(h[0]),y.push(h[1]),l=h;return b.axisLetter=r,b.axis=M,b.crossAxis=E,b.value=e,b.constvar=a,b.index=m,b.x=v,b.y=y,b.smoothing=E.smoothing,b}function s(e){var n,i,o,s,l,c=[],u=[],h={};if(h.length=w.length,h.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(z-2,e)),l=Math.min(1,Math.max(0,e-o)),h.xy=function(r){return t.evalxy([],r,e)},h.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(b=w[u],x=w[y],l=0;lw[w.length-1]||T.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(h=5e-15,d=(f=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+h)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+h))].sort(function(t,e){return t-e}))[0],p=f[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||T.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&A.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&A.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":727,"../../plots/cartesian/axes":785}],908:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],924:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],l=r[0].trace,c=e.xaxis,f=e.yaxis,d=l.aaxis,p=l.baxis,m=t._fullLayout,g=e.plot.selectAll(".carpetlayer"),v=m._clips,y=n(g,"g","carpet"+l.uid).classed("trace",!0),b=n(y,"g","minorlayer"),x=n(y,"g","majorlayer"),_=n(y,"g","boundarylayer"),w=n(y,"g","labellayer");y.style("opacity",l.opacity),a(c,f,x,d,"a",d._gridlines),a(c,f,x,p,"b",p._gridlines),a(c,f,b,d,"a",d._minorgridlines),a(c,f,b,p,"b",p._minorgridlines),a(c,f,_,d,"a-boundary",d._boundarylines),a(c,f,_,p,"b-boundary",p._boundarylines);!function(t,e,r,n,i,a,o,l){var c,u,h,f;c=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],h=r.ab2xy(c,u,!0),f=r.dxyda_rough(c,u),s(t,e,r,n,h,f,r.aaxis,i,a,o,"a-title"),c=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),h=r.ab2xy(c,u,!0),f=r.dxydb_rough(c,u),s(t,e,r,n,h,f,r.baxis,i,a,l,"b-title")}(t,w,l,i,c,f,o(t,c,f,l,i,w,d._labels,"a-label"),o(t,c,f,l,i,w,p._labels,"b-label")),function(t,e,r,i,a){var o,s,l,c,f=r.select("#"+t._clipPathId);f.size()||(f=r.append("clipPath").classed("carpetclip",!0));var d=n(f,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(c.font,i.font).text(i.text).call(d.convertToTspans,t),p=c.bBox(this);u.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*p.height+")"),h=Math.max(h,p.width+i.axis.labelpadding)}),u.exit().remove(),h}function s(t,e,r,n,i,a,o,s,u,h,p){var m=[];o.title&&m.push(o.title);var g=e.selectAll("text."+p).data(m);g.enter().append("text").classed(p,!0),g.each(function(){var e=f(r,s,u,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(h=0),h+=o.titlefont.size+o.titleoffset;l.select(this).text(o.title||"").call(d.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+h+")").classed("user-select-none",!0).attr("text-anchor","middle").call(c.font,o.titlefont)}),g.exit().remove()}var l=t("d3"),c=t("../../components/drawing"),u=t("./map_1d_array"),h=t("./makepath"),f=t("./orient_text"),d=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},h.c2p=function(t){return t},f.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,h.smoothing,f.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,h.smoothing,f.smoothing),t.dxydi=s([t.xctrl,t.yctrl],h.smoothing,f.smoothing),t.dxydj=l([t.xctrl,t.yctrl],h.smoothing,f.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var h,f,d,p,m=0,g=0,v=[];ne[c-1]?(h=c-2,f=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):f=o-(h=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(d=u-2,p=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,h,d,f,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,h,d,f,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":756,"./compute_control_points":911,"./constants":912,"./create_i_derivative_evaluator":913,"./create_j_derivative_evaluator":914,"./create_spline_evaluator":915}],926:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){function i(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&o0&&a1e-5);return n.log("Smoother converged to",k,"after",T,"iterations"),t}},{"../../lib":738}],927:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":969,"./has_columns":917}],928:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":614,"../../components/colorscale/attributes":619,"../../lib/extend":727,"../../plots/attributes":783,"../scattergeo/attributes":1093}],929:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;cl&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":623,"../../lib":738,"./attributes":928}],931:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],932:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,h=u[0].trace,f=t.subplot;for(s=0;s")}(t,h,o,f.mockAxis),[t]}},{"../../plots/cartesian/axes":785,"../scatter/fill_hover_text":1062,"./attributes":928}],933:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":814,"../heatmap/colorbar":968,"./attributes":928,"./calc":929,"./defaults":930,"./event_data":931,"./hover":932,"./plot":934,"./select":935,"./style":936}],934:[function(t,e,r){"use strict";function n(t,e){for(var r=t[0].trace,n=t.length,i=s(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,s=t.geometry,l=s.coordinates,c=t.id,u=[];r="RUS"===c||"FJI"===c?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var s=o.tester(n);s.pts.pop(),u.push(s)}:function(t){u.push(o.tester(t))};switch(s.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,h=e._input.contours;if(c>u&&(s.start=h.start=u,u=s.end=h.end=c,c=s.start),!(s.size>0)){var f;f=c===u?1:n(c,u,e.ncontours).dtick,h.size=s.size=f}}return r}},{"../../lib":738,"../../plots/cartesian/axes":785,"../heatmap/calc":966}],939:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,h=c.size||1,f=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===f&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===f||"heatmap"===f?d:"").line({color:"lines"===f?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:h}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":617,"../../plots/plots":846,"./end_plus":943,"./make_color_map":947}],940:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],941:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,"contours.start"),o=n.coerce2(t,e,i,"contours.end"),s=!1===a||!1===o,l=r("contours.size");!(s?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{"../../lib":738,"./attributes":937}],942:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)):e.visible=!1}},{"../../lib":738,"../heatmap/has_columns":972,"../heatmap/xyz_defaults":981,"./attributes":937,"./contours_defaults":941,"./style_defaults":951}],943:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],944:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==l.BOTTOMSTART.indexOf(t)?i=1:-1!==l.LEFTSTART.indexOf(t)?n=1:-1!==l.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),g=[o(t,e,[-m[0],-m[1]])],v=m.join(","),y=t.z.length,b=t.z[0].length;for(h=0;h<1e4;h++){if(p>20?(p=l.CHOOSESADDLE[p][(m[0]||m[1])<0?0:1],t.crossings[d]=l.SADDLEREMAINDER[p]):delete t.crossings[d],!(m=l.NEWDELTA[p])){s.log("Found bad marching index:",p,e,t.level);break}g.push(o(t,e,m)),e[0]+=m[0],e[1]+=m[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),d=e.join(",");var x=m[0]&&(e[0]<0||e[0]>b-2)||m[1]&&(e[1]<0||e[1]>y-2);if(d===f&&m.join(",")===v||r&&x)break;p=t.crossings[d]}1e4===h&&s.log("Infinite loop in contour?");var _,w,M,k,T,A,S,E,L,C,I,P=n(g[0],g[g.length-1],a,c),D=0,z=.2*t.smoothing,O=[],F=0;for(h=1;h=F;h--)if((_=O[h])=F&&_+O[w]E&&L--,t.edgepaths[L]=I.concat(g,C));break}N||(t.edgepaths[E]=g.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r)return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208;return 15===r?0:r}((c=t[u]).level,s))&&(c.crossings[o]=l,-1!==i.indexOf(l)&&(c.starts.push([e,r]),p&&-1!==i.indexOf(l,i.indexOf(l)+1)&&c.starts.push([e,r])))}},{"./constants":940}],949:[function(t,e,r){"use strict";function n(t,e,n){var l=n[0].trace,c=n[0].x,u=n[0].y,g=l.contours,v=l.uid,y=e.xaxis,b=e.yaxis,x=t._fullLayout,_="contour"+v,w=function(t,e,r){for(var n=t.size,i=[],a=p(t),s=t.start;s1e3){o.warn("Too many contours, clipping at 1000",t);break}return i}(g,e,n[0]);if(!0!==l.visible)return x._paper.selectAll("."+_+",.hm"+v).remove(),void x._infolayer.selectAll(".cb"+v).remove();"heatmap"===g.coloring?(l.zauto&&!1===l.autocontour&&(l._input.zmin=l.zmin=g.start-g.size/2,l._input.zmax=l.zmax=l.zmin+w.length*g.size),h(t,e,[n])):(x._paper.selectAll(".hm"+v).remove(),x._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+v).remove()),f(w),d(w);var M=y.c2p(c[0],!0),k=y.c2p(c[c.length-1],!0),T=b.c2p(u[0],!0),A=b.c2p(u[u.length-1],!0),S=[[M,A],[k,A],[k,T],[M,T]],E=r.makeContourGroup(e,n,_);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(E,S,g),function(t,e,r,n){var o=t.selectAll("g.contourfill").data([0]);o.enter().append("g").classed("contourfill",!0);var s=o.selectAll("path").data("fill"===n.coloring?e:[]);s.enter().append("path"),s.exit().remove(),s.each(function(t){var e=i(t,r);e?a.select(this).attr("d",e).style("stroke","none"):a.select(this).remove()})}(E,w,S,g),function(t,e,n,i,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var h=!1!==l.showlines,f=l.showlabels,d=h&&f,p=r.createLines(u,h||f,e),g=r.createLineClip(u,d,n._fullLayout._clips,i.trace.uid),v=t.selectAll("g.contourlabels").data(f?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),f){var y=[c],b=[];o.clearLocationCache();var x=r.labelFormatter(l,i.t.cb,n._fullLayout),_=s.tester.append("text").attr("data-notex",1).call(s.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var T=Math.sqrt(w*w+M*M),A=m.LABELDISTANCE*T/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,x,_,n);a.select(this).selectAll("path").each(function(){var t=o.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/A),m.LABELMAX),i=0;i=0&&(c=b,h=f):Math.abs(l[1]-c[1])<.01?Math.abs(l[1]-b[1])<.01&&(b[0]-l[0])*(c[0]-b[0])>=0&&(c=b,h=f):o.log("endpt to newendpt is not vert. or horz.",l,c,b)}if(l=c,h>=0)break;m+="L"+c}if(h===t.edgepaths.length){o.log("unclosed perimeter path");break}g=h,(y=-1===v.indexOf(g))&&(g=v[0],m+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*a)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(h)+Math.cos(c)*a);if(f<1||d<1)return 1/0;var p=g.EDGECOST*(1/(f-1)+1/(d-1));p+=g.ANGLECOST*c*c;for(var m=s-u,v=l-h,y=s+u,b=l+h,x=0;x2*g.MAXCOST)break;d&&(s/=2),l=(a=c-s/2)+1.5*s}if(f<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),h=i*u,f=a*c,d=i*c,p=-a*u,m=[[o-h-f,s-d-p],[o+h-f,s+d-p],[o+h+f,s+d+p],[o-h+f,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;a.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(l.convertToTspans,r)}),i){for(var s="",c=0;cb.end&&(b.start=b.end=(b.start+b.end)/2),e._input.contours=a({},b)}else{var _=b.start,w=b.end,M=e._input.contours;if(_>w&&(b.start=M.start=w,w=b.end=M.end=_,_=b.start),!(b.size>0)){var k;k=_===w?1:n(_,w,e.ncontours).dtick,M.size=b.size=k}}return y}}},{"../../components/colorscale/calc":620,"../../lib":738,"../../plots/cartesian/axes":785,"../carpet/lookup_carpetid":919,"../heatmap/clean_2d_array":967,"../heatmap/convert_column_xyz":969,"../heatmap/find_empties":971,"../heatmap/has_columns":972,"../heatmap/interp2d":975,"../heatmap/make_bound_array":976,"../heatmap/max_row_length":977,"./defaults":959}],954:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-1/0,h=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],955:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],956:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":955,"fast-isnumeric":132}],957:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":956,"fast-isnumeric":132}],958:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":738}],961:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":796,"../contour/colorbar":939,"../contour/style":950,"./attributes":952,"./calc":953,"./defaults":959,"./plot":964}],962:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function h(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,x=_):Math.abs(v[1]-y[1])=0&&(y=L,x=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(x>=0)break;M+=m(v,y),v=y}if(x===e.edgepaths.length){a.log("unclosed perimeter path");break}g=x,(T=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;U--)j=k.clipsegments[U],N=l([],j.x,L.c2p),B=l([],j.y,C.c2p),N.reverse(),B.reverse(),H.push(c(N,B,j.bicubic));var q="M"+H.join("L")+"Z";!function(t,e,r,n,i,a){var o,s,u,h,f=t.selectAll("g.contourbg").data([0]);f.enter().append("g").classed("contourbg",!0);var d=f.selectAll("path").data("fill"!==a||i?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(h=0;hb&&(n.max=b);n.len=n.max-n.min}(this,r,t,n,f,e.height),!(n.len<(e.width+e.height)*m.LABELMIN)))for(var s=Math.min(Math.ceil(n.len/P),m.LABELMAX),l=0;lI){r("x scale is not linear");break}}if(y.length&&"fast"===L){var P=(y[y.length-1]-y[0])/(y.length-1),D=Math.abs(P/100);for(w=0;wD){r("y scale is not linear");break}}}var z=u(_),O="scaled"===e.xtype?"":m,F=p(e,O,g,v,z,k),R="scaled"===e.ytype?"":y,j=p(e,R,b,x,_.length,T);E||(a.expand(k,F),a.expand(T,j));var N={x:F,y:j,z:_,text:e.text};if(S&&(N.xRanges=M.xRanges,N.yRanges=M.yRanges,N.pts=M.pts),s(e,_,"","z"),A&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};N.xfill=p(B,O,g,v,z,k),N.yfill=p(B,R,b,x,_.length,T)}return[N]}},{"../../components/colorscale/calc":620,"../../lib":738,"../../plots/cartesian/axes":785,"../../registry":861,"../histogram2d/calc":998,"./clean_2d_array":967,"./convert_column_xyz":969,"./find_empties":971,"./has_columns":972,"./interp2d":975,"./make_bound_array":976,"./max_row_length":977}],967:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,c;if(e){for(i=0,l=0;l=0;o--)(s=((h[[(r=(a=f[o])[0])-1,i=a[1]]]||m)[2]+(h[[r+1,i]]||m)[2]+(h[[r,i-1]]||m)[2]+(h[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],f.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)h[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":977}],972:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],973:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=x[0].length||d<0||d>x.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-b[0],r-b[b.length-1])>o)return;if(c){var A;for(k=[2*y[0]-y[1]],A=1;Am&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":738}],976:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],h=n.traceIs(t,"contour"),f=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!f&&"category"!==o.type){var p=e.length;if(!(p<=a))return h?e.slice(0,a):e.slice(0,a+1);if(h||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)x=m.c2p(A[k]),k--;for(x0;)M=g.c2p(S[k]),k--;if(M0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c){var l=a(e,i,o),u=a(r,i,o),h=t===s?0:1;return l[h]!==u[h]}return Math.floor(r/t)-Math.floor(e/t)>.1}(f,t,e,l,r,n))break;u=f}return u}function i(t,e){return e&&t>f?t>c?t>1.1*s?s:t>1.1*l?l:c:t>u?u:t>h?h:f:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r){var n=e.c2d(t,s,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var o=t("../../constants/numerical"),s=o.ONEAVGYEAR,l=o.ONEAVGMONTH,c=o.ONEDAY,u=o.ONEHOUR,h=o.ONEMIN,f=o.ONESEC,d=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,l,u=-1.1*e,h=-.1*e,f=t-h,p=r[0],m=r[1],g=Math.min(n(p+h,p+f,i,a),n(m+h,m+f,i,a)),v=Math.min(n(p+u,p+h,i,a),n(m+u,m+h,i,a));if(g>v&&vc){var y=o===s?1:6,b=o===s?"M12":"M1";return function(e,r){var n=i.c2d(e,s,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cp.size/1.9?p.size:p.size/Math.ceil(p.size/x);var A=p.start+(p.size-x)/2;_=A-x*Math.ceil((A-_)/x)}for(h=0;h=0&&w=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}(a,b.direction,b.currentbin);var Z=Math.min(i.length,a.length),J=[],K=0,Q=Z-1;for(r=0;r=K;r--)if(a[r]){Q=r;break}for(r=K;r<=Q;r++)if(o(i[r])&&o(a[r])){var $={p:i[r],s:a[r],b:0};b.enabled||($.pts=I[r],H?$.p0=$.p1=I[r].length?T[I[r][0]]:i[r]:($.p0=X(S[r]),$.p1=X(S[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=l.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),c(J,e),Array.isArray(e.selectedpoints)&&s.tagSelected(J,e,Y),J}}},{"../../constants/numerical":717,"../../lib":738,"../../plots/cartesian/axes":785,"../bar/arrays_to_calcdata":870,"./average":986,"./bin_functions":988,"./bin_label_vals":989,"./clean_bins":991,"./norm_functions":996,"fast-isnumeric":132}],991:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var h="date"===a?o:1,f=c.size;if(n(f))c.size=f>0?Number(f):h;else if("string"!=typeof f)c.size=h;else{var d=f.charAt(0),p=f.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=h)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":717,"../../lib":738,"fast-isnumeric":132}],992:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function h(r,n){return i.coerce(t,e,c,r,n)}var f=h("x"),d=h("y");h("cumulative.enabled")&&(h("cumulative.direction"),h("cumulative.currentbin")),h("text");var p=h("orientation",d&&!f?"h":"v"),m=e["v"===p?"x":"y"];if(m&&m.length){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u);e["h"===p?"x":"y"]&&h("histfunc");o(t,e,h,"h"===p?["y"]:["x"]),s(t,e,h,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,h)}else e.visible=!1}},{"../../components/color":613,"../../components/errorbars/defaults":643,"../../lib":738,"../../registry":861,"../bar/style_defaults":883,"./attributes":985,"./bin_defaults":987}],993:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;t.pointNumbers=a,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex;var o;if(r._indexToPoints){o=[];for(var s=0;sT&&g.splice(T,g.length-T),y.length>T&&y.splice(T,y.length-T),n(e,"x",g,m,_,M,b),n(e,"y",y,v,w,k,x);var A=[],S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,I=[],P=[],D=L?I:e.xbins,z=C?P:e.ybins,O=0,F=[],R=[],j=e.histnorm,N=e.histfunc,B=-1!==j.indexOf("density"),U="max"===N||"min"===N?null:0,V=c.count,H=u[j],q=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==N&&(q="avg"===N,V=c[N]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-l.tickIncrement(Z,X.size,!1,b))/1e6;for(r=Z;r=0&&d=0&&p0)o=c(t.alphahull,f);else{var d=["x","y","z"].indexOf(t.delaunayaxis);o=l(f.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:f,cells:o,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:h(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=function(t){return t.map(function(t){var e=t[0],r=s(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=i(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=i(t.facecolor)):(this.color=t.color,p.meshColor=h(t.color)),this.mesh.update(p)},f.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=o({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":760,"alpha-shape":44,"convex-hull":104,"delaunay-triangulate":124,"gl-mesh3d":206,tinycolor2:543}],1010:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),h=c(["i","j","k"]);if(u){h&&h.forEach(function(t){for(var e=0;ei?r=!0:e1)){var h=a.simpleMap(u.x,e.d2c,0,r.xcalendar),f=a.distinctVals(h).minDiff;o=Math.min(o,f)}}for(o===1/0&&(o=1),c=0;c");S.push(o,o,o,o,o,o,null)},R=0;Rs&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),c.splice(s)),l=0;l0)&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),h=Math.min(h,o.values.length)),o._index=l,u.push(o));if(isFinite(h))for(l=0;lh&&(o.values=o.values.slice(0,h));return u}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var h={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",h),n.coerceFont(c,"tickfont",h),n.coerceFont(c,"rangefont",h)}},{"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627,"../../lib":738,"./attributes":1019,"./constants":1023}],1025:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1019,"./base_plot":1020,"./calc":1021,"./colorbar":1022,"./defaults":1024,"./plot":1028}],1026:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function i(t,e,r,i,a,o){function s(c){var u;u=Math.min(i,a-c*i),o.offset=f*c*i,o.count=f*u,0===c&&(window.cancelAnimationFrame(r.currentRafs[l]),delete r.currentRafs[l],n(t,o.scissorX,o.scissorY,o.scissorWidth,o.viewBoxSize[1])),r.clearOnly||(e(o),c*i+u>>8*e)%256/255}function s(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i=h-4?o(s,h-2-l):.5);return i}(E,S,A,C),O=s(E,z),F=e.regl,R=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?p:a).concat(r))}return n}(w,M,Math.round(255*(M?I:1)))}),j=F({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:k?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:R,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),N=[0,1],B=[];return{setColorDomain:function(t){N[0]=t[0],N[1]=t[1]},render:function(t,e,a){var o,s,l,c=1/0,h=-1/0;for(o=0;oh&&(h=t[o].dim2.canvasX,l=o),t[o].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t){return d.scale.linear().domain(i(t))}function s(t,e,r){var i=v(e),a=i.trace,s=i.lineColor,l=i.cscale,c=a.line,u=a.domain,p=a.dimensions,m=t.width,g=a.labelfont,y=a.tickfont,b=a.rangefont,x=f.extendDeep({},c,{color:s.map(o({values:s,range:[c.cmin,c.cmax]})),blockLineCount:h.blockLineCount,canvasOverdrag:h.overdrag*h.canvasPixelRatio}),_=Math.floor(m*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,T=w;return{key:r,colCount:p.filter(n).length,dimensions:p,tickDistance:h.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return d.rgb(t)}),n="rgb".split("").map(function(t){return d.scale.linear().clamp(!0).domain(e).range(r.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return n.map(function(e){return e(t)})}}(l),lines:x,labelFont:g,tickFont:y,rangeFont:b,layoutWidth:m,layoutHeight:t.height,domain:u,translateX:u.x[0]*m,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*h.canvasPixelRatio+2*x.canvasOverdrag,canvasHeight:T*h.canvasPixelRatio,width:k,height:T,canvasPixelRatio:h.canvasPixelRatio}}function l(t){var e=t.width,r=t.height,a=t.dimensions,s=t.canvasPixelRatio,l=function(r){return e*r/Math.max(1,t.colCount-1)},c=h.verticalPadding/(r*s),u=1-2*c,f=function(t){return c+u*t},p={key:t.key,xScale:l,model:t},m={};return p.dimensions=a.filter(n).map(function(e,n){var a=o(e),c=m[e.label];m[e.label]=(c||0)+1;return{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:h.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(f),xScale:l,x:l(n),canvasX:l(n)*s,unitScale:function(t,e){return d.scale.linear().range([t-e,e])}(r,h.verticalPadding),domainScale:function(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?d.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(d.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):d.scale.linear().domain(n).range([t-e,e])}(r,h.verticalPadding,e),ordinalScale:function(t){var e=i(t);return t.tickvals&&d.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function c(t){t.classed(h.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var u=t("./lines"),h=t("./constants"),f=t("../../lib"),d=t("d3"),p=t("../../components/drawing"),m=t("../../lib/gup").keyFun,g=t("../../lib/gup").repeat,v=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i,o){function y(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function b(t,e){return(h.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,h={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==L&&(c?o.hover(h):o.unhover&&o.unhover(h),L=u)}}),S.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var C=e.selectAll("."+h.cn.parcoords).data(A,m);C.exit().remove(),C.enter().append("g").classed(h.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(g,m);e.enter().append("defs");var r=e.selectAll("#"+h.id.filterBarPattern).data(g,m);r.enter().append("pattern").attr("id",h.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-h.bar.width).attr("width",h.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(g,m);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",h.bar.width).attr("x",h.bar.width/2).attr("fill",h.bar.fillcolor).attr("fill-opacity",h.bar.fillopacity).attr("stroke",h.bar.strokecolor).attr("stroke-opacity",h.bar.strokeopacity).attr("stroke-width",h.bar.strokewidth)}),C.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var I=C.selectAll("."+h.cn.parcoordsControlView).data(g,m);I.enter().append("g").classed(h.cn.parcoordsControlView,!0).style("box-sizing","content-box"),I.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var P=I.selectAll("."+h.cn.yAxis).data(function(t){return t.dimensions},m);P.enter().append("g").classed(h.cn.yAxis,!0).each(function(t){E.dimensions.push(t)}),I.each(function(t){b(P,t)}),S.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=u(this,t,h.scatter),t.viewModel[t.key]=t.lineLayer,E.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),P.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),P.call(d.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;T=!1,k||(t.x=Math.max(-h.overdrag,Math.min(t.model.width+h.overdrag,d.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,P.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),b(P,e),P.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),d.select(this).attr("transform","translate("+t.x+", 0)"),P.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;k?"ending"===k&&(k=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,b(P,e),d.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),T=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),P.exit().remove();var D=P.selectAll("."+h.cn.axisOverlays).data(g,m);D.enter().append("g").classed(h.cn.axisOverlays,!0),D.selectAll("."+h.cn.axis).remove();var z=D.selectAll("."+h.cn.axis).data(g,m);z.enter().append("g").classed(h.cn.axis,!0),z.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),p.font(z.selectAll("text"),t.model.tickFont)}),z.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),z.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var O=D.selectAll("."+h.cn.axisHeading).data(g,m);O.enter().append("g").classed(h.cn.axisHeading,!0);var F=O.selectAll("."+h.cn.axisTitle).data(g,m);F.enter().append("text").classed(h.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-h.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){p.font(F,t.model.labelFont)});var R=D.selectAll("."+h.cn.axisExtent).data(g,m);R.enter().append("g").classed(h.cn.axisExtent,!0);var j=R.selectAll("."+h.cn.axisExtentTop).data(g,m);j.enter().append("g").classed(h.cn.axisExtentTop,!0),j.attr("transform","translate(0,"+-h.axisExtentOffset+")");var N=j.selectAll("."+h.cn.axisExtentTopText).data(g,m);N.enter().append("text").classed(h.cn.axisExtentTopText,!0).call(c),N.text(function(t){return x(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){p.font(N,t.model.rangeFont)});var B=R.selectAll("."+h.cn.axisExtentBottom).data(g,m);B.enter().append("g").classed(h.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+h.axisExtentOffset)+")"});var U=B.selectAll("."+h.cn.axisExtentBottomText).data(g,m);U.enter().append("text").classed(h.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(c),U.text(function(t){return x(t)(t.domainScale.domain()[0])}).each(function(t){p.font(U,t.model.rangeFont)});var V=D.selectAll("."+h.cn.axisBrush).data(g,m),H=V.enter().append("g").classed(h.cn.axisBrush,!0);V.each(function(t){t.brush||(t.brush=d.svg.brush().y(t.unitScale).on("brushstart",_).on("brush",w).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),d.select(this).call(t.brush))}),H.selectAll("rect").attr("x",-h.bar.capturewidth/2).attr("width",h.bar.capturewidth),H.selectAll("rect.extent").attr("fill","url(#"+h.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),H.selectAll(".resize rect").attr("height",h.bar.handleheight).attr("opacity",0).style("visibility","visible"),H.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",h.bar.handleoverlap-h.bar.handleheight),H.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",h.bar.handleoverlap);var q=!1,G=!1;return E}},{"../../components/drawing":638,"../../lib":738,"../../lib/gup":735,"./constants":1023,"./lines":1026,d3:123}],1028:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},h=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:h.w,height:h.h,margin:{t:h.t,r:h.r,b:h.b,l:h.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1027,regl:508}],1029:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../lib/extend").extendFlat,s=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:o({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:o({},s,{}),insidetextfont:o({},s,{}),outsidetextfont:o({},s,{}),domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},y:{valType:"info_array",items:[{valType:"number",min:0,max:1,editType:"calc"},{valType:"number",min:0,max:1,editType:"calc"}],dflt:[0,1],editType:"calc"},editType:"calc"},hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":612,"../../lib/extend":727,"../../plots/attributes":783,"../../plots/font_attributes":810}],1030:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n")}}return y};var l},{"../../components/color":613,"./helpers":1034,"fast-isnumeric":132,tinycolor2:543}],1032:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var h=o("text"),f=o("textinfo",Array.isArray(h)?"text+percent":"percent");if(o("hovertext"),f&&"none"!==f){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":738,"./attributes":1029}],1033:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":652}],1034:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}var a=t("d3"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./helpers"),h=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,h=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===h.indexOf(s.scalegroup)&&h.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}(e),f.each(function(){var f=a.select(this).selectAll("g.slice").data(e);f.enter().append("g").classed("slice",!0),f.exit().remove();var m=[[[],[]],[[],[]]],g=!1;f.each(function(e){function s(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)a.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var f=d.cx,v=d.cy,y=a.select(this),b=y.selectAll("path.surface").data([e]),x=!1,_=!1;if(b.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==i.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=o.castHoverinfo({hoverinfo:[u.castOption(l,e.pts)],_module:p._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var c=n(e,d),m=f+e.pxmid[0]*(1-c),g=v+e.pxmid[1]*(1-c),y=r.separators,b=[];if(-1!==l.indexOf("label")&&b.push(e.label),-1!==l.indexOf("text")){var w=u.castOption(s.hovertext||s.text,e.pts);w&&b.push(w)}-1!==l.indexOf("value")&&b.push(u.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&b.push(u.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;o.loneHover({x0:m-c*d.r,x1:m+c*d.r,y:g,text:b.join("
"),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:u.castOption(M.bgcolor,e.pts)||e.color,borderColor:u.castOption(M.bordercolor,e.pts),fontFamily:u.castOption(k.family,e.pts),fontSize:u.castOption(k.size,e.pts),fontColor:u.castOption(k.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),x=!0}t.emit("plotly_hover",{points:[h(e,s)],event:a.event}),_=!0}}).on("mouseout",function(r){var n=t._fullLayout,i=t._fullData[p.index];_&&(r.originalEvent=a.event,t.emit("plotly_unhover",{points:[h(e,i)],event:a.event}),_=!1),x&&(o.loneUnhover(n._hoverlayer.node()),x=!1)}).on("click",function(){var r=t._fullLayout,n=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[h(e,n)],o.click(t,a.event))}),p.pull){var w=+u.castOption(p.pull,e.pts)||0;w>0&&(f+=w*e.pxmid[0],v+=w*e.pxmid[1])}e.cxFinal=f,e.cyFinal=v;var M=p.hole;if(e.v===d.vTotal){var k="M"+(f+e.px0[0])+","+(v+e.px0[1])+s(e.px0,e.pxmid,!0,1)+s(e.pxmid,e.px0,!0,1)+"Z";M?b.attr("d","M"+(f+M*e.px0[0])+","+(v+M*e.px0[1])+s(e.px0,e.pxmid,!1,M)+s(e.pxmid,e.px0,!1,M)+"Z"+k):b.attr("d",k)}else{var T=s(e.px0,e.px1,!0,1);if(M){var A=1-M;b.attr("d","M"+(f+M*e.px1[0])+","+(v+M*e.px1[1])+s(e.px1,e.px0,!1,M)+"l"+A*e.px0[0]+","+A*e.px0[1]+T+"Z")}else b.attr("d","M"+f+","+v+"l"+e.px0[0]+","+e.px0[1]+T+"Z")}var S=u.castOption(p.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=a.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,"outside"===S?p.outsidetextfont:p.insidetextfont).call(c.convertToTspans,t);var o,s=l.bBox(r.node());"outside"===S?o=i(s,e):(o=function(t,e,r){var i=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=n(e,r),c={scale:l*r.r*2/i,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),h=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),f={scale:2*h/t.height,rCenter:Math.cos(h/r.r)-h*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>f.scale?g:f;return c.scale<1&&v.scale>c.scale?v:c}(s,e,d),"auto"===S&&o.scale<1&&(r.call(l.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(s=l.bBox(r.node())),o=i(s,e)));var u=f+e.pxmid[0]*o.rCenter+(o.x||0),h=v+e.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(e.yLabelMin=h-s.height/2,e.yLabelMid=h,e.yLabelMax=h+s.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+u+","+h+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}}),g&&function(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,d=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),p=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,v=t.cyFinal+c(t.px0[1],t.px1[1]),y=d-p;if(y*f>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(i=0;i=(u.castOption(e.pull,a.pts)||0)||((t.pxmid[1]-a.pxmid[1])*f>0?(y=a.cyFinal+c(a.px0[1],a.px1[1])-p-t.labelExtraY)*f>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*f>0&&(n=3*h*Math.abs(i-m.indexOf(t)),(s=a.cxFinal+l(a.px0[0],a.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*h>0&&(t.labelExtraX+=s)))}var a,o,s,l,c,h,f,d,p,m,g,v,y;for(o=0;o<2;o++)for(s=o?r:n,c=o?Math.max:Math.min,f=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,h=a?1:-1,(d=t[o][a]).sort(s),p=t[1-o][a],m=p.concat(d),v=[],g=0;gMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(s.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){f.selectAll("tspan").each(function(){var t=a.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":613,"../../components/drawing":638,"../../components/fx":655,"../../lib/svg_text_utils":761,"./event_data":1033,"./helpers":1034,d3:123}],1039:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1040,d3:123}],1040:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":613,"./helpers":1034}],1041:[function(t,e,r){"use strict";var n=t("../scattergl/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scattergl/attributes":1102}],1042:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),o=t("../scatter/get_trace_color"),s=["xaxis","yaxis"],l=n.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,i,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,h=t.xbounds&&t.ybounds,f=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,h)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);if(f)r=f;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=a(t.marker.color),m=a(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,b=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=b,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,b/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[s[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new n(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":760,"../scatter/get_trace_color":1064,"gl-pointcloud2d":231}],1043:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":738,"./attributes":1041}],1044:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":823,"../scatter3d/calc":1080,"./attributes":1041,"./convert":1042,"./defaults":1043}],1045:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll;e.exports=l({hoverinfo:s({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:{x:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]},y:{valType:"info_array",items:[{valType:"number",min:0,max:1},{valType:"number",min:0,max:1}],dflt:[0,1]}},orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":612,"../../components/fx/attributes":647,"../../lib/extend":727,"../../plot_api/edit_types":769,"../../plots/attributes":783,"../../plots/font_attributes":810}],1046:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":656,"../../plot_api/edit_types":769,"../../plots/get_data":820,"./plot":1051}],1047:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":738,"../../lib/gup":735,"strongly-connected-components":537}],1048:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1049:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}c("node.label"),c("node.pad"),c("node.thickness"),c("node.line.color"),c("node.line.width");c("node.color",e.node.label.map(function(t,e){return o.addOpacity(function(t){return a[t%a.length]}(e),.8)})),c("link.label"),c("link.source"),c("link.target"),c("link.value"),c("link.line.color"),c("link.line.width"),c("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),c("domain.x"),c("domain.y"),c("orientation"),c("valueformat"),c("valuesuffix"),c("arrangement"),n.coerceFont(c,"textfont",n.extendFlat({},l.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":613,"../../components/color/attributes":612,"../../lib":738,"./attributes":1045,tinycolor2:543}],1050:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1045,"./base_plot":1046,"./calc":1047,"./defaults":1049,"./plot":1051}],1051:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+b.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+b.sankeyNode).filter(l(t)).call(c)}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+b.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(b.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),b=t("./constants").cn,x=y._;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=x(t,"source:")+" ",y=x(t,"target:")+" ",_=x(t,"incoming flow count:")+" ",w=x(t,"outgoing flow count:")+" ";m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,r,n){p.select(e).call(h.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,c=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),h=u.left+u.width/2,f=u.top+u.height/2,m=g.loneHover({x:h-c.left,y:f-c.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",l+i.link.source.label,y+i.link.target.label].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},unhover:function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())},select:function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(u,r,n),g.click(t,{target:!0})}}})}},{"../../components/color":613,"../../components/fx":655,"../../lib":738,"./constants":1048,"./render":1052,d3:123}],1052:[function(t,e,r){"use strict";function n(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function i(t){return function(e){return e.node.originalX===t.node.originalX}}function a(t){for(var e=0;e1||t.linkLineWidth>0}function f(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function d(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function p(t){return w.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+_.nodeTextOffsetHorizontal:_.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-_.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-_.nodeTextOffsetHorizontal,0]])}function m(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function g(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function v(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function y(t){return t.horizontal&&t.left?"100%":"0%"}function b(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function x(t,e,r){var a=w.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(E.raiseToTop(this),a.interactionState.dragInProgress=a.node,n(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+Math.floor(a.node.originalX);a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=S.forceSimulation(n).alphaDecay(0).force("collide",S.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(_.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}(0,e,n,r)).stop()}(0,o,a),function(t,e,r,n){window.requestAnimationFrame(function a(){for(var o=0;o<_.forceTicksPerFrame;o++)r.forceLayouts[n].tick();r.sankey.relayout(),c(t.filter(i(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,a,o)}}).on("drag",function(r){if("fixed"!==r.arrangement){var a=w.event.x,o=w.event.y;"snap"===r.arrangement?(r.node.x=a,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=a),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),n(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),c(t.filter(i(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}var _=t("./constants"),w=t("d3"),M=t("tinycolor2"),k=t("../../components/color"),T=t("../../components/drawing"),A=t("@plotly/d3-sankey").sankey,S=t("d3-force"),E=t("../../lib"),L=t("../../lib/gup").keyFun,C=t("../../lib/gup").repeat,I=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n){var i=t.selectAll("."+_.cn.sankey).data(e.filter(function(t){return I(t).trace.visible}).map(function(t,e,r){for(var n,i=I(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,u="h"===i.orientation,h=i.node.pad,f=i.node.thickness,d=i.node.line.color,p=i.node.line.width,m=i.link.line.color,g=i.link.line.width,v=i.valueformat,y=i.valuesuffix,b=i.textfont,x=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{pointNumber:e,label:t,color:E.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{pointNumber:e,label:l.label[e],color:E.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),T=A().size(u?[x,w]:[w,x]).nodeWidth(f).nodePadding(h).nodes(M).links(k).layout(_.sankeyIterations),S=T.nodes(),L=0;L5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),R.transition().ease(_.ease).duration(_.duration).attr("startOffset",y).style("fill",v)}},{"../../components/color":613,"../../components/drawing":638,"../../lib":738,"../../lib/gup":735,"./constants":1048,"@plotly/d3-sankey":39,d3:123,"d3-force":119,tinycolor2:543}],1053:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;rg&&p.splice(g,p.length-g),m.length>g&&m.splice(g,m.length-g);var v={padded:!0},y={padded:!0};if(o.hasMarkers(e)){if(r=e.marker,u=r.size,Array.isArray(u)){var b={type:"linear"};i.setConvert(b),(u=b.makeCalcdata(e.marker,"size")).length>g&&u.splice(g,u.length-g)}var x,_=1.6*(e.marker.sizeref||1);x="area"===e.marker.sizemode?function(t){return Math.max(Math.sqrt((t||0)/_),3)}:function(t){return Math.max((t||0)/_,3)},v.ppad=y.ppad=Array.isArray(u)?u.map(x):x(u)}s(e),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&m[0]===m[g-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(o.hasMarkers(e)||o.hasText(e))||(v.padded=!1,v.ppad=0):v.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||p[0]===p[g-1]&&m[0]===m[g-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(y.padded=!1):y.tozero=!0,i.expand(f,p,v),i.expand(d,m,y);var w=new Array(g);for(h=0;h=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1058:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,h=l.cmin,f=l.cmax;n(h)||(h=i.aggNums(Math.min,null,u)),n(f)||(f=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,h,f),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:h,end:f,size:(f-h)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":617,"../../components/colorscale":628,"../../lib":738,"../../plots/plots":846,"fast-isnumeric":132}],1059:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":620,"../../components/colorscale/has_colorscale":627,"./subtypes":1076}],1060:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1061:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),h=t("./text_defaults"),f=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=(O=I[L][1])>=H&&(P=(D=I[L-1][0])+(I[L][0]-D)*(H-z)/(O-z),N=Math.min(N,P),B=Math.max(B,P));N=Math.max(N,0),B=Math.min(B,d._length);var q=s.defaultLine;return s.opacity(f.fillcolor)?q=f.fillcolor:s.opacity((f.line||{}).color)&&(q=f.line.color),n.extendFlat(t,{distance:c+10,x0:N,x1:B,y0:H,y1:H,color:q}),delete t.index,f.text&&!Array.isArray(f.text)?t.text=String(f.text):t.text=f.name,[t]}}}},{"../../components/color":613,"../../components/errorbars":644,"../../components/fx":655,"../../lib":738,"./fill_hover_text":1062,"./get_trace_color":1064}],1066:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc"),n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":796,"./arrays_to_calcdata":1053,"./attributes":1054,"./calc":1055,"./clean_data":1057,"./colorbar":1058,"./defaults":1061,"./hover":1065,"./plot":1073,"./select":1074,"./style":1075,"./subtypes":1076}],1067:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627}],1068:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=z.c2p(t[e].x),i=O.c2p(t[e].y);return r!==n&&i!==n&&[r,i]}function l(t){var e=t[0]/z._length,r=t[1]/O._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*j}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=nt[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)tt||t[1]rt)return[o(t[0],$,tt),o(t[1],et,rt)]}function f(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function d(t,e){var r=[],n=h(t),i=h(e);return n&&i&&f(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=h(n),s=h(a),l=[];if(o&&s&&f(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){(o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c}return l}}function m(t){var e=t[0],r=t[1],n=e===H[q-1][0],i=r===H[q-1][1];if(!n||!i)if(q>1){var a=e===H[q-2][0],o=r===H[q-2][1];n&&(e===$||e===tt)&&a?o?q--:H[q-1]=t:i&&(r===et||r===rt)&&o?a?q--:H[q-1]=t:H[q++]=t}else H[q++]=t}function g(t){H[q-1][0]!==t[0]&&H[q-1][1]!==t[1]&&m([W,X]),m(t),Z=null,W=X=0}function v(t){if(G=t[0]<$?$:t[0]>tt?tt:0,Y=t[1]rt?rt:0,G||Y){if(q)if(Z){var e=K(Z,t);e.length>1&&(g(e[0]),H[q++]=e[1])}else J=K(H[q-1],t)[0],H[q++]=J;else H[q++]=[G||t[0],Y||t[1]];var r=H[q-1];G&&Y&&(r[0]!==G||r[1]!==Y)?(Z&&(W!==G&&X!==Y?m(W&&X?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?$:tt,rt]:[n>0?tt:$,et]}(Z,t):[W||G,X||Y]):W&&X&&m([W,X])),m([G,Y])):W-G&&X-Y&&m([G||W,Y||X]),Z=t,W=G,X=Y}else Z&&g(K(Z,t)[0]),H[q++]=t}var y,b,x,_,w,M,k,T,A,S,E,L,C,I,P,D,z=e.xaxis,O=e.yaxis,F=e.simplify,R=e.connectGaps,j=e.baseTolerance,N=e.shape,B="linear"===N,U=[],V=s.minTolerance,H=new Array(t.length),q=0;F||(j=V=-1);var G,Y,W,X,Z,J,K,Q=s.maxScreensAway,$=-z._length*Q,tt=z._length*(1+Q),et=-O._length*Q,rt=O._length*(1+Q),nt=[[$,et,tt,et],[tt,et,tt,rt],[tt,rt,$,rt],[$,rt,$,et]];for("linear"===N||"spline"===N?K=u:"hv"===N||"vh"===N?K=d:"hvh"===N?K=p(0,$,tt):"vhv"===N&&(K=p(1,et,rt)),y=0;yl(M))break;x=M,(C=A[0]*T[0]+A[1]*T[1])>E?(E=C,_=M,k=!1):C=t.length||!M)break;v(M),b=M}}else v(_)}Z&&m([W||Z[0],X||Z[1]]),U.push(H.slice(0,q))}return U}},{"../../constants/numerical":717,"../../lib":738,"./constants":1060}],1069:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1070:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i=null,a=0;a0?Math.max(e,i):0}}},{"fast-isnumeric":132}],1072:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),h=(t.line||{}).color;if(c=c||{},h&&(r=h),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",h&&!Array.isArray(h)&&e.marker.color!==h?h:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":613,"../../components/colorscale/defaults":623,"../../components/colorscale/has_colorscale":627,"./subtypes":1076}],1073:[function(t,e,r){"use strict";function n(t,e,r,n,u,f,d){function p(t){return _?t.transition():t}function m(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function v(){return!1}function y(e){var n,s=e[0].trace,c=i.select(this),u=l.hasMarkers(s),h=l.hasText(s),f=function(t){if(t.ids)return g}(s),d=v,y=v;u&&(d=s.marker.maxdisplayed||s._needsCull?m:a.identity),h&&(y=s.marker.maxdisplayed||s._needsCull?m:a.identity);var b=(n=c.selectAll("path.point").data(d,f)).enter().append("path").classed("point",!0);_&&b.call(o.pointStyle,s,t).call(o.translatePoints,w,M).style("opacity",0).transition().style("opacity",1);var x=u&&o.tryColorscale(s.marker,""),k=u&&o.tryColorscale(s.marker,"line");n.order(),n.each(function(e){var n=i.select(this),a=p(n);o.translatePoint(e,a,w,M)?(o.singlePointStyle(e,a,s,x,k,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,w,M,s.xcalendar,s.ycalendar),s.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),_?n.exit().transition().style("opacity",0).remove():n.exit().remove(),(n=c.selectAll("g").data(y,f)).enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=i.select(this),n=p(e.select("text"));o.translatePoint(t,n,w,M)?r.layerClipId&&o.hideOutsideRangePoint(t,e,w,M,s.xcalendar,s.ycalendar):e.remove()}),n.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=w.c2p(t.x),r=M.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){p(i.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var b,x;!function(t,e,r,n,o){var s=r.xaxis,c=r.yaxis,u=i.extent(a.simpleMap(s.range,s.r2c)),h=i.extent(a.simpleMap(c.range,c.r2c)),f=n[0].trace;if(!l.hasMarkers(f))return;var d=f.marker.maxdisplayed;if(0===d)return;var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=h[0]&&t.y<=h[1]}),m=Math.ceil(p.length/d),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0,w=r.xaxis,M=r.yaxis,k=n[0].trace,T=k.line,A=i.select(f);if(A.call(s.plot,r,d),!0===k.visible){p(A).style("opacity",k.opacity);var S,E,L=k.fill.charAt(k.fill.length-1);"x"!==L&&"y"!==L&&(L=""),n[0].node3=A;var C="",I=[],P=k._prevtrace;P&&(C=P._prevRevpath||"",E=P._nextFill,I=P._polygons);var D,z,O,F,R,j,N,B,U,V="",H="",q=[],G=a.noop;if(S=k._ownFill,l.hasLines(k)||"none"!==k.fill){for(E&&E.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(O=o.steps(T.shape),F=o.steps(T.shape.split("").reverse().join(""))):O=F="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),T.smoothing):o.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},R=function(t){return F(t.reverse())},q=c(n,{xaxis:w,yaxis:M,connectGaps:k.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,simplify:T.simplify}),U=k._polygons=new Array(q.length),x=0;x1){var r=i.select(this);if(r.datum(n),t)p(r.style("opacity",0).attr("d",D).call(o.lineGroupStyle)).style("opacity",1);else{var a=p(r);a.attr("d",D),o.singleLineStyle(n,a)}}}}}var Y=A.selectAll(".js-line").data(q);p(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(G(!0)),o.setClipUrl(Y,r.layerClipId),q.length&&(S?j&&B&&(L?("y"===L?j[1]=B[1]=M.c2p(0,!0):"x"===L&&(j[0]=B[0]=w.c2p(0,!0)),p(S).attr("d","M"+B+"L"+j+"L"+V.substr(1)).call(o.singleFillStyle)):p(S).attr("d",V+"Z").call(o.singleFillStyle)):"tonext"===k.fill.substr(0,6)&&V&&C&&("tonext"===k.fill?p(E).attr("d",V+"Z"+C+"Z").call(o.singleFillStyle):p(E).attr("d",V+"L"+C.substr(1)+"Z").call(o.singleFillStyle),k._polygons=k._polygons.concat(I)),k._prevRevpath=H,k._prevPolygons=U);var W=A.selectAll(".points");b=W.data([n]),W.each(y),b.enter().append("g").classed("points",!0).each(y),b.exit().remove(),b.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(i.select(this),e?null:r.layerClipId)})}}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./line_points"),u=t("./link_traces"),h=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,c,h,f,d=e.plot.select("g.scatterlayer"),p=!a,m=!!a&&a.duration>0;for((h=d.selectAll("g.trace").data(r,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),u(t,e,r),function(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=i.select(this);if((n=t[0].trace)._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,d,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),m){s&&(f=s());i.transition().duration(a.duration).ease(a.easing).each("end",function(){f&&f()}).each("interrupt",function(){f&&f()}).each(function(){d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)})})}else d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)});p&&h.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":638,"../../components/errorbars":644,"../../lib":738,"../../lib/polygon":750,"./line_points":1068,"./link_traces":1070,"./subtypes":1076,d3:123}],1074:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],h=s[0].trace;if(!n.hasMarkers(h)&&!n.hasText(h))return[];if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}(e.textposition),r.textColor=g(e.textfont,1,S),r.textSize=o(e.textfont.size,S,p.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var P=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var D=e.projection[P[n]];(r.project[n]=D.show)&&(r.projectOpacity[n]=D.opacity,r.projectScale[n]=D.scale)}r.errorBounds=x(e,d);var z=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=m(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=z.color,r.errorLineWidth=z.lineWidth,r.errorCapSize=z.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=m(e.surfacecolor),r}function l(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}var c=t("gl-line3d"),u=t("gl-scatter3d"),h=t("gl-error3d"),f=t("gl-mesh3d"),d=t("delaunay-triangulate"),p=t("../../lib"),m=t("../../lib/str2rgbarray"),g=t("../../lib/gl_format_color"),v=t("../scatter/make_bubble_size_func"),y=t("../../constants/gl3d_dashes"),b=t("../../constants/gl3d_markers"),x=t("./calc_errors"),_=n.prototype;_.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},_.update=function(t){var e,r,n,i,a=this.scene.glplot.gl,o=y.solid;this.data=t;var p=s(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in y&&(o=y[p.lineDashes]),this.color=l(p.scatterColor)||l(p.lineColor),this.dataPoints=p.position,e={gl:a,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:o[0],dashScale:o[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=c(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var m=t.opacity;if(t.marker&&t.marker.opacity&&(m*=t.marker.opacity),r={gl:a,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:m,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=u(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),i={gl:a,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(i):(this.textMarkers=u(i),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=h(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n=0&&f("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];f(v+".show")&&(f(v+".opacity"),f(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":643,"../../lib":738,"../../registry":861,"../scatter/line_defaults":1067,"../scatter/marker_defaults":1072,"../scatter/subtypes":1076,"../scatter/text_defaults":1077,"./attributes":1079}],1084:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":715,"../../plots/gl3d":826,"../scatter/colorbar":1058,"./attributes":1079,"./calc":1080,"./convert":1082,"./defaults":1083}],1085:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":614,"../../components/colorscale/color_attributes":621,"../../lib/extend":727,"../../plots/attributes":783,"../scatter/attributes":1054}],1086:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../plots/cartesian/axes"),a=t("../scatter/subtypes"),o=t("../scatter/colorscale_calc"),s=t("../scatter/arrays_to_calcdata"),l=t("../scatter/calc_selection"),c=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=c(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var u;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var h,f,d=e.a.length,p=new Array(d),m=!1;for(u=0;ud&&b.splice(d,b.length-d)}return o(e),s(p,e),l(p,e),p}}},{"../../plots/cartesian/axes":785,"../carpet/lookup_carpetid":919,"../scatter/arrays_to_calcdata":1053,"../scatter/calc_selection":1056,"../scatter/colorscale_calc":1059,"../scatter/subtypes":1076,"fast-isnumeric":132}],1087:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}d("carpet"),e.xaxis="x",e.yaxis="y";var p,m=d("a"),g=d("b");if(p=Math.min(m.length,g.length)){m&&p0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,h=c-u;return s.x0=Math.max(Math.min(s.x0,h),u),s.x1=Math.max(Math.min(s.x1,h),u),o}var f=s.cd[s.index];s.a=f.a,s.b=f.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(f.hi||d.hoverinfo).split("+"),g=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,f.a),-1!==m.indexOf("b")&&a(p.baxis,f.b);var v=p.ab2ij([f.a,f.b]),y=Math.floor(v[0]),b=v[0]-y,x=Math.floor(v[1]),_=v[1]-x,w=p.evalxy([],y,x,b,_);return g.push("y: "+w[1].toFixed(3)),s.extraText=g.join("
"),o}}},{"../scatter/hover":1065}],1090:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":796,"../scatter/colorbar":1058,"../scatter/select":1074,"./attributes":1085,"./calc":1086,"./defaults":1087,"./event_data":1088,"./hover":1089,"./plot":1091,"./style":1092}],1091:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}(u,g,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":655,"../../constants/numerical":717,"../../plots/cartesian/axes":785,"../scatter/fill_hover_text":1062,"../scatter/get_trace_color":1064,"./attributes":1093}],1098:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":814,"../scatter/colorbar":1058,"./attributes":1093,"./calc":1094,"./defaults":1095,"./event_data":1096,"./hover":1097,"./plot":1099,"./select":1100,"./style":1101}],1099:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");e.exports=function(t,e){function r(t,e){t.lonlat[0]===a&&n.select(e).remove()}for(var h=0;h=e.length?t(i):t(e[a]);return n}function o(t,e,r){return l(D(t,r),P(e,r),r)}function s(t,e,r,n){var i=w(t,e,n);return i=Array.isArray(i[0])?i:a(g.identity,[i],n),l(i,P(r,n),n)}function l(t,e,r){for(var n=new Array(4*r),i=0;iZ?X-Z:0),!q||H.noBorder||H.noFill?u(this.scatter.options.colors,Y,f,B,G):u(this.scatter.options.colors,C,f,0),u(this.scatter.options.borderColors,W,f,B,G);N?(this.scatter.options.positions=null,this.fancyScatter.update(),this.scatter.options.positions=T):this.fancyScatter.update()}else this.fancyScatter.clear();this.scatter.clear(),this.expandAxesFancy(l,h,j)},I.updateLines=function(t,e){var r;if(this.hasLines){var n=e;if(!t.connectgaps){var i=0,a=this.xData,s=this.yData;for(n=new Float64Array(2*a.length),r=0;r=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),f=e-h;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([f,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+h,p[1]],g=c.c2p(m),v=u.c2p(m),y=d.mrc||1;return t.x0=g-y,t.x1=g+y,t.y0=v-y,t.y1=v+y,t.color=i(l,d),t.extraText=function(t,e,r){function n(t){return t+"\xb0"}var i=(e.hi||t.hoverinfo).split("+"),o=-1!==i.indexOf("all"),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),c=e.lonlat,u=[];return o||s&&l?u.push("("+n(c[0])+", "+n(c[1])+")"):s?u.push(r.lon+n(c[0])):l&&u.push(r.lat+n(c[1])),(o||-1!==i.indexOf("text"))&&a(e,t,u),u.join("
")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":655,"../../constants/numerical":717,"../scatter/fill_hover_text":1062,"../scatter/get_trace_color":1064}],1113:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){if(e){e[0].trace._glTrace.update(e)}},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":840,"../scatter/colorbar":1058,"../scattergeo/calc":1094,"./attributes":1108,"./defaults":1110,"./event_data":1111,"./hover":1112,"./plot":1114,"./select":1115}],1114:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1109}],1115:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,h=[],f=l[0].trace;if(!n.hasMarkers(f))return[];if(!1===e)for(s=0;sk&&S.splice(k,S.length-k)}return o(e),s(T,e),l(T,e),T}},{"../../plots/cartesian/axes":785,"../scatter/arrays_to_calcdata":1053,"../scatter/calc_selection":1056,"../scatter/colorscale_calc":1059,"../scatter/subtypes":1076,"fast-isnumeric":132}],1118:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../scatter/constants"),a=t("../scatter/subtypes"),o=t("../scatter/marker_defaults"),s=t("../scatter/line_defaults"),l=t("../scatter/line_shape_defaults"),c=t("../scatter/text_defaults"),u=t("../scatter/fillcolor_defaults"),h=t("./attributes");e.exports=function(t,e,r,f){function d(r,i){return n.coerce(t,e,h,r,i)}var p,m=d("a"),g=d("b"),v=d("c");if(m?(p=m.length,g?(p=Math.min(p,g.length),v&&(p=Math.min(p,v.length))):p=v?Math.min(p,v.length):0):g&&v&&(p=Math.min(g.length,v.length)),p){m&&p"),s}}},{"../../plots/cartesian/axes":785,"../scatter/hover":1065}],1121:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":854,"../scatter/colorbar":1058,"../scatter/select":1074,"./attributes":1116,"./calc":1117,"./defaults":1118,"./event_data":1119,"./hover":1120,"./plot":1122,"./style":1123}],1122:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e){var r=t.plotContainer;r.select(".scatterlayer").selectAll("*").remove();for(var i={xaxis:t.xaxis,yaxis:t.yaxis,plot:r,layerClipId:t._hasClipOnAxisFalse?t.clipIdRelative:null},a=0;a",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1134:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}var o=t("./constants"),s=t("../../lib/extend").extendFlat,l=t("fast-isnumeric");e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),c=e.cells.values,u=e.domain,h=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),f=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),d=r.length?r[0].map(function(){return e.header.height}):[],p=c.length?c[0].map(function(){return e.cells.height}):[],m=d.reduce(function(t,e){return t+e},0),g=a(p,f-m+o.uplift),v=i(a(d,m),[]),y=i(g,v),b={},x=e._fullInput.columnorder,_=r.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return l(n)?Number(n):1}),w=_.reduce(function(t,e){return t+e},0);_=_.map(function(t){return t/w*h});var M={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:h,height:f,columnOrder:x,groupHeight:f,rowBlocks:y,headerRowBlocks:v,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=b[t];b[t]=(r||0)+1;return{key:t+"__"+b[t],label:t,specIndex:e,xIndex:x[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:_[e]}})};return M.columns.forEach(function(t){t.calcdata=M,t.x=n(t)}),M}},{"../../lib/extend":727,"./constants":1133,"fast-isnumeric":132}],1135:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":727}],1136:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=function(t){return"string"==typeof t&&t.match(T.latexCheck)}(n);t.latex=s;var l,h=s?"":u(t.calcdata.cells.prefix,e,r)||"",f=s?"":u(t.calcdata.cells.suffix,e,r)||"",d=s?null:u(t.calcdata.cells.format,e,r)||null,p=h+(d?A.format(d)(t.value):t.value)+f;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=c(p)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?c(p):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var m;if(t.wrappingNeeded){var g=(" "===T.wrapSplitCharacter?p.replace(/
i&&n.push(a),i+=l}return n}(i,u,c);1===h.length&&(h[0]===i.length-1?h.unshift(h[0]-1):h.push(h[0]+1)),h[0]%2&&h.reverse(),e.each(function(t,e){t.page=h[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(w(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(v(t,r,e,h,n.prevPages,n,0),v(t,r,e,h,n.prevPages,n,1),o(r,t))}}function g(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*A.event.dy:n;var l=o.selectAll("."+T.cn.yColumn).selectAll("."+T.cn.columnBlock).filter(f);m(t,l,o)}}function v(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function y(t,e,r){return function(){var n=A.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,c=t.column.columnWidth-2*T.cellPad;for(t.value="";o.length;)l+(i=(r=o.shift()).width+a)>c&&(t.value+=s.join(T.wrapSpacer)+T.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(T.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),l(n.select("."+T.cn.cellText),r,t),A.select(e.parentNode.parentNode).call(_)}}function b(t,e,r,n,i){return function(){if(!i.settledY){var a=A.select(e.parentNode),s=k(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*T.cellPad:c,h=Math.max(u,c);h-s.rows[l].rowHeight&&(s.rows[l].rowHeight=h,t.selectAll("."+T.cn.columnCell).call(_),m(null,t.filter(f),0),o(r,n,!0)),a.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),e=A.select(this.parentNode).select("."+T.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),n=e.top-t.top+(r?r.matrix.f:T.cellPad);return"translate("+x(i,A.select(this.parentNode).select("."+T.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+n+")"}),i.settledY=!0}}}function x(t,e){switch(t.align){case"left":return T.cellPad;case"right":return t.column.columnWidth-(e||0)-T.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return T.cellPad}}function _(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+M(e,1/0)},0);return"translate(0 "+(M(k(t),t.key)+e)+")"}).selectAll("."+T.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(k(t),t.key).rowHeight})}function w(t,e){for(var r=0,n=e-1;n>=0;n--)r+=function(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n0){var y,b,x,_,w,M=t.xa,k=t.ya;"h"===f.orientation?(w=e,y="y",x=k,b="x",_=M):(w=r,y="x",x=M,b="y",_=k);var T=h[t.index];if(w>=T.span[0]&&w<=T.span[1]){var A=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(T,f,w),L=o.getPositionOnKdePath(T,f,S),C=x._offset,I=x._length;A[y+"0"]=L[0],A[y+"1"]=L[1],A[b+"0"]=A[b+"1"]=S,A[b+"Label"]=b+": "+i.hoverLabelText(_,w)+", "+h[0].t.labels.kde+" "+E.toFixed(3),g.push(A),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+I),u[y+"2"]=n.constrain(C+L[1],C,C+I),u[b+"1"]=u[b+"2"]=_._offset+S}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var P=l.selectAll(".violinline-"+f.uid).data(u?[0]:[]);return P.enter().append("line").classed("violinline-"+f.uid,!0).attr("stroke-width",1.5),P.exit().remove(),P.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":738,"../../plots/cartesian/axes":785,"../box/hover":887,"./helpers":1142}],1144:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":796,"../box/select":892,"./attributes":1139,"./calc":1140,"./defaults":1141,"./hover":1143,"./layout_attributes":1145,"./layout_defaults":1146,"./plot":1147,"./set_positions":1148,"./style":1149}],1145:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":738,"../box/layout_attributes":889}],1146:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":738,"../box/layout_defaults":890,"./layout_attributes":1145}],1147:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:h,yaxis:f,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,h=e.xaxis,f=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,g=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),v=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-u.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],b=e[a.posLetter+"axis"],x="both"===s.side,_=x||"positive"===s.side,w=x||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,T=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+v,u=b.c2p(l);switch(s.scalemode){case"width":e=T.maxWidth/g;break;case"count":e=T.maxWidth/g*(T.maxCount/t.pts.length)}var h,f,d,p,m,M,k;if(_){for(M=new Array(o),p=0;pi&&(i=c,a=l)}}return i?s(a):h};case"rms":return function(t,e){for(var r=0,i=0,a=0;a=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,i){return n.coerce(t,a,r.attributes,e,i)}var a={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,a,"valuecalendar",null),o(t,a,"targetcalendar",null)}return a},r.calcTransform=function(t,e,r){function i(t,r){for(var i=0;i":return function(t){return f(t)>i};case">=":return function(t){return f(t)>=i};case"[]":return function(t){var e=f(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=f(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=f(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=f(t);return ei[1]};case"](":return function(t){var e=f(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=f(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(f(t))};case"}{":return function(t){return-1===i.indexOf(f(t))}}}(r,a.getDataToCoordFunc(t,e,h,u),d),b={},x={},_=0;r.preservegaps?(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set(new Array(f))},v=function(t,e){var r=b[t.astr][e];t.get()[e]=r}):(g=function(t){b[t.astr]=n.extendDeep([],t.get()),t.set([])},v=function(t,e){var r=b[t.astr][e];t.get().push(r)}),i(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;oMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],40:[function(t,e,r){"use strict";function n(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}e.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],c=t.mode||"turntable",u=i(),f=a(),h=o();return u.setDistanceLimits(l[0],l[1]),u.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 n({turntable:u,orbit:f,matrix:h},c)};var i=t("turntable-camera-controller"),a=t("orbit-camera-controller"),o=t("matrix-camera-controller"),s=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+u;if((r=a-u-f[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)(r=(e=t[n]).y+e.dy+u-a)>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(h).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(f[1]-(t.length-1)*u)/e.sum(t,s)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),d.forEach(function(e){e.dy=e.value*t})}(),n();for(var l=1;t>0;--t)!function(t){function r(t){return o(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,s);n.y+=(i-o(n))*t}})})}(l*=.99),n(),function(t){function r(t){return o(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,s);n.y+=(i-o(n))*t}})})}(l),n()}function a(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}h.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),h.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function o(t){return t.y+t.dy/2}function s(t){return t.value}var l={},c=24,u=8,f=[1,1],h=[],d=[];return l.nodeWidth=function(t){return arguments.length?(c=+t,l):c},l.nodePadding=function(t){return arguments.length?(u=+t,l):u},l.nodes=function(t){return arguments.length?(h=t,l):h},l.links=function(t){return arguments.length?(d=t,l):d},l.size=function(t){return arguments.length?(f=t,l):f},l.layout=function(r){return h.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),d.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=h[t.source]),"number"==typeof n&&(n=t.target=h[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),h.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,s),e.sum(t.targetLinks,s))}),t(),i(r),a(),l},l.relayout=function(){return a(),l},l.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,f=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+f+"C"+s+","+f+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},l},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":120,"d3-collection":121,"d3-interpolate":125}],42:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":165,"gl-vao":259,"weak-map":573}],43:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=t[o]),t[o]>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3])),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t.str2RgbaArray=function(t,n){var i,a;if("string"!=typeof t)return t;if(i=[],"#"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),a=parseInt(t,16),i[0]=a>>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3]),a[4]?i[3]=parseFloat(a[4]):i[3]=1),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t}()},{}],51:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!h(t[o],e[o],r,n))return!1;return!0}(t,e,r,s))}return r?t===e:t==e}function d(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function p(t,e,r){h(t,e,!0)&&u(t,e,r,"notDeepStrictEqual",p)}function m(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function g(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&u(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&v.isError(i),s=!t&&i&&!r;if((o&&a&&m(i,r)||s)&&u(i,r,"Got unwanted exception"+n),t&&i&&r&&!m(i,r)||!t&&i)throw i}var v=t("util/"),y=Object.prototype.hasOwnProperty,x=Array.prototype.slice,b="foo"===function(){}.name,_=e.exports=f,w=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return l(c(t.actual),128)+" "+t.operator+" "+l(c(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=u,_.ok=f,_.equal=function(t,e,r){t!=e&&u(t,e,r,"==",_.equal)},_.notEqual=function(t,e,r){t==e&&u(t,e,r,"!=",_.notEqual)},_.deepEqual=function(t,e,r){h(t,e,!1)||u(t,e,r,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,e,r){h(t,e,!0)||u(t,e,r,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,e,r){h(t,e,!1)&&u(t,e,r,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=p,_.strictEqual=function(t,e,r){t!==e&&u(t,e,r,"===",_.strictEqual)},_.notStrictEqual=function(t,e,r){t===e&&u(t,e,r,"!==",_.notStrictEqual)},_.throws=function(t,e,r){g(!0,t,e,r)},_.doesNotThrow=function(t,e,r){g(!1,t,e,r)},_.ifError=function(t){if(t)throw t};var M=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":563}],52:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],53:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(f):f<0&&(u=u.ushln(-f)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":56,"./is-rat":58,"./lib/is-bn":62,"./lib/num-to-bn":63,"./lib/rationalize":64,"./lib/str-to-bn":65}],58:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":62}],59:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":73}],60:[function(t,e,r){"use strict";var n=t("./bn-sign");e.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}},{"bit-twiddle":71,"double-bits":131}],62:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":73}],63:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.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)}},{"bn.js":73,"double-bits":131}],64:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.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]}},{"./bn-sign":59,"./num-to-bn":63}],65:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":73}],66:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":64}],67:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":59}],68:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":64}],69:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.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,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(h=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":60,"./lib/ctz":61}],70:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],71:[function(t,e,r){"use strict";"use restrict";function n(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}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.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},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=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|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],72:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s){for(var l=0;l=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(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}function l(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 c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}function c(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function f(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 h(){f.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){f.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){f.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){f.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(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 v(t){g.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)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var y;try{y=t("buffer").Buffer}catch(t){}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++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;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){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),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,l=Math.min(a,a-o)+r,c=0,u=r;u1&&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 x=["","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"],b=[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],_=[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];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?x[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 c=b[t],u=_[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modn(u).toString(t);r=(f=f.idivn(u)).isZero()?h+r:x[c-h.length]+h+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!==y),this.toArrayLike(y,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,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[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=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=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,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],D=8191&z,I=z>>>13,P=0|o[8],O=8191&P,F=P>>>13,R=0|o[9],N=8191&R,j=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>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,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((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,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((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,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|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(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,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(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,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(v,$)|0,i=(i=i+Math.imul(v,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(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,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(v,rt)|0,i=(i=i+Math.imul(v,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(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(F,U)|0,a=Math.imul(F,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,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(v,at)|0,i=(i=i+Math.imul(v,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,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(F,H)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,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(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,X))+Math.imul(j,W)|0,a=Math.imul(j,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,K)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|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 St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,K))+Math.imul(j,J)|0,a=Math.imul(j,K),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(F,rt)|0,a=a+Math.imul(F,nt)|0,n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(F,at)|0,a=a+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,at),i=(i=Math.imul(N,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(F,lt)|0,a=a+Math.imul(F,ct)|0,n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(I,ft)|0,a=a+Math.imul(I,ht)|0;var zt=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(N,lt),i=(i=Math.imul(N,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(F,ft)|0,a=a+Math.imul(F,ht)|0;var Dt=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var It=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(F,pt)|0))<<13)|0;c=((a=a+Math.imul(F,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Pt=(c+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=Dt,l[17]=It,l[18]=Pt,0!==c&&(l[19]=c,r.length++),r};Math.imul||(w=l),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):r<63?l(this,t,e):r<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):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},u.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);var i;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,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),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&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;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 c=0;c=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){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 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)},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),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=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(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),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(c)}},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=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,f=1;0==(r.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var h;return(h=0===e.cmpn(1)?i:o).cmpn(0)<0&&h.iadd(t),h},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=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=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 g(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};f.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},f.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):r.strip(),r},f.prototype.split=function(t,e){t.iushrn(this.n,0,e)},f.prototype.imulK=function(t){return t.imul(this.k)},i(h,f),h.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},h.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 h;else if("p224"===t)e=new d;else if("p192"===t)e=new p;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new m}return M[t]=e,e},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.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")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.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)},g.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},g.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)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.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(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new v(t)},i(v,g),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.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)},v.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)},v.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],74:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var f,h=l.mallocDouble(2*s*a),d=l.mallocInt32(a);if((a=i(t,s,h,d))>0){if(1===s&&n)c.init(a),f=c.sweepComplete(s,r,0,a,h,d,0,a,h,d);else{var p=l.mallocDouble(2*s*o),m=l.mallocInt32(o);(o=i(e,s,p,m))>0&&(c.init(a+o),f=1===s?c.sweepBipartite(s,r,0,a,h,d,0,o,p,m):u(s,r,n,a,h,d,o,p,m),l.free(p),l.free(m))}l.free(h),l.free(d)}return f}}}function o(t,e){s.push([t,e])}e.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return s=[],a(t,t,o,!0),s}(t);case 2:return"function"==typeof e?a(t,t,e,!0):function(t,e){return s=[],a(t,e,o,!1),s}(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var s,l=t("typedarray-pool"),c=t("./lib/sweep"),u=t("./lib/intersect")},{"./lib/intersect":77,"./lib/sweep":81,"typedarray-pool":554}],76:[function(t,e,r){"use strict";function n(t){function e(e,r){var s=function(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),s=["function ",n,"(",_.join(),"){","var ",l,"=2*",i,";"],w="for(var i="+c+","+d+"="+l+"*"+c+";i<"+u+";++i,"+d+"+="+l+"){var x0="+f+"["+a+"+"+d+"],x1="+f+"["+a+"+"+d+"+"+i+"],xi="+h+"[i];",M="for(var j="+p+","+y+"="+l+"*"+p+";j<"+m+";++j,"+y+"+="+l+"){var y0="+g+"["+a+"+"+y+"],"+(r?"y1="+g+"["+a+"+"+y+"+"+i+"],":"")+"yi="+v+"[j];";return t?s.push(w,b,":",M):s.push(M,b,":",w),r?s.push("if(y1"+m+"-"+p+"){"),t?(e(!0,!1),M.push("}else{"),e(!1,!1)):(M.push("if("+s+"){"),e(!0,!0),M.push("}else{"),e(!0,!1),M.push("}}else{if("+s+"){"),e(!1,!0),M.push("}else{"),e(!1,!1),M.push("}")),M.push("}}return "+r);var k=n.join("")+M.join("");return new Function(k)()}var i="d",a="ax",o="vv",s="fp",l="es",c="rs",u="re",f="rb",h="ri",d="rp",p="bs",m="be",g="bb",v="bi",y="bp",x="rv",b="Q",_=[i,a,o,c,u,f,h,p,m,g,v];r.partial=n(!1),r.full=n(!0)},{}],77:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){var c=M*t;A[c]=e,A[c+1]=r,A[c+2]=n,A[c+3]=i,A[c+4]=a,A[c+5]=o;var u=k*t;T[u]=s,T[u+1]=l}function i(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,m=i*f;p0;){var P=(D-=1)*M,O=A[P],F=A[P+1],R=A[P+2],N=A[P+3],j=A[P+4],B=A[P+5],U=D*k,V=T[U],q=T[U+1],H=1&B,G=!!(16&B),Y=d,W=S,X=L,Z=C;if(H&&(Y=L,W=C,X=d,Z=S),!(2&B&&(R=x(t,O,F,R,Y,W,q),F>=R)||4&B&&(F=b(t,O,F,R,Y,W,V))>=R)){var J=R-F,K=j-N;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),y=d("lo===p0",["p0"]),x=d("lor&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p>>1,h=2*t,d=f,p=s[h*f+e];c=x?(d=y,p=x):v>=_?(d=g,p=v):(d=b,p=_):x>=_?(d=y,p=x):_>=v?(d=g,p=v):(d=b,p=_);for(var w=h*(u-1),M=h*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],80:[function(t,e,r){"use strict";function n(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 c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>1,g=m-h,v=m+h,y=d,x=g,b=m,_=v,w=p,M=t+1,k=e-1,A=0;l(y,x,r)&&(A=y,y=x,x=A),l(_,w,r)&&(A=_,_=w,w=A),l(y,b,r)&&(A=y,y=b,b=A),l(x,b,r)&&(A=x,x=b,b=A),l(y,_,r)&&(A=y,y=_,_=A),l(b,_,r)&&(A=b,b=_,_=A),l(x,w,r)&&(A=x,x=w,w=A),l(x,b,r)&&(A=x,x=b,b=A),l(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*x],S=r[2*x+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*b,D=2*w,I=2*d,P=2*m,O=2*p,F=0;F<2;++F){var R=r[C+F],N=r[z+F],j=r[D+F];r[I+F]=R,r[P+F]=N,r[O+F]=j}a(g,t,r),a(v,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&i(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(o(B,M,k,r),++M,--k):(i(B,k,r),--k);break}if(--k>>1;s(m,S);var E=0,L=0;for(M=0;M=l)n(f,h,L--,C=C-l|0);else if(C>=0)n(c,u,E--,C);else if(C<=-l){C=-C-l|0;for(var z=0;z>>1;s(m,E);var L=0,C=0,z=0;for(k=0;k>1==m[2*k+3]>>1&&(I=2,k+=1),D<0){for(var P=-(D>>1)-1,O=0;O>1)-1,0===I?n(c,u,L--,P):1===I?n(f,h,C--,P):2===I&&n(d,p,z--,P)}},scanBipartite:function(t,e,r,a,o,f,h,d,p,g,v,y){var x=0,b=2*t,_=e,w=e+t,M=1,k=1;a?k=l:M=l;for(var A=o;A>>1;s(m,L);var C=0;for(A=0;A=l?(D=!a,T-=l):(D=!!a,T-=1),D)i(c,u,C++,T);else{var I=y[T],P=b*T,O=v[P+e+1],F=v[P+e+1+t];t:for(var R=0;R>>1;s(m,M);var k=0;for(x=0;x=l)c[k++]=b-l;else{var T=d[b-=1],S=g*b,E=h[S+e+1],L=h[S+e+1+t];t:for(var C=0;C=0;--C)if(c[C]===b){for(P=C+1;PP)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?function(t,e,r){if(e<0||t.byteLength=P)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P.toString(16)+" bytes");return 0|t}function u(t,e){if(i.isBuffer(t))return t.length;if(C(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function f(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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,z(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:p(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var 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}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function _(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,c,u,f;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],c=t[i+2],128==(192&l)&&128==(192&c)&&(f=(15&a)<<12|(63&l)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(f=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>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<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function k(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 A(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),I.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),I.write(t,e,r,n,52,8),r+8}function S(t,e){e=e||1/0;for(var r,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 E(t){return D.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function z(t){return t!=t}var D=t("base64-js"),I=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var P=2147483647;r.kMaxLength=P,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=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 m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){M(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){M(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},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var n,a=[],o=e;o0?u-4:u;var f=0;for(e=0,r=0;e>16&255,c[f++]=a>>8&255,c[f++]=255&a;return 2===o?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,c[f++]=255&a):1===o&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,c[f++]=a>>8&255,c[f++]=255&a),c},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",s=[],l=0,c=r-n;lc?c:l+16383));return 1===n?(e=t[r-1],i+=o[e>>2],i+=o[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=o[e>>10],i+=o[e>>4&63],i+=o[e<<2&63],i+="="),s.push(i),s.join("")};for(var o=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=c.length;u0;){for(var d=r.pop(),p=(u=-1,f=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),n(t,e,r,u,s,f),n(t,e,r,s,f,u),n(t,e,r,f,d,u),n(t,e,r,d,u,f))}}},{"binary-search-bounds":89,"robust-in-sphere":513}],86:[function(t,e,r){"use strict";function n(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 i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}var a=t("binary-search-bounds");e.exports=function(t,e,r){var a=function(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var p=0;p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var v=function(t,e,r){for(var n=0,i=0;i1&&h(r[u[d-2]],r[u[d-1]],n)>0;)t.push([u[d-1],u[d-2],i]),d-=1;u.length=d,u.push(i);var p=c.upperIds;for(d=p.length;d>1&&h(r[p[d-2]],r[p[d-1]],n)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var r;return(r=t.a[0]v[0]&&l.push(new i(v,g,m,f),new i(g,v,p,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),x=[new n([y,1],[y,0],-1,[],[],[],[])],b=[],_=(f=0,l.length);f<_;++f){var w=l[f],M=w.type;M===d?s(b,x,t,w.a,w.idx):M===m?c(x,0,w):u(x,0,w)}return b}},{"binary-search-bounds":89,"robust-orientation":515}],88:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],90:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],94:[function(t,e,r){"use strict";function n(t){var e=m(t);return[v(e,-1/0),v(e,1/0)]}function i(t){for(var e=new Array(t.length),r=0;re[2]?1:0)}function l(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[o=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=b;b=_,_=k}x[0]=b;var A,T=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===o;){var S,E=(S=n[--a])[1];i?e.push([T,E,A]):e.push([T,E]),T=E}i?e.push([T,_,A]):e.push([T,_])}return s}(t,e,o,c,r));return l(e,u,r),!!u||(o.length>0||c.length>0)}e.exports=function(t,e,r){var n;if(r){n=e;for(var o=new Array(e.length),s=0;s>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:93}],98:[function(t,e,r){"use strict";e.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]}},{}],99:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:93,"color-rgba":101,dtype:133}],100:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1);c=1,(h=u.length)<=4?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1];s=u=f.replace(/a$/,"");var h="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===u&&l.push(1),c=void 0===l[h]?1:l[h],l=l.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":98,defined:129,"is-plain-obj":286}],101:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?(e=Array(3),e[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):[]}},{clamp:93,"color-parse":100,"color-space/hsl":102}],102:[function(t,e,r){"use strict";var n=t("./rgb");e.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,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-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[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":103}],103:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],104:[function(t,e,r){e.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]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,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:0,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]}]}},{}],105:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,c,u,f,h,d,p,m,g,v,y,x=[],b=[],_=[],w=[];if(a.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!s[h])throw Error(h+" not a supported colorscale");f=o(s[h])}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);f=o(h)}if(f.length>p)throw new Error(h+" map requires nshades to be at least size "+f.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:o(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=f.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y=0}e.exports=function(t,e,r,o){var s=i(e,r,o);if(0===s){var l=a(i(t,e,r)),c=a(i(t,e,o));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,o)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,o)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:a(c-l)}var f=i(t,e,r);return f>0?s>0&&i(t,e,o)>0?1:-1:f<0?s>0||i(t,e,o)>0?1:-1:i(t,e,o)>0?1:n(t,e,r)?1:-1};var i=t("robust-orientation"),a=t("signum"),o=t("two-sum"),s=t("robust-product"),l=t("robust-sum")},{"robust-orientation":515,"robust-product":516,"robust-sum":520,signum:522,"two-sum":553}],107:[function(t,e,r){function n(t,e){return t-e}e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]);return i(l,t[2])-i(c,e[2])||i(l+t[2],o)-i(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+d-(p+m+g+v)||i(u,f,h,d)-i(p,m,g,v,p)||i(u+f,u+h,u+d,f+h,f+d,h+d)-i(p+m,p+g,p+v,m+g,m+v,g+v)||i(u+f+h,u+f+d,u+h+d,f+h+d)-i(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),x=e.slice().sort(n),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],111:[function(t,e,r){"use strict";e.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=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":45,"incremental-convex-hull":278}],113:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],114:[function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r;return(r=parseInt(e.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var u=e.substr(0,i),f=e.substr(i+1,l-(i+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=o(f[1]),m=o(f[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),h];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],115:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=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]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n},e.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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],116:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":118}],117:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(l=0;l0&&v.push("var "+y.join(",")),l=0;l3&&v.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&v.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var A=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",A,"(",g.join(","),"){",v.join("\n"),"} return ",A].join(""))()}},{uniq:556}],118:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u=0?(a>=b?10:a>=_?5:a>=w?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=b?10:a>=_?5:a>=w?2:1)}function n(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=b?i*=10:a>=_?i*=5:a>=w&&(i*=2),ee?1:t>=e?0:NaN},o=function(t){return 1===t.length&&(t=function(t){return function(e,r){return a(t(e),r)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},s=o(a),l=s.right,c=s.left,u=function(t){return null===t?NaN:+t},f=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},h=function(t,e){var r=f(t,e);return r?Math.sqrt(r):r},d=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},A=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},T=function(t){if(!(a=t.length))return[];for(var e=-1,r=A(t,i),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=h,t.extent=d,t.histogram=function(){function t(t){var a,o,s=t.length,c=new Array(s);for(a=0;ah;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)(m=g[a]=[]).x0=a>0?d[a-1]:f,m.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=A,t.pairs=function(t,r){null==r&&(r=e);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l=u.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,c,f,h=-1,d=e.length,p=u[n++],m=r(),g=i();++hu.length)return t;var n,i=f[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],f=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return f[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},t.set=l,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],122:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=E.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=L.exec(t))?i(parseInt(e[1],16)):(e=C.exec(t))?new l(e[1],e[2],e[3],1):(e=z.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=D.exec(t))?a(e[1],e[2],e[3],e[4]):(e=I.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=P.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=O.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,r,n)}function u(t,e,i,a){return 1===arguments.length?function(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;var e=(t=t.rgb()).r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new f(l,c,u,t.opacity)}(t):new f(t,e,i,null==a?1:a)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function h(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function d(t){if(t instanceof m)return new m(t.l,t.a,t.b,t.opacity);if(t instanceof _){var e=t.h*R;return new m(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/j),s=g((.2126729*r+.7151522*n+.072175*i)/B);return new m(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/U)),t.opacity)}function p(t,e,r,n){return 1===arguments.length?d(t):new m(t,e,r,null==n?1:n)}function m(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>G?Math.pow(t,1/3):t/H+V}function v(t){return t>q?t*t*t:H*(t-V)}function y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function b(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof _)return new _(t.h,t.c,t.l,t.opacity);t instanceof m||(t=d(t));var e=Math.atan2(t.b,t.a)*N;return new _(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function w(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,s=(X*(r-i)-Y*a)/W,c=Math.sqrt(s*s+a*a)/(X*i*(1-i)),u=c?Math.atan2(s,a)*N-120:NaN;return new M(u<0?u+360:u,c,i,t.opacity)}(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var k=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},A="\\s*([+-]?\\d+)\\s*",T="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E=/^#([0-9a-f]{3})$/,L=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[A,A,A]+"\\)$"),z=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),D=new RegExp("^rgba\\("+[A,A,A,T]+"\\)$"),I=new RegExp("^rgba\\("+[S,S,S,T]+"\\)$"),P=new RegExp("^hsl\\("+[T,S,S]+"\\)$"),O=new RegExp("^hsla\\("+[T,S,S,T]+"\\)$"),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),k(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),k(f,u,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(h(t>=240?t-240:t+120,i,n),h(t,i,n),h(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var R=Math.PI/180,N=180/Math.PI,j=.95047,B=1,U=1.08883,V=4/29,q=6/29,H=3*q*q,G=q*q*q;k(m,p,e(r,{brighter:function(t){return new m(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new m(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=B*v(t),e=j*v(e),r=U*v(r),new l(y(3.2404542*e-1.5371385*t-.4985314*r),y(-.969266*e+1.8760108*t+.041556*r),y(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),k(_,b,e(r,{brighter:function(t){return new _(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}));var Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=1.78277*X,K=1.78277*Y- -.14861*W;k(M,w,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*R,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(-.14861*n+1.78277*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=u,t.lab=p,t.hcl=b,t.cubehelix=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],123:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",i),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;ad+s||np+s||if.index){var l=d-a.x-a.vx,u=p-a.y-a.vy,v=l*l+u*u;vt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e=m)){(t.data!==o||t.next)&&(0===i&&(i=h(),u+=i*i),0===a&&(a=h(),u+=a*a),u1?(null==e?g.remove(t):g.set(t,s(e)),l):g.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,r=0,o=n.length;r180||r<-180?r-360*Math.round(r/360):r):x(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?o:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):x(isNaN(e)?r:e)}}function o(t,e){var r=e-t;return r?n(t,r):x(isNaN(t)?e:t)}function s(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:A(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:A(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:A(t,r)},{i:s-2,x:A(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(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:A(r,n)})),a=E.lastIndex;return a=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}function r(t){return t[0]}function n(t){return t[1]}function i(t,e,i){var o=new a(null==e?r:e,null==i?n:i,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function a(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function o(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var s=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},l=i.prototype=a.prototype;l.copy=function(){var t,e,r=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=o(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=o(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,r){var n,i,a,o,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new s(g,f,h,d,p)),null==r?r=1/0:(f=t-r,h=e-r,d=t+r,p=e+r,r*=r);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(a=c.y0)>p||(o=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(p+g)/2))?p=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--f}function o(){g=(m=y.now())+v,f=h=0;try{a()}finally{f=0,function(){var t,e,r=c,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);u=t,l(n)}(),g=0}}function s(){var t=y.now(),e=t-m;e>p&&(v-=e,m=t)}function l(t){if(!f){h&&(h=clearTimeout(h));var e=t-g;e>24?(t<1/0&&(h=setTimeout(o,e)),d&&(d=clearInterval(d))):(d||(m=g,d=setInterval(s,p)),f=1,x(o))}}var c,u,f=0,h=0,d=0,p=1e3,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,x="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||u===this||(u?u._next=this:c=this,u=this),this._call=t,this._time=n,l()},stop:function(){this._call&&(this._call=null,this._time=1/0,l())}};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},t.interval=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],128:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(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}}}function s(t){return t.length}function l(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function u(t){return(t+="")===ua||t[0]===fa?fa+t:t}function f(t){return(t+="")[0]===fa?t.slice(1):t}function h(t){return u(t)in this._}function d(t){return(t=u(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(f(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ha.length;r0&&(t=t.slice(0,a));var s=wa.get(t);return s&&(t=s,o=G),a?e?function(){var a=o(e,ea(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}:n:e?b:function(){var e,r=new RegExp("^__on([^.]+)"+$i.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]}}}function H(t,e){return function(r){var n=$i.event;$i.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{$i.event=n}}}function G(t,e){var r=H(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}function Y(e){var n=".dragsuppress-"+ ++ka,i="click"+n,a=$i.select(r(e)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==Ma&&(Ma=!("onselectstart"in e)&&x(e.style,"userSelect")),Ma){var o=t(e).style,s=o[Ma];o[Ma]="none"}return function(t){if(a.on(n,null),Ma&&(o[Ma]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Aa<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=$i.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Aa=!(o.f||o.e),n.remove()}}return Aa?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function X(){return $i.event.changedTouches[0].identifier}function Z(t){return t>0?1:t<0?-1:0}function J(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function K(t){return t>1?0:t<-1?Ea:Math.acos(t)}function Q(t){return t>1?za:t<-1?-za:Math.asin(t)}function $(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return(t=Math.sin(t/2))*t}function et(){}function rt(t,e,r){return this instanceof rt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof rt?new rt(t.h,t.s,t.l):gt(""+t,vt,rt):new rt(t,e,r)}function nt(t,e,r){function n(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(a-i)*t/60:t<180?a:t<240?i+(a-i)*(240-t)/60:i}(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,a=r<=.5?r*(1+e):r+e-r*e,i=2*r-a,new ht(n(t+120),n(t),n(t-120))}function it(t,e,r){return this instanceof it?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof it?new it(t.h,t.c,t.l):lt(t instanceof ot?t.l:(t=yt((t=$i.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new it(t,e,r)}function at(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ot(r,Math.cos(t*=Da)*e,Math.sin(t)*e)}function ot(t,e,r){return this instanceof ot?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ot?new ot(t.l,t.a,t.b):t instanceof it?at(t.h,t.c,t.l):yt((t=ht(t)).r,t.g,t.b):new ot(t,e,r)}function st(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=ct(i)*Ua,n=ct(n)*Va,a=ct(a)*qa,new ht(ft(3.2404542*i-1.5371385*n-.4985314*a),ft(-.969266*i+1.8760108*n+.041556*a),ft(.0556434*i-.2040259*n+1.0572252*a))}function lt(t,e,r){return t>0?new it(Math.atan2(r,e)*Ia,Math.sqrt(e*e+r*r),t):new it(NaN,NaN,t)}function ct(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ut(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ft(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ht(t,e,r){return this instanceof ht?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ht?new ht(t.r,t.g,t.b):gt(""+t,ht,nt):new ht(t,e,r)}function dt(t){return new ht(t>>16,t>>8&255,255&t)}function pt(t){return dt(t)+""}function mt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function gt(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(bt(i[0]),bt(i[1]),bt(i[2]))}return(a=Ya.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 vt(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 rt(n,i,l)}function yt(t,e,r){var n=ut((.4124564*(t=xt(t))+.3575761*(e=xt(e))+.1804375*(r=xt(r)))/Ua),i=ut((.2126729*t+.7151522*e+.072175*r)/Va);return ot(116*i-16,500*(n-i),200*(i-ut((.0193339*t+.119192*e+.9503041*r)/qa)))}function xt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function _t(t){return"function"==typeof t?t:function(){return t}}function wt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Mt(e,r,t,n)}}function Mt(t,e,r,n){function i(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=$i.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=$i.event;$i.event=t;try{o.progress.call(a,l)}finally{$i.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ea(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},$i.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}function kt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return Xa?Xa.n=i:Wa=i,Xa=i,Za||(Ja=clearTimeout(Ja),Za=1,Ka(At)),i}function At(){var t=Tt(),e=St()-t;e>24?(isFinite(e)&&(clearTimeout(Ja),Ja=setTimeout(At,e)),Za=0):(Za=1,Ka(At))}function Tt(){for(var t=Date.now(),e=Wa;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function St(){for(var t,e=Wa,r=1/0;e;)e.c?(e.t1?Date.UTC.apply(this,arguments):arguments[0])}function Ct(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3)}(+n[0]),r+n[0].length):-1}function Bt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ut(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Vt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function qt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function Ht(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Gt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Yt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Wt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Xt(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=ca(e)/60|0,i=ca(e)%60;return r+Dt(n,"0",2)+Dt(i,"0",2)}function Zt(t,e,r){oo.lastIndex=0;var n=oo.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jt(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,f=i*l+u*Math.cos(s),h=u*o*Math.sin(s);ho.add(Math.atan2(h,f)),n=t,i=l,a=c}var e,r,n,i,a;po.point=function(o,s){po.point=t,n=(e=o)*Da,i=Math.cos(s=(r=s)*Da/2+Ea/4),a=Math.sin(s)},po.lineEnd=function(){t(e,r)}}function ne(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function oe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function se(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function le(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ce(t){return[Math.atan2(t[1],t[0]),Q(t[2])]}function ue(t,e){return ca(t[0]-e[0])=0;--s)i.point((f=u[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function xe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(we))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=$i.merge(d);var t=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;ho.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>Ea,A=p*x;if(ho.add(Math.atan2(A*w*Math.sin(M),m*b+A*Math.cos(M))),a+=k?_+w*La:_,k^h>=r^v>=r){var T=ae(ne(f),ne(t));le(T);var S=ae(i,T);le(S);var E=(k^_>=0?-1:1)*Q(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;h=v,p=x,m=b,f=t}}return(a<-Ta||a1}function Me(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:b,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ke(t,e){return((t=t.x)[0]<0?t[1]-za-Ta:za-t[1])-((e=e.x)[0]<0?e[1]-za-Ta:za-e[1])}function Ae(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,d=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>u&&(u=a)}else if(d>0){if(a0&&(i.a={x:l+u*h,y:c+u*d}),f<1&&(i.b={x:l+f*h,y:c+f*d}),i}}}}}}function Te(t,e,r,n){function i(n,i){return ca(n[0]-t)0?0:3:ca(n[0]-r)0?2:1:ca(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(a,s,l,c){var u=0,f=0;if(null==a||(u=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==f);else c.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function u(t,e){c(t,e)&&s.point(t,e)}function f(t,e){var r=c(t=Math.max(-Eo,Math.min(Eo,t)),e=Math.max(-Eo,Math.min(Eo,e)));if(d&&p.push([t,e]),_)m=t,g=e,v=r,_=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&b)s.point(t,e);else{var n={a:{x:y,y:x},b:{x:t,y:e}};A(n)?(b||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),w=!1):r&&(s.lineStart(),s.point(t,e),w=!1)}y=t,x=e,b=r}var h,d,p,m,g,v,y,x,b,_,w,M=s,k=Me(),A=Ae(t,e,r,n),T={point:u,lineStart:function(){T.point=f,d&&d.push(p=[]),_=!0,b=!1,y=x=NaN},lineEnd:function(){h&&(f(m,g),v&&b&&k.rejoin(),h.push(k.buffer())),T.point=u,b&&s.lineEnd()},polygonStart:function(){s=k,h=[],d=[],w=!0},polygonEnd:function(){s=M,h=$i.merge(h);var e=function(t){for(var e=0,r=d.length,n=t[1],i=0;in&&J(c,a,t)>0&&++e:a[1]<=n&&J(c,a,t)<0&&--e,c=a;return 0!==e}([t,n]),r=w&&e,i=h.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&ye(h,a,e,l,s),s.polygonEnd()),h=d=p=null}};return T}}function Se(t){var e=0,r=Ea/3,n=je(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Ea/180,r=t[1]*Ea/180):[e/Ea*180,r/Ea*180]},i}function Ee(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,Q((a-(t*t+r*r)*i*i)/(2*i))]},r}function Le(){function t(t,e){Co+=i*t-n*e,n=t,i=e}var e,r,n,i;Oo.point=function(a,o){Oo.point=t,e=n=a,r=i=o},Oo.lineEnd=function(){t(e,r)}}function Ce(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ze(t,e){vo+=t,yo+=e,++xo}function De(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);bo+=o*(e+t)/2,_o+=o*(r+n)/2,wo+=o,ze(e=t,r=n)}var e,r;Ro.point=function(n,i){Ro.point=t,ze(e=n,r=i)}}function Ie(){Ro.point=ze}function Pe(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);bo+=o*(n+t)/2,_o+=o*(i+e)/2,wo+=o,Mo+=(o=i*t-n*e)*(n+t),ko+=o*(i+e),Ao+=3*o,ze(n=t,i=e)}var e,r,n,i;Ro.point=function(a,o){Ro.point=t,ze(e=n=a,r=i=o)},Ro.lineEnd=function(){t(e,r)}}function Oe(t){function e(e){return(a?function(e){function n(r,n){r=t(r,n),e.point(r[0],r[1])}function i(){y=NaN,M.point=o,e.lineStart()}function o(n,i){var o=ne([n,i]),s=t(n,i);r(y,x,v,b,_,w,y=s[0],x=s[1],v=n,b=o[0],_=o[1],w=o[2],a,e),e.point(y,x)}function s(){M.point=n,e.lineEnd()}function l(){i(),M.point=c,M.lineEnd=u}function c(t,e){o(f=t,e),h=y,d=x,p=b,m=_,g=w,M.point=o}function u(){r(y,x,v,b,_,w,h,d,f,p,m,g,a,e),M.lineEnd=s,s()}var f,h,d,p,m,g,v,y,x,b,_,w,M={point:n,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),M.lineStart=l},polygonEnd:function(){e.polygonEnd(),M.lineStart=i}};return M}:function(e){return Re(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function r(e,a,o,s,l,c,u,f,h,d,p,m,g,v){var y=u-e,x=f-a,b=y*y+x*x;if(b>4*n&&g--){var _=s+d,w=l+p,M=c+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=ca(ca(M)-1)n||ca((y*C+x*z)/b-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(n)},e}function Fe(t){this.stream=t}function Re(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ne(t){return je(function(){return t})()}function je(t){function e(t){return t=o(t[0]*Da,t[1]*Da),[t[0]*f+s,l-t[1]*f]}function r(){o=ge(a=qe(g,v,x),i);var t=i(p,m);return s=h-t[0]*f,l=d+t[1]*f,n()}function n(){return c&&(c.valid=!1,c=null),e}var i,a,o,s,l,c,u=Oe(function(t,e){return t=i(t,e),[t[0]*f+s,l-t[1]*f]}),f=150,h=480,d=250,p=0,m=0,g=0,v=0,x=0,b=So,_=y,w=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=Be(b(a,u(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(b=null==t?(w=t,So):function(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t,e,r){var n=[1,0,0],a=ae(ne(t),ne(e)),o=ie(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=i*o/l,u=-i*s/l,f=ae(n,a),h=se(n,c);oe(h,se(a,u));var d=f,p=ie(h,d),m=ie(d,d),g=p*p-m*(ie(h,h)-1);if(!(g<0)){var v=Math.sqrt(g),y=se(d,(-p-v)/m);if(oe(y,h),y=ce(y),!r)return y;var x,b=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(ca(y[0]-b)Ea^(b<=y[0]&&y[0]<=_)){var T=se(d,(-p+v)/m);return oe(T,h),[y,ce(T)]}}}function n(e,r){var n=a?t:Ea-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var i=Math.cos(t),a=i>0,o=ca(i)>Ta;return _e(e,function(t){var i,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=e(f,h),g=a?m?0:n(f,h):m?n(f+(f<0?Ea:-Ea),h):0;if(!i&&(c=l=m)&&t.lineStart(),m!==l&&(d=r(i,p),(ue(i,d)||ue(p,d))&&(p[0]+=Ta,p[1]+=Ta,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=r(p,i),t.point(d[0],d[1])):(d=r(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(o&&i&&a^m){var v;g&s||!(v=r(p,i,!0))||(u=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||i&&ue(i,p)||t.point(p[0],p[1]),i=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},We(t,6*Da),a?[0,-t]:[-Ea,t-Ea])}((w=+t)*Da),n()):w},e.clipExtent=function(t){return arguments.length?(M=t,_=t?Te(t[0][0],t[0][1],t[1][0],t[1][1]):y,n()):M},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],r()):[h,d]},e.center=function(t){return arguments.length?(p=t[0]%360*Da,m=t[1]%360*Da,r()):[p*Ia,m*Ia]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Da,v=t[1]%360*Da,x=t.length>2?t[2]%360*Da:0,r()):[g*Ia,v*Ia,x*Ia]},$i.rebind(e,u,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&function(t){return(t=o.invert((t[0]-s)/f,(l-t[1])/f))&&[t[0]*Ia,t[1]*Ia]},r()}}function Be(t){return Re(t,function(e,r){t.point(e*Da,r*Da)})}function Ue(t,e){return[t,e]}function Ve(t,e){return[t>Ea?t-La:t<-Ea?t+La:t,e]}function qe(t,e,r){return t?e||r?ge(Ge(t),Ye(e,r)):Ge(t):e||r?Ye(e,r):Ve}function He(t){return function(e,r){return e+=t,[e>Ea?e-La:e<-Ea?e+La:e,r]}}function Ge(t){var e=He(t);return e.invert=He(-t),e}function Ye(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),Q(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),Q(u*n-s*i)]},r}function We(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Xe(r,i),a=Xe(r,a),(o>0?ia)&&(i+=o*La)):(i=t+o*La,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-za+Ta&&(e=-za+Ta):e>za-Ta&&(e=za-Ta);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Ea/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=Z(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-za]},r):rr}function er(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return ca(i)1&&J(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function lr(t,e){return t[0]-e[0]||t[1]-e[1]}function cr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ur(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function fr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function hr(t){var e=Ko.pop()||new function(){Sr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function dr(t){_r(t),Xo.remove(t),Ko.push(t),Sr(t)}function pr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];dr(t);for(var l=a;l.circle&&ca(r-l.circle.x)Ta)s=s.L;else{if(!((i=a-function(t,e){var r=t.N;if(r)return gr(r,e);var n=t.site;return n.y===e?n.x:1/0}(s,o))>Ta)){n>-Ta?(e=s.P,r=s):i>-Ta?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=hr(t);if(Xo.insert(e,l),e||r){if(e===r)return _r(e),r=hr(e.site),Xo.insert(l,r),l.edge=r.edge=Mr(e.site,l.site),br(e),void br(r);if(r){_r(e),_r(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,g=p.y-f,v=2*(h*g-d*m),y=h*h+d*d,x=m*m+g*g,b={x:(g*y-d*x)/v+u,y:(h*x-m*y)/v+f};kr(r.edge,c,p,b),l.edge=Mr(c,t,null,b),r.edge=Mr(t,p,null,b),br(e),br(r)}else l.edge=Mr(e.site,l.site)}}function gr(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,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function vr(t){this.site=t,this.edges=[]}function yr(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=Wo,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;oTa||ca(i-r)>Ta)&&(s.splice(o,0,new Ar(function(t,e,r){var n=new wr(t,null);return n.a=e,n.b=r,Yo.push(n),n}(a.site,u,ca(n-f)Ta?{x:f,y:ca(e-f)Ta?{x:ca(r-p)Ta?{x:h,y:ca(e-h)Ta?{x:ca(r-d)=-Sa)){var h=l*l+c*c,d=u*u+g*g,p=(g*h-c*d)/f,m=(l*d-u*h)/f,g=m+s,v=Qo.pop()||new function(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,x=Jo._;x;)if(v.y=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}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.xa&&(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:Nr(r,n)})),a=es.lastIndex;return a=0&&!(r=$i.interpolators[n](t,e)););return r}function Ur(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(tn(r)+"rotate(",null,")")-2,x:Nr(t,e)})):e&&r.push(tn(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(tn(r)+"skewX(",null,")")-2,x:Nr(t,e)}):e&&r.push(tn(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(tn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Nr(t[0],e[0])},{i:i-2,x:Nr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(tn(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function pn(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;++oi&&(n=r,i=e);return n}function An(t){return t.reduce(Tn,0)}function Tn(t,e){return t+e[1]}function Sn(t,e){return En(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function En(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 Ln(t){return[$i.min(t),$i.max(t)]}function Cn(t,e){return t.value-e.value}function zn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Dn(t,e){t._pack_next=e,e._pack_prev=t}function In(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 Pn(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,f=-1/0,h=1/0,d=-1/0;if(r.forEach(On),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(Nn(n,i,a=r[2]),e(a),zn(n,a),n._pack_prev=a,zn(a,i),i=n._pack_next,o=3;o2?Kn:Xn,l=n?nn:rn;return o=i(t,e,l,r),s=i(e,t,l,Br),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Jr)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ri(t,e)},a.tickFormat=function(e,r){return ni(t,e,r)},a.nice=function(e){return ti(t,e),i()},a.copy=function(){return Qn(t,e,r,n)},i()}function $n(t,e){return $i.rebind(t,e,"range","rangeRound","interpolate","clamp")}function ti(t,e){return Zn(t,Jn(ei(t,e)[2])),Zn(t,Jn(ei(t,e)[2])),t}function ei(t,e){null==e&&(e=10);var r=Yn(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 ri(t,e){return $i.range.apply($i,ei(t,e))}function ni(t,e,r){var n=ei(t,e);if(r){var i=$a.exec(r);if(i.shift(),"s"===i[8]){var a=$i.formatPrefix(Math.max(ca(n[0]),ca(n[1])));return i[7]||(i[7]="."+ii(a.scale(n[2]))),i[8]="f",r=$i.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+function(t,e){var r=ii(e[2]);return t in ds?Math.abs(r-ii(Math.max(ca(e[0]),ca(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],n)),r=i.join("")}else r=",."+ii(n[2])+"f";return $i.format(r)}function ii(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ai(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=Zn(n.map(i),r?Math:ms);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Yn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;h--)o.push(a(c)*h);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return ps;arguments.length<2?r=ps:"function"!=typeof r&&(r=$i.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function bi(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,g=h-u,v=d-f,y=g*g+v*v,x=r-n,b=u*d-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,M=(-b*g-v*_)/y,k=(b*v+g*_)/y,A=(-b*g+v*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-c],[w*r/x,M*r/x]]}function _i(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],f=-1,h=e.length,d=_t(r),p=_t(n);++f1?t.join("L"):t+"Z"}function Mi(t){return t.join("L")+"Z"}function ki(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 c=2;c9&&(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}function Ii(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,f,h,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=kt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function Yi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Wi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function Xi(t){return t.toISOString()}function Zi(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=$i.bisect(Bs,n);return i==Bs.length?[e.year,ei(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Bs[i-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=Ji(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=Ji(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Yn(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],Ji(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Zi(t.copy(),e,r)},$n(n,t)}function Ji(t){return new Date(t)}function Ki(t){return JSON.parse(t.responseText)}function Qi(t){var e=ra.createRange();return e.selectNode(ra.body),e.createContextualFragment(t.responseText)}var $i={version:"3.5.17"},ta=[].slice,ea=function(t){return ta.call(t)},ra=this.document;if(ra)try{ea(ra.documentElement.childNodes)[0].nodeType}catch(t){ea=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}),ra)try{ra.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var na=this.Element.prototype,ia=na.setAttribute,aa=na.setAttributeNS,oa=this.CSSStyleDeclaration.prototype,sa=oa.setProperty;na.setAttribute=function(t,e){ia.call(this,t,e+"")},na.setAttributeNS=function(t,e,r){aa.call(this,t,e,r+"")},oa.setProperty=function(t,e,r){sa.call(this,t,e+"",r)}}$i.ascending=n,$i.descending=function(t,e){return et?1:e>=t?0:NaN},$i.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},$i.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},$i.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 l/(u-1)},$i.deviation=function(){var t=$i.variance.apply(this,arguments);return t?Math.sqrt(t):t};var la=o(n);$i.bisectLeft=la.left,$i.bisect=$i.bisectRight=la.right,$i.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},$i.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},$i.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},$i.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 ca=Math.abs;$i.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}(ca(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)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,f,h,d=-1,p=o.length,m=a[s++],g=new c;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t($i.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},$i.set=function(t){var e=new v;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}},$i.event=null,$i.requote=function(t){return t.replace(da,"\\$&")};var da=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,pa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},ma=function(t,e){return e.querySelector(t)},ga=function(t,e){return e.querySelectorAll(t)},va=function(t,e){var r=t.matches||t[x(t,"matchesSelector")];return(va=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(ma=function(t,e){return Sizzle(t,e)[0]||null},ga=Sizzle,va=Sizzle.matchesSelector),$i.selection=function(){return $i.select(ra.documentElement)};var ya=$i.selection.prototype=[];ya.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),ba.hasOwnProperty(r)?{space:ba[r],local:t}:t}},ya.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=$i.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ya.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=D(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},ya.sort=function(t){t=function(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.transition().duration(E)),e.call(t.event)}function o(){b&&b.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){L++||t({type:"zoomstart"})}function l(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=P.of(t,arguments),a=0,o=$i.select(r(t)).on(z,function(){a=1,i($i.mouse(t),u),l(n)}).on(D,function(){o.on(z,null).on(D,null),f(a),c(n)}),u=e($i.mouse(t)),f=Y(t);Cs.call(t),s(n)}function f(){function t(){var t=$i.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=$i.event.target;$i.select(e).on(b,o).on(_,h),w.push(e);for(var r=$i.event.changedTouches,n=0,i=r.length;n1){c=s[0];var u=s[1],f=c[0]-u[0],d=c[1]-u[1];v=f*f+d*d}}function o(){var t,e,r,a,o=$i.touches(p);Cs.call(p);for(var s=0,c=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++8?function(t){return t/r}:function(t){return t*r},symbol:t}});$i.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=$i.round(t,Et(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Qa[8+r/3]};var $a=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,to=$i.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=$i.round(t,Et(t,e))).toFixed(Math.max(0,Math.min(20,Et(t*(1+1e-15),e))))}}),eo=$i.time={},ro=Date;Lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){no.setUTCDate.apply(this._,arguments)},setDay:function(){no.setUTCDay.apply(this._,arguments)},setFullYear:function(){no.setUTCFullYear.apply(this._,arguments)},setHours:function(){no.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){no.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){no.setUTCMinutes.apply(this._,arguments)},setMonth:function(){no.setUTCMonth.apply(this._,arguments)},setSeconds:function(){no.setUTCSeconds.apply(this._,arguments)},setTime:function(){no.setTime.apply(this._,arguments)}};var no=Date.prototype;eo.year=Ct(function(t){return(t=eo.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),eo.years=eo.year.range,eo.years.utc=eo.year.utc.range,eo.day=Ct(function(t){var e=new ro(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),eo.days=eo.day.range,eo.days.utc=eo.day.utc.range,eo.dayOfYear=function(t){var e=eo.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=eo[t]=Ct(function(t){return(t=eo.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});eo[t+"s"]=r.range,eo[t+"s"].utc=r.utc.range,eo[t+"OfYear"]=function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)}}),eo.week=eo.sunday,eo.weeks=eo.sunday.range,eo.weeks.utc=eo.sunday.utc.range,eo.weekOfYear=eo.sundayOfYear;var io={"-":"",_:" ",0:"0"},ao=/^\s*\d+/,oo=/^%/;$i.locale=function(t){return{numberFormat:function(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:y;return function(t){var r=$a.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],f=r[7],h=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=to.get(d)||function(t){return t+""};var x=c&&f;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=$i.formatPrefix(t,h);t=l.scale(t),r=l.symbol+g}else t*=p;var b,_,w=(t=d(t,h)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(b=t,_=""):(b=t.substring(0,M),_=t.substring(M))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=a(b,1/0));var k=m.length+b.length+_.length+(x?0:i.length),A=k"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(x?t:A+t))+r}}}(t),timeFormat:function(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=_[o in io?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}var n=t.dateTime,i=t.date,a=t.time,o=t.periods,s=t.days,l=t.shortDays,c=t.months,u=t.shortMonths;e.multi=(e.utc=function(t){function r(t){try{var e=new(ro=Lt);return e._=t,n(e)}finally{ro=Date}}var n=e(t);return r.parse=function(t){try{ro=Lt;var e=n.parse(t);return e&&e._}finally{ro=Date}},r.toString=n.toString,r}).multi=Jt;var f=$i.map(),h=It(s),d=Pt(s),p=It(l),m=Pt(l),g=It(c),v=Pt(c),y=It(u),x=Pt(u);o.forEach(function(t,e){f.set(t.toLowerCase(),e)});var b={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Dt(t.getDate(),e,2)},e:function(t,e){return Dt(t.getDate(),e,2)},H:function(t,e){return Dt(t.getHours(),e,2)},I:function(t,e){return Dt(t.getHours()%12||12,e,2)},j:function(t,e){return Dt(1+eo.dayOfYear(t),e,3)},L:function(t,e){return Dt(t.getMilliseconds(),e,3)},m:function(t,e){return Dt(t.getMonth()+1,e,2)},M:function(t,e){return Dt(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Dt(t.getSeconds(),e,2)},U:function(t,e){return Dt(eo.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Dt(eo.mondayOfYear(t),e,2)},x:e(i),X:e(a),y:function(t,e){return Dt(t.getFullYear()%100,e,2)},Y:function(t,e){return Dt(t.getFullYear()%1e4,e,4)},Z:Xt,"%":function(){return"%"}},_={a:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){h.lastIndex=0;var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,n){return r(t,b.c.toString(),e,n)},d:Vt,e:Vt,H:Ht,I:Ht,j:qt,L:Wt,m:Ut,M:Gt,p:function(t,e,r){var n=f.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Yt,U:Ft,w:Ot,W:Rt,x:function(t,e,n){return r(t,b.x.toString(),e,n)},X:function(t,e,n){return r(t,b.X.toString(),e,n)},y:jt,Y:Nt,Z:Bt,"%":Zt};return e}(t)}};var so=$i.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});$i.format=so.numberFormat,$i.geo={},Kt.prototype={s:0,t:0,add:function(t){Qt(t,this.t,lo),Qt(lo.s,this.s,this),this.s?this.t+=lo.t:this.s=lo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var lo=new Kt;$i.geo.stream=function(t,e){t&&co.hasOwnProperty(t.type)?co[t.type](t,e):$t(t,e)};var co={Feature:function(t,e){$t(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ne([e*Da,r*Da]);if(v){var i=ae(v,n),a=ae([i[1],-i[0],0],i);le(a),a=ce(a);var o=e-p,l=o>0?1:-1,c=a[0]*Ia*l,m=ca(o)>180;if(m^(l*pd&&(d=g)}else if(c=(c+360)%360-180,m^(l*pd&&(d=r);m?es(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e):h>=u?(eh&&(h=e)):e>p?s(u,e)>s(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=h,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=ca(n)>180?n+(n>0?360:-360):n}else m=t,g=r;po.point(t,r),e(t,r)}function a(){po.lineStart()}function o(){i(m,g),po.lineEnd(),ca(y)>Ta&&(u=-(h=180)),b[0]=u,b[1]=h,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tTa?d=90:y<-Ta&&(f=-90),b[0]=u,b[1]=h}};return function(t){d=h=-(u=f=1/0),x=[],$i.geo.stream(t,_);if(i=x.length){x.sort(l);for(var e=1,r=[p=x[0]];es(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):r.push(p=a);for(var n,i,a,o=-1/0,p=(e=0,r[i=r.length-1]);e<=i;p=a,++e)a=r[e],(n=s(p[1],a[0]))>o&&(o=n,u=a[0],h=p[1])}return x=b=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[h,d]]}}(),$i.geo.centroid=function(t){mo=go=vo=yo=xo=bo=_o=wo=Mo=ko=Ao=0,$i.geo.stream(t,To);var e=Mo,r=ko,n=Ao,i=e*e+r*r+n*n;return i0?Ea:-Ea,l=ca(a-r);ca(l-Ea)0?za:-za),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Ea&&(ca(r-i)Ta?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*za,n.point(-Ea,i),n.point(0,i),n.point(Ea,i),n.point(Ea,0),n.point(Ea,-i),n.point(0,-i),n.point(-Ea,-i),n.point(-Ea,0),n.point(-Ea,i);else if(ca(t[0]-e[0])>Ta){var a=t[0]=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],f=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(l).point,n=o.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ta,f+.12*c+Ta],[u-.214*c-Ta,f+.234*c-Ta]]).stream(l).point,i=s.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ta,f+.166*c+Ta],[u-.115*c-Ta,f+.234*c-Ta]]).stream(l).point,t},t.scale(1070)};var Lo,Co,zo,Do,Io,Po,Oo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Co=0,Oo.lineStart=Le},polygonEnd:function(){Oo.lineStart=Oo.lineEnd=Oo.point=b,Lo+=ca(Co/2)}},Fo={point:function(t,e){tIo&&(Io=t),ePo&&(Po=e)},lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ro={point:ze,lineStart:De,lineEnd:Ie,polygonStart:function(){Ro.lineStart=Pe},polygonEnd:function(){Ro.point=ze,Ro.lineStart=De,Ro.lineEnd=Ie}};$i.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),$i.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Lo=0,$i.geo.stream(t,i(Oo)),Lo},t.centroid=function(t){return vo=yo=xo=bo=_o=wo=Mo=ko=Ao=0,$i.geo.stream(t,i(Ro)),Ao?[Mo/Ao,ko/Ao]:wo?[bo/wo,_o/wo]:xo?[vo/xo,yo/xo]:[NaN,NaN]},t.bounds=function(t){return Io=Po=-(zo=Do=1/0),$i.geo.stream(t,i(Fo)),[[zo,Do],[Io,Po]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||function(t){var e=Oe(function(e,r){return t([e*Ia,r*Ia])});return function(t){return Be(e(t))}}(t):y,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new function(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ce(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ce(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}:new function(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,La)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:b};return s}(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection($i.geo.albersUsa()).context(null)},$i.geo.transform=function(t){return{stream:function(e){var r=new Fe(e);for(var n in t)r[n]=t[n];return r}}},Fe.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},$i.geo.projection=Ne,$i.geo.projectionMutator=je,($i.geo.equirectangular=function(){return Ne(Ue)}).raw=Ue.invert=Ue,$i.geo.rotation=function(t){function e(e){return e=t(e[0]*Da,e[1]*Da),e[0]*=Ia,e[1]*=Ia,e}return t=qe(t[0]%360*Da,t[1]*Da,t.length>2?t[2]*Da:0),e.invert=function(e){return e=t.invert(e[0]*Da,e[1]*Da),e[0]*=Ia,e[1]*=Ia,e},e},Ve.invert=Ue,$i.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=qe(-t[0]*Da,-t[1]*Da,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Ia,t[1]*=Ia}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=We((e=+n)*Da,i*Da),t):e},t.precision=function(n){return arguments.length?(r=We(e*Da,(i=+n)*Da),t):i},t.angle(90)},$i.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Da,i=t[1]*Da,a=e[1]*Da,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},$i.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return $i.range(Math.ceil(a/g)*g,i,g).map(h).concat($i.range(Math.ceil(c/v)*v,l,v).map(d)).concat($i.range(Math.ceil(n/p)*p,r,p).filter(function(t){return ca(t%g)>Ta}).map(u)).concat($i.range(Math.ceil(s/m)*m,o,m).filter(function(t){return ca(t%v)>Ta}).map(f))}var r,n,i,a,o,s,l,c,u,f,h,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=Ze(s,o,90),f=Je(n,r,y),h=Ze(c,l,90),d=Je(a,i,y),t):y},t.majorExtent([[-180,-90+Ta],[180,90-Ta]]).minorExtent([[-180,-80-Ta],[180,80+Ta]])},$i.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=Ke,i=Qe;return t.distance=function(){return $i.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},$i.geo.interpolate=function(t,e){return function(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),c=i*Math.sin(t),u=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(tt(n-e)+i*o*tt(r-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,r=Math.sin(h-t)*d,n=r*l+e*u,i=r*c+e*f,o=r*a+e*s;return[Math.atan2(i,n)*Ia,Math.atan2(o,Math.sqrt(n*n+i*i))*Ia]}:function(){return[t*Ia,e*Ia]};return p.distance=h,p}(t[0]*Da,t[1]*Da,e[0]*Da,e[1]*Da)},$i.geo.length=function(t){return No=0,$i.geo.stream(t,jo),No};var No,jo={sphere:b,point:b,lineStart:function(){function t(t,i){var a=Math.sin(i*=Da),o=Math.cos(i),s=ca((t*=Da)-e),l=Math.cos(s);No+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;jo.point=function(i,a){e=i*Da,r=Math.sin(a*=Da),n=Math.cos(a),jo.point=t},jo.lineEnd=function(){jo.point=jo.lineEnd=b}},lineEnd:b,polygonStart:b,polygonEnd:b},Bo=$e(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});($i.geo.azimuthalEqualArea=function(){return Ne(Bo)}).raw=Bo;var Uo=$e(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);($i.geo.azimuthalEquidistant=function(){return Ne(Uo)}).raw=Uo,($i.geo.conicConformal=function(){return Se(tr)}).raw=tr,($i.geo.conicEquidistant=function(){return Se(er)}).raw=er;var Vo=$e(function(t){return 1/t},Math.atan);($i.geo.gnomonic=function(){return Ne(Vo)}).raw=Vo,rr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-za]},($i.geo.mercator=function(){return nr(rr)}).raw=rr;var qo=$e(function(){return 1},Math.asin);($i.geo.orthographic=function(){return Ne(qo)}).raw=qo;var Ho=$e(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});($i.geo.stereographic=function(){return Ne(Ho)}).raw=Ho,ir.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-za]},($i.geo.transverseMercator=function(){var t=nr(ir),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=ir,$i.geom={},$i.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=_t(r),a=_t(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+f;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Ta)*Ta,y:Math.round(o(t,e)/Ta)*Ta,i:e}})}var n=ar,i=or,a=n,o=i,s=$o;return t?e(t):(e.links=function(t){return zr(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return zr(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(xr),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,h=n>=u,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),f?i=c:s=c,h?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,f,h,d,p,m,g,v,y,x=_t(s),b=_t(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),f=[],h=[],p=t.length,o)for(d=0;dv&&(v=u.x),u.y>y&&(y=u.y),f.push(u.x),h.push(u.y);else for(d=0;dv&&(v=_),w>y&&(y=w),f.push(_),h.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null};if(A.add=function(t){a(A,t,+x(t,++d),+b(t,d),m,g,v,y)},A.visit=function(t){Or(t,A,m,g,v,y)},A.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,d){if(!(u>a||f>o||h=_)<<1|e>=b,M=w+4;w=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ns.get(r)||rs,n=is.get(n)||y,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}(n(r.apply(null,ta.call(arguments,1))))},$i.interpolateHcl=function(t,e){t=$i.hcl(t),e=$i.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return at(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateHsl=function(t,e){t=$i.hsl(t),e=$i.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return nt(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateLab=function(t,e){t=$i.lab(t),e=$i.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return st(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateRound=Jr,$i.transform=function(t){var e=ra.createElementNS($i.ns.prefix.svg,"g");return($i.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Kr(r?r.matrix:as)})(t)},Kr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var as={a:1,b:0,c:0,d:1,e:0,f:0};$i.interpolateTransform=en,$i.layout={},$i.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=kt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return pn(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=vn,r=mn,n=gn;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(dn(e,function(t){t.children&&(t.value=0)}),pn(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},$i.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&((o=l[$i.bisect(f,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Ln,i=Sn;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=_t(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return En(t,e)}:_t(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},$i.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,pn(s,function(t){t.r=+u(t.value)}),pn(s,Pn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;pn(s,function(t){t.r+=f}),pn(s,Pn),pn(s,function(t){t.r-=f})}return Rn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=$i.layout.hierarchy().sort(Cn),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},hn(t,r)},$i.layout.tree=function(){function t(t,l){var c=i.call(this,t,l),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;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 m=a(h,d)/2-h.x,g=o[0]/(d.x+a(d,h)/2+m),v=o[1]/(p.depth||1);dn(u,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return c}function e(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.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 i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+a(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+a(t._,n._));t.parent.A=function(t,e,r){if(e){for(var n,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,f=s.m,h=l.m;s=Un(s),i=Bn(i),s&&i;)l=Bn(l),(o=Un(o)).a=t,(n=s.z+f-i.z-c+a(s._,i._))>0&&(!function(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}(function(t,e,r){return t.a.parent===e.parent?t.a:r}(s,t,r),t,n),c+=n,u+=n),f+=s.m,c+=i.m,h+=l.m,u+=o.m;s&&!Un(o)&&(o.t=s,o.m+=f-u),i&&!Bn(l)&&(l.t=i,l.m+=c-h,r=t)}return r}(t,n,t.parent.A||r[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function n(t){t.x*=o[0],t.y=t.depth*o[1]}var i=$i.layout.hierarchy().sort(null).value(null),a=jn,o=[1,1],s=null;return t.separation=function(e){return arguments.length?(a=e,t):a},t.size=function(e){return arguments.length?(s=null==(o=e)?n:null,t):s?null:o},t.nodeSize=function(e){return arguments.length?(s=null==(o=e)?null:n,t):s?o:null},hn(t,i)},$i.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;pn(l,function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(e),t.y=function(t){return 1+$i.max(t,function(t){return t.y})}(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Vn(l),f=qn(l),h=u.x-r(u,f)/2,d=f.x+r(f,u)/2;return pn(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=$i.layout.hierarchy().sort(null).value(null),r=jn,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},hn(t,e)},$i.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(a=f[s-1]),c.area+=a.area,"squarify"!==h||(o=function(t,e){var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;for(;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}(c,m))<=p?(f.pop(),p=o):(c.area-=c.pop().area,n(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(n(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function r(e){var i=e.children;if(i&&i.length){var a,o=u(e),s=i.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(n(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);i.forEach(r)}}function n(t,e,r,n){var i,a=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=$i.random.normal.apply($i,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=$i.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rf?0:1;if(c=Ca)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,x,b,_,w,M,k,A,T=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===bs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(S*=-1),c&&(S=Q(g/c*Math.sin(v))),t&&(T=Q(g/t*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var L=Math.abs(f-u-2*S)<=Ea?0:1;if(S&&xi(y,x,b,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),M=t*Math.sin(f-T),k=t*Math.cos(u+T),A=t*Math.sin(u+T);var z=Math.abs(u-f+2*T)<=Ea?0:1;if(T&&xi(w,M,k,A)===1-d^z){var D=(u+f)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(h>Ta&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ai,basis:Ei,"basis-open":function(t){if(t.length<4)return wi(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(Li(ks,a)+","+Li(ks,o)),--n;++nEa)+",1 "+e}function n(t,e,r,n){return"Q 0,0 "+n}var i=Ke,a=Qe,o=Oi,s=gi,l=vi;return t.radius=function(e){return arguments.length?(o=_t(e),t):o},t.source=function(e){return arguments.length?(i=_t(e),t):i},t.target=function(e){return arguments.length?(a=_t(e),t):a},t.startAngle=function(e){return arguments.length?(s=_t(e),t):s},t.endAngle=function(e){return arguments.length?(l=_t(e),t):l},t},$i.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,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(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Ke,r=Qe,n=Fi;return t.source=function(r){return arguments.length?(e=_t(r),t):e},t.target=function(e){return arguments.length?(r=_t(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},$i.svg.diagonal.radial=function(){var t=$i.svg.diagonal(),e=Fi,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]-za;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},$i.svg.symbol=function(){function t(t,n){return(As.get(e.call(this,t,n))||ji)(r.call(this,t,n))}var e=Ni,r=Ri;return t.type=function(r){return arguments.length?(e=_t(r),t):e},t.size=function(e){return arguments.length?(r=_t(e),t):r},t};var As=$i.map({circle:ji,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*Ss)),r=e*Ss;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/Ts),r=e*Ts/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ts),r=e*Ts/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});$i.svg.symbolTypes=As.keys();var Ts=Math.sqrt(3),Ss=Math.tan(30*Da);ya.transition=function(t){for(var e,r,n=Es||++Ds,i=Hi(t),a=[],o=Ls||{time:Date.now(),ease:function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){var t=$i.mouse(x),r=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||($i.event.altKey?(v||(v=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(t[0]=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(u=0;u<_.length;++u)h=(b=_[u])[0],b[0]=b[1],b[1]=h;return _}},{"incremental-convex-hull":278,uniq:556}],131:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]};function a(t,e){return i[0]=t,i[1]=e,n[0]}e.exports.pack=a;function o(t){return n[0]=t,i[0]}e.exports.lo=o;function s(t){return n[0]=t,i[1]}e.exports.hi=s}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]};function l(t,e){return i[1]=t,i[0]=e,n[0]}e.exports.pack=l;function c(t){return n[0]=t,i[1]}e.exports.lo=c;function u(t){return n[0]=t,i[0]}e.exports.hi=u}else r=!1}if(!r){var f=new t(8);e.exports=function(t){return f.writeDoubleLE(t,0,!0),[f.readUInt32LE(0,!0),f.readUInt32LE(4,!0)]};function h(t,e){return f.writeUInt32LE(t,0,!0),f.writeUInt32LE(e,4,!0),f.readDoubleLE(0,!0)}e.exports.pack=h;function d(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(0,!0)}e.exports.lo=d;function p(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(4,!0)}e.exports.hi=p}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:82}],132:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":43,"normalize-svg-path":460}],133:[function(t,e,r){e.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}}},{}],134:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=f&&c(ar.x)&&d(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=p(e,t);a(r,r.next)}}(m[o],r),r=a(r,r.next);return r}(t,e,u,r)),t.length>80*r){h=g=t[0],m=v=t[1];for(var _=r;_g&&(g=y),x>v&&(v=x);b=Math.max(g-h,v-m)}return o(u,f,r,h,m,b),f}function i(t,e,r,n,i){var a,o;if(i===y(t,e,r,n)>0)for(a=e;a=e;a-=n)o=m(a,t[a],t[a+1],o);return o&&f(o,o.next)&&(g(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!f(n,n.next)&&0!==u(n.prev,n,n.next))n=n.next;else{if(g(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,s,m){if(t){!m&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=l(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,s);for(var v,y,x=t;t.prev!==t.next;)if(v=t.prev,y=t.next,s?function(t,e,r,n){var i=t.prev,a=t,o=t.next;if(u(i,a,o)>=0)return!1;var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,d=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=l(s,f,e,r,n),m=l(h,d,e,r,n),g=t.nextZ;for(;g&&g.z<=m;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.nextZ}g=t.prevZ;for(;g&&g.z>=p;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}(t,n,i,s):function(t){var e=t.prev,r=t,n=t.next;if(u(e,r,n)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(c(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&u(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(v.i/r),e.push(t.i/r),e.push(y.i/r),g(t),t=y.next,x=y.next;else if((t=y)===x){m?1===m?o(t=function(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!f(i,a)&&h(i,n,n.next,a)&&d(i,a)&&d(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),g(n),g(n.next),n=t=a),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,s,2):2===m&&function(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&h(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&d(t,e)&&d(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(l,c)){var u=p(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}(t,e,r,n,i,s):o(a(t),e,r,n,i,s,1);break}}}function s(t,e){return t.x-e.x}function l(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function c(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function u(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function f(t,e){return t.x===e.x&&t.y===e.y}function h(t,e,r,n){return!!(f(t,e)&&f(r,n)||f(t,n)&&f(r,e))||u(t,e,r)>0!=u(t,e,n)>0&&u(r,n,t)>0!=u(r,n,e)>0}function d(t,e){return u(t.prev,t,t.next)<0?u(t,e,t.next)>=0&&u(t,t.prev,e)>=0:u(t,e,t.prev)<0||u(t,t.next,e)<0}function p(t,e){var r=new v(t.i,t.x,t.y),n=new v(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function m(t,e,r,n){var i=new v(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function g(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],136:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],139:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],140:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&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}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],141:[function(t,e,r){"use strict";function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";return"("+("=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?o(t.slice(1),"||"):"all"===e?o(t.slice(1),"&&"):"none"===e?c(o(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?c(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var a=i(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+a+"=== typeof "+o+"&&":"")+a+r+o}function o(t,e){return t.map(n).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(u)),n=i(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function u(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))};var f=["Unknown","Point","LineString","Polygon"]},{}],142:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var u=a.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},l.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=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":70,"cubic-hermite":115}],143:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&"string"!=typeof e||(e=new(n(e||"float32"))(a+r));var o=e.length-r;if(a!==o)throw new Error("source length "+a+" ("+i+"x"+t.length+") does not match destination length "+o);for(var s=0,l=r;s0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(t,e,r,n,i.right)}function f(t,e){this.tree=t,this._stack=e}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}e.exports=function(t){return new s(t||function(t,e){return te?1:0},null)};var d=0,p=1,m=s.prototype;Object.defineProperty(m,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(m,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(d,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(h._color===p||i._color===p)break;var m=l[f-2];if(m.left===h)if(h.left===i){if(!(g=m.right)||g._color!==d){if(m._color=d,m.left=h.right,h._color=p,h.right=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).left===m?v.left=h:v.right=h}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else{if(!(g=m.right)||g._color!==d){if(h.right=i.left,m._color=d,m.left=i.right,i._color=p,i.left=h,i.right=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){(v=l[f-3]).left===m?v.left=i:v.right=i}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else if(h.right===i){if(!(g=m.left)||g._color!==d){if(m._color=d,m.right=h.left,h._color=p,h.left=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).right===m?v.right=h:v.left=h}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}else{var g;if(!(g=m.left)||g._color!==d){if(h.left=i.right,m._color=d,m.right=i.left,i._color=p,i.right=h,i.left=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){var v;(v=l[f-3]).right===m?v.right=i:v.left=i}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}}return l[0]._color=p,new s(r,l[0])},m.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(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(m,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(m,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),m.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},m.remove=function(t){var e=this.find(t);return e?e.remove():this},m.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 g=f.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new f(this.tree,this._stack.slice())},g.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if((r=e[e.length-1])._color===d){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=p);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===d)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=p,r._color=p,s._color=p,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),void(t[l-1]=n);if(n.left&&n.left._color===d)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).left===r?c.left=s:c.right=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.right=a(d,n));r.right=a(d,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=d,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11&&((c=t[l-2]).right===r?c.right=n:c.left=n),void(t[l-1]=n);if(n.right&&n.right._color===d)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).right===r?c.right=s:c.left=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.left=a(d,n));r.left=a(d,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=d,o(r),o(n),l>1){var c;(c=t[l-2]).right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"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}),g.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(g,"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}}),g.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},g.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(g,"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}})},{}],145:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],146:[function(t,e,r){function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}(t)===e?t:t.reverse()}var s=t("geojson-area");e.exports=n},{"geojson-area":146}],148:[function(t,e,r){"use strict";function n(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,r,a,o,s,l,c){if(r/=e,a/=e,l>=r&&c<=a)return t;if(l>a||c=r&&d<=a)u.push(p);else if(!(h>a||d=e&&s<=r&&i.push(o)}return i}(m,r,a,o):function(t,e,r,i,a,o){for(var s=[],l=0;lr?(b.push(a(c,p,e),a(c,p,r)),o||(b=n(s,b,g,v,y))):d>=e&&b.push(a(c,p,e)):h>r?dr&&(b.push(a(c,p,r)),o||(b=n(s,b,g,v,y))));c=m[x-1],(h=c[i])>=e&&h<=r&&b.push(c),f=b[b.length-1],o&&f&&(b[0][0]!==f[0]||b[0][1]!==f[1])&&b.push(b[0]),n(s,b,g,v,y)}return s}(m,r,a,o,s,3===g);v.length&&u.push(i(p.tags,g,v,p.id))}}return u.length?u:null};var i=t("./feature")},{"./feature":150}],149:[function(t,e,r){"use strict";function n(t,e,r){if(null!==e.geometry){var o,l,c,u,f=e.geometry,h=f.type,d=f.coordinates,p=e.properties,m=e.id;if("Point"===h)t.push(s(p,1,[a(d)],m));else if("MultiPoint"===h)t.push(s(p,1,i(d),m));else if("LineString"===h)t.push(s(p,2,[i(d,r)],m));else if("MultiLineString"===h||"Polygon"===h){for(c=[],o=0;o1?1:n,[r,n,0]}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),x=this.tiles[y]=h(t,v,r,n,b,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(x.source=t,l){if(e===p.maxZoom||e===l)continue;var w=1<1&&console.time("clipping");var M,k,A,T,S,E,L=.5*p.buffer/p.extent,C=.5-L,z=.5+L,D=1+L;M=k=A=T=null,S=u(t,v,r-L,r+z,0,a,x.min[0],x.max[0]),E=u(t,v,r+C,r+D,0,a,x.min[0],x.max[0]),S&&(M=u(S,v,n-L,n+z,1,o,x.min[1],x.max[1]),k=u(S,v,n+C,n+D,1,o,x.min[1],x.max[1])),E&&(A=u(E,v,n-L,n+z,1,o,x.min[1],x.max[1]),T=u(E,v,n+C,n+D,1,o,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(A||[],e+1,2*r+1,2*n),d.push(T||[],e+1,2*r+1,2*n+1))}else l&&(g=e)}return g},n.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,l=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var f,h=t,d=e,p=r;!f&&h>0;)h--,d=Math.floor(d/2),p=Math.floor(p/2),f=this.tiles[i(h,d,p)];if(!f||!f.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",h,d,p),s(f,a,n.buffer))return c.tile(f,a);o>1&&console.time("drilling down");var m=this.splitTile(f.source,h,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return c=s-n,u=l-i,c*c+u*u}(t[r],t[s],t[l]))>n&&(a=r,n=i);n>o?(t[a][2]=n,c.push(s),c.push(a),s=a):(l=c.pop(),s=c.pop())}}},{}],153:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){for(var o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},s=0;sf)&&(h.push(s),t.numSimplified++),t.numPoints++;3===c&&function(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;io.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1])}return o}},{}],154:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}e.exports=function(t,e){var r=new i(t);return r.update(e),r};var s=t("./lib/text.js"),l=t("./lib/lines.js"),c=t("./lib/background.js"),u=t("./lib/cube.js"),f=t("./lib/ticks.js"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(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,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(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,u=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,c=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?c=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(c=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new a,new a,new a],m=[0,0,0],g={model:h,view:h,projection:h};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];d.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||h,i=t.view||h,a=t.projection||h,s=this.bounds,l=u(r,i,a,s),c=l.cubeEdges,f=l.axis,d=i[12],b=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*d+a[7]*b+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=c[k],this.lastCubeProps.axis[k]=f[k];var A=p;for(k=0;k<3;++k)o(p[k],k,this.bounds,c,f);e=this.gl;var T=m;for(k=0;k<3;++k)this.backgroundEnable[k]?T[k]=f[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];f[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(E=0;E<2;++E){L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var z=n(v,A[k].primalMinor),D=n(y,A[k].mirrorMinor),I=this.lineTickLength;for(E=0;E<3;++E){var P=M/r[5*E];z[E]*=I[E]*P,D[E]*=I[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,D,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){var O=A[k].primalMinor,F=n(x,A[k].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[k]&&(F[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],F,this.tickColor[k])}if(this.labelEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.labelPad[E]/r[5*E];F[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],F,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":158,"./lib/cube.js":159,"./lib/lines.js":160,"./lib/text.js":162,"./lib/ticks.js":163}],158:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(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[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=i(t,new Float32Array(e)),y=i(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=o(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new n(t,v,x,b)};var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders").bg,s=n.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),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":161,"gl-buffer":165,"gl-vao":259}],159:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<f[y][1]&&(O=y));var F=-1;for(y=0;y<3;++y)(N=O^1<f[R][0]&&(R=N))}var j=m;j[0]=j[1]=j[2]=0,j[a.log2(F^O)]=O&F,j[a.log2(O^R)]=O&R;var B=7^R;B===_||B===P?(B=7^F,j[a.log2(R^B)]=B&R):j[a.log2(F^B)]=B&F;var U=g,V=_;for(k=0;k<3;++k)U[k]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 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 colorChannel = abs(normal);\n}","precision mediump 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}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":243}],162:[function(t,e,r){(function(r){"use strict";function n(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}e.exports=function(t,e,r,o,l,c){var u=i(t),f=a(t,[{buffer:u,size:3}]),h=s(t);h.attributes.position.location=0;var d=new n(t,h,u,f);return d.update(e,r,o,l,c),d};var i=t("gl-buffer"),a=t("gl-vao"),o=t("vectorize-text"),s=t("./shaders").text,l=window||r.global||{},c=l.__TEXT_CACHE||{};l.__TEXT_CACHE={};var u=n.prototype,f=[0,0];u.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,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.update=function(t,e,r,n,i){function a(t,e,r,n){var i=c[r];i||(i=c[r]={});var a=i[e];a||(a=i[e]=function(t,e){try{return o(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,f=a.cells,h=0,d=f.length;h=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(s.length/3|0)-f[d],l[d]=s.length/3|0;for(var p=0;p=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.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 a(t,e){for(var r=o.malloc(t.length,e),n=t.length,i=0;i=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=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=o.malloc(t.size,r),u=l(n,t.shape);s.assign(u,t),this.length=i(this.gl,this.type,this.length,this.usage,e<0?n:n.subarray(0,t.size),e),o.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=i(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),o.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(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}},e.exports=function(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||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(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==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 a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],166:[function(t,e,r){e.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"}},{}],167:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":166}],168:[function(t,e,r){"use strict";function n(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}function i(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])}function a(t,e,r,n){for(var i=f[n],a=0;a=1},u.isTransparent=function(){return this.opacity<1},u.drawTransparent=u.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var f=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}();u.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m;(m=f.slice())[c]+=d[1][c],o.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":170,"gl-buffer":165,"gl-vao":259}],169:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&h.drawBuffersWEBGL(m[f]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=o(r,c,u,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=o(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=s(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=s(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=s(r,c,u,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),v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),c=0;ca||r<0||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");var o=1;if("color"in(n=n||{})){if((o=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(o>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(o>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+o+" draw buffers")}}var s=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&o>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");s=t.FLOAT}else n.preferFloat&&o>0&&c&&(s=t.FLOAT);var u=!0;"depth"in n&&(u=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new l(t,e,r,s,o,u,g,i)};var f,h,d,p,m=null,g=l.prototype;Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return c(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,c(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,c(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),u.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]]}},u.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),n=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=1/((h[2]=r[r.length-1])-d),g=1/((h[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var x=(v-1)*(y-1)*(f.length>>>1);this.numVertices=x;for(var b=o.mallocUint8(4*x),_=o.mallocFloat32(2*x),w=o.mallocUint8(2*x),M=o.mallocUint32(x),k=0,A=0;A 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 highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp 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 highp 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\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":243}],177:[function(t,e,r){"use strict";function n(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 i(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 a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(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.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=p(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 n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=s(e),a=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),u=h(new Array(1024),[256,1,4]),f=0;f<1024;++f)u.data[f]=255;var d=c(e,u);d.wrap=e.REPEAT;var g=new o(e,r,n,i,a,d);return g.update(t),g};var s=t("gl-buffer"),l=t("gl-vao"),c=t("gl-texture2d"),u=t("glsl-read-float"),f=t("binary-search-bounds"),h=t("ndarray"),d=t("./lib/shaders"),p=d.createShader,m=d.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v=o.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(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)},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e0){for(var x=0;x<24;++x)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var b,_;Array.isArray(o[0])?(b=o[e-1],_=o[e]):b=_=o,3===b.length&&(b=[b[0],b[1],b[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,b[0],b[1],b[2],b[3],y[0],y[1],y[2],v[0],v[1],v[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(d),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,b=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*b,t[1]=(h+x)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(h-x)*_,t[5]=(1-(f+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,g=o*f,v=s*f,y=l*c,x=l*u,b=l*f,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+b)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(h+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(g-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-f-p,t[1]=u+v,t[2]=h-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,f,h,d,p,m,g=e[0],v=e[1],y=e[2],x=a[0],b=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=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,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":199,"./mat3.js":202,"./vec3.js":206,"./vec4.js":207}],205:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=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},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=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},i.transformMat3=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=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.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":199}],207:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=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},i.subtract=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},i.sub=i.subtract,i.multiply=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},i.mul=i.multiply,i.divide=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},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=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},i.max=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},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=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},i.scaleAndAdd=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},i.distance=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)},i.dist=i.distance,i.squaredDistance=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},i.sqrDist=i.squaredDistance,i.length=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)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=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},i.normalize=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},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=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},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[u]}return Math.abs(g-1)>.001?null:[f,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump 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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump 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}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],210:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,g,v,y,x,b,_,w,k,A,T,S){this.gl=t,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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!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._model=M,this._view=M,this._projection=M,this._resolution=[1,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("gl-vao"),s=t("gl-texture2d"),l=t("normals"),c=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),f=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),p=t("typedarray-pool"),m=t("./lib/shaders"),g=t("./lib/closest-point"),v=m.meshShader,y=m.wireShader,x=m.pointShader,b=m.pickShader,_=m.pointPickShader,w=m.contourShader,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=n.prototype;k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){(p=this.triShader).bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){(p=this.lineShader).bind(),p.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){(p=this.pointShader).bind(),p.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p;(p=this.contourShader).bind(),p.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||M,n=t.view||M,i=t.projection||M,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,pickId:this.pickId/255};if((l=this.pickShader).bind(),l.uniforms=s,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),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l;(l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},k.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;al[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n]&&M&&(e[1^n]-=T*d*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=T*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],kl[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n+2]&&M&&(e[1^n]+=T*d*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),c.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],f=a[c+2]-u,h=.5*(o[c+2]+o[c]),d=o[c+2]-o[c],p=l[c],m=l[c+2]-p,g=s[c],v=s[c+2]-g;e[c]=2*f/d*m/v,t[c]=2*(u-h)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;w[x]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,b,w),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":218,"./lib/create-attributes":219,"./lib/create-uniforms":220,"./lib/reflect":221,"./lib/runtime-reflect":222,"./lib/shader-cache":223}],218:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}(n.prototype=new Error).name="GLError",n.prototype.constructor=n,e.exports=n},{}],219:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,s,f)}else{if(!(h.indexOf("mat")>=0))throw new o("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,s,f)}}}return s};var o=t("./GLError"),s=n.prototype;s.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(s,"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}})},{"./GLError":218}],220:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new o("","Unknown uniform data type for "+name+": "+r)}var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new o("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new o("","Unrecognized data type for vector "+name+": "+r)}}}function c(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,c(a,i)):r.push([a,i])}return r}function u(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a4)throw new o("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(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 o("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new o("","Unknown uniform data type for "+name+": "+t)}}(r[c].type)}function h(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){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function i(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!x&&U.autoResize){var t=b.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*U.pixelRatio),i=0|Math.ceil(r*U.pixelRatio);if(n!==b.width||i!==b.height){b.width=n,b.height=i;var a=b.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",O=!0}}}function r(){for(var t=z.length,e=P.length,r=0;r0&&0===I[e-1];)I.pop(),P.pop().dispose()}function g(){if(U.contextLost)return!0;_.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}function v(){if(!g()){e();var t=U.camera.tick();j.view=U.camera.matrix,O=O||t,F=F||t,E.pixelRatio=U.pixelRatio,C.pixelRatio=U.pixelRatio;var r=z.length,i=G[0],a=G[1];i[0]=i[1]=i[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;oM.distance)continue;for(var c=0;c>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),r=0;r>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,o),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/s,t[4]=2/l,t[6]=-2*o[0]/s-1,t[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=u<5,i.uniforms.pointSize=u,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var f=a.getParameter(a.BLEND),h=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),h&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),h&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.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]]}}},{"./lib/shader":227,"gl-buffer":165,"gl-shader":228,"typedarray-pool":554}],236:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],237:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];if(r||(r=i[e]={}),t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(F[1])){var R=O;O=F,F=R,R=I,I=P,P=R;var N=z;z=D,D=N}O[0]<0&&(I[z]=-1),F[1]>0&&(P[D]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(d[4*z+C],2),B+=Math.pow(d[4*D+C],2);I[z]/=Math.sqrt(j),P[D]/=Math.sqrt(B),h.axes[0]=I,h.axes[1]=P,h.fragClipBounds[0]=l(A,S[0],E,-1e8),h.fragClipBounds[1]=l(A,S[1],E,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function u(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||v,s.view=n.view||v,s.projection=n.projection||v,x[0]=2/o.drawingBufferWidth,x[1]=2/o.drawingBufferHeight,s.screenSize=x,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}c(e,r,n,i),r.vao.unbind()}var f=t("gl-buffer"),h=t("gl-vao"),d=t("typedarray-pool"),p=t("gl-mat4/multiply"),m=t("./lib/shaders"),g=t("./lib/glyphs"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,r=m.createPerspective(e),n=m.createOrtho(e),i=m.createProject(e),o=m.createPickPerspective(e),s=m.createPickOrtho(e),l=m.createPickProject(e),c=f(e),u=f(e),d=f(e),p=f(e),g=new a(e,r,n,i,c,u,d,p,h(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return g.update(t),g};var y=a.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},y.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var x=[0,0],b=[0,0,0],_=[0,0,0],w=[0,0,0,1],M=[0,0,0,1],k=v.slice(),A=[0,0,0],T=[[0,0,0],[0,0,0]],S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];y.draw=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},y.drawTransparent=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},y.drawPick=function(t){u(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(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},y.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]},y.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(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,c=t.color,u=t.size,f=t.angle,h=t.lineColor,p=0,m=0,v=0,y=n.length;t:for(var x=0;x0&&(C[0]=-a[0]*(1+k[0][0]));var q=w.cells,H=w.positions;for(_=0;_0){var v=r*u;o.drawBox(f-v,h-v,d+v,h+v,a),o.drawBox(f-v,p-v,d+v,p+v,a),o.drawBox(f-v,h-v,f+v,p+v,a),o.drawBox(d-v,h-v,d+v,p+v,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)}},{"./lib/shaders":240,"gl-buffer":165,"gl-shader":243}],242:[function(t,e,r){"use strict";function n(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)}}e.exports=function(t,e){return new n(t,i(t,e),a.mallocUint8(e[0]*e[1]*4))};var i=t("gl-fbo"),a=t("typedarray-pool"),o=t("ndarray"),s=t("bit-twiddle").nextPow2,l=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,x,_),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":244,"./lib/create-attributes":245,"./lib/create-uniforms":246,"./lib/reflect":247,"./lib/runtime-reflect":248,"./lib/shader-cache":249}],244:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],245:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":244,dup:219}],246:[function(t,e,r){arguments[4][220][0].apply(r,arguments)},{"./GLError":244,"./reflect":247,dup:220}],247:[function(t,e,r){arguments[4][221][0].apply(r,arguments)},{dup:221}],248:[function(t,e,r){arguments[4][222][0].apply(r,arguments)},{dup:222}],249:[function(t,e,r){arguments[4][223][0].apply(r,arguments)},{"./GLError":244,dup:223,"gl-format-compiler-error":172,"weakmap-shim":576}],250:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],251:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":243}],252:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders/index");e.exports=function(t,e){function r(t,e,r,n,i,a){var o=[t,e,r,0,0,0,1];o[n+3]=1,o[n]=i,s.push.apply(s,o),o[6]=-1,s.push.apply(s,o),o[n]=a,s.push.apply(s,o),s.push.apply(s,o),o[6]=1,s.push.apply(s,o),o[n]=i,s.push.apply(s,o)}var s=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=i(t,s),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=o(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new n(t,l,c,u);return f.update(e),f};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=n.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||s,o=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,d=u,p=0;p<3;++p)i&&i[p]<0?(h[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(h[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":251,"gl-buffer":165,"gl-vao":259}],253:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\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 worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(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\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\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 (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\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_1_1(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 \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + 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",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\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 vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\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",s="precision mediump float;\n#define GLSLIFY 1\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 any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n 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";r.createShader=function(t){var e=n(t,i,a,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},r.createPickShader=function(t){var e=n(t,i,s,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},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":243}],254:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=s,this._contourShader=l,this._contourPickShader=c,this._contourBuffer=u,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=d,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=[y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0]),y(p.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.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}function i(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=F.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],b(l,t.model,l);var c=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function a(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||C,n.view=t.view||C,n.projection=t.projection||C,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.contourColor=this.contourColor[0],n.inverseModel=_(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var o=n.clipBounds[a],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[a][s],-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=j,n.vertexColor=this.vertexColor;var l=N;for(b(l,n.view,n.model),b(l,n.projection,l),_(l,l),a=0;a<3;++a)n.eyePosition[a]=l[12+a]/l[15];var c=l[15];for(a=0;a<3;++a)c+=this.lightPosition[a]*l[4*a+3];for(a=0;a<3;++a){var u=l[12+a];for(s=0;s<3;++s)u+=l[4*s+a]*this.lightPosition[s];n.lightPosition[a]=u/c}var f=i(n,this);if(f.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=f.projections[a],this._shader.uniforms.clipBounds=f.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(h.uniforms.permutation=D[a],r.lineWidth(this.contourWidth[a]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t};var O=[0,0,0],F={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},R={model:C,view:C,projection:C,inverseModel:C.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,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},N=C.slice(),j=[1,0,0,0,1,0,0,0,1];P.draw=function(t){return a.call(this,t,!1)},P.drawTransparent=function(t){return a.call(this,t,!0)};var B={model:C,view:C,projection:C,inverseModel:C,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};P.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=B;r.model=t.model||C,r.view=t.view||C,r.projection=t.projection||C,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=j;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=i(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=D[o],n=0;n>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=i+u,p=s+h,m=f*(h?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=w.le(this.contourLevels[y],c[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]Math.abs(b-c[y])&&(v[y]+=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],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},P.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=s(t.contourWidth,Number)),"showContour"in t&&(this.showContour=s(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=s(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=c(t.contourColor)),"contourProject"in t&&(this.contourProject=s(t.contourProject,function(t){return s(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=c(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=s(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=s(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);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 n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(p.freeFloat(this._field[2].data),this._field[2].data=p.mallocFloat(u.nextPow2(n))),this._field[2]=y(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),o(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(p.freeFloat(this._field[a].data),this._field[a].data=p.mallocFloat(this._field[2].size)),this._field[a]=y(this._field[a].data,[i[0]+2,i[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(a=0;a<2;++a){var f=l[a];for(w=0;w<2;++w)if(f.shape[w]!==i[w])throw new Error("gl-surface: coords have incorrect shape");o(this._field[a],f)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var d=h[a];if((Array.isArray(d)||d.length)&&(d=y(d)),d.shape[0]!==i[a])throw new Error("gl-surface: invalid tick length");var b=y(d.data,i);b.stride[a]=d.stride[0],b.stride[1^a]=0,o(this._field[a],b)}}else{for(a=0;a<2;++a){var _=[0,0];_[a]=1,this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var w=0;w0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=p.mallocFloat(nt.length);for(a=0;ai||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 a(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}function o(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 s(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 l(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)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 l=s(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,l,e,r,n,i)}var c=t("ndarray"),u=t("ndarray-ops"),f=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(h||function(t){h=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],d=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],p=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return l(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return l(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=n(e)?e:e.raw;if(r)return function(t,e,r,n,i,o){var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,l,r,n,i,o)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var l=o(n,e.stride.slice()),h=0;"float32"===r?h=t.FLOAT:"float64"===r?(h=t.FLOAT,l=!1,r="float32"):"uint8"===r?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,l=!1,r="uint8");var d=0;if(2===n.length)d=t.LUMINANCE,n=[n[0],n[1],1],e=c(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])d=t.ALPHA;else if(2===n[2])d=t.LUMINANCE_ALPHA;else if(3===n[2])d=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}h!==t.FLOAT||t.getExtension("OES_texture_float")||(h=t.UNSIGNED_BYTE,l=!1);var p,g,v=e.size;if(l)p=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[n[2],n[2]*n[0],1];g=f.malloc(v,r);var x=c(g,n,y,0);"float32"!==r&&"float64"!==r||h!==t.UNSIGNED_BYTE?u.assign(x,e):m(x,e),p=g.subarray(0,v)}var b=s(t);return t.texImage2D(t.TEXTURE_2D,0,d,n[0],n[1],0,d,h,p),l||f.free(g),new a(t,b,n[0],n[1],d,h)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var h=null,d=null,p=null,m=function(t,e){u.muls(t,e,255)},g=a.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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(),p.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(),p.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(p.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 i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),g.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},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.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)},g.setPixels=function(t,e,r,i){var a=this.gl;this.bind(),Array.isArray(e)?(i=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),i=i||0;var s=n(t)?t:t.raw;if(s){this._mipLevels.indexOf(i)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(i)):a.texSubImage2D(a.TEXTURE_2D,i,e,r,this.format,this.type,s)}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]>>>i||r+t.shape[0]>this._shape[0]>>>i||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,n,i,a,s,l){var h=l.dtype,d=l.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,g=0,v=o(d,l.stride.slice());if("float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,v=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,v=!1,h="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],l=c(l.data,d,[l.stride[0],l.stride[1],1],l.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||i!==t.LUMINANCE&&i!==t.ALPHA||(g=i),g!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),p===a&&v)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var b;b=a===t.FLOAT?f.mallocFloat32(y):f.mallocUint8(y);var _=c(b,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&a===t.UNSIGNED_BYTE?m(_,l):u.assign(_,l),x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,b.subarray(0,y)),a===t.FLOAT?f.freeFloat32(b):f.freeUint8(b)}}(a,e,r,i,this.format,this.type,this._mipLevels,t)}}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],256:[function(t,e,r){"use strict";e.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;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],265:[function(t,e,r){e.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}},{}],266:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],267:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r-1?y:j.indexOf(t)>-1?v:g,e(z.join("")),C=l,E}return z.push(A),T=A,E+1}();break;case x:E=/[^\s]/g.test(A)?(e(z.join("")),C=l,E):(z.push(A),T=A,E+1);break;case l:z=z.length?[]:z,E="/"===T&&"*"===A?(O=L+E-1,C=u,T=A,E+1):"/"===T&&"/"===A?(O=L+E-1,C=f,T=A,E+1):"#"===A?(C=h,O=L+E,E):/\s/.test(A)?(C=x,O=L+E,E):(F=/\d/.test(A),R=/[^\w_]/.test(A),O=L+E,C=F?p:R?d:c,E)}if(r!==E)switch(N[r]){case"\n":P=0,++I;break;default:++P}}return L+=E,N=N.slice(E),D}function M(){return"\r"!==A&&"\n"!==A||"\\"===T?(z.push(A),T=A,E+1):(e(z.join("")),C=l,E)}function k(t){for(var r,n,a=0;;){if(r=i.indexOf(t.slice(0,t.length+a).join("")),n=i[r],-1===r){if(a--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),O+=n.length,(z=z.slice(n.length)).length}}var A,T,S,E=0,L=0,C=l,z=[],D=[],I=1,P=0,O=0,F=!1,R=!1,N="",j=a,B=n;return"300 es"===(t=t||{}).version&&(j=s,B=o),function(t){return D=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):(z.length&&e(z.join("")),C=b,e("(eof)"),D)}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,f=1,h=2,d=3,p=4,m=5,g=6,v=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":270,"./lib/builtins-300es":269,"./lib/literals":272,"./lib/literals-300es":271,"./lib/operators":273}],269:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.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"])},{"./builtins":270}],270:[function(t,e,r){e.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"]},{}],271:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","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"])},{"./literals":272}],272:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","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"]},{}],273:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],274:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=i.concat(r(t)),i=i.concat(r(null))}},{"./index":268}],275:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=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=u):(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>=u?(s=0,o=u):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,c-=8);t[r+d-p]|=128*m}},{}],278:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return l(t.vertices,e.vertices)}function o(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=c[t];i||(i=c[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=s[t+1];return i||(i=s),n(i)}(t)),this.orient=i}e.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 a=t.slice(0,i+1),l=s.apply(void 0,a);if(0===l)throw new Error("Input not in general position");for(var c=new Array(i+1),u=0;u<=i;++u)c[u]=u;l<0&&(c[0]=1,c[1]=0);var f=new n(c,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var p=c.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);h[u]=v,d[u]=v}for(d[i+1]=f,u=0;u<=i;++u){p=h[u].vertices;var y=h[u].adjacent;for(m=0;m<=i;++m){var x=p[m];if(x<0)y[m]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[m]=h[b])}}var _=new o(i,a,d),w=!!e;for(u=i+1;u0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=o;++b)y[b]<0?(x=b,l[b]=t):l[b]=s[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=d.slice(),M=p.slice(),k=new n(w,M,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,M[m]=v,w[g]=-1,M[g]=e,p[g]=k,k.flip();for(b=0;b<=o;++b){var T=w[b];if(!(T<0||T===r)){for(var S=new Array(o-1),E=0,L=0;L<=o;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new i(S,k,b))}}}}}}h.sort(a);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":515,"simplicial-complex":526}],279:[function(t,e,r){"use strict";function n(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}function i(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 a(t,e){var r=p(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 o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?v:(r.splice(n,1),a(t,r),y)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,h),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);return 2===(o=this.left.remove(t))?(this.left=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return v;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);return 2===(o=this.right.remove(t))?(this.right=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:v;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(a=g.ge(this.leftPoints,t,h);athis.mid){if(this.right){var r;if(r=this.right.queryPoint(t,e))return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n;if(n=this.right.queryInterval(t,e,r))return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var b=m.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==v}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":70}],280:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r4))}},{}],288:[function(t,e,r){"use strict";function n(t,e,r,n,a){e=e||function(t){return t[0]},r=r||function(t){return t[1]},a=a||Array,this.nodeSize=n||64,this.points=t,this.ids=new a(t.length),this.coords=new a(2*t.length);for(var o=0;o=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(g))}}return u}},{}],290:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(o,Math.floor(r+(l-c)*f/l+h)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],291:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],g=e[2*p+1];n(m,g,r,i)<=c&&l.push(t[p]);var v=(u+1)%2;(0===u?r-a<=m:i-a<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?r+a>=m:i+a>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],292:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);this.nodeSize=e||64,this.coords=t.slice();var r=Math.floor(t.length/2);this.ids=Array(r);for(var i=0;in;){if(i-n>600){var l=i-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);o(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(i,Math.floor(r+(l-c)*f/l+h)),a)}var d=e[2*r+a],p=n,m=i;for(s(t,e,n,r),e[2*i+a]>d&&s(t,e,n,i);pd;)m--}e[2*n+a]===d?s(t,e,n,m):s(t,e,++m,i),m<=r&&(n=m+1),r<=m&&(i=m-1)}}function s(t,e,r,n){l(t,r,n),l(e,2*r,2*n),l(e,2*r+1,2*n+1)}function l(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype.range=function(t,e,r,n){for(var i,a,o=this.ids,s=this.coords,l=this.nodeSize,c=[0,o.length-1,0],u=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=l)for(var p=d;p<=h;p++)i=s[2*p],a=s[2*p+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[p]);else{var m=Math.floor((d+h)/2);i=s[2*m],a=s[2*m+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[m]);var g=(f+1)%2;(0===f?t<=i:e<=a)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?r>=i:n>=a)&&(c.push(m+1),c.push(h),c.push(g))}}return u},n.prototype.within=function(t,e,r){for(var n=this.ids,a=this.coords,o=this.nodeSize,s=[0,n.length-1,0],l=[],c=r*r;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(a[2*d],a[2*d+1],t,e)<=c&&l.push(n[d]);else{var p=Math.floor((h+f)/2),m=a[2*p],g=a[2*p+1];i(m,g,t,e)<=c&&l.push(n[p]);var v=(u+1)%2;(0===u?t-r<=m:e-r<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?t+r>=m:e+r>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],293:[function(t,e,r){"use strict";function n(t,e){var r;if(u(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],f=c||void 0!==t.property,h=c||!f,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],g=0;g=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?function(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:468}],295:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:563}],296:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{"../error/validation_error":295,"../util/extend":296,"../util/get_type":297,"./validate_array":300,"./validate_boolean":301,"./validate_color":302,"./validate_constants":303,"./validate_enum":304,"./validate_filter":305,"./validate_function":306,"./validate_layer":308,"./validate_number":310,"./validate_object":311,"./validate_source":313,"./validate_string":314}],300:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":295,"../util/get_type":297}],304:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298}],305:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f=8&&(f&&!t.valueSpec["property-function"]?d.push(new n(t.key,t.value,"property functions not supported")):h&&!t.valueSpec["zoom-function"]&&d.push(new n(t.key,t.value,"zoom functions not supported"))),d}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299,"./validate_array":300,"./validate_number":310,"./validate_object":311}],307:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":295,"./validate_string":314}],308:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],311:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],f=i(r);if("object"!==f)return[new n(e,r,"object expected, %s found",f)];for(var h in r){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299}],312:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":295,"./validate":299}],313:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298,"./validate_enum":304,"./validate_object":311}],314:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],315:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":316,"./validate/validate":299,"./validate/validate_constants":303,"./validate/validate_filter":305,"./validate/validate_glyphs_url":307,"./validate/validate_layer":308,"./validate/validate_layout_property":309,"./validate/validate_paint_property":312,"./validate/validate_source":313}],316:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":317}],317:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],318:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],319:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":433}],320:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},a=0;a1?p.name+b:p.name]=m[b]*g}}},n.VertexArrayType=function(t){return new c({members:t,alignment:4})},n.ElementArrayType=function(t){return new c({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":431,"../util/util":433,"./array_group":319,"./bucket/circle_bucket":321,"./bucket/fill_bucket":322,"./bucket/line_bucket":323,"./bucket/symbol_bucket":324,"./buffer_group":326,assert:51,"feature-filter":141}],321:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,(n.prototype=a.inherit(i,{})).addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],322:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,(n.prototype=a.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var h,d,p,m,g,v,y,x=r,b=f?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],g=c.sub(h)._unit()._perp());for(var w=0;w0){var S=h.dist(d);if(S>2*o){var E=h.sub(h.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?x:b;if(L&&"round"===C&&(An&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A100)M=g.clone();else{var z=m.x*g.y-m.y*g.x>0?-1:1,D=A*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(D*z)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var I=m.x*g.y-m.y*g.x>0,P=-Math.sqrt(A*A-1);if(I?(y=0,v=P):(v=0,y=P),_||this.addCurrentVertex(h,this.distance,m,v,y,!1),"fakeround"===C){for(var O,F=Math.floor(8*(.5-(k-.5))),R=0;R=0;N--)O=m.mult((N+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(h,this.distance,O,I)}p&&this.addCurrentVertex(h,this.distance,g,-v,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,g,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,g,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,g,-1,-1,!0),this.addCurrentVertex(h,this.distance,g,0,0,!1)));if(T&&w2*o){var B=h.add(p.sub(h)._mult(o/j)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),h=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,f=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],324:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),f=t("../../symbol/shaping"),h=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=f.shapeText,x=f.shapeIcon,b=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,(n.prototype=m.inherit(o,{})).serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var f="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,h=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,v=24*a["text-letter-spacing"],b=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var z=C||b;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,g,x,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,x=p.br,b=p.tex,_=p.anchorPoint,w=Math.max(f+Math.log(p.minScale)/Math.LN2,h),M=Math.min(f+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===h&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(u,_.x,_.y,g.x,g.y,b.x,b.y,w,M,h,k);i(u,_.x,_.y,v.x,v.y,b.x+b.w,b.y,w,M,h,k),i(u,_.x,_.y,y.x,y.y,b.x,b.y+b.h,w,M,h,k),i(u,_.x,_.y,x.x,x.y,b.x+b.w,b.y+b.h,w,M,h,k),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(I,P,O,F,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":382,"../../symbol/clip_line":384,"../../symbol/collision_feature":386,"../../symbol/get_anchors":388,"../../symbol/mergelines":391,"../../symbol/quads":392,"../../symbol/resolve_text":393,"../../symbol/shaping":394,"../../util/token":432,"../../util/util":433,"../bucket":320,"../load_geometry":328,"point-geometry":477}],325:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=l.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||h.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":433,"./bucket":320,assert:51}],329:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],330:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":433}],331:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":330}],332:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,f=t("gl-matrix"),h=f.vec4,d=f.mat4,p=f.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.locationCoordinate(this.center)._zoomTo(e),i=new a(n.column-.5,n.row-.5);return c.cover(e,[this.pointCoordinate(new a(0,0))._zoomTo(e),this.pointCoordinate(new a(this.width,0))._zoomTo(e),this.pointCoordinate(new a(this.width,this.height))._zoomTo(e),this.pointCoordinate(new a(0,this.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return i.dist(t)-i.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];h.transformMat4(e,e,this.pixelMatrixInverse),h.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,f=e[2]/n,d=r[2]/i,p=f===d?0:(0-f)/(d-f),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return h.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":320,"../source/tile_coord":360,"../util/interpolate":427,"../util/util":433,"./coordinate":329,"./lng_lat":330,"gl-matrix":198,"point-geometry":477}],333:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,f,h,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&b,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":354,"./create_uniform_pragmas":335}],337:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,h>>16),s.uniform2f(o.u_pixel_coord_lower,65535&f,65535&h),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}var i=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){var a=t.gl;a.enable(a.STENCIL_TEST);var o;if(o=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"],t.isOpaquePass===o){t.setDepthSublayer(1);for(var s=0;s0?1-1/(1.001-t):-t}(r.paint["raster-saturation"])),a.uniform1f(l.u_contrast_factor,function(t){return t>0?1/(1-t):1+t}(r.paint["raster-contrast"])),a.uniform3fv(l.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var c,u,f=o.source&&o.source.findLoadedParent(n,0,{}),h=function(t,e,r,n){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=n.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(a[0]=i.clamp(l,0,1),a[1]=1-a[0]):(a[0]=i.clamp(1-c,0,1),a[1]=1-a[0])}var h=r.paint["raster-opacity"];return a[0]*=h,a[1]*=h,a}(o,f,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o.texture),a.activeTexture(a.TEXTURE1),f?(a.bindTexture(a.TEXTURE_2D,f.texture),c=Math.pow(2,f.coord.z-o.coord.z),u=[o.coord.x*c%1,o.coord.y*c%1]):(a.bindTexture(a.TEXTURE_2D,o.texture),h[1]=0);a.uniform2fv(l.u_tl_parent,u||[0,0]),a.uniform1f(l.u_scale_parent,c||1),a.uniform1f(l.u_buffer_scale,1),a.uniform1f(l.u_opacity0,h[0]),a.uniform1f(l.u_opacity1,h[1]),a.uniform1i(l.u_image0,0),a.uniform1i(l.u_image1,1);var d=o.boundsBuffer||t.rasterBoundsBuffer;(o.boundsVAO||t.rasterBoundsVAO).bind(a,l,d),a.drawArrays(a.TRIANGLE_STRIP,0,d.length)}(t,e,r,l)}a.depthFunc(a.LEQUAL)}}var i=t("../util/util"),a=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new a({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":431,"../util/util":433}],343:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,l,c,u,f,h,d,p,m,g){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],345:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":320,"../data/buffer":325,"../source/pixels_to_tile_units":354,"../source/source_cache":358,"../util/browser":417,"../util/struct_array":431,"../util/util":433,"./create_uniform_pragmas":335,"./draw_background":336,"./draw_circle":337,"./draw_debug":339,"./draw_fill":340,"./draw_line":341,"./draw_raster":342,"./draw_symbol":343,"./frame_history":344,"./painter/use_program":347,"./vertex_array_object":348,"gl-matrix":198}],347:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=o[t],h="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":320,"../util/evented":425,"../util/util":433,"resolve-url":508}],350:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),f.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),f=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(f,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":416,"../util/util":433,"./geojson_wrapper":351,"./vector_tile_worker_source":362,"geojson-rewind":147,"geojson-vt":151,supercluster:538,"vt-pbf":570}],351:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},f=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rf-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var x=h.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,u=0;u=0&&v[1].y>=0){for(var y=[],x=0;x=0&&t%1==0),s(!isNaN(e)&&e>=0&&e%1==0),s(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hu.dy&&(l=c,c=u,u=l),c.dy>f.dy&&(l=c,c=f,f=l),u.dy>f.dy&&(l=u,u=f,f=l),c.dy&&a(f,c,n,o,s),u.dy&&a(f,u,n,o,s)}var s=t("assert"),l=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<0;a--)i+=(e&(n=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var o,l;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":425,"../util/mapbox":430,"../util/util":433,"./load_tilejson":353}],362:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new s(t);i.abort=this.loadVectorData(t,function(t,a){return delete this.loading[r][n],t?e(t):a?(i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][n]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=i.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":416,"./worker_tile":365,pbf:470,"vector-tile":564}],363:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,h=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new f;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new h(e.serialize(),f.serialize(),h.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":320,"../data/buffer":325,"../geo/lng_lat":330,"../render/draw_raster":342,"../render/vertex_array_object":348,"../util/ajax":416,"../util/evented":425,"../util/util":433,"./tile_coord":360,"point-geometry":477}],364:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)x(E,P[e]);b()}}function x(t,e){if(e.populateArrays(A,N,R),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=u.create({layer:w,index:z++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var F in L)0!==(k=L[F]).features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),I.push(k),"symbol"===k.type?P.push(k):O.push(k));var R={},N={},j=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(R),P[_].updateFont(N);for(var B in N)N[B]=Object.keys(N[B]).map(Number);R=Object.keys(R),r.send("get glyphs",{uid:this.uid,stacks:N},function(t,e){N=e,y(t)}),R.length?r.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)x(0,O[_]);if(0===P.length)return b()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),f=s.filter(i);return{result:{buckets:f.map(a),collisionTile:u.data},transferables:o(f).concat(u.transferables)}}},{"../data/bucket":320,"../data/feature_index":327,"../symbol/collision_box":385,"../symbol/collision_tile":387,"../symbol/symbol_instances":396,"../symbol/symbol_quads":397,"../util/dictionary_coder":423,"../util/util":433}],366:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],367:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":416,"../util/browser":417,"../util/evented":425,"../util/mapbox":430}],368:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":433,"./style_function":371,csscolorparser:114}],369:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire("error",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?f.getJSON(h(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),f=t("../util/ajax"),h=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),x=t("../source/source_cache"),b=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);return!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,f*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),f/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:f,to:a,toScale:1,t:n}}}(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var o=[],s=this.value.stops,l=0;l=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}},{}],384:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s=i&&h.x>=i||(f.x>=i?f=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}},{"point-geometry":477}],385:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":431,"../util/util":433,"point-geometry":477}],386:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=h-f,g=p-d;if(m>0)if(m=Math.max(10*s,m),u){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,f,p,h,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),f=-a/2,h=this.boxes,d=r,p=n+1,m=f;do{if(--p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return h;g=e[p].dist(e[p+1])}var x=y-m,b=e[p],_=e[p+1].sub(b)._unit()._mult(x)._add(b)._round(),w=i/2/Math.max(Math.abs(y-f)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return h}},{}],387:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),k=new i(c.x2,c.y1).matMult(w),A=new i(c.x1,c.y2).matMult(w),T=new i(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=c.maxScale}else _=c;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),f=this.tempCollisionBox;f.anchorX=u.x,f.anchorY=u.y,f.x1=0,f.y1=0,f.x2=r-t,f.y2=n-e,f.maxScale=a,a=f.maxScale;for(var h=[u.x+f.x1/a,u.y+f.y1/a*this.yStretch,u.x+f.x2/a,u.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m=a&&(o[y][x]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var f=Math.min(Math.max(s,l),Math.max(c,u)),h=i.maxScale,d=r.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&A=0&&T=0&&v+d<=p){var S=new a(A,T,M,x)._round();s&&!o(t,S,c,s,l)||y.push(S)}}g+=w}return f||y.length||u||(y=n(t,g/2,r,s,l,c,u,!0,h)),y}var i=t("../util/interpolate"),a=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,i,a,o,s,l,c){var u=i?.6*o*s:0,f=Math.max(i?i.right-i.left:0,a?a.right-a.left:0),h=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return e-f*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);o(i,function(t,r){for(var i=!t&&new s(new c(new Uint8Array(r))),a=0;an&&null!==f){var x=g[f+1].x;m=Math.max(x,m);for(var b=f+1;b<=v;b++)g[b].y+=r,g[b].x-=x;if(c){var _=f;a[g[f].codePoint]&&_--,i(g,e,d,_,c)}d=f+1,f=null,h+=x,p++}o[y.codePoint]&&(f=v)}var w=g[g.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;i(g,e,d,g.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(f?(clearTimeout(f),f=null,o("dblclick",e)):f=setTimeout(r,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){n.mousePos(l,t).equals(u)&&o("click",t)},!1),l.addEventListener("dblclick",function(t){o("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){c=t,t.preventDefault()},!1)}},{"../util/dom":419,"./handler/box_zoom":404,"./handler/dblclick_zoom":405,"./handler/drag_pan":406,"./handler/drag_rotate":407,"./handler/keyboard":408,"./handler/scroll_zoom":409,"./handler/touch_zoom_rotate":410,"point-geometry":477}],399:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&p.lng<0?p.lng+=360:c.center.lng<0&&p.lng>0&&(p.lng-=360));var y=c.zoomScale(m-f),x=c.point,b="center"in t?c.project(p).sub(u.div(y)):x,_=c.worldSize,w=t.curve,M=Math.max(c.width,c.height),k=M/y,A=b.sub(x).mag();if("minZoom"in t){var T=n.clamp(Math.min(t.minZoom,f,m),c.minZoom,c.maxZoom),S=M/c.zoomScale(T-f);w=Math.sqrt(S/A*2)}var E=w*w,L=r(0),C=function(t){return s(L)/s(L+w*t)},z=function(t){return M*((s(L)*function(t){return a(t)/s(t)}(L+w*t)-a(L))/E)/A},D=(r(1)-L)/w;if(Math.abs(A)<1e-6){if(Math.abs(M-k)<1e-6)return this.easeTo(t);var I=k=0)return!1;return!0})).join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],401:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":425,"../../util/util":433}],402:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433,"./control":401}],403:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],404:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":331,"../../util/dom":419,"../../util/util":433}],405:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],406:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,f=l.mult(-u/2);this._map.panBy(f,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],407:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=f*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433,"point-geometry":477}],408:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],409:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),c=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433}],410:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&a!==s){var f=.15*l/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),d=a+f*h/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:h,easing:o,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],411:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":433}],412:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),f=t("../style/animation_loop"),h=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),x=t("point-geometry"),b=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new f,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new b(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof x||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof x||"number"==typeof t[0]){e=[x.convert(t)]}else{var r=[x.convert(t[0]),x.convert(t[1])];e=[r[0],new x(r[1].x,r[0].y),r[1],new x(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new h(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":330,"../geo/lng_lat_bounds":331,"../geo/transform":332,"../render/painter":346,"../style/animation_loop":366,"../style/style":369,"../util/browser":417,"../util/canvas":418,"../util/dom":419,"../util/evented":425,"../util/util":433,"./bind_handlers":398,"./camera":399,"./control/attribution":400,"./hash":411,"point-geometry":477}],413:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":330,"../util/dom":419,"point-geometry":477}],414:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)r.appendChild(e);return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":330,"../util/dom":419,"../util/evented":425,"../util/util":433}],415:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],416:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":318}],418:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":433,"mapbox-gl-supported":318}],419:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var u=0;u=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i(e.y-t.y)*(r.x-t.x)}function a(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}(t,e[i-1],e[i])e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function s(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var n=0;n=3)for(var u=0;u1){if(n(t,e))return!0;for(var i=0;ithis.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],430:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}var a=t("./config"),o=t("./browser"),s=t("url"),l=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=s.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==s.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=s.parse(t);if("mapbox:"!==r.protocol)return t;return n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=s.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,s.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=s.parse(t,!0);if(!e)return t;if("mapbox:"!==s.parse(e).protocol)return t;var i=o.supportsWebp?".webp":"$1",c=o.devicePixelRatio>=2||512===r?"@2x":"";return s.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,c+i),query:function(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?l.extend({},t,{access_token:a.ACCESS_TOKEN}):t}(n.query)})}},{"./browser":417,"./config":422,"./util":433,url:559}],431:[function(t,e,r){"use strict";function n(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function a(t){return f[t].BYTES_PER_ELEMENT}function o(t){return t.toLowerCase()}function s(t,e){var r="this._pos"+a(t.type).toFixed(0)+" + "+(t.offset/a(t.type)+e).toFixed(0);return"this._structArray."+o(t.type)+"["+r+"]"}function l(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function c(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var u=t("assert");e.exports=function(t){function e(){l.apply(this,arguments)}function r(){c.apply(this,arguments),this.members=e.prototype.members}var d=JSON.stringify(t);if(h[d])return h[d];void 0===t.alignment&&(t.alignment=1);var p=0,m=0,g=["Uint8"];return(e.prototype=Object.create(l.prototype)).members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},u(r.name.length),u(r.type in f),g.indexOf(r.type)<0&&g.push(r.type);var n=a(r.type);m=Math.max(m,n),r.offset=p=i(p,Math.max(t.alignment,n));for(var o=0;othis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},c.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":329,unitbezier:557}],434:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],435:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],436:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ip[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":438,"gl-mat4/clone":180,"gl-mat4/create":181,"gl-mat4/determinant":182,"gl-mat4/invert":186,"gl-mat4/transpose":196,"gl-vec3/cross":260,"gl-vec3/dot":261,"gl-vec3/length":262,"gl-vec3/normalize":264}],438:[function(t,e,r){e.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}},{}],439:[function(t,e,r){function n(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var a=t("gl-vec3/lerp"),o=t("mat4-recompose"),s=t("mat4-decompose"),l=t("gl-mat4/determinant"),c=t("quat-slerp"),u=n(),f=n(),h=n();e.exports=function(t,e,r,n){if(0===l(e)||0===l(r))return!1;var i=s(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),d=s(r,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!(!i||!d||(a(h.translate,u.translate,f.translate,n),a(h.skew,u.skew,f.skew,n),a(h.scale,u.scale,f.scale,n),a(h.perspective,u.perspective,f.perspective,n),c(h.quaternion,u.quaternion,f.quaternion,n),o(t,h.translate,h.scale,h.skew,h.perspective,h.quaternion),0))}},{"gl-mat4/determinant":182,"gl-vec3/lerp":263,"mat4-decompose":437,"mat4-recompose":440,"quat-slerp":490}],440:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.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}},{"gl-mat4/create":181,"gl-mat4/fromRotationTranslation":184,"gl-mat4/identity":185,"gl-mat4/multiply":188,"gl-mat4/scale":194,"gl-mat4/translate":195}],441:[function(t,e,r){"use strict";function n(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]}var i=t("binary-search-bounds"),a=t("mat4-interpolate"),o=t("gl-mat4/invert"),s=t("gl-mat4/rotateX"),l=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];e.exports=function(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=n.prototype;p.recalcMatrix=function(t){var e=this._time,r=i.le(e,t),n=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)f[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&f[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)n[c]=f[c];else a(n,f,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],h(m,m);var g=this.computedInverse;o(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-n[2+4*c]*b}},p.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=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=t("robust-orientation")[3]},{"robust-orientation":515}],443:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==m.alt,m.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==m.shift,m.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==m.control,m.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==m.meta,m.meta=!!t.metaKey),e}function i(t,i){var a=n.x(i),o=n.y(i);"buttons"in i&&(t=0|i.buttons),(t!==h||a!==d||o!==p||r(i))&&(h=0|t,d=a||0,p=o||0,e&&e(h,d,p,m))}function a(t){i(0,t)}function o(){(h||d||p||m.shift||m.alt||m.meta||m.control)&&(d=p=0,h=0,m.shift=m.alt=m.control=m.meta=!1,e&&e(0,0,0,m))}function s(t){r(t)&&e&&e(h,d,p,m)}function l(t){0===n.buttons(t)?i(0,t):i(h,t)}function c(t){i(h|n.buttons(t),t)}function u(t){i(h&~n.buttons(t),t)}function f(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var h=0,d=0,p=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;f();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return g},set:function(e){e?f():g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":445}],444:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-o.left,r[1]=a-o.top,r}},{}],445:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.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;k=k-1&m)b.push(_+"["+A+"+"+g(k)+"]");for(b.push(v(0)),k=0;k=0;--e)L(e,0);var r=[];for(e=0;e0){",h(S[t]),"=1;"),D(t-1,e|1<0&&q.push(s(j,S[B-1])+"*"+o(S[B-1])),R.push(d(j,S[B])+"=("+q.join("-")+")|0")}for(j=0;j=0;--j)H.push(o(S[j]));R.push(k+"=("+H.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",A+"=0"),R.push(p(0)+"=0");for(B=1;B<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 a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return x(t.vertex,t.cell,t.phase,i,r,o)};var _="V",w="P",M="N",k="Q",A="X",T="T"},{"typedarray-pool":554}],448:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":119}],449:[function(t,e,r){"use strict";function n(t){if(t in o)return o[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){for(a.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");for(a.push("){grad",r,"(src.pick(",s.join(),")",c),l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join();if(v=s[r])return v;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],l=0;l<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:o,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":116}],453:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":454,ndarray:458}],454:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":116}],455:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[a.mallocUint8,a.freeUint8];case"uint16":return[a.mallocUint16,a.freeUint16];case"uint32":return[a.mallocUint32,a.freeUint32];case"int8":return[a.mallocInt8,a.freeInt8];case"int16":return[a.mallocInt16,a.freeInt16];case"int32":return[a.mallocInt32,a.freeInt32];case"float32":return[a.mallocFloat,a.freeFloat];case"float64":return[a.mallocDouble,a.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",f,"*n",f].join("")):s.push(["d",d,"=s",d].join("")),f=d);var p;0!=(p=t.length-1-l)&&(h>0?s.push(["e",p,"=s",p,"-e",h,"*n",h,",f",p,"=",c[p],"-f",h,"*n",h].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),h=p)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",o,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+a);var g=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var f=[],h=1;h1){for(o.push("dptr=0;sptr=ptr"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");for(o.push("dptr=cptr;sptr=cptr-s0"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));return o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c?new Function("malloc","free",o.join("\n"))(c[0],c[1]):new Function(o.join("\n"))()}(t,e);return g(v,function(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function s(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function l(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function c(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i)0!==(o=t[i])&&_.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function f(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++A;u(o,[n,i],!1,["comp=",s("ptr0"),"-",s("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else _.push(["if(",s(a(n)),">",s(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?c([e,r],!1,l("ptr0",s("ptr1"))):_.push(l(a(e),s(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;u(i,[r],!0,[e,"=",s("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",s(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?c([e,r],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(c([e,r,n],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?c([e,r],!0,[l("ptr0",s("ptr1")),"\n",l("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(l(a(e),s(a(r))),l(a(r),"pivot"+n))}function x(e,r){_.push(["if((",r,"-",e,")<=",o,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function b(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),c([e],!0,["if(",s("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",s(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?c(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",s("ptr1"),"\n","pivot2[pivot_ptr]=",s("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",s("ptr0"),"\n","y=",s("ptr2"),"\n","z=",s("ptr4"),"\n",l("ptr5","x"),"\n",l("ptr6","y"),"\n",l("ptr7","z")].join("")):_.push(["pivot1=",s(a("el2")),"\n","pivot2=",s(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",s(a("el1")),"\n","y=",s(a("el3")),"\n","z=",s(a("el5")),"\n",l(a("index1"),"x"),"\n",l(a("index3"),"y"),"\n",l(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),b("less",1,"++less"),b("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k?new Function("insertionSort","malloc","free",_.join("\n"))(r,k[0],k[1]):new Function("insertionSort",_.join("\n"))(r)}(t,e,v))}},{"typedarray-pool":554}],456:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.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}},{"./lib/compile_sort.js":455}],457:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":119,"ndarray-linear-interpolate":451}],458:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");return new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],i)}var o=t("iota-array"),s=t("is-buffer"),l="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var o=i-1,u=1;o>=0;--o)r[o]=u,u*=e[o]}if(void 0===n)for(n=0,o=0;o>>0;e.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)}},{"double-bits":131}],460:[function(t,e,r){function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function a(t,e,r,n,i,s,u,f,h,d){if(d)M=d[0],k=d[1],_=d[2],w=d[3];else{var p=o(t,e,-i);t=p.x,e=p.y;var m=(t-(f=(p=o(f,h,-i)).x))/2,g=(e-(h=p.y))/2,v=m*m/(r*r)+g*g/(n*n);v>1&&(r*=v=Math.sqrt(v),n*=v);var y=r*r,x=n*n,b=(s==u?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*m*m)/(y*g*g+x*m*m)));b==1/0&&(b=1);var _=b*r*g/n+(t+f)/2,w=b*-n*m/r+(e+h)/2,M=Math.asin(((e-w)/n).toFixed(9)),k=Math.asin(((h-w)/n).toFixed(9));M=t<_?l-M:M,k=f<_?l-k:k,M<0&&(M=2*l+M),k<0&&(k=2*l+k),u&&M>k&&(M-=2*l),!u&&k>M&&(k-=2*l)}if(Math.abs(k-M)>c){var A=k,T=f,S=h;k=M+c*(u&&k>M?1:-1);var E=a(f=_+r*Math.cos(k),h=w+n*Math.sin(k),r,n,i,0,u,T,S,[k,A,_,w])}var L=Math.tan((k-M)/4),C=4/3*r*L,z=4/3*n*L,D=[2*t-(t+C*Math.sin(M)),2*e-(e-z*Math.cos(M)),f+C*Math.sin(k),h-z*Math.cos(k),f,h];if(d)return D;E&&(D=D.concat(E));for(var I=0;I7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=d,b=p;"C"!=e&&"S"!=e||(x+=x-o,b+=b-l),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),v=i(d,p,f,h,v[1],v[2]);break;case"Q":f=v[1],h=v[2],v=i(d,p,v[1],v[2],v[3],v[4]);break;case"L":v=n(d,p,v[1],v[2]);break;case"H":v=n(d,p,v[1],p);break;case"V":v=n(d,p,d,v[1]);break;case"Z":v=n(d,p,c,u)}e=y,d=v[v.length-2],p=v[v.length-1],v.length>4?(o=v[v.length-4],l=v[v.length-3]):(o=d,l=p),r.push(v)}return r}},{}],461:[function(t,e,r){r.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[c],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,M=(x+2)%3;b[x]+=_*(v[w]*m[M]-v[M]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.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;for(c=0;c<3;++c)h[c]*=d;i[o]=h}return i}},{}],462:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var f=Math.sqrt(u+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,c);f=Math.sqrt(2*h-u+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}},{}],464:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=s([r]),this.center=s(e),this.rotation=s(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)}e.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),a(r=[].slice.call(r,0,4),r);var i=new o(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 s=t("filtered-vector"),l=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),u=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),h=o.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;a(e,e);var r=this.computedMatrix;c(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,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d);u/=p,f/=p,h/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,x=m*u+g*f+v*h,b=n(m-=y*o+x*u,g-=y*s+x*f,v-=y*l+x*h);m/=b,g/=b,v/=b;var _=u*e+o*r,w=f*e+s*r,M=h*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*u,v=e*l+r*f,y=e*c+r*h,x=-(p*y-m*v),b=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=i(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*x+T*_-S*b,C=T*w+E*b+S*x-A*_,z=S*w+E*_+A*b-T*x,D=E*w-A*x-T*b-S*_;if(a){x=d,b=p,_=m;var I=Math.sin(a)/n(x,b,_);x*=I,b*=I,_*=I,D=D*(w=Math.cos(e))-(L=L*w+D*x+C*_-z*b)*x-(C=C*w+D*b+z*x-L*_)*b-(z=z*w+D*_+L*b-C*x)*_}var P=i(L,C,z,D);P>1e-6?(L/=P,C/=P,z/=P,D/=P):(L=C=z=0,D=1),this.rotation.set(t,L,C,z,D)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;l(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,c=0;c<3;++c)s+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(s,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;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;u(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),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)}},{"./lib/quatFromFrame":463,"filtered-vector":142,"gl-mat4/fromQuat":183,"gl-mat4/invert":186,"gl-mat4/lookAt":187}],465:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":507}],466:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:function(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?function(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=d.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&function(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,i,e)},writePackedSVarint:function(t,e){this.writeMessage(t,a,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,o,e)},writePackedDouble:function(t,e){this.writeMessage(t,s,e)},writePackedFixed32:function(t,e){this.writeMessage(t,c,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,u,e)},writePackedFixed64:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,h,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":469}],471:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":280,"typedarray-pool":554}],473:[function(t,e,r){"use strict";function n(t){return i[t]?i[t]:("string"==typeof t&&(t=i[t]=t.split(/\s*,\s*|\s+/)),t)}e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a0){o=c[u][i][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=c[f][i],d=0;d0&&(o=p,s=m,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=i(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],f=t,h=s[1],d=i(u,f,!0);if(n(e[u],e[f],e[h],e[d])<0)break;s.push(t),l=i(u,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;u0;){c[0][u].length;var m=a(u,d);o(0,m)?p.push.apply(p,m):(p.length>0&&h.push(p),p=m)}p.length>0&&h.push(p)}return h};var n=t("compare-angle")},{"compare-angle":106}],475:[function(t,e,r){"use strict";e.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 c=r[d];for(s=0;s0})).length,g=new Array(m),v=new Array(m);for(d=0;d0;){var N=O.pop(),j=E[N];c(j,function(t,e){return t-e});var B,U=j.length,V=F[N];for(0===V&&(B=[H=p[N]]),d=0;d=0)&&(F[q]=1^V,O.push(q),0===V)){var H;r(H=p[q])||(H.reverse(),B.push(H))}}0===V&&R.push(B)}return R};var i=t("edges-to-adjacency-list"),a=t("planar-dual"),o=t("point-in-big-polygon"),s=t("two-product"),l=t("robust-sum"),c=t("uniq"),u=t("./lib/trim-leaves")},{"./lib/trim-leaves":475,"edges-to-adjacency-list":136,"planar-dual":474,"point-in-big-polygon":478,"robust-sum":520,"two-product":552,uniq:556}],477:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],478:[function(t,e,r){function n(){return!0}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var s=i.key,l=o(r,s[0],s[1]);if(s[0][0]0))return 0;a=-1,i=i.right}else if(l>0)i=i.left;else{if(!(l<0))return 0;a=1,i=i.right}}return a}}(g.slabs,g.coordinates);return 0===n.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(i(n),v)};var o=t("robust-orientation")[3],s=t("slab-decomposition"),l=t("interval-tree-1d"),c=t("binary-search-bounds")},{"binary-search-bounds":70,"interval-tree-1d":279,"robust-orientation":515,"slab-decomposition":532}],479:[function(t,e,r){function n(t,e,r){var n=i.segments(t),a=i.segments(e),o=r(i.combine(n,a));return i.polygon(o)}var i,a=t("./lib/build-log"),o=t("./lib/epsilon"),s=t("./lib/intersecter"),l=t("./lib/segment-chainer"),c=t("./lib/segment-selector"),u=t("./lib/geojson"),f=!1,h=o();i={buildLog:function(t){return!0===t?f=a():!1===t&&(f=!1),!1!==f&&f.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=s(!0,h,f);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:s(!1,h,f).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:c.union(t.combined,f),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:c.intersect(t.combined,f),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:c.difference(t.combined,f),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:c.differenceRev(t.combined,f),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:c.xor(t.combined,f),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,h,f),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(i,t)},polygonToGeoJSON:function(t){return u.fromPolygon(i,h,t)},union:function(t,e){return n(t,e,i.selectUnion)},intersect:function(t,e){return n(t,e,i.selectIntersect)},difference:function(t,e){return n(t,e,i.selectDifference)},differenceRev:function(t,e){return n(t,e,i.selectDifferenceRev)},xor:function(t,e){return n(t,e,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),e.exports=i},{"./lib/build-log":480,"./lib/epsilon":481,"./lib/geojson":482,"./lib/intersecter":483,"./lib/segment-chainer":485,"./lib/segment-selector":486}],480:[function(t,e,r){e.exports=function(){function t(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}var e,r=0,n=!1;return e={list:[],segmentId:function(){return r++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,n){return t("temp_status",{seg:e,above:r,below:n})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,n){return t("status",{seg:e,above:r,below:n})},vert:function(r){return r===n?e:(n=r,t("vert",{x:r}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}}}},{}],481:[function(t,e,r){e.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-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],482:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}if(e.length<=0)return t.segments({inverted:!1,regions:[]});for(var n=r(e[0]),i=1;i0})}function s(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),m=!d&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;p&&(d||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),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 c=n.create(),f=[];!u.isEmpty();){var h=u.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=o(h),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(h.seg,!!p&&p.seg,!!m&&m.seg);var g=function(){if(p){var t=s(h,p);if(t)return t}return!!m&&s(h,m)}();if(g&&(t?(v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(g.seg),h.other.remove(),h.remove()),u.getHead()!==h){r&&r.rewind(h.seg);continue}if(t){var v;v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=v?!h.seg.myFill.below:h.seg.myFill.below}else if(null===h.seg.otherFill){var y;y=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?a:i,h.seg.otherFill={above:y,below:y}}r&&r.status(h.seg,!!p&&p.seg,!!m&&m.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(c.exists(x.prev)&&c.exists(x.next)&&s(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}f.push(h.seg)}u.getHead().remove()}return r&&r.done(),f}var u=n.create();return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p):(b=0,d>=0?(_=0,y=p):-d>=f?(_=1,y=f+2*d+p):y=d*(_=-d/f)+p);else if(_<0)_=0,h>=0?(b=0,y=p):-h>=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p;else{var w=1/x;y=(b*=w)*(c*b+u*(_*=w)+2*h)+_*(u*b+f*_+2*d)+p}else{var M,k,A,T;b<0?(k=f+d)>(M=u+h)?(A=k-M)>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p:(b=0,k<=0?(_=1,y=f+2*d+p):d>=0?(_=0,y=p):y=d*(_=-d/f)+p):_<0?(k=c+h)>(M=u+d)?(A=k-M)>=(T=c-2*u+f)?(_=1,b=0,y=f+2*d+p):y=(b=1-(_=A/T))*(c*b+u*_+2*h)+_*(u*b+f*_+2*d)+p:(_=0,k<=0?(b=1,y=c+2*h+p):h>=0?(b=0,y=p):y=h*(b=-h/c)+p):(A=f+d-u-h)<=0?(b=0,_=1,y=f+2*d+p):A>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p}var S=1-b-_;for(l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]);return n+a((t=t.replace(C,".")).split("."),e).join(".")}function s(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(e+=P((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=P(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:b}function u(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?I(t/k):t>>1,t+=I(t/e);t>D*w>>1;n+=b)t=I(t/D);return I(n+(D+1)*t/(t+M))}function h(t){var e,r,n,a,o,s,u,h,d,p,m=[],g=t.length,v=0,y=T,M=A;for((r=t.lastIndexOf(S))<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a=g&&i("invalid-input"),((h=c(t.charCodeAt(a++)))>=b||h>I((x-v)/s))&&i("overflow"),v+=h*s,d=u<=M?_:u>=M+w?w:u-M,!(hI(x/(p=b-d))&&i("overflow"),s*=p;M=f(v-o,e=m.length+1,0==o),I(v/e)>x-y&&i("overflow"),y+=I(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,c,h,d,p,m,g,v,y,M,k=[];for(g=(t=s(t)).length,e=T,r=0,o=A,l=0;l=e&&mI((x-r)/(v=n+1))&&i("overflow"),r+=(c-e)*v,e=c,l=0;lx&&i("overflow"),m==e){for(h=r,d=b;p=d<=o?_:d>=o+w?w:d-o,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=b-_,I=Math.floor,P=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:h,encode:d,toASCII:function(t){return o(t,function(t){return L.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return o(t,function(t){return E.test(t)?h(t.slice(4).toLowerCase()):t})}},p&&m)if(e.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],490:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":236}],491:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(f=m.substr(0,g),h=m.substr(g+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],492:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne?1:0};a>r;){if(a-r>600){var s=a-r+1,l=e-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-l*u/s+f)),Math.min(a,Math.floor(e+(s-l)*u/s+f)),o)}var h=t[e],d=r,p=a;for(i(t,r,e),o(t[a],h)>0&&i(t,r,a);d0;)p--}0===o(t[r],h)?i(t,r,p):i(t,++p,a),p<=e&&(r=p+1),e<=p&&(a=p-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],495:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":90,"compare-cell":107,"compare-oriented-cell":108}],500:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){function r(t){t?p(t):null===t&&m(),c()}function c(e){if("number"==typeof e)return d(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),k.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?d(r):t.draw=!0)})}function d(t){"number"==typeof t&&(t=k[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],g(t),t.after&&t.after(t))}function p(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(k=t.map(function(t,c){var u=k[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(k[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},M,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a2&&(t._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&x(e),e.thickness&&e.color&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],e.scaleRatio[0]>L||e.scaleRatio[1]>L?y(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.positions.length>=C)?y(e):v(e),e.after&&e.after(e)))}function m(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0;if(S=t.map(function(t,r){var s=S[r];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=l(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color stroke colors stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",after:"after callback done pass"}),s||(S[r]=s={id:r,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,offset:0,dashLength:0,hole:!0},t=o({},T,t)),c(s,t,[{thickness:parseFloat,opacity:parseFloat,miterLimit:parseFloat,overlay:Boolean,join:function(t){return t},after:function(t){return t},hole:function(t){return t||[]},positions:function(t,r,n){t=u(t,"float64");var i=Math.floor(t.length/2),o=a(t,2);return r.range||n.range||(n.range=o),r.count=i,r.bounds=o,e+=i,t},fill:function(t){return t?i(t,"uint8"):null},dashes:function(t,e,r){var n,i=e.dashLength;if(!t||t.length<2)i=1,n=new Uint8Array([255,255,255,255,255,255,255,255]);else{i=0;for(var a=0;a=4&&e.positions[0]===e.positions[e.positions.length-2]&&e.positions[1]===e.positions[e.positions.length-1]},positions:function(t,e,r){if(e.fill&&t.length){for(var n=[],i={},a=0,o=0,s=0,l=e.count;o 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord + translate) * scale;\n\tvec2 aBotPosition = (aBotCoord + translate) * scale;\n\n\tvec2 bTopPosition = (bTopCoord + translate) * scale;\n\tvec2 bBotPosition = (bBotCoord + translate) * scale;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = (aCoord + translate) * scaleRatio + viewport.xy;\n\tendCoord = (bCoord + translate) * scaleRatio + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1},bColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset+4},divisor:1},prevCoord:{buffer:w,stride:8,offset:function(t,e){return 8*e.offset},divisor:1},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},nextCoord:{buffer:w,stride:8,offset:function(t,e){return 24+8*e.offset},divisor:1}}},z)),y=t(o({vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float thickness, pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nconst float MAX_LINES = 256.;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n return (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n}\n\nvoid main() {\n\t// vec2 scaleRatio = scale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\tfloat depth = (MAX_LINES - 1. - id) / (MAX_LINES);\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scaleRatio);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},aCoordFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoordFract:{buffer:M,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},color:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1}}},z)),x=t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= opacity;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset}},positionFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset}}},blend:z.blend,depth:{enable:!1},scissor:z.scissor,stencil:z.stencil,viewport:z.viewport}),o(r,{update:m,draw:d,destroy:g,regl:t,gl:A,canvas:A.canvas,lines:S}),r}},{"array-bounds":48,"array-normalize":49,"color-normalize":99,earcut:135,"flatten-vertex-data":143,glslify:502,"object-assign":462,"pick-by-alias":473,"update-diff":558}],502:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],503:[function(t,e,r){"use strict";var n=t("color-normalize"),i=t("array-bounds"),a=t("color-id"),o=t("snap-points-2d"),s=t("object-assign"),l=t("glslify"),c=t("binary-search-bounds"),u=t("pick-by-alias"),f=t("update-diff"),h=t("flatten-vertex-data"),d=t("is-iexplorer"),p=t("to-float32"),m=p.float32,g=p.fract32;e.exports=function(t,e){function r(t){t?x(t):null===t&&M(),p()}function p(t){if("number"==typeof t)return v(t);Array.isArray(t)?t.forEach(function(t,e){if(null!=t)return t.length?v(t,e):v(t)}):O.forEach(function(t,e){t&&v(e)})}function v(e,r){"number"==typeof e&&(e=O[e]);var n;if(Array.isArray(e)&&(n=e,e=O[r]),e&&e.count&&e.opacity){var i;if(n){i=Array(e.count);for(var a=0;a1)){var g=m.offset,v=m.count+g,y=c.ge(f,i[0],g,v-1),x=c.lt(f,i[2],y,v-1)+1;if(!(x<=y))if(r){var b=n(t.data.subarray(y,x),r);l.push(s({},e,{elements:b,marker:F[h],offset:0,count:b.length}))}else l.push(s({},e,{elements:t.elements,marker:F[h],offset:y,count:x-y}))}}return l}function x(e){if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=0,n=0,a=0;O=e.map(function(e,l){var c=O[l];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=u(e,{positions:"positions data points",snap:"snap cluster",size:"sizes size radius",borderSize:"borderSizes borderSize stroke-width strokeWidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",palette:"palette swatch",marker:"markers marker shape",range:"range dataBox",viewport:"viewport viewBox",opacity:"opacity alpha"}),c||(O[l]=c={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,markerIds:[]},e=s({},P,e)),!e.positions||"marker"in e||(e.marker=c.marker,delete c.marker),f(c,e,[{snap:!0,size:function(t){return n+=t.length?1:0,t},borderSize:function(t){return n+=t.length?1:0,t},opacity:parseFloat,color:function(t){return t=w(t),a++,t},borderColor:function(t){return t=w(t),a++,t},positions:function(t,e,n){t=h(t,"float64");var a=e.count=Math.floor(t.length/2),o=e.bounds=a?i(t,2):null;return n.range||e.range||(delete e.range,n.range=o),e.offset=r,r+=a,n.marker||e.marker||(delete e.marker,n.marker=null),t}},{marker:function(t,e,r){if(e.markerIds.length=0,t&&"number"!=typeof t[0])for(var n=0,i=t.length;ni)){c.snap=!0;var h=c.x=Array(u),d=c.w=Array(u),p=void 0;if(n.length>1){p=Array(2*u);for(var m=0;m=0)return r;var n;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)n=e;else{n=new Uint8Array(e.length);for(var i=0,a=e.length;i 1.0) {\n discard;\n }\n\n float centerFraction = fragBorderSize == 0. ? 2. : fragSize / (fragSize + fragBorderSize + 1.25);\n\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, 1.);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n"]),vert:l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth, fragBorderSize, fragSize;\n\nvoid main() {\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n fragBorderSize = borderSize;\n fragSize = size;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragWidth = 1. / gl_PointSize;\n}\n"]),uniforms:{color:function(t,e){var r=e.color.length?e.color[0]:e.color;return D.slice(4*r,4*r+4).map(function(t){return t/255})},borderColor:function(t,e){var r=e.borderColor.length?e.borderColor[0]:e.borderColor;return D.slice(4*r,4*r+4).map(function(t){return t/255})},pixelRatio:t.context("pixelRatio"),palette:C,scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("marker")},attributes:{position:S,positionFract:E,size:B.attributes.size,borderSize:B.attributes.borderSize}}));else{var U=s({},B);U.frag=l(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float pixelRatio, opacity;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n //max-distance alpha\n if (dist < 0.003) discard;\n\n //null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a);\n return;\n }\n\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n}\n"]),U.vert=l(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius,\n\t\tfragWidth, fragBorderColorLevel, fragColorLevel;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pixelRatio;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),k=t(U);var V=s({},B);V.frag=l(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif(radius > 1.0 + delta) {\n\t\tdiscard;\n\t\treturn;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),V.vert=l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),A=t(V)}return s(r,{update:x,draw:p,destroy:M,regl:t,gl:z,canvas:z.canvas,groups:O,markers:R}),r}},{"array-bounds":48,"binary-search-bounds":504,"color-id":97,"color-normalize":99,"flatten-vertex-data":143,glslify:505,"is-iexplorer":284,"object-assign":462,"pick-by-alias":473,"snap-points-2d":534,"to-float32":547,"update-diff":558}],504:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{dup:89}],505:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],506:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){function t(t,e){this.id=j++,this.type=t,this.data=e}function e(t){if(0===t.length)return[];var r=t.charAt(0),n=t.charAt(t.length-1);if(1>>=e,r=(255>>=r,e|=r,r=(15>>=r,e|=r,r=(3>>r>>1}function c(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=G[l(t)>>2]).length?e.pop():new ArrayBuffer(t)}function u(t){G[l(t.byteLength)>>2].push(t)}function f(t,e,r,n,i,a){for(var o=0;o>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),s.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(ft).forEach(function(e){t+=ft[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;C.call(r);var a=E();return"number"==typeof t?A(a,0|t,"number"==typeof e?0|e:0|t):t?(z(r,t),T(a,t)):A(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,P(i),S(a,3553),D(r,3553),O(),L(a),s.profile&&(i.stats.size=M(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=$[i.internalformat],n.type=tt[i.type],n.mag=et[r.magFilter],n.min=rt[r.minFilter],n.wrapS=ot[r.wrapS],n.wrapT=ot[r.wrapT],n}var i=new I(3553);return ft[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return c(o,i),o.width=0,o.height=0,d(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,P(i),p(o,3553,e,r,a),O(),k(o),n},n.resize=function(e,r){var a=0|e,o=0|r||a;if(a===i.width&&o===i.height)return n;n.width=i.width=a,n.height=i.height=o,P(i);for(var l=0;i.mipmask>>l;++l)t.texImage2D(3553,l,i.format,a>>l,o>>l,0,i.format,i.type,null);return O(),s.profile&&(i.stats.size=M(i.internalformat,i.type,a,o,!1,!1)),n},n._reglType="texture2d",n._texture=i,s.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,o,l){function f(t,e,r,n,i,a){var o,l=h.texInfo;for(C.call(l),o=0;6>o;++o)g[o]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)T(g[0],t),T(g[1],e),T(g[2],r),T(g[3],n),T(g[4],i),T(g[5],a);else if(z(l,t),u(h,t),"faces"in t)for(t=t.faces,o=0;6>o;++o)c(g[o],h),T(g[o],t[o]);else for(o=0;6>o;++o)T(g[o],t)}else for(t=0|t||1,o=0;6>o;++o)A(g[o],t,t);for(c(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),o=0;6>o;++o)S(g[o],34069+o);for(D(l,34067),O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=$[h.internalformat],f.type=tt[h.type],f.mag=et[l.magFilter],f.min=rt[l.minFilter],f.wrapS=ot[l.wrapS],f.wrapT=ot[l.wrapT],o=0;6>o;++o)L(g[o]);return f}var h=new I(34067);ft[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,o,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return c(a,h),a.width=0,a.height=0,d(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,P(h),p(a,34069+t,r,n,i),O(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,s.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);D(e.texInfo,e.target)})}}}function A(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function T(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);H(l).forEach(e),l={},H(c).forEach(e),c={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,u={},r.shaderCount=0},program:function(t,e,i){var a=u[e];a||(a=u[e]={});var o=a[t];return o||(o=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(e,t),r.shaderCount++,s(o),a[t]=o,f.push(o)),o},restore:function(){l={},c={};for(var t=0;t="+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",u,"=",s,".createStream(",34962,",",i,".buffer);","}else{",u,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l})}),o}(r),u.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=P(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=O(e,function(t,r){return t.invoke(r,e)})}),n}(o),u}function w(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a),i(n,".",a,"=",r[a].append(t,e),";")}),e(i)}function M(t,e,r,n){var i,a=(s=t.shared).gl,o=s.framebuffer;J&&(i=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",a,".bindFramebuffer(",36160,",",t,".framebuffer);"),J&&e(i,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),J&&e(i,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function k(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,l=n.current,c=n.next,u=t.cond(l,".dirty");$.forEach(function(e){if(!((e=g(e))in r.state)){var n,f;if(e in o){n=o[e],f=a[e];var h=s(K[e].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(h.map(function(t,e){return t+"!=="+f+"["+e+"]"}).join("||")).then(i,".",rt[e],"(",h,");",h.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";"))}else n=u.def(c,".",e),h=t.cond(n,"!==",l,".",e),u(h),e in et?h(t.cond(n).then(i,".enable(",et[e],");").else(i,".disable(",et[e],");"),l,".",e,"=",n,";"):h(i,".",rt[e],"(",n,");",l,".",e,"=",n,";")}}),0===Object.keys(r.state).length&&u(l,".dirty=false;"),e(u)}function A(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;z(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(et[i]){var u=et[i];I(l)?e(s,c?".enable(":".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(v(c)){var f=a[i];e(s,".",rt[i],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",rt[i],"(",c,");",o,".",i,"=",c,";")}})}function T(t,e){X&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function S(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(h,".count+=",i,";"):t(h,".count++;"),p&&(n?(u=e.def(),t(u,"=",m,".getNumPendingQueries();")):t(m,".beginQuery(",h,");"))}function s(t){t(h,".cpuTime+=",a(),"-",c,";"),p&&(n?t(m,".pushScopeStats(",u,",",m,".getNumPendingQueries(),",h,");"):t(m,".endQuery();"))}function l(t){var r=e.def(d,".profile");e(d,".profile=",t,";"),e.exit(d,".profile=",r,";")}var c,u,f=t.shared,h=t.stats,d=f.current,m=f.timer;if(r=r.profile){if(I(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(d,".profile");o(f=t.block()),e("if(",r,"){",f,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function F(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(yt))return;var c=t.scopeAttrib(s);o={},Object.keys(new Y).forEach(function(t){o[t]=e.def(c,".",t)})}!function(r,n,i){function o(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",d.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",d.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),X&&(a=i.divisor,e("if(",u,".divisor!==",a,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,a],");",u,".divisor=",a,";}"))}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",ht.map(function(t,e){return u+"."+t+"!=="+h[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",h,");",ht.map(function(t,e){return u+"."+t+"="+h[e]+";"}).join(""),"}")}var l=a.gl,c=e.def(r,".location"),u=e.def(a.attributes,"[",c,"]");r=i.state;var f=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];1===r?o():2===r?s():(e("if(",r,"===",1,"){"),o(),e("}else{"),s(),e("}"))}(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)})}function R(t,r,n,i,a){for(var o,l=t.shared,c=l.gl,u=0;u>1)",m],");")}function e(){r(g,".drawArraysInstancedANGLE(",[h,d,p,m],");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[h,d,p]+");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,f=function(){var i=u.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","elements"),i&&a("if("+i+")"+l+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),h=i("primitive"),d=i("offset"),p=function(){var i=u.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","count"),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,g;X&&(m=i("instances"),g=t.instancing);var v=f+".type",y=u.elements&&I(u.elements);X&&("number"!=typeof m||0<=m)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function U(t,e,r,n,i){return e=b(),i=e.proc("body",i),X&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function V(t,e,r,n){T(t,e),F(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),j(t,e,e,r)}function q(t,e,r,n){function i(){return!0}t.batchId="a1",T(t,e),F(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),j(t,e,e,r)}function H(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}T(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&w(t,u,r.context),r.needsFramebuffer&&M(t,u,r.framebuffer),A(t,u,r.state,i),r.profile&&i(r.profile)&&S(t,u,r,!1,!0),n?(F(t,c,r,n.attributes,a),F(t,u,r,n.attributes,i),R(t,c,r,n.uniforms,a),R(t,u,r,n.uniforms,i),j(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link(function(e){return U(q,t,r,e,2)}),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function G(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];B.isDynamic(n)&&(n=t.invoke(e,n),e(u,".",r,"=",n,";"))})}var i=e.static[r];if(i&&function(t){if("object"==typeof t&&!v(t)){for(var e=Object.keys(t),r=0;r":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},gt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vt={cw:2304,ccw:2305},yt=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===it.length)E&&E.update(),lt=null;else{lt=U.next(e),h();for(var t=it.length-1;0<=t;--t){var r=it[t];r&&r(D,null,0)}y.flush(),E&&E.update()}}function r(){!lt&&0=it.length&&n()}var r=R(it,t);it[r]=e}}}function f(){var t=rt.viewport,e=rt.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=y.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=y.drawingBufferHeight}function h(){D.tick+=1,D.time=v(),f(),et.procs.poll()}function g(){f(),et.procs.refresh(),E&&E.update()}function v(){return(V()-L)/1e3}if(!(t=a(t)))return null;var y=t.gl,x=y.getContextAttributes();y.isContextLost();var b=function(t,e){function r(e){e=e.toLowerCase();var r;try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;i(i=l)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=s,0>s&&(i=4,1===(s=n.buffer.dimension)&&(i=0),2===s&&(i=1),3===s&&(i=4)),n.primType=i}function s(t){n.elementsCount--,delete l[t.id],t.buffer.destroy(),t.buffer=null}var l={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function l(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,s=0,h=0;Array.isArray(t)||q(t)||o(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=J[t.usage]),"primitive"in t&&(n=tt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?s=0|t.length:(s=i,5123===h||5122===h?s*=2:5125!==h&&5124!==h||(s*=4))),a(f,e,r,n,i,s,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return l}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,l(t),l._reglType="elements",l._elements=f,l.subdata=function(t,e){return c.subdata(t,e),l},l.destroy=function(){s(f)},l},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){H(l).forEach(s)}}}(y,M,P,w),j=(C=function(t,e,r,n,i){for(t=r.maxAttributes,e=Array(t),r=0;r=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach(function(e){t+=u[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(a=e.shape,n=0|a[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height?o:(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){H(u).forEach(o)},restore:function(){H(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}}(y,M,0,w,t),X=function(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?(t=n.create2D({width:t,height:e,format:a,type:s}),t._texture.refCount=0,new o(3553,t,null)):(t=i.create({width:t,height:e,format:a}),t._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=M++,k[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete k[e.id]}function v(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){H(k).forEach(g)},restore:function(){H(k).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}})}(y,M,I,G,W,w),et=F(y,_,M,I,P,O,0,X,{},C,j,{elements:null,primitive:4,count:-1,offset:0,instances:-1},D,E,t),rt=(_=S(y,X,et.procs.poll,D),et.next),nt=y.canvas,it=[],at=[],ot=[],st=[t.onDestroy],lt=null;nt&&(nt.addEventListener("webglcontextlost",i,!1),nt.addEventListener("webglcontextrestored",s,!1));var ht=X.setFBO=l({framebuffer:B.define.call(null,1,"framebuffer")});return g(),x=N(l,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)ht(N({framebuffer:t.framebuffer.faces[e]},t),c);else ht(t,c);else c(0,t)},prop:B.define.bind(null,1),context:B.define.bind(null,2),this:B.define.bind(null,3),draw:l({}),buffer:function(t){return P.create(t,34962,!1,!1)},elements:function(t){return O.create(t,!1)},texture:G.create2D,cube:G.createCube,renderbuffer:W.create,framebuffer:X.create,framebufferCube:X.createCube,attributes:x,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=at;break;case"restore":r=ot;break;case"destroy":r=st}return r.push(e),{cancel:function(){for(var t=0;t=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,r)}},{}],508:[function(t,e,r){!function(t,n){"object"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",i(t.slice(0,e)),",",i(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function o(t){return!0&t?"-":""}function s(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===n?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?i[t]:i)}var i=t("robust-determinant"),a=6,o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:d(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],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+f*(g-v)+h*(y-x),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(h));return b>_||-b>_?b:p(t,e,r,n)}];!function(){for(;m.length<=h;)m.push(s(m.length));for(var t=[],r=["slow"],n=0;n<=h;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=h;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&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),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(c+=1)=n?(i=h,(c+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(f=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(f,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],522:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],523:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":74,"reduce-simplicial-complex":499}],524:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,a=new Array(t+1);a[0]=[[]];for(var o=1;o<=t;++o)for(var s=a[o]=i(o),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--o){o>1,s=n(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(i=o-1)}return a}function l(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==n(t[g],o)););}return r}function c(t,e){if(e<0)return[];for(var r=[],n=(1<>>u&1&&c.push(i[u]);e.push(c)}return a(e)},r.skeleton=c,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=l(t);if(!(r>=0&&e0){var t=A[0];return o(0,S-1),S-=1,c(0),t}return-1}function h(t,e){var r=A[t];return x[r]===e?t:(x[r]=-1/0,u(t),f(),x[r]=e,S+=1,u(S-1))}function d(t){if(!b[t]){b[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],a(e)),T[r]>=0&&h(T[r],a(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),x=new Array(m),b=new Array(m),_=0;_>1;_>=0;--_)c(_);for(;;){var E=f();if(E<0||x[E]>r)break;d(E)}var L=[];for(_=0;_=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":515,"simplicial-complex":528}],531:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var a=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?a-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],a=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=i(r,a,s),c=i(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=i(s,o,a),c=i(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var i=t("robust-orientation")},{"robust-orientation":515}],532:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=a(t.right,e))return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}e.exports=function(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var c=this.horizontal[e];if(c.length>0){var h=l.ge(c,t[1],i);if(h=c.length)return n;d=c[h]}}if(d.start)if(o){var p=u(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":531,"binary-search-bounds":70,"functional-red-black-tree":144,"robust-orientation":515}],533:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],f=a[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function i(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function a(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function o(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],f=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=f}function s(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function l(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function u(t,e,r,h,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,x=y-m,b=y+m,_=g,w=x,M=y,k=b,A=v,T=t+1,S=e-1,E=0;l(_,w,r,h,d)&&(E=_,_=w,w=E),l(k,A,r,h,d)&&(E=k,k=A,A=E),l(_,M,r,h,d)&&(E=_,_=M,M=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(_,k,r,h,d)&&(E=_,_=k,k=E),l(M,k,r,h,d)&&(E=M,M=k,k=E),l(w,A,r,h,d)&&(E=w,w=A,A=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(k,A,r,h,d)&&(E=k,k=A,A=E);var L=r[w],C=h[2*w],z=h[2*w+1],D=d[w],I=p[w],P=r[k],O=h[2*k],F=h[2*k+1],R=d[k],N=p[k],j=_,B=M,U=A,V=g,q=y,H=v,G=r[j],Y=r[B],W=r[U];r[V]=G,r[q]=Y,r[H]=W;for(var X=0;X<2;++X){var Z=h[2*j+X],J=h[2*B+X],K=h[2*U+X];h[2*V+X]=Z,h[2*q+X]=J,h[2*H+X]=K}var Q=d[j],$=d[B],tt=d[U];d[V]=Q,d[q]=$,d[H]=tt;var et=p[j],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,a(x,t,r,h,d,p),a(b,e,r,h,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,0,D,r,h,d))it!==T&&i(it,T,r,h,d,p),++T;else if(!c(it,P,O,0,R,r,h,d))for(;;){if(c(S,P,O,0,R,r,h,d)){c(S,L,C,0,D,r,h,d)?(o(it,T,S,r,h,d,p),++T,--S):(i(it,S,r,h,d,p),--S);break}if(--S=Math.max(.9*d,32)){var _=c+s>>>1;l(g,v,f,h,_,u+1),h=_}l(g,v,f,h,y,u+1),h=y}}}var c=t.length>>>1;if(c<1)return[];e||(e=Array(c)),r||(r=Array(c)),s||(s=[]);for(var u=0;u=s[2]||s[1]>=s[3]){var f=o(t,2);f[0]===f[2]&&(f[2]+=1),f[1]===f[3]&&(f[3]+=1),s[0]=f[0],s[1]=f[1],s[2]=f[2],s[3]=f[3]}var h=s[0],d=s[1],p=s[2],m=s[3],g=1/(p-h),v=1/(m-d),y=Math.max(p-h,m-d),x=new Int32Array(c),b=0;l(h,d,y,0,c,0),a(x,t,e,r,c);var _=[],w=0,M=c;for(b=c-1;b>=0;--b){t[2*b]=(t[2*b]-h)*g,t[2*b+1]=(t[2*b+1]-d)*v;var k=x[b];k!==w&&(_.push(new i(y*Math.pow(.5,k),b+1,M-(b+1))),M=b+1,w=k)}return _.push(new i(y*Math.pow(.5,k+1),0,M)),_}},{"./lib/sort":533,"array-bounds":48}],535:[function(t,e,r){"use strict";function n(t,e){var r=o(a(t,e),[e[e.length-1]]);return r[r.length-1]}function i(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||o>0&&u<0){var f=i(s,u,l,o);r.push(f),a.push(f.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}},e.exports.positive=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r},e.exports.negative=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}},{"robust-dot-product":512,"robust-sum":520}],536:[function(t,e,r){!function(){"use strict";function t(e){return function(e,r){var i,a,o,s,l,c,u,f,h,d=1,p=e.length,m="";for(a=0;a=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}n.json.test(s[8])?m+=i:(!n.number.test(s[8])||f&&!s[3]?h="":(h=f?"+":"-",i=i.toString().replace(n.sign,"")),c=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",u=s[6]-(h+i).length,l=s[6]&&u>0?c.repeat(u):"",m+=s[5]?h+i+l:"0"===c?h+l+i:l+h+i)}return m}(function(t){if(i[t])return i[t];var e,r=t,a=[],o=0;for(;r;){if(null!==(e=n.text.exec(r)))a.push(e[0]);else if(null!==(e=n.modulo.exec(r)))a.push("%");else{if(null===(e=n.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],l=e[2],c=[];if(null===(c=n.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=n.key_access.exec(l)))s.push(c[1]);else{if(null===(c=n.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(e)}r=r.substring(e[0].length)}return i[t]=a}(e),arguments)}function e(e,r){return t.apply(null,[e].concat(r||[]))}var n={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:/^[\+\-]/},i=Object.create(null);void 0!==r&&(r.sprintf=t,r.vsprintf=e),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},{}],537:[function(t,e,r){"use strict";e.exports=function(t){function e(e){var r=[e],c=[e];for(n[e]=i[e]=u,a[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(o[e]=0&&l[e].push(s[m])}o[e]=p}else{if(i[e]===n[e]){var g=[],v=[],y=0;for(p=r.length-1;p>=0;--p){var x=r[p];if(a[x]=!1,g.push(x),v.push(l[x]),y+=l[x].length,s[x]=f.length,x===e){r.length=p;break}}f.push(g);var b=new Array(y);for(p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function u(t){return t.x}function f(t){return t.y}var h=t("kdbush");e.exports=function(t){return new n(t)},n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(i);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var o=+Date.now();this.trees[a+1]=h(n,u,f,this.options.nodeSize,Float32Array),n=this._cluster(n,a),e&&console.log("z%d: %d clusters in %dms",a,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=h(n,u,f,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(s(t[0]),l(t[3]),s(t[2]),l(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+g[b]+"*c");var T=p[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+T+"*("+p[b].join("+")+A+")/("+m[b].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var E=[];for(c=0;c<1<1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,m=void 0===p?0:p,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(d*i/360),b=Math.cos(d*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var M=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);M>1&&(u*=Math.sqrt(M),f*=Math.sqrt(M));var k=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(d,2),y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,M=(h-x)/a,k=(d-b)/o,A=(-h-x)/a,T=(-d-b)/o,S=s(1,0,M,k),E=s(M,k,A,T);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,m,v,x,b,_,w),A=n(k,4),T=A[0],S=A[1],E=A[2],L=A[3],C=Math.max(Math.ceil(Math.abs(L)/(i/4)),1);L/=C;for(var z=0;ze[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":43,assert:51,"is-svg-path":287,"normalize-svg-path":543,"parse-svg-path":466}],543:[function(t,e,r){"use strict";function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,d=0,p=0,m=t.length;p4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=d),r.push(g)}return r};var a=t("svg-arc-to-cubic-bezier")},{"svg-arc-to-cubic-bezier":541}],544:[function(t,e,r){(function(r){"use strict";var n=t("svg-path-bounds"),i=t("parse-svg-path"),a=t("draw-svg-path"),o=t("is-svg-path"),s=t("bitmap-sdf"),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");e||(e={});var u,f;e.shape?(u=e.shape[0],f=e.shape[1]):(u=l.width=e.w||e.width||200,f=l.height=e.h||e.height||200);var h=Math.min(u,f),d=e.stroke||0,p=e.viewbox||e.viewBox||n(t),m=[u/(p[2]-p[0]),f/(p[3]-p[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d)),c.translate(.5*u,.5*f),c.scale(g,g),r.Path2D){var v=new Path2D(t);c.fill(v),d&&c.stroke(v)}else{var y=i(t);a(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bitmap-sdf":72,"draw-svg-path":132,"is-svg-path":287,"parse-svg-path":466,"svg-path-bounds":542}],545:[function(t,e,r){(function(r){"use strict";function n(t,e,r){r=r||{};var a=o[t];a||(a=o[t]={" ":{data:new Float32Array(0),shape:.2}});var s=a[e];if(!s)if(e.length<=1||!/\d/.test(e))s=a[e]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var d=new Float32Array(u),p=0,m=-.5*f;for(h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;t=_(t,360),e=_(e,100),r=_(r,100);if(0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(e.h,i,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=b(n),{ok:s,format:e.format||l,r:I(255,P(r.r,0)),g:I(255,P(r.g,0)),b:I(255,P(r.b,0)),a:n}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=D(100*this._a)/100,this._format=n.format||i.format,this._gradientType=n.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=i.ok,this._tc_id=z++}function n(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n,i,a=P(t,e,r),o=I(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;)i.h=(i.h+a)%360,o.push(r(i));return o}function x(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function b(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=I(r,P(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function w(t){return I(1,P(0,t))}function M(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function A(t){return t<=1&&(t=100*t+"%"),t}function T(e){return t.round(255*parseFloat(e)).toString(16)}function S(t){return M(t)/255}function E(t){return!!N.CSS_UNIT.exec(t)}var L=/^\s+/,C=/\s+$/,z=0,D=t.round,I=t.min,P=t.max,O=t.random;r.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 e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=b(t),this._roundA=D(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),n=D(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),i=D(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return a(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=[k(D(t).toString(16)),k(D(e).toString(16)),k(D(r).toString(16)),k(T(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:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(100*_(this._r,255))+"%",g:D(100*_(this._g,255))+"%",b:D(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%)":"rgba("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+o(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},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 r(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(u,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:A(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:O(),g:O(),b:O()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=function(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(n)).level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,c=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=r(e[u]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var F=r.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"},R=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(F),N=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],547:[function(t,e,r){"use strict";function n(t){if(t instanceof Float32Array)return t;if("number"==typeof t)return new Float32Array([t])[0];var e=new Float32Array(t);return e.set(t),e}e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t){if("number"==typeof t)return n(t-n(t));for(var e=n(t),r=0,i=e.length;r1)n=function(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(o);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":!function(t){t.forEach(a)}(t.arcs)}}var s,l=[],c=[];return o(e),c.forEach(null==r?function(t){l.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var i,s,l=1,u=a(n[0]);lu&&(s=n[0],n[0]=n[l],n[l]=s,u=i);return n})}}var a=function(t){return t},o=function(t){if(null==(e=t.transform))return a;var e,r,n,i=e.scale[0],o=e.scale[1],s=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+s,t[1]=(n+=t[1])*o+l,t}},s=function(t){function e(t){l[0]=t[0],l[1]=t[1],s(l),l[0]f&&(f=l[0]),l[1]h&&(h=l[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,s=o(t),l=new Array(2),c=1/0,u=c,f=-c,h=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]h&&(h=l[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,f,h]}return n},l=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},c=function(t,e){function r(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}var n={},i={},a={},o=[],s=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++s],e[s]=r,e[n]=i)}),e.forEach(function(e){var r,n,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,n=i[l]){delete i[n.start];var c=n===r?r:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[r.start]=a[r.end]=r;else if(r=i[l])if(delete i[r.start],r.unshift(e),r.start=s,n=a[s]){delete a[n.end];var u=n===r?r:n.concat(r);i[u.start=n.start]=a[u.end=r.end]=u}else i[r.start]=a[r.end]=r;else i[(r=[e]).start=s]=a[r.end=l]=r}),r(a,i),r(i,a),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=s(t),o=a[0],l=(a[2]-o)/(e-1)||1,c=a[1],u=(a[3]-c)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,s=t.length,f=t[0],h=f[0]=Math.round((f[0]-o)/l),d=f[1]=Math.round((f[1]-c)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,l){this.center=s(r),this.up=s(n),this.right=s(i),this.radius=s([a]),this.angle=s([o,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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];u(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=h(r,p)/s,g=h(i,p)/s;c=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)};var s=t("filtered-vector"),l=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),u=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),h=t("gl-vec3/dot"),d=o.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,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];var s=Math.sqrt(i),l=0;for(o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;var c=Math.sqrt(l);for(o=0;o<3;++o)r[o]/=c;var h=this.computedToward;u(h,e,r),f(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,M=x,k=-g*x,A=-v*x,T=y,S=this.computedEye,E=this.computedMatrix;for(o=0;o<3;++o){var L=_*r[o]+w*h[o]+M*e[o];E[4*o+1]=k*r[o]+A*h[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],D=E[9],I=E[2],P=E[6],O=E[10],F=z*O-D*P,R=D*I-C*O,N=C*P-z*I,j=n(F,R,N);F/=j,R/=j,N/=j,E[0]=F,E[4]=R,E[8]=N;for(o=0;o<3;++o)S[o]=b[o]+E[2+4*o]*d;for(o=0;o<3;++o){l=0;for(var B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[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 a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,p);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d),m=(u/=p)*e+o*r,g=(f/=p)*e+s*r,v=(h/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),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,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var c=e[o],u=e[o+4],f=e[o+8];if(a){var h=Math.abs(c),d=Math.abs(u),p=Math.abs(f),m=Math.max(h,d,p);h===m?(c=c<0?-1:1,u=f=0):p===m?(f=f<0?-1:1,c=u=0):(u=u<0?-1:1,c=f=0)}else{var g=n(c,u,f);c/=g,u/=g,f/=g}var v=e[s],y=e[s+4],x=e[s+8],b=v*c+y*u+x*f,_=n(v-=c*b,y-=u*b,x-=f*b),w=u*(x/=_)-f*(y/=_),M=f*(v/=_)-c*x,k=c*y-u*v,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,c,u,f),this.right.jump(t,v,y,x);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*v+L*y+C*x,D=E*w+L*M+C*k;T=F<0?-Math.PI/2:Math.PI/2,S=Math.atan2(D,z)}else{var I=e[2],P=e[6],O=e[10],F=I*c+P*u+O*f,R=I*v+P*y+O*x,N=I*w+P*M+O*k;T=Math.asin(i(F)),S=Math.atan2(N,R)}this.angle.jump(t,S,T),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*W,G-B*W,Y-U*W)},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,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(u,f,h);if(!(d<1e-6)){u/=d,f/=d,h/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,x=n(m-=y*o,g-=y*s,v-=y*l);if(!(x<.01&&(m=s*h-l*f,g=l*u-o*h,v=o*f-s*u,(x=n(m,g,v))<1e-6))){m/=x,g/=x,v/=x,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var b=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(b,_,w),k=o*u+s*f+l*h,A=m*u+g*f+v*h,T=(b/=M)*u+(_/=M)*f+(w/=M)*h,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);D0?r.pop():new ArrayBuffer(t)}function o(t){return new Uint8Array(a(t),0,t)}function s(t){return new Uint16Array(a(2*t),0,t)}function l(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function u(t){return new Int16Array(a(2*t),0,t)}function f(t){return new Int32Array(a(4*t),0,t)}function h(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function p(t){return x?new Uint8ClampedArray(a(t),0,t):o(t)}function m(t){return new DataView(a(t),0,t)}function g(t){t=v.nextPow2(t);var e=v.log2(t),r=w[e];return r.length>0?r.pop():new n(t)}var v=t("bit-twiddle"),y=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var x="undefined"!=typeof Uint8ClampedArray,b=e.__TYPEDARRAY_POOL;b.UINT8C||(b.UINT8C=y([32,0])),b.BUFFER||(b.BUFFER=y([32,0]));var _=b.DATA,w=b.BUFFER;r.free=function(t){if(n.isBuffer(t))w[v.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|v.log2(e);_[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){i(t.buffer)},r.freeArrayBuffer=i,r.freeBuffer=function(t){w[v.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return o(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return c(t);case"int16":return u(t);case"int32":return f(t);case"float":case"float32":return h(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return g(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=o,r.mallocUint16=s,r.mallocUint32=l,r.mallocInt8=c,r.mallocInt16=u,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=h,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=p,r.mallocDataView=m,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)b.UINT8[t].length=0,b.UINT16[t].length=0,b.UINT32[t].length=0,b.INT8[t].length=0,b.INT16[t].length=0,b.INT32[t].length=0,b.FLOAT[t].length=0,b.DOUBLE[t].length=0,b.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":71,buffer:82,dup:134}],555:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],558:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),h=["%","/","?",";","#"].concat(f),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=t("querystring");n.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?I+="x":I+=D[P];if(!I.match(p)){var F=C.slice(0,A),R=C.slice(A+1),N=D.match(m);N&&(F.push(N[1]),R.unshift(N[2])),R.length&&(u="/"+R.join(".")+u),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=a.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[w])for(A=0,z=f.length;A0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=M.slice(-1)[0],T=(r.host||t.host||M.length>1)&&("."===A||".."===A)||""===A,S=0,E=M.length;E>=0;E--)"."===(A=M[E])?M.splice(E,1):".."===A?(M.splice(E,1),S++):S&&(M.splice(E,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),T&&"/"!==M.join("/").substr(-1)&&M.push("");var L=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=L?"":M.length?M.shift():"";var C;(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(_=_||r.host&&M.length)&&!L&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":560,punycode:489,querystring:493}],560:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],561:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],562:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],563:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&b(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return p(i)||(i=s(t,i,n)),i}var a=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),v=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),x(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(b(e)){var _=e.name?": "+e.name:"";return t.stylize("[Function"+_+"]","special")}if(g(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(y(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return l(e)}var w="",k=!1,A=["{","}"];if(u(e)&&(k=!0,A=["[","]"]),b(e)){w=" [Function"+(e.name?": "+e.name:"")+"]"}if(g(e)&&(w=" "+RegExp.prototype.toString.call(e)),y(e)&&(w=" "+Date.prototype.toUTCString.call(e)),x(e)&&(w=" "+l(e)),0===o.length&&(!k||0==e.length))return A[0]+w+A[1];if(n<0)return g(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var T;return T=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(T,w,A)}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),l||(t.seen.indexOf(c.value)<0?(l=h(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+l.split("\n").map(function(t){return" "+t}).join("\n")):l=t.stylize("[Circular]","special")),m(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+l}function u(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function h(t){return null===t}function d(t){return"number"==typeof t}function p(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return v(t)&&"[object RegExp]"===_(t)}function v(t){return"object"==typeof t&&null!==t}function y(t){return v(t)&&"[object Date]"===_(t)}function x(t){return v(t)&&("[object Error]"===_(t)||t instanceof Error)}function b(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!p(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":566}],568:[function(t,e,r){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":569}],569:[function(t,e,r){"use strict";function n(t,e,r,n){var i=function(t,e){var r=a(t,128);return e?s(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,n),o=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;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}var o=t("pbf"),s=t("./vector-tile-pb"),l=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new l(t[r].features),e[r].name=r;return n({layers:e})},e.exports.GeoJSONWrapper=l},{"./lib/geojson_wrapper":571,"./vector-tile-pb":572,pbf:470}],571:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e=0?e[o]:a})},has___:{value:i(function(e){var i=n(e);return i?r in i:t.indexOf(e)>=0})},set___:{value:i(function(i,a){var o,s=n(i);return s?s[r]=a:(o=t.indexOf(i))>=0?e[o]=a:(o=t.length,e[o]=a,t[o]=i),this})},delete___:{value:i(function(i){var a,o,s=n(i);return s?r in s&&delete s[r]:!((a=t.indexOf(i))<0||(o=t.length-1,t[a]=void 0,e[a]=e[o],t[a]=t[o],t.length=o,e.length=o,0))})}})};b.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 s?function(){function r(){this instanceof b||a();var e,r=new s,n=void 0,l=!1;return e=o?function(t,e){return r.set(t,e),r.has(t)||(n||(n=new b),n.set(t,e)),this}:function(t,e){if(l)try{r.set(t,e)}catch(r){n||(n=new b),n.set___(t,e)}else r.set(t,e);return this},Object.create(b.prototype,{get___:{value:i(function(t,e){return n?r.has(t)?r.get(t):n.get___(t,e):r.get(t,e)})},has___:{value:i(function(t){return r.has(t)||!!n&&n.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!r.delete(t);return n?n.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=b.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=b)}}()},{}],574:[function(t,e,r){var n=t("./hidden-store.js");e.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)}}},{"./hidden-store.js":575}],575:[function(t,e,r){e.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}},{}],576:[function(t,e,r){var n=t("./create-store.js");e.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}}}},{"./create-store.js":574}],577:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":156}],578:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,a=this._validateYear(t,i.local.invalidyear),s=h[a-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(n=o.newDate(l,c,u)).add(4-(n.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-n.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 i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,i.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var a=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{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");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var p=0;p>9&4095,v=m>>5&15,y=31&m,x=new Date(g,v-1,y+l);return a.year=x.getFullYear(),a.month=1+x.getMonth(),a.day=x.getDate(),a}(t,s,r,a);return o.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=o.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=n||{}}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;var l,c=(o=h[a.year-h[0]])>>9&4095,u=o>>5&15,d=31&o,p=new Date(c,u-1,d),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-p)/864e5);var g,v=f[a.year-f[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l>13;return!x||g=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:a[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var a={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":595,"object-assign":462}],584:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":595,"object-assign":462}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main");t("object-assign")(n.prototype=new a.baseCalendar,{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,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.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,a.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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+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)}}),a.calendars.hebrew=n},{"../main":595,"object-assign":462}],586:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":595,"object-assign":462}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),i.calendars.julian=n},{"../main":595,"object-assign":462}],588:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main");t("object-assign")(n.prototype=new o.baseCalendar,{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,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);t%=400,t+=t<0?400:0;return 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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":595,"object-assign":462}],589:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.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)}}),i.calendars.nanakshahi=n},{"../main":595,"object-assign":462}],590:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),r=e.year(),n=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;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,c)},_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,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/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=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":595,"object-assign":462}],592:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.taiwan=n},{"../main":595,"object-assign":462}],593:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.thai=n},{"../main":595,"object-assign":462}],594:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth).toJD()-24e5+.5,n=0,o=0;or)return a[n]-a[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),o=12*(n.year()-1)+n.month()-15292;return n.day()+a[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,o=Math.floor((i-1)/12),s=o+1,l=i-12*o,c=e-a[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var a=[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]},{"../main":595,"object-assign":462}],595:[function(t,e,r){function n(){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 i(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.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]}}}),l(i.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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,c.local.invalidDate||c.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),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":462}],596:[function(t,e,r){var n=t("object-assign"),i=t("./main");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=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n1}),u=function(t,e,r,n){var i=""+e;if(c(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=m;for(var E=this.daysInMonth(h,d);p>E;E=this.daysInMonth(h,d))d++,p-=E}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,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":595,"object-assign":462}],597:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":116}],598:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":597}],599:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;a(t,e,r,c);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},g=0;g<2;g++){var v=d[g],y=i.coerceRef(t,e,m,v,"","paper");if(i.coercePosition(e,m,c,y,v,.5),h){var x="a"+v,b=i.coerceRef(t,e,m,x,"pixel");"pixel"!==b&&b!==y&&(b=e[x]="pixel");var _="pixel"===b?p[g]:.4;i.coercePosition(e,m,c,b,x,_)}c(v+"anchor"),c(v+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":743,"../../plots/cartesian/axes":789,"./attributes":601,"./common_defaults":604}],600:[function(t,e,r){"use strict";e.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}]},{}],601:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},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:"calcIfAutorange"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":794,"../../plots/font_attributes":816,"./arrow_paths":600}],602:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,s=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=1,s[t.yref]=1});for(var l in s){var c=a.getFromId(t,l);if(c&&c.autorange)return i.syncOrAsync([o,n],t)}}}},{"../../lib":743,"../../plots/cartesian/axes":789,"./draw":607}],603:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,i=n(t,e),o=i.on,s=i.off.concat(i.explicitOff),l={};if(o.length||s.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var a=N.selectAll("a");if(1===a.size()&&a.text()===N.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(P.node())}var c=C.select(".annotation-text-math-group"),h=!c.empty(),v=f.bBox((h?c:N).node()),y=v.width,L=v.height,D=e.width||y,R=e.height||L,j=Math.round(D+2*I),B=Math.round(R+2*I);e._w=D,e._h=R;for(var U=!1,V=["x","y"],q=0;q1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;H=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],H=_.l+_.w*Y):(Y=1-e[Z],H=_.t+_.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=H;var st=e["a"+Z];X=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=H+st,G=X+st),at.text=at.tail+X;var lt=b["x"===Z?"width":"height"];if("paper"===J&&(at.head=l.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*r(W,nt),at.text=H+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)C.remove();else{var ft=0,ht=0;if("left"!==e.align&&(ft=(D-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(R-L)*("middle"===e.valign?.5:1)),h)c.select("svg").attr({x:I+ft-1,y:I+ht}).call(f.setClipUrl,O?M:null);else{var dt=I+ht-v.top,pt=I+ft-v.left;N.call(d.positionText,pt,dt).call(f.setClipUrl,O?M:null)}F.select("rect").call(f.setRect,I,I,D,R),P.call(f.setRect,z/2,z/2,j-z,B-z),C.call(f.setTranslate,Math.round(k.x.text-j/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+A+","+k.x.text+","+k.y.text+")"});var mt=function(r,a){T.selectAll(".annotation-arrow-g").remove();var c=k.x.head,h=k.y.head,d=k.x.tail+r,p=k.y.tail+a,v=k.x.text+r,y=k.y.text+a,b=l.rotationXYMatrix(A,v,y),M=l.apply2DTransform(b),E=l.apply2DTransform2(b),L=+P.attr("width"),z=+P.attr("height"),D=v-.5*L,I=D+L,O=y-.5*z,F=O+z,R=[[D,O,D,F],[D,F,I,F],[I,F,I,O],[I,O,D,O]].map(E);if(!R.reduce(function(t,e){return t^!!l.segmentsIntersect(c,h,c+1e6,h+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=l.segmentsIntersect(d,p,c,h,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var N=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,U=T.append("g").style({opacity:u.opacity(j)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+h).style("stroke-width",N+"px").call(u.stroke,u.rgb(j));if(g(V,B,e),w.annotationPosition&&V.node().parentNode&&!n){var q=c,H=h;if(e.standoff){var G=Math.sqrt(Math.pow(c-d,2)+Math.pow(h-p,2));q+=e.standoff*(d-c)/G,H+=e.standoff*(p-h)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-q)+","+(p-H),transform:"translate("+q+","+H+")"}).style("stroke-width",N+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),gd:t,prepFn:function(){var t=f.getTranslate(C);W=t.x,X=t.y,Y={},i&&i.autorange&&(Y[i._name+".autorange"]=!0),s&&s.autorange&&(Y[s._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(W,X),a=n[0]+t,o=n[1]+r;C.call(f.setTranslate,a,o),Y[x+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,Y[x+".y"]=s?s.p2r(s.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(Y[x+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[x+".ay"]=s.p2r(s.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+A+","+a+","+o+")"})},doneFn:function(){o.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),E){var gt,vt;m.init({element:C.node(),gd:t,prepFn:function(){vt=S.attr("transform"),gt={}},moveFn:function(t,r){var a="pointer";if(e.showarrow)e.axref===e.xref?gt[x+".ax"]=i.p2r(i.r2p(e.ax)+t):gt[x+".ax"]=e.ax+t,e.ayref===e.yref?gt[x+".ay"]=s.p2r(s.r2p(e.ay)+r):gt[x+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)gt[x+".x"]=e.x+t/i._m;else{var o=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-o/2;gt[x+".x"]=m.align(l+t/_.w,o,0,1,e.xanchor)}if(s)gt[x+".y"]=e.y+r/s._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;gt[x+".y"]=m.align(u-r/_.h,c,0,1,e.yanchor)}i&&s||(a=m.getCursor(i?.5:gt[x+".x"],s?.5:gt[x+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+vt}),p(C,a)},doneFn:function(){p(C),o.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}var y,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,x=n+".annotations["+r+"]"):(y="annotation",x="annotations["+r+"]"),b._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+b._uid+"_ann"+r;if(e._input&&!1!==e.visible){var k={x:{},y:{}},A=+e.textangle||0,T=b._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=T.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:a.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){h.loneUnhover(b._hoverlayer.node())});var z=e.borderwidth,D=e.borderpad,I=z+D,P=C.append("rect").attr("class","bg").style("stroke-width",z+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),O=e.width||e.height,F=b._topclips.selectAll("#"+M).data(O?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),F.exit().remove();var R=e.font,N=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?N.call(d.makeEditable,{delegate:C,gd:t}).call(c).on("edit",function(r){e.text=r,this.call(c);var n={};n[x+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),s&&s.autorange&&(n[s._name+".autorange"]=!0),o.relayout(t,n)}):N.call(c)}else a.selectAll("#"+M).remove()}var a=t("d3"),o=t("../../plotly"),s=t("../../plots/plots"),l=t("../../lib"),c=t("../../plots/cartesian/axes"),u=t("../color"),f=t("../drawing"),h=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,x=d.backoff*m+r.standoff,b=p.backoff*g+r.startstandoff;if("line"===h.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var _=l.x-c.x,w=l.y-c.y;if(u=Math.atan2(w,_),f=u+Math.PI,x&&b&&x+b>Math.sqrt(_*_+w*w))return void o();if(x){if(x*x>_*_+w*w)return void o();var M=x*Math.cos(u),k=x*Math.sin(u);c.x+=M,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>_*_+w*w)return void o();var A=b*Math.cos(u),T=b*Math.sin(u);l.x-=A,l.y-=T,t.attr({x1:l.x,y1:l.y})}}else if("path"===h.nodeName){var S=h.getTotalLength(),E="";if(S1){c=!0;break}}c?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))}}},{"../../plots/gl3d/project":841,"../annotations/draw":607}],614:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);1!==n.getAlpha()&&(n=i(o.combine(t,c)));return(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e0?E>=O:E<=O));L++)E>R&&E0?E>=O:E<=O));L++)E>C[0]&&E1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[K+X,K+G-X],et.setScale();var st=T._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");et._axislayer=st.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ut,ft=S.l+(k.x+Y)*S.w,ht=et.titlefont.size;ut="top"===k.titleside?(1-(K+G-X))*S.h+S.t+3+.75*ht:(1-(K+X))*S.h+S.t-3-.25*ht,A(et._id+"title",{attributes:{x:ft,y:ut,"text-anchor":"start"}})}var dt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),a=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+et._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=parseInt(r.node().style.fontSize,10)*v),o?(ct=d.bBox(o).height)>s&&(a[1]-=(ct-s)/2):r.node()&&!r.classed(w.jsPlaceholder)&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===k.titleside)et.domain[1]-=ct/S.h,a[1]*=-1;else{et.domain[0]+=ct/S.h;var c=g.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(S.h*(1-et.domain[1]))+")"),et._axislayer.attr("transform","translate(0,"+Math.round(-S.t)+")");var f=st.select(".cbfills").selectAll("rect.cbfill").data(D);f.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(D[e]+D[e-1])/2,e===D.length-1?C[1]:(D[e]+D[e+1])/2].map(et.c2p).map(Math.round);e!==D.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=P(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var h=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?z:[]);return h.enter().append("path").classed(w.cbline,!0),h.exit().remove(),h.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+k.line.width/2%1)+"h"+V).call(d.lineGroupStyle,k.line.width,I(t),k.line.dash)}),et._axislayer.selectAll("g."+et._id+"tick,path").remove(),et._pos=Z+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),et.side="right",u.syncOrAsync([function(){return l.doTicks(t,et,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=et.titlefont.size,r=et._offset+et._length/2,i=S.l+(et.position||0)*S.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));A("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:k.titleside,offsetLeft:S.l,offsetTop:0,maxShift:T.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var r=V+k.outlinewidth/2+d.bBox(et._axislayer.node()).width;if((j=lt.select("text")).node()&&!j.classed(w.jsPlaceholder)){var n,i=lt.select(".h"+et._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(k.titleside)?d.bBox(i).width:d.bBox(lt.node()).right-Z-S.l,r=Math.max(r,n)}var a=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,s=Q-$;st.select(".cbbg").attr({x:Z-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:$-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:$+k.ypad+("top"===k.titleside?ct:0),width:Math.max(V,2),height:Math.max(s-2*k.ypad-ct,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var l=({center:.5,right:1}[k.xanchor]||0)*a;st.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:a*({right:1,center:.5}[k.xanchor]||0),r:a*({left:1,center:.5}[k.xanchor]||0),t:s*({bottom:1,middle:.5}[k.yanchor]||0),b:s*({top:1,middle:.5}[k.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition){var pt,mt,gt;c.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),h(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),mt=c.align(J+t/S.w,q,0,1,k.xanchor),gt=c.align(K-e/S.h,G,0,1,k.yanchor);var r=c.getCursor(mt,gt,k.xanchor,k.yanchor);h(st,r)},doneFn:function(){h(st),void 0!==mt&&void 0!==gt&&a.restyle(t,{"colorbar.x":mt,"colorbar.y":gt},M().index)}})}return dt}T._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":743,"./flip_scale":630,"./scales":637}],626:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":732,"./attributes":624,"./scales.js":637}],627:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":637}],628:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,g=p[h+"min"],v=p[h+"max"],y=p.colorscale;c(f+h+"auto",!(n(g)&&n(v)&&g=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],631:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":627,"./is_valid_scale_array":635,"./scales":637}],632:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],639:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.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]}},{"../../lib":743}],640:[function(t,e,r){"use strict";function n(){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 i(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t("mouse-event-offset"),o=t("has-hover"),s=t("../../plotly"),l=t("../../lib"),c=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),f=e.exports={};f.align=t("./align"),f.getCursor=t("./cursor");var h=t("./unhover");f.unhover=h.wrapped,f.unhoverRaw=h.raw;var d=l.eventListenerOptionsSupported();f.init=function(t){function e(e){_._dragged=!1,_._dragging=!0;var s=i(e);return h=s[0],p=s[1],x=e.target,y=e,b=e.buttons&&2===e.buttons||e.ctrlKey,(m=(new Date).getTime())-_._mouseDownTimeM&&(w=Math.max(w-1,1)),_._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(w,y),!b){var n;try{n=new MouseEvent("click",e)}catch(t){var c=i(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,c[0],c[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}x.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&s.plot(t)}(_),_._dragged=!1,l.pauseEvent(e)}_._dragged=!1}var h,p,m,g,v,y,x,b,_=t.gd,w=1,M=u.DBLCLICKDELAY,k=t.element;_._mouseDownTime||(_._mouseDownTime=0),k.style.pointerEvents="all",k.onmousedown=e,d?(k._ontouchstart&&k.removeEventListener("touchstart",k._ontouchstart),k._ontouchstart=e,k.addEventListener("touchstart",e,{passive:!1})):k.ontouchstart=e;var A=t.clampFn||function(t,e,r){return Math.abs(t)=200?k:"")}function i(t,e,r,n){var i=l.select(t.node().parentNode),a=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",o=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=n?n/.8+1:0,c=(m.lineCount(t)-1)*v+1,u=S[o]*s,f=.75*r+S[a]*s+(S[a]-1)*c*r/2;t.attr("text-anchor",o),i.attr("transform","translate("+u+","+f+")")}function a(t,e){var r=t.ts||e.textfont.size;return c(r)&&r>0?r:0}function o(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],c=Math.pow(i*i+a*a,E/2),u=Math.pow(o*o+s*s,E/2),f=(u*u*i-c*c*o)*n,h=(u*u*a-c*c*s)*n,d=3*u*(c+u),p=3*c*(c+u);return[[l.round(e[0]+(d&&f/d),2),l.round(e[1]+(d&&h/d),2)],[l.round(e[0]-(p&&f/p),2),l.round(e[1]-(p&&h/p),2)]]}function s(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var l=t("d3"),c=t("fast-isnumeric"),u=t("tinycolor2"),f=t("../../registry"),h=t("../color"),d=t("../colorscale"),p=t("../../lib"),m=t("../../lib/svg_text_utils"),g=t("../../constants/xmlns_namespaces"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../constants/interactions").DESELECTDIM,x=t("../../traces/scatter/subtypes"),b=t("../../traces/scatter/make_bubble_size_func"),_=e.exports={};_.font=function(t,e,r,n){p.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(h.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,i){t.call(_.setPosition,e,r).call(_.setSize,n,i)},_.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(c(i)&&c(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},_.translatePoints=function(t,e,r){t.each(function(t){var n=l.select(this);_.translatePoint(t,n,e,r)})},_.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(e){var i=e[0].trace,a=i.xcalendar,o=i.ycalendar;t.selectAll(".point,.textpoint").each(function(t){_.hideOutsideRangePoint(t,l.select(this),r,n,a,o)})})}},_.crispRound=function(t,e,r){return e&&c(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";h.stroke(e,n||a.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,o=n||i.dash||"";l.select(this).call(h.stroke,r||i.color).call(_.dashLine,o,a)})},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.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},_.singleFillStyle=function(t){var e=(((l.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(h.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=l.select(this);try{r.call(h.fill,e[0].trace.fillcolor)}catch(e){p.error(e,t),r.remove()}})};var w=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(w).forEach(function(t){var e=w[t];_.symbolList=_.symbolList.concat([e.n,t,e.n+100,t+"-open"]),_.symbolNames[e.n]=t,_.symbolFuncs[e.n]=e.f,e.needLine&&(_.symbolNeedLines[e.n]=!0),e.noDot?_.symbolNoDot[e.n]=!0:_.symbolList=_.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(_.symbolNoFill[e.n]=!0)});var M=_.symbolNames.length,k="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";_.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=M||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0};_.gradient=function(t,e,r,n,i,a){var o=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],p.identity);o.exit().remove(),o.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=l.select(this);"horizontal"===n?t.attr(A):"vertical"===n&&t.attr(T),t.attr("id",r);var e=u(i),o=u(a);t.append("stop").attr({offset:"0%","stop-color":h.tinyRGB(o),"stop-opacity":o.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":h.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},_.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},_.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;!function(t,e,r,i,a,o,s,l){if(f.traceIs(r,"symbols")){var c=b(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:x.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var i=_.symbolNumber(t.mx||o.symbol)||0;return t.om=i%200>=100,n(i,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var u,d,p,m=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,u=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?h.defaultLine:s.color,Array.isArray(o.color)&&(u=h.defaultLine,m=!0),u="mc"in t?t.mcc=i(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(h.stroke,u).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=o.gradient,v=t.mgt;if(v?m=!0:v=g&&g.type,v&&"none"!==v){var y=t.mgc;y?m=!0:y=g.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(_.gradient,l,w,v,u,y)}else e.call(h.fill,u);p&&e.call(h.stroke,d)}}(t,e,r,i,a,s,s.line,o)},_.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=_.tryColorscale(n,""),a=_.tryColorscale(n,"line");t.each(function(t){_.singlePointStyle(t,l.select(this),e,i,a,r)})}},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},s=i.marker||{},c=a.opacity,u=o.opacity,d=s.opacity,p=void 0!==u,m=void 0!==d;t.each(function(t){var e,r=l.select(this),n=t.mo,i=void 0!==n;(i||p||m)&&(t.selected?p&&(e=u):e=m?d:y*(i?n:c)),void 0!==e&&r.style("opacity",e)});var g=o.color,v=s.color;(g||v)&&t.each(function(t){var e,r=l.select(this);t.selected?g&&(e=g):v&&(e=v),e&&h.fill(r,e)});var x=o.size,b=s.size,w=void 0!==x,M=void 0!==b;f.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=l.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?x/2:i:M?b/2:i,r.attr("d",n(_.symbolNumber(o),e)),t.mrc2=e})}},_.tryColorscale=function(t,e){var r=e?p.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?d.makeColorScaleFunc(d.extractScale(n,r.cmin,r.cmax)):p.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};_.textPointStyle=function(t,e,r){t.each(function(t){var n=l.select(this),o=p.extractOption(t,e,"tx","text");if(o){var s=t.tp||e.textposition,c=a(t,e);n.call(_.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).text(o).call(m.convertToTspans,r).call(i,s,c,t.mrc)}else n.remove()})},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},n=e.unselected||{};t.each(function(t){var o,s=l.select(this),c=t.tc||e.textfont.color,u=t.tp||e.textposition,f=a(t,e),d=(r.textfont||{}).color,p=(n.textfont||{}).color;t.selected?d&&(o=d):p?o=p:d||(o=h.addOpacity(c,y)),o&&h.fill(s,o),i(s,u,f,t.mrc2||t.mrc)})}};var E=.5;_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(_.savedBBoxes={},C=0),r&&(_.savedBBoxes[r]=v),C++,p.extendFlat({},v)},_.setClipUrl=function(t,e){if(e){var r="#"+e,n=l.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},_.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}},_.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+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.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}},_.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+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var z=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=l.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),o=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(z);t=1===e&&1===r?[]:["translate("+a+","+o+")","scale("+e+","+r+")","translate("+-a+","+-o+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../constants/xmlns_namespaces":723,"../../lib":743,"../../lib/svg_text_utils":766,"../../registry":873,"../../traces/scatter/make_bubble_size_func":1083,"../../traces/scatter/subtypes":1088,"../color":618,"../colorscale":633,"./symbol_defs":644,d3:128,"fast-isnumeric":140,tinycolor2:546}],644:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:128}],645:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],646:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=[];if(a.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(a),u=0;u0;t.each(function(t){var u,f=t[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(u=function(t){return t.id});var p=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||h.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,u);if(m.exit().remove(),t.length){h.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(m,e.layerClipId),m.each(function(t){var e=n.select(this),a=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,s,l);if(!p||t.vis){var o;if(d.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var u=d.width;o="M"+(a.x-u)+","+a.yh+"h"+2*u+"m-"+u+",0V"+a.ys,a.noYS||(o+="m-"+u+",0h"+2*u);var f=e.select("path.yerror");!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(f=f.transition().duration(r.duration).ease(r.easing)),f.attr("d",o)}if(h.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var m=(h.copy_ystyle?d:h).width;o="M"+a.xh+","+(a.y-m)+"v"+2*m+"m0,-"+m+"H"+a.xs,a.noXS||(o+="m0,-"+m+"v"+2*m);var g=e.select("path.xerror");!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1088,"../drawing":643,d3:128,"fast-isnumeric":140}],651:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.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)})}},{"../color":618,d3:128}],652:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":816}],653:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||i.identity,Array.isArray(t)&&(e[0][r]=n(t))}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){function e(t){return function(e){return i.coerceHoverinfo({hoverinfo:e},{_module:t._module},o)}}for(var r=t.calcdata,o=t._fullLayout,s=0;s=0&&r.indextt.width||$<0||$>tt.height)return v.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(P="xval"in e?b.flat(m,e.xval):b.p2c(S,Q),O="yval"in e?b.flat(m,e.yval):b.p2c(E,$),!c(P[0])||!c(O[0]))return f.warn("Fx.hover failed",e,t),v.unhoverRaw(t,e)}var et=1/0;for(R=0;RY&&(Z.splice(0,Y),et=Z[0].distance),_._has("cartesian")&&0!==X&&0===Z.length){G.distance=X,G.index=!1;var ot=j._module.hoverPoints(G,q,H,"closest",_._hoverlayer);if(ot){var st,lt=ot.filter(function(t){return t.xa.showspikes});if(lt.length){var ct=lt[0];c(ct.x0)&&c(ct.y0)&&(st=d(ct),(!K.vLinePoint||K.vLinePoint.distance>st.distance)&&(K.vLinePoint=st))}var ut=ot.filter(function(t){return t.ya.showspikes});if(ut.length){var ft=ut[0];c(ft.x0)&&c(ft.y0)&&(st=d(ft),(!K.hLinePoint||K.hLinePoint.distance>st.distance)&&(K.hLinePoint=st))}}}}var ht={fullLayout:_,container:_._hoverlayer,outerContainer:_._paperdiv,event:e},dt=t._spikepoints,pt={vLinePoint:K.vLinePoint,hLinePoint:K.hLinePoint};if(t._spikepoints=pt,_._has("cartesian")&&0!==X&&0!==Z.length){var mt=u(Z.filter(function(t){return t.ya.showspikes}),X);K.hLinePoint=d(mt);var gt=u(Z.filter(function(t){return t.xa.showspikes}),X);K.vLinePoint=d(gt)}if(0===Z.length){var vt=v.unhoverRaw(t,e);return!_._has("cartesian")||null===K.hLinePoint&&null===K.vLinePoint||s(dt)&&o(K,ht),vt}_._has("cartesian")&&s(dt)&&o(K,ht),Z.sort(function(t,e){return t.distance-e.distance});var yt=t._hoverdata,xt=[];for(F=0;F1,wt=i(Z,{hovermode:I,rotateLabels:_t,bgColor:g.combine(_.plot_bgcolor||g.background,_.paper_bgcolor),container:_._hoverlayer,outerContainer:_._paperdiv,commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance},t);if(function(t,e,r){function n(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--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}var i,a,o,s,l,c,u,f=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?k:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});for(;!i&&f<=t.length;){for(f++,i=!0,s=0;s.01&&m.pmin===g.pmin&&m.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),h.splice(s+1,1),u=0,l=d.length-1;l>=0;l--)u+=d[l].dp;for(o=u/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;i=!1}else s++}h.forEach(n)}for(s=h.length-1;s>=0;s--){var v=h[s];for(l=v.length-1;l>=0;l--){var y=v[l],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(Z,_t?"xa":"ya",_),a(wt,_t),e.target&&e.target.tagName){var Mt=x.getComponentMethod("annotations","hasClickToShow")(t,xt);p(l.select(e.target),Mt?"pointer":"")}e.target&&!n&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,yt)&&(yt&&t.emit("plotly_unhover",{event:e,points:yt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,c=e.container,u=e.outerContainer,f=e.commonLabelOpts||{},h=e.fontFamily||_.HOVERFONT,p=e.fontSize||_.HOVERFONTSIZE,v=t[0],y=v.xa,x=v.ya,b="y"===a?"yLabel":"xLabel",M=v[b],k=(String(M)||"").split(" ")[0],A=u.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,z=v.distance<=e.hoverdistance&&("x"===a||"y"===a);for(n=0;n-1&&n.length>v&&(n=v>3?n.substr(0,v-3)+"...":n.substr(0,v))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):z&&t[a+"Label"]===M?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var y=e.select("text.nums").call(m.font,t.fontFamily||h,t.fontSize||p,t.fontColor||f).text(i).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==i?(x.call(m.font,t.fontFamily||h,t.fontSize||p,u).text(n).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*E):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:f});var _,k,A=y.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,I=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),F=A.width+S+E+b;t.ty0=T-A.top,t.bx=A.width+2*E,t.by=A.height+2*E,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,_=I+O/2+F<=C,k=I-O/2-F>=0,"top"!==t.idealAlign&&_||!k?_?(I+=O/2,t.anchor="start"):t.anchor="middle":(I-=O/2,t.anchor="end")):(t.pos=I,_=D+P/2+F<=L,k=D-P/2-F>=0,"left"!==t.idealAlign&&_||!k?_?(D+=P/2,t.anchor="start"):t.anchor="middle":(D-=P/2,t.anchor="end")),y.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+I+")"+(o?"rotate("+w+")":""))}),P}function a(t,e){t.each(function(t){var r=l.select(this);if(t.del)r.remove();else{var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(S+E),s=o+a*(t.txwidth+E),c=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-T,c=t.offset*A),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+c)+","+(S+u)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+c)+"V"+(u-S)+"Z"),i.call(d.positionText,o+c,u+t.ty0-t.by/2+E),t.tx2width&&(r.select("text.name").call(d.positionText,s+a*E+c,u+t.ty0-t.by/2+E),r.select("rect").call(m.setRect,s+(a-1)*t.tx2width/2+c,u-t.by/2-1,t.tx2width,t.by+2))}})}function o(t,e){var r,n,i=e.container,a=e.fullLayout,o=e.event,s=!!t.hLinePoint,l=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),l||s){var c=g.combine(a.plot_bgcolor,a.paper_bgcolor);if(s){var f,h,d=t.hLinePoint;r=d&&d.xa;"cursor"===(n=d&&d.ya).spikesnap?(f=o.pointerX,h=o.pointerY):(f=r._offset+(d.x0+d.x1)/2,h=n._offset+(d.y0+d.y1)/2);var p,v,y=u.readability(d.color,c)<1.5?g.contrast(c):d.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,M=(w.left+w.right)/2=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],670:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":816,"../color/attributes":617}],671:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],672:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,f,h,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,h="bottom"):(c=0,f="left",u=-.1,h="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",f),l("y",u),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":743,"../../plots/layout_attributes":843,"../../registry":873,"./attributes":670,"./helpers":676}],673:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*x;if(o){var l=d.bBox(o);n=l.height,i=l.width,d.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),u=m.lineCount(c),f=c.node();n=s*u,i=f?d.bBox(f).width:0;var h=s*(.3+(1-u)/2);m.positionText(c,40,h)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,o=f.traceIs(a,"pie"),s=a.index,u=o?n.label:a.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.edits.legendText&&!o?h.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(o.type))u[(a=n.trace.transforms)[a.length-1].direction+".name"]=t;else if(f.hasTransform(o,"groupby")){var h=f.getTransformIndices(o,"groupby"),d=h[h.length-1],p=c.keyedContainer(o,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),u=p.constructUpdate()}else u.name=t;return l.restyle(e,u,s)}):h.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(p.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){g(t,e,n)},k):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,g(t,e,n))}})}function a(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=w.isGrouped(i),l=0;if(i.width=0,i.height=0,w.isVertical(i))o&&e.each(function(t,e){d.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;d.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),l=40;else if(o){for(var c=[i.width],u=e.data(),f=0,h=u.length;fa+_-M,r.each(function(t){var e=t[0],r=g?40+t[0].width:x;a+b+M+r>n.width-(n.margin.r+n.margin.l)&&(b=0,v+=y,i.height=i.height+y,y=0),d.setTranslate(this,a+b,5+a+e.height/2+v),i.width+=M+r,i.height=Math.max(i.height,e.height),b+=M+r,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];s.select(this).select(".legendtoggle").call(d.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+l,r.height)})}function o(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center");var n="top";M.isBottomAnchor(e)?n="bottom":M.isMiddleAnchor(e)&&(n="middle"),u.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../../registry"),h=t("../dragelement"),d=t("../drawing"),p=t("../color"),m=t("../../lib/svg_text_utils"),g=t("./handle_click"),v=t("./constants"),y=t("../../constants/interactions"),x=t("../../constants/alignment").LINE_SPACING,b=t("./get_legend_data"),_=t("./style"),w=t("./helpers"),M=t("./anchor_utils"),k=y.DBLCLICKDELAY;e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(d.setTranslate,0,e),L.call(d.setRect,N,t,v.scrollBarWidth,v.scrollBarHeight),T.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,m="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&b(t.calcdata,y),w=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+m).remove(),void u.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=r._topdefs.selectAll("#"+m).data([0]);T.enter().append("clipPath").attr("id",m).append("rect");var S=A.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(p.stroke,y.bordercolor),S.call(p.fill,y.bgcolor),S.style("stroke-width",y.borderwidth+"px");var E=A.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var L=A.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(p.fill,"#808BA4");var C=E.selectAll("g.groups").data(x);C.enter().append("g").attr("class","groups"),C.exit().remove();var z=C.selectAll("g.traces").data(c.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(_,t).style("opacity",function(t){var e=t[0].trace;return f.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){s.select(this).call(n,t).call(i,t)});var D=0!==A.enter().size();D&&(a(t,C,z),o(t));var I=r.width,P=r.height;a(t,C,z),y.height>P?function(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center"),u.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}(t):o(t);var O=r._size,F=O.l+O.w*y.x,R=O.t+O.h*(1-y.y);M.isRightAnchor(y)?F-=y.width:M.isCenterAnchor(y)&&(F-=y.width/2),M.isBottomAnchor(y)?R-=y.height:M.isMiddleAnchor(y)&&(R-=y.height/2);var N=y.width,j=O.w;N>j?(F=O.l,N=j):(F+N>I&&(F=I-N),F<0&&(F=0),N=Math.min(I-F,y.width));var B=y.height,U=O.h;B>U?(R=O.t,B=U):(R+B>P&&(R=P-B),R<0&&(R=0),B=Math.min(P-R,y.height)),d.setTranslate(A,F,R);var V,q,H=B-v.scrollBarHeight-2*v.scrollBarMargin,G=y.height-B;if(y.height<=B||t._context.staticPlot)S.attr({width:N-y.borderwidth,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),d.setTranslate(E,0,0),T.select("rect").attr({width:N-2*y.borderwidth,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),E.call(d.setClipUrl,m);else{V=v.scrollBarMargin,q=E.attr("data-scroll")||0,S.attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),T.select("rect").attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-q}),E.call(d.setClipUrl,m),D&&e(V,q),A.on("wheel",null),A.on("wheel",function(){q=c.constrain(E.attr("data-scroll")-s.event.deltaY/H*G,-G,0),e(V=v.scrollBarMargin-q/G*H,q),0!==q&&q!==-G&&s.event.preventDefault()}),L.on(".drag",null),E.on(".drag",null);var Y=s.behavior.drag().on("drag",function(){V=c.constrain(s.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+H),q=-(V-v.scrollBarMargin)/H*G,e(V,q)});L.call(Y),E.call(Y)}if(t._context.edits.legendPosition){var W,X,Z,J;A.classed("cursor-move",!0),h.init({element:A.node(),gd:t,prepFn:function(){var t=d.getTranslate(A);Z=t.x,J=t.y},moveFn:function(t,e){var r=Z+t,n=J+e;d.setTranslate(A,r,n),W=h.align(r,0,O.l,O.l+O.w,y.xanchor),X=h.align(n,0,O.t+O.h,O.t,y.yanchor)},doneFn:function(){void 0!==W&&void 0!==X&&l.relayout(t,{"legend.x":W,"legend.y":X})},clickFn:function(e,n){var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===e?A._clickTimeout=setTimeout(function(){g(i,t,e)},k):2===e&&(A._clickTimeout&&clearTimeout(A._clickTimeout),g(i,t,e)))}})}}}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../../registry":873,"../color":618,"../dragelement":640,"../drawing":643,"./anchor_utils":669,"./constants":671,"./get_legend_data":674,"./handle_click":675,"./helpers":676,"./style":678,d3:128}],674:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var a,o,s={},l=[],c=!1,u={},f=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],f=u.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var m={},g={};h&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(f,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),h&&(s[0].mrc=3);var x=v.selectAll("g.pointtext").data(d?s:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)})}},{"../../lib":743,"../../registry":873,"../../traces/pie/style_one":1052,"../../traces/scatter/subtypes":1088,"../color":618,"../drawing":643,d3:128}],679:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=h.list(t,null,!0),f="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),i(x,r);h&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var b=function(t){for(var e=a.list({_fullLayout:t},null,!0),r=0;r0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;ad&&(d=f)));return d>=h?[h,d]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sH&&n>G&&!t.shiftKey?f.getCursor(i/r,1-a/n):"move";h(e,o),q=o.split("-")[0]}function c(n,o){if("path"===r.type){var s=function(t){return U(j(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};N&&"date"===N.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else d[x]=r.x0=U(m+n),d[b]=r.y0=V(g+o),d[_]=r.x1=U(v+n),d[w]=r.y1=V(y+o);e.attr("d",i(t,r))}function u(n,o){if("path"===r.type){var s=function(t){return U(j(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};N&&"date"===N.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else{var c=~q.indexOf("n")?M+o:M,u=~q.indexOf("s")?k+o:k,f=~q.indexOf("w")?A+n:A,h=~q.indexOf("e")?T+n:T;u-c>G&&(d[S]=r[z]=V(c),d[E]=r[D]=V(u)),h-f>H&&(d[L]=r[I]=U(f),d[C]=r[P]=U(h))}e.attr("d",i(t,r))}var d,m,g,v,y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P,O,F,R,N,j,B,U,V,q,H=10,G=10,Y={element:e.node(),gd:t,prepFn:function(e){R=l.getFromId(t,r.xref),N=l.getFromId(t,r.yref),j=p.getDataToPixel(t,R),B=p.getDataToPixel(t,N,!0),U=p.getPixelToData(t,R),V=p.getPixelToData(t,N,!0);var i="shapes["+n+"]";"path"===r.type?(O=r.path,F=i+".path"):(m=j(r.x0),g=B(r.y0),v=j(r.x1),y=B(r.y1),x=i+".x0",b=i+".y0",_=i+".x1",w=i+".y1");ml&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),s.log("Ignoring extra params in segment "+t)),i+c})}(e.path,n,a);var h=n(e.x0),m=n(e.x1),g=a(e.y0),v=a(e.y1);if("line"===o)return"M"+h+","+g+"L"+m+","+v;if("rect"===o)return"M"+h+","+g+"H"+m+"V"+v+"H"+h+"Z";var y=(h+m)/2,x=(g+v)/2,b=Math.abs(y-h),_=Math.abs(x-g),w="A"+b+","+_,M=y+b+","+x;return"M"+M+w+" 0 1,1 "+(y+","+(x-_))+w+" 0 0,1 "+M+"Z"}function a(t,e,r){return t.replace(d.segmentRE,function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),f=t("../dragelement"),h=t("../../lib/setcursor"),d=t("./constants"),p=t("./helpers");e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r0)){n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font);n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.steps;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":704,"./constants":705}],707:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-M.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=M.currentValueInset,i="left"}a.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(b.font,e.currentvalue.font).text(o).call(_.convertToTspans,e.gd);var s=_.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*k;return _.positionText(a,n,l),a}}function a(t,e,r){var n=t.selectAll("rect."+M.gripRectClass).data([0]);n.enter().append("rect").classed(M.gripRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:M.gripWidth,height:M.gripHeight,rx:M.gripRadius,ry:M.gripRadius}).call(x.stroke,r.bordercolor).call(x.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function o(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(b.font,r.font).text(e.step.label).call(_.convertToTspans,r.gd),n}function s(t,e){var r=t.selectAll("g."+M.labelsClass).data([0]);r.enter().append("g").classed(M.labelsClass,!0);var n=r.selectAll("g."+M.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(M.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=v.select(this);r.call(o,t,e),b.setTranslate(r,d(e,t.fraction),M.tickOffset+e.ticklen+e.font.size*k+M.labelOffset+e.currentValueTotalHeight)})}function l(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&c(t,e,r,a,!0,i)}function c(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(h,r,r.active/(r.steps.length-1),o),e.call(i,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&y.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function u(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=v.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+M.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),o.call(x.fill,t.activebgcolor);var s=p(t,v.mouse(i)[0]);l(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=p(t,v.mouse(i)[0]);l(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(x.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function f(t,e){var r=t.selectAll("rect."+M.tickRectClass).data(e.steps);r.enter().append("rect").classed(M.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=v.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(x.fill,e.tickcolor),b.setTranslate(i,d(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?M.tickOffset:M.minorTickOffset)+e.currentValueTotalHeight)})}function h(t,e,r,n){var i=t.select("rect."+M.gripRectClass),a=d(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*M.gripWidth)+","+e.currentValueTotalHeight+")")}}function d(t,e){return t.inputAreaStart+M.stepInset+(t.inputAreaLength-2*M.stepInset)*Math.min(1,Math.max(0,e))}function p(t,e){return Math.min(1,Math.max(0,(e-M.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*M.stepInset-2*t.inputAreaStart)))}function m(t,e,r){var n=t.selectAll("rect."+M.railTouchRectClass).data([0]);n.enter().append("rect").classed(M.railTouchRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,M.tickOffset+r.ticklen+r.labelHeight)}).call(x.fill,r.bgcolor).attr("opacity",0),b.setTranslate(n,0,r.currentValueTotalHeight)}function g(t,e){var r=t.selectAll("rect."+M.railRectClass).data([0]);r.enter().append("rect").classed(M.railRectClass,!0);var n=e.inputAreaLength-2*M.railInset;r.attr({width:n,height:M.railWidth,rx:M.railRadius,ry:M.railRadius,"shape-rendering":"crispEdges"}).call(x.stroke,e.bordercolor).call(x.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),b.setTranslate(r,M.railInset,.5*(e.inputAreaWidth-M.railWidth)+e.currentValueTotalHeight)}var v=t("d3"),y=t("../../plots/plots"),x=t("../color"),b=t("../drawing"),_=t("../../lib/svg_text_utils"),w=t("../legend/anchor_utils"),M=t("./constants"),k=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[M.name],n=[],i=0;i0?[0]:[]);if(l.enter().append("g").classed(M.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0),e.call(i,r).call(g,r).call(s,r).call(f,r).call(m,t,r).call(a,t,r),b.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(h,r,r.active/(r.steps.length-1),!1),e.call(i,r)}(t,v.select(this),e)}})}}},{"../../constants/alignment":716,"../../lib/svg_text_utils":766,"../../plots/plots":852,"../color":618,"../drawing":643,"../legend/anchor_utils":669,"./constants":705,d3:128}],708:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":704,"./constants":705,"./defaults":706,"./draw":707}],709:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),h=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){function d(t){s.syncOrAsync([p,m],t)}function p(e){var r;return M?(r="",M.rotate&&(r+="rotate("+[M.rotate,w.x,w.y]+")"),M.offset&&(r+="translate(0, "+M.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":S,"font-size":n.round(E,2)+"px",fill:c.rgb(L),opacity:C*c.opacity(L),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&D){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=i(_.pad)?_.pad:2,u=l.bBox(e.node()),f={left:0,top:0,right:A.width,bottom:A.height},h=_.maxShift||(f[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(h<0)r=h;else{var d=_.offsetLeft||0,p=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[a])+c))}),r=Math.min(h,r)}if(r>0||h<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,x=r.placeholder,b=r.traceIndex,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont||{},S=T.family,E=T.size,L=T.color,C=1,z=!1,D=(v.title||"").trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var I=t._context.edits[g];""===D?C=0:D.replace(h," % ")===x.replace(h," % ")&&(C=.2,z=!0,I||(D=""));var P=D||I;k||(k=A._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var O=k.selectAll("text").data(P?[0]:[]);return O.enter().append("text"),O.text(D).attr("class",e),O.exit().remove(),P?(O.call(d),I&&(D?O.on(".opacity",null):(C=0,z=!0,O.text(x).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),O.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),O.classed("js-placeholder",z),k):k}},{"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../color":618,"../drawing":643,d3:128,"fast-isnumeric":140}],710:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"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:{_isLinkedToArray:"button",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",dflt:""},execute:{valType:"boolean",dflt:!0}},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,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/font_attributes":816,"../../plots/pad_attributes":851,"../color/attributes":617}],711:[function(t,e,r){"use strict";e.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:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],712:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,o,r,n)}n("visible",function(t,e){function r(t,e){return i.coerce(n,a,l,t,e)}var n,a,o=t.buttons||[],s=e.buttons=[];for(var c=0;c0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.buttons;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":710,"./constants":711}],713:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e){return+t.attr(M.menuIndexAttrName)===e._index}function a(t,e,r,n,i,a,l,c){e._input.active=e.active=l,"buttons"===e.type?s(t,n,null,null,e):"dropdown"===e.type&&(i.attr(M.menuIndexAttrName,"-1"),o(t,n,i,a,e),c||s(t,n,i,a,e))}function o(t,e,r,n,a){var o=e.selectAll("g."+M.headerClassName).data([0]);o.enter().append("g").classed(M.headerClassName,!0).style("pointer-events","all");var c=a.active,u=a.buttons[c]||M.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},g={width:a.headerWidth,height:a.headerHeight};o.call(l,a,u,t).call(p,a,f,g);var v=e.selectAll("text."+M.headerArrowClassName).data([0]);v.enter().append("text").classed(M.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(x.font,a.font).text(M.arrowSymbol[a.direction]),v.attr({x:a.headerWidth-M.arrowOffsetX+a.pad.l,y:a.headerHeight/2+M.textOffsetY+a.pad.t}),o.on("click",function(){r.call(m),r.attr(M.menuIndexAttrName,i(r,a)?-1:String(a._index)),s(t,e,r,n,a)}),o.on("mouseover",function(){o.call(h)}),o.on("mouseout",function(){o.call(d,a)}),x.setTranslate(e,a.lx,a.ly)}function s(t,e,r,n,i){r||(r=e).attr("pointer-events","all");var o=function(t){return-1==+t.attr(M.menuIndexAttrName)}(r)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?M.dropdownButtonClassName:M.buttonClassName,c=r.selectAll("g."+s).data(o),u=c.enter().append("g").classed(s,!0),m=c.exit();"dropdown"===i.type?(u.attr("opacity","0").transition().attr("opacity","1"),m.transition().attr("opacity","0").remove()):m.remove();var y=0,x=0,b=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(b?x=i.headerHeight+M.gapButtonHeader:y=i.headerWidth+M.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(x=-M.gapButtonHeader+M.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-M.gapButtonHeader+M.gapButton-i.openWidth);var _={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:M.gapButton,xPad:M.gapButton,index:0},w={l:_.x+i.borderwidth,t:_.y+i.borderwidth};c.each(function(o,s){var u=g.select(this);u.call(l,i,o,t).call(p,i,_),u.on("click",function(){g.event.defaultPrevented||(a(t,i,0,e,r,n,s),o.execute&&v.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:i,button:o,active:i.active}))}),u.on("mouseover",function(){u.call(h)}),u.on("mouseout",function(){u.call(d,i),c.call(f,i)})}),c.call(f,i),b?(w.w=Math.max(i.openWidth,i.headerWidth),w.h=_.y-w.t):(w.w=_.x-w.l,w.h=Math.max(i.openHeight,i.headerHeight)),w.direction=i.direction,n&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,f=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(c.enter().append("g").classed(M.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,A=n.barLength+2*n.barPad,T=n.barWidth+2*n.barPad,S=p,E=g+v;E+T>c&&(E=c-T);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=L.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:E,width:A,height:T}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>M,z=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,I=p+m,P=g;I+z>l&&(I=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),C?(this.vbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:I,y:P,width:z,height:D}),this._vbarYMin=P+D/2,this._vbarTranslateMax=M-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=u-.5,N=C?f+z+.5:f+.5,j=h-.5,B=k?d+T+.5:d+.5,U=s._topdefs.selectAll("#"+F).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(R),y:Math.floor(j),width:Math.ceil(N)-Math.floor(R),height:Math.ceil(B)-Math.floor(j)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||C){var V=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":743,"../color":618,"../drawing":643,d3:128}],716:[function(t,e,r){"use strict";e.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},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],717:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],718:[function(t,e,r){"use strict";e.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]}},{}],719:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],720:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],721:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],722:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],723:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],724:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.33.0",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":609,"./components/annotations3d":614,"./components/fx":660,"./components/images":668,"./components/legend":677,"./components/rangeselector":689,"./components/rangeslider":695,"./components/shapes":702,"./components/sliders":708,"./components/updatemenus":714,"./fonts/mathjax_config":725,"./lib/queue":757,"./locale-en":771,"./locale-en-us":770,"./plot_api/plot_schema":778,"./plot_api/register":779,"./plot_api/set_plot_config":780,"./plot_api/to_image":782,"./plot_api/validate":783,"./plotly":784,"./snapshot":878,"./snapshot/download":875,"./traces/scatter":1078,d3:128,"es6-promise":137}],725:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],726:[function(t,e,r){"use strict";var n=Math.PI;r.deg2rad=function(t){return t/180*n},r.rad2deg=function(t){return t/n*180},r.wrap360=function(t){var e=t%360;return e<0?e+360:e},r.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],727:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":721,"fast-isnumeric":140}],728:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):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){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(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}function s(t){return t.formatDate("yyyy")}var l=t("d3"),c=t("fast-isnumeric"),u=t("./loggers"),f=t("./mod"),h=t("../constants/numerical"),d=h.BADNUM,p=h.ONEDAY,m=h.ONEHOUR,g=h.ONEMIN,v=h.ONESEC,y=h.EPOCHJD,x=t("../registry"),b=l.time.format.utc,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,w=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,M=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?x.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:x.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?x.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var k,A;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*g)>=k&&t<=A?t:d;if("string"!=typeof t&&"number"!=typeof t)return d;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?w:_);if(!s)return d;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),b=Number(s[11]||0);if(i){if(2===l.length)return d;l=Number(l);var T;try{var S=x.getComponentMethod("calendars","getCal")(e);if(o){var E="i"===c.charAt(c.length-1);c=parseInt(c,10),T=S.newDate(l,S.toMonthIndex(l,c,E),u)}else T=S.newDate(l,Number(c),u)}catch(t){return d}return T?(T.toJD()-y)*p+f*m+h*g+b*v:d}l=2===l.length?(Number(l)+2e3-M)%100+M:Number(l),c-=1;var L=new Date(Date.UTC(2e3,c,u,f,h));return L.setUTCFullYear(l),L.getUTCMonth()!==c?d:L.getUTCDate()!==u?d:L.getTime()+b*v},k=r.MIN_MS=r.dateTime2ms("-9999"),A=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==d};var T=90*p,S=3*m,E=5*g;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=k&&t<=A))return d;e||(e=0);var i,o,s,l,c,u,h=Math.floor(10*f(t+.05,1)),_=Math.round(t-h/10);if(n(r)){var w=Math.floor(_/p)+y,M=Math.floor(f(t,p));try{i=x.getComponentMethod("calendars","getCal")(r).fromJD(w).formatDate("yyyy-mm-dd")}catch(t){i=b("G%Y-%m-%d")(new Date(_))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=k+p&&t<=A-p))return d;var e=Math.floor(10*f(t+.05,1)),r=new Date(Math.round(t-e/10));return a(l.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return u.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return u.error("unrecognized date",t),e;return t};var L=/%\d?f/g,C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,i,a){var l,c;if(a=n(a)&&a,e)return function(t,e,r,i){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 a=new Date(Math.floor(e+.05));if(n(i))try{t=x.getComponentMethod("calendars","worldCalFmt")(t,e,i)}catch(t){return"Invalid"}return r(t)(a)}(e,t,i,a);if(a)try{var u=Math.floor((t+.05)/p)+y,f=x.getComponentMethod("calendars","getCal")(a).fromJD(u);"y"===r?c=s(f):"m"===r?c=function(t){return t.formatDate("M yyyy")}(f):"d"===r?(l=s(f),c=function(t){return t.formatDate("M d")}(f)):(l=function(t){return t.formatDate("M d, yyyy")}(f),c=o(t,r))}catch(t){return"Invalid"}else{var h=new Date(Math.floor(t+.05));"y"===r?c=i("%Y")(h):"m"===r?c=i("%b %Y")(h):"d"===r?(l=i("%Y")(h),c=i("%b %-d")(h)):(l=i("%b %-d, %Y")(h),c=o(t,r))}return c+(l?"\n"+l:"")};var z=3*p;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=f(t,p);if(t=Math.round(t-i),r)try{var a=Math.round(t/p)+y,o=x.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-y)*p+i}catch(e){u.error("invalid ms "+t+" in calendar "+r)}var l=new Date(t+z);return l.setUTCMonth(l.getUTCMonth()+e)+i-z},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&x.getComponentMethod("calendars","getCal")(e),f=0;f0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function i(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}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,f=a-e,h=l-o,d=c-s,p=u*u+f*f,m=h*h+d*d,g=Math.min(i(u,f,p,o-t,s-e),i(u,f,p,l-t,c-e),i(h,d,m,t-o,e-s),i(h,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),f=t.getPointAtLength(a(r,e)),h={x:(4*f.x+i.x+c.x)/6,y:(4*f.y+i.y+c.y)/6,theta:u};return o[r]=h,h},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,f=t.getTotalLength(),h=f,d=n(u);d;){if((u+=d+r)>h)return;d=n(u)}for(d=n(h);d;){if(h-=d+r,u>h)return;d=n(h)}return{min:u,max:h,len:h-u,total:f,isClosed:0===u&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":750}],738:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],739:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(o(t))return u;var e=s(t);return e.length?e:u}function a(t){return o(t)?t:f}var o=t("fast-isnumeric"),s=t("color-normalize"),l=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,u=s(c),f=1;e.exports=function(t,e,r){var o,c,h,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,c=g?function(t,e){return void 0===t[e]?u:s(o(t[e]))}:i,h=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var x=0;x=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}(t))))}},{"../constants/string_mappings":722,"superscript-text":539}],742:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],743:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./angles");l.deg2rad=p.deg2rad,l.rad2deg=p.rad2deg,l.wrap360=p.wrap360,l.wrap180=p.wrap180;var m=t("./geometry2d");l.segmentsIntersect=m.segmentsIntersect,l.segmentDistance=m.segmentDistance,l.getTextLocation=m.getTextLocation,l.clearLocationCache=m.clearLocationCache,l.getVisibleSegment=m.getVisibleSegment,l.findPointOnPath=m.findPointOnPath;var g=t("./extend");l.extendFlat=g.extendFlat,l.extendDeep=g.extendDeep,l.extendDeepAll=g.extendDeepAll,l.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");l.log=v.log,l.warn=v.warn,l.error=v.error;var y=t("./regex");l.counterRegex=y.counter;var x=t("./throttle");l.throttle=x.throttle,l.throttleDone=x.done,l.clearThrottle=x.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.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,c=new Array(l),u=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]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n=0&&t%1==0}function a(e){return void 0!==e&&e1?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};var w=/%{([^\s%{}]*)}/g,M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(w,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n},l.eventListenerOptionsSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}},{"../constants/numerical":721,"./angles":726,"./clean_number":727,"./coerce":728,"./dates":729,"./ensure_array":730,"./extend":732,"./filter_unique":733,"./filter_visible":734,"./geometry2d":737,"./get_graph_div":738,"./identity":742,"./is_array":744,"./is_plain_object":745,"./keyed_container":746,"./localize":747,"./loggers":748,"./matrix":749,"./mod":750,"./nested_property":751,"./noop":752,"./notifier":753,"./push_unique":756,"./regex":758,"./relative_attr":759,"./relink_private":760,"./search":761,"./stats":764,"./throttle":767,"./to_log_range":768,d3:128,"fast-isnumeric":140}],744:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],745:[function(t,e,r){"use strict";e.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)===Object.prototype}},{}],746:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,c(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}(d)):f[e[u]]=n}}function o(t,e){var r=e;return l(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}var l=t("fast-isnumeric"),c=t("./is_array"),u=t("./is_plain_object"),f=t("../plot_api/container_array_match");e.exports=function(t,e){if(l(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),s=0;so||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,f,h,d,p,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":721,"./matrix":749}],756:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else 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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(u=p>=0?r?n:i:r?o:a,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&l.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":140}],765:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":99}],766:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t,e,r){var n="math-output-"+c.randstr([],64),i=l.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(function(t){return t.replace(p,"\\lt ").replace(m,"\\gt ")}(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=l.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function a(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function o(t,e){function r(){p++;var e=document.createElementNS(u.svg,"tspan");l.select(e).attr({class:"line",dy:p*h+"em"}),t.appendChild(e),s=e;var r=d;if(d=[{node:e}],r.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),s=d[d.length-1].node}else c.log("Ignoring unexpected end tag .",e)}e=function(t){return function(t,e){if(!t)return"";for(var r=0;r|>|>)/g,g={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},v={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},x="\u200b",b=["http:","https:","mailto:","",void 0,":"],_=new RegExp("]*)?/?>","g"),w=Object.keys(f.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:f.entityToUnicode[t]}}),M=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,A=/<(\/?)([^ >]*)(\s+(.*))?>/i,T=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,E=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,z=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(_," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=l.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){!function(){var r=l.select(i).select(".svg-container"),a=r.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12);a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(s(t,r,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=l.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;l.select(this).transition().duration(0).remove(),l.select(document).on("mouseup",null),o.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,l.select(document).on("mouseup",function(){if(l.event.target===t)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===l.event.which?(i._editing=!1,t.style({opacity:1}),l.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),l.select(this).call(s(t,r,e)))}).on("keydown",function(){13===l.event.which&&this.blur()}).call(n)}(),t.style({opacity:0});var r,a=c.attr("class");(r=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(r).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}var i=e.gd,a=e.delegate,o=l.dispatch("edit","input","cancel"),c=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():c.on("click",r),l.rebind(t,o,"on")}},{"../constants/alignment":716,"../constants/string_mappings":722,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],767:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e?a():o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],768:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.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}},{"fast-isnumeric":140}],769:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":818,"topojson-client":549}],770:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],771:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],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:["$",""]}}},{}],772:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axis_ids"),d=h.cleanId,p=h.getFromTrace,m=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;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 i=(f.subplotsRegistry.cartesian||{}).attrRegex,o=(f.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),m.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s1&&o.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 o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),d(t),!0)}var x,b,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,f).get(),C=[],z=-1,D=E.length;for(x=0;xE.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,k),-1===z&&(z=_);else for(b=0;b=0;x--)E.splice(C[x],1),L&&L.splice(C[x],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(h(g,v),p!==a){var I;if(-1===z)I=T;else{for(D=Math.max(E.length,D),I=[],x=0;x=z);x++)I.push(_);for(x=z;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 s(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]),o(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&o(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function l(t,e,r,n,i,s){!function(t,e,r,n){var i=v.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!v.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");o(t,r,"indices");for(var a in 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,c,u,f=function(t,e,r,n){var i,o,s,l,c,u=v.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=a(r,t.data.length-1);for(var h in e)for(var d=0;d=0&&uY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(j+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(j+".range[0]",Math.log(Z)/Math.LN10),r(j+".range[1]",Math.log(J)/Math.LN10)):(r(j+".range[0]",Math.pow(10,Z)),r(j+".range[1]",Math.pow(10,J)))}else r(j+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[E.parts[0]]&&"radialaxis"===E.parts[1]&&delete u[E.parts[0]]._subplot.viewInitial["radialaxis.range"],b.getComponentMethod("annotations","convertCoords")(t,U,L,r),b.getComponentMethod("images","convertCoords")(t,U,L,r)}else r(j+".autorange",!0),r(j+".range",null);v.nestedProperty(u,j+"._inputRange").set(null)}else if(F.match(P.AX_NAME_PATTERN)){var K=v.nestedProperty(u,S).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),b.getComponentMethod("annotations","convertCoords")(t,K,Q,r),b.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=C.containerArrayMatch(S);if($){a=$.array,o=$.index;var tt=$.property,et=(v.nestedProperty(l,a)||[])[o]||{},rt=et,nt=q||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===o?(it?M.calc=!0:I.update(M,nt),it=!1):""===tt&&(rt=L,C.isAddVal(L)?A[S]=null:C.isRemoveVal(L)?(A[S]=et,rt=et):v.warn("unrecognized full object value",e)),it&&(n(rt,"x")||n(rt,"y"))?M.calc=!0:I.update(M,nt),d[a]||(d[a]={});var at=d[a][o];at||(at=d[a][o]={}),at[tt]=L,delete e[S]}else"reverse"===F?(B.range?B.range.reverse():(r(j+".autorange",!0),B.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):((!u._has("gl2d")&&!u._has("regl")||"dragmode"!==S||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&q?I.update(M,q):M.calc=!0,E.set(L))}}for(a in d){C.applyContainerArrayChanges(t,v.nestedProperty(l,a),d[a],M)||(M.plot=!0)}var ot=u._axisConstraintGroups||[];for(x in T)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=v.getGraphDiv(t),!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=w.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(e){if(0!==e.length){for(var s=0;so._timeToNext&&function(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,w.transition(t,e.frame.data,e.frame.layout,z.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(o._animationRaf),o._animationRaf=null}()};e()}()}}function f(t){return Array.isArray(s)?p>=s.length?t.transitionOpts=s[p]:t.transitionOpts=s[0]:t.transitionOpts=s,p++,t}var h,d,p=0,m=[],g=void 0===e||null===e,y=Array.isArray(e);if(!g&&!y&&v.isPlainObject(e))m.push({type:"object",data:f(v.extendFlat({},e))});else if(g||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&__)&&M.push(d);m=M}}m.length>0?u(m):(t.emit("plotly_animated"),l())})},g.addFrames=function(t,e,r){t=v.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=l.length+2*e.length,f=[];for(i=e.length-1;i>=0;i--)if(v.isPlainObject(e[i])){var h=(c[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&c[h]&&(n++,v.warn('addFrames: overwriting frame "'+c[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&v.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:w.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(a=f[i].frame).name&&v.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=w.modifyFrames,l=w.modifyFrames,c=[t,o],u=[t,a];return x&&x.add(t,s,c,l,u),w.modifyFrames(t,a)},g.purge=function(t){var e=(t=v.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return w.cleanPlot([],{},r,e),w.purge(t),y.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":618,"../components/drawing":643,"../components/errorbars":649,"../constants/xmlns_namespaces":723,"../lib":743,"../lib/events":731,"../lib/queue":757,"../lib/svg_text_utils":766,"../plotly":784,"../plots/cartesian/axis_ids":792,"../plots/cartesian/constants":794,"../plots/cartesian/constraints":796,"../plots/cartesian/graph_interact":798,"../plots/plots":852,"../plots/polar/legacy":860,"../registry":873,"./edit_types":773,"./helpers":774,"./manage_arrays":775,"./plot_schema":778,"./subroutines":781,d3:128,"fast-isnumeric":140,"has-hover":276}],777:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],778:[function(t,e,r){"use strict";function n(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function a(){var t,e,r={};x(r,h);for(t in c.subplotsRegistry)if((e=c.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)s(r,e,"xaxis"),s(r,e,"yaxis");else{s(r,e,"subplot"===e.attr?e.name:e.attr)}r=function(t){return y(t,{radialaxis:g.radialaxis,angularaxis:g.angularaxis}),y(t,g.layout),t}(r);for(t in c.componentsRegistry){var n=(e=c.componentsRegistry[t]).schema;if(n&&(n.subplots||n.layout)){var i=n.subplots;if(i&&i.xaxis&&!i.yaxis)for(var a in i.xaxis)delete r.yaxis[a]}else e.layoutAttributes&&l(r,e.layoutAttributes,e.name)}return{layoutAttributes:o(r)}}function o(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):u.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[_];if(!n)return;delete t[_],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function s(t,e,r){var n=u.nestedProperty(t,r),i=x({},e.layoutAttributes);i[b]=!0,n.set(i)}function l(t,e,r){var n=u.nestedProperty(t,r);n.set(x(n.get()||{},e))}var c=t("../registry"),u=t("../lib"),f=t("../plots/attributes"),h=t("../plots/layout_attributes"),d=t("../plots/frame_attributes"),p=t("../plots/animation_attributes"),m=t("../plots/polar/legacy/area_attributes"),g=t("../plots/polar/legacy/axis_attributes"),v=t("./edit_types"),y=u.extendFlat,x=u.extendDeepAll,b="_isSubplotObj",_="_isLinkedToArray",w=[b,_,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=b,r.IS_LINKED_TO_ARRAY=_,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=w,r.get=function(){var t={};c.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:m},r={}):r=(e=c.modules[t]._module).basePlotModule;var n={};n.type=null,x(n,f),x(n,e.attributes),r.attributes&&x(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:o(n)};if(e.layoutAttributes){var a={};x(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}(e)});var e={};return Object.keys(c.transformsRegistry).forEach(function(t){e[t]=function(t){var e=c.transformsRegistry[t],r=x({},e.attributes);return Object.keys(c.componentsRegistry).forEach(function(e){var n=c.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){l(r,n.schema.transforms[t][e],e)})}),{attributes:o(r)}}(t)}),{defs:{valObjects:u.valObjectMeta,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:v.traces,layout:v.layout},impliedEdits:{}},traces:t,layout:a(),transforms:e,frames:function(){var t={frames:u.extendDeepAll({},d)};return o(t),t.frames}(),animation:o(p)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===w.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||u.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,a,o){i=i.slice(0,o).concat([r]);if(e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[o-1]&&("ticktext"===r||"tickvals"===r))){var s=function(t){return t.join(".")}(i),l=u.nestedProperty(t,s).get();Array.isArray(l)&&n.push(s)}}var n=[],i=[];if(r.crawl(f,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,o=0;o=t.transforms.length)return!1;a=(r=(c.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=m[o];else{var u=t._module;if(u||(u=(c.modules[t.type||f.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(a=r&&r[o])){var h=u.basePlotModule;h&&h.attributes&&(a=h.attributes[o])}a||(a=f[o])}return n(a,e,s)},r.getLayoutValObject=function(t,e){return n(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var a=e.plotgroup.selectAll(".bg").data(i);a.enter().append("rect").classed("bg",!0),a.exit().remove(),a.each(function(){e.bg=a;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=l._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){l._plots[t].bg=o.select(this)}),b.each(function(t){function r(t){return"M"+k+","+t+"H"+A}function o(t){return"M"+y._offset+","+t+"h"+y._length}function s(t){return"M"+t+","+z+"V"+C}function c(t){return"M"+t+","+x._offset+"v"+x._length}function p(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}var v=l._plots[t],y=v.xaxis,x=v.yaxis;v.bg&&m&&v.bg.call(h.setRect,y._offset-u,x._offset-u,y._length+2*u,x._length+2*u).call(f.fill,l.plot_bgcolor).style("stroke-width",0),v.clipId="clip"+l._uid+t+"plot";var b=l._clips.selectAll("#"+v.clipId).data([0]);b.enter().append("clipPath").attr({class:"plotclip",id:v.clipId}).append("rect"),b.selectAll("rect").attr({width:y._length,height:x._length}),h.setTranslate(v.plot,y._offset,x._offset);var _,w;for(v._hasClipOnAxisFalse?(_=null,w=v.clipId):(_=v.clipId,w=null),h.setClipUrl(v.plot,_),i=0;i1&&d.push(a("object","layout"))),l.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&i<=10||e>=15*T)t._tickround="d";else if(e>=E&&i<=16||e>=S)t._tickround="M";else if(e>=L&&i<=19||e>=E)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(m(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);m(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(c(t.exponentformat)&&!u(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function s(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=f(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}function r(t,n){return e(n,0)?t:r(n,t%n)}var n=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),i=t*n,a=Math.abs(r(i,n));return[Math.round(i/a),Math.round(n/a)]}(a);if(o[1]>=100)e.text=f(v.deg2rad(e.x),t,i,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(e.text=C+e.text)}}}}function c(t){return"SI"===t||"B"===t}function u(t){return t>14||t<-15}function f(t,e,r,n){var i=t<0,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,f=I.getTickFormat(e),h=e.separatethousands;if(n){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:m(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(d),a=(Number(d._tickround)||0)+4,l=d._tickexponent,e.hoverformat&&(f=e.hoverformat)}if(f)return e._numFormat(f)(t).replace(/-/g,C);var p=Math.pow(10,-a)/2;if("none"===s&&(l=0),(t=Math.abs(t))"+x+"":"B"===s&&9===l?t+="B":c(s)&&(t+=H[l/3+5])}return i?C+t:t}function h(t,e){for(var r=0;r2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},I.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);if(n===i){var m=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),v.simpleMap(r,t.l2r||Number)},I.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=I.getAutoRange(t),t._r=t.range.slice(),t._rl=v.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},I.saveRangeInitial=function(t,e){for(var r=I.list(t,"",!0),n=!1,i=0;i=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:b&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:b&&0===u?0:f})}}}if((t.autorange||!!v.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,g,y=e.length,x=r.padded?.05*t._length:0,b=r.tozero&&("linear"===t.type||"-"===t.type);x&&"domain"===t.constrain&&t._inputDomain&&(x*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var _=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),A=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=y-1;a>5;a--)i(a)}},I.autoBin=function(t,e,r,n,i){var a=v.aggNums(Math.min,null,t),o=v.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:a-.5,end:o+.5,size:1,_count:o-a+1};var s;if(r)s=(o-a)/r;else{var l=v.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*v.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*v.stdev(t)/Math.pow(t.length,n?.25:.4)),m(s)||(s=1)}var f;f="log"===e.type?{type:"linear",range:[a,o]}:{type:e.type,range:v.simpleMap([a,o],e.c2r,0,i),calendar:i},I.setConvert(f),I.autoTicks(f,s);var h,d,p=I.tickIncrement(I.tickFirst(f),f.dtick,"reverse",i);if("number"==typeof f.dtick)h=(p=function(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,c=0,u=0;u.3*f||a(n)||a(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=I.tickIncrement(t,"M6","reverse")+1.5*T:a.exactMonths>.8?t=I.tickIncrement(t,"M1","reverse")+15.5*T:t-=T/2;var s=I.tickIncrement(t,r);if(s<=n)return s}return t}(p,t,f.dtick,a,i)),h=p,d=0;h<=o;)h=I.tickIncrement(h,f.dtick,!1,i),d++;return{start:e.c2r(p,0,i),end:e.c2r(h,0,i),size:f.dtick,_count:d}},I.calcTicks=function(t){var e=v.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=v.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),I.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),o(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=v.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),f=Math.max(l,c),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e=l:f<=l)&&!(a.length>u||f===c);f=I.tickIncrement(f,t.dtick,i,t.calendar))c=f,a.push(f);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dk?(e/=k,n=r(10),t.dtick="M"+12*a(e,n,R)):i>A?(e/=A,t.dtick="M"+a(e,1,N)):i>T?(t.dtick=a(e,T,B),t.tick0=v.dateTick0(t.calendar,!0)):i>S?t.dtick=a(e,S,N):i>E?t.dtick=a(e,E,j):i>L?t.dtick=a(e,L,j):(n=r(10),t.dtick=a(e,n,R))}else if("log"===t.type){t.tick0=0;var o=v.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,n=r(10),t.dtick="L"+a(e,n,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=a(e,n,q)):(t.tick0=0,n=r(10),t.dtick=a(e,n,R));if(0===t.dtick&&(t.dtick=1),!m(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},I.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(m(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return v.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?V:U,l=t+.01*i,c=v.roundUp(v.mod(l,1),s,r);return Math.floor(l)+Math.log(p.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},I.tickFirst=function(t){var e=t.r2l||Number,r=v.simpleMap(t.range,e),n=r[1]"+o,t._prevDateHead=o)),e.text=s}(t,o,r,d):"log"===t.type?function(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=f(Math.pow(10,o),t,i,n);else if(m(a)||"D"===a.charAt(0)&&v.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||c(t.exponentformat)&&u(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+C+-l+"",e.fontSize*=1.25):(e.text=f(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,v.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("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*(o<0?.5:.25)))}}(t,o,0,d,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"angular"===t._id?l(t,o,r,d,i):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=f(e.x,t,i,n)}(t,o,0,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o},I.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return I.hoverLabelText(t,e)+" - "+I.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=I.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":C+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];I.getTickFormat=function(t){function e(t){return"string"!=typeof t?t:Number(t.replace("M",""))*A}function r(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function n(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function i(t,e){var n=null===e[0],i=null===e[1],a=r(t,e[0])>=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}var a,o;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(a=0;a1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":873,"./constants":794}],793:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],794:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":743}],795:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;oo*v)||_)for(r=0;rz&&IL&&(L=I);f/=(L-E)/(2*C),E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=A.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function c(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:k.background,stroke:k.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function u(t){t.selectAll(".select-outline").remove()}function f(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 d(t){y.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function p(t){j&&t.data&&t._context.showTips&&(w.notifier(w._(t,"Double-click to zoom back out"),"long"),j=!1)}function m(t){return"lasso"===t||"select"===t}function g(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,R)/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 v(t,e){if(N){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}var y=t("d3"),x=t("tinycolor2"),b=t("../../plotly"),_=t("../../registry"),w=t("../../lib"),M=t("../../lib/svg_text_utils"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("../../components/fx"),S=t("../../lib/setcursor"),E=t("../../components/dragelement"),L=t("../../constants/alignment").FROM_TL,C=t("../plots"),z=t("./axes").doTicks,D=t("./axis_ids").getFromId,I=t("./select"),P=t("./scale_zoom"),O=t("./constants"),F=O.MINDRAG,R=O.MINZOOM,N=w.eventListenerOptionsSupported(),j=!0;e.exports={makeDragBox:function(t,e,r,n,h,k,S,N){function j(){X=[e.xaxis],Z=[e.yaxis];var r=X[0],n=Z[0];Q=r._length,$=n._length;var i=ot._axisConstraintGroups,o=[r._id],s=[n._id];W=[e].concat(S&&N?e.overlays:[]);for(var l=1;lR||s>R?(yt="xy",o/Q>s/$?(s=o*$/Q,dt>a?pt.t=dt-s:pt.b=dt+s):(o=s*Q/$,ht>i?pt.l=ht-o:pt.r=ht+o),bt.attr("d",g(pt))):n():!et||s10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Mt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=At.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(N||nt){for(N||(l=.5),a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(j(),"ew"===tt||"ns"===et)return tt&&s(X,e),et&&s(Z,r),Y([tt?-e:0,et?-r:0,Q,$]),void H(et,tt);if(nt&&tt&&et){var i="w"===tt==("n"===et)?1:-1,a=(e/Q+i*r/$)/2;e=a*Q,r=i*a*$}"w"===tt?e=n(X,0,e):"e"===tt?e=n(X,1,-e):tt||(e=0),"n"===et?r=n(Z,1,r):"s"===et?r=n(Z,0,-r):et||(r=0);var o="w"===tt?e:0,l="n"===et?r:0;if(nt){var c;if(!tt&&1===et.length){for(c=0;c rect").call(A.setTranslate,s,l).call(A.setScale,a,o);var T=m.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");m.plot.call(A.setTranslate,M,k).call(A.setScale,1/a,1/o),T.selectAll(".point").call(A.setPointGroupScale,a,o),T.selectAll(".textpoint").call(A.setTextPointsScale,a,o),T.call(A.hideOutsideRangePoints,m)}}}var W,X,Z,J,K,Q,$,tt,et,rt,nt,it,at,ot=t._fullLayout,st=t._fullLayout._zoomlayer,lt=S+N==="nsew",ct=1===(S+N).length;j();var ut=i(e,S+N+"drag",rt,r,n,h,k);if(!et&&!tt&&!m(ot.dragmode))return ut.onmousedown=null,ut.style.pointerEvents=lt?"all":"none",ut;var ft={element:ut,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;lt?e.shiftKey?"pan"===i?i="zoom":m(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan",ft.minDrag="lasso"===i?1:void 0,"zoom"===i?(ft.moveFn=B,ft.doneFn=U,ft.minDrag=1,function(e,r,n){var i=ut.getBoundingClientRect();ht=r-i.left,dt=n-i.top,pt={l:ht,r:ht,w:0,t:dt,b:dt,h:0},mt=t._hmpixcount?t._hmlumcount/t._hmpixcount:x(t._fullLayout.plot_bgcolor).getLuminance(),vt=!1,yt="xy",xt=l(st,mt,J,K,gt="M0,0H"+Q+"V"+$+"H0V0"),bt=c(st,J,K),u(st)}(0,r,n)):"pan"===i?(ft.moveFn=q,ft.doneFn=G,u(st)):m(i)&&(ft.xaxes=X,ft.yaxes=Z,I(e,r,n,ft,i))},clickFn:function(r,n){if(d(t),2!==r||ct||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(tt?X:[]).concat(et?Z:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;ru[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":743,"fast-isnumeric":140}],806:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.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)]}},{"../../constants/alignment":716}],807:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function b(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,s=o.nestedProperty(t,e).get();if(i="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:r.dfltRange||p.DFLTRANGEX,i=i.slice(),s&&2===s.length)for("date"===t.type&&(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(s[n],t.calendar)){t[e]=i;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!a(s[n])){if(!a(s[1-n])){t[e]=i;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-h?s[n]=-h:s[n]>h&&(s[n]=h),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else o.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:i.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:i.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":721,"../../lib":743,"./axis_ids":792,"./constants":794,d3:128,"fast-isnumeric":140}],809:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);r("tickprefix")&&r("showtickprefix",s);r("ticksuffix",o.tickSuffixDflt)&&r("showticksuffix",s);if(r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){function r(t,e){return n.coerce(s,l,i.tickformatstops,t,e)}var a=t.tickformatstops,o=e.tickformatstops=[];if(Array.isArray(a))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),h=u.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],812:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(t){var e=t.xaxis,r=t.yaxis;d._defs.select("#"+t.clipId+"> 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 f(e,r){var n,i,l,c=m[e.xaxis._id],u=m[e.yaxis._id],f=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,f[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[2]=e.xaxis._length*(1-r+r*p/h)}else f[0]=0,f[2]=e.xaxis._length;if(u){i=(n=t._fullLayout[u.axisName])._r,l=u.to,f[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var g=i[1]-i[0],v=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[3]=e.yaxis._length*(1-r+r*v/g)}else f[1]=0,f[3]=e.yaxis._length;!function(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,k,A).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,E,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}function h(){b=Date.now();for(var e=Math.min(1,(b-x)/r.duration),n=w(e),a=0;ar.duration?(!function(){for(var e={},r=0;r0?".":"")+i;l.isPlainObject(a)?o(a,e,s,n+1):e(s,i,a)}})}var s=t("../plotly"),l=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(c)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(c){n(t,c,o.cache),o.check=function(){if(s){var e=n(t,c,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fn*Math.PI/180}return!1},r.getPath=function(){return i.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(m.precision),n&&r.clipAngle(n-m.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],h=e.lonaxis,d=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(h.range,d.range);u.fitExtent(f,p);var g=this.bounds=u.getBounds(p),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!c){var A=u?o.projRotate:[k,0,0];M=r("projection.rotation.lon",A[0]),r("projection.rotation.lat",A[1]),r("projection.rotation.roll",A[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}var T,S;if(c?(T=-96.6,S=38.7):(T=u?k:M,S=(b[0]+b[1])/2),r("center.lon",T),r("center.lat",S),f){r("projection.parallels",o.projParallels||[0,60])}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":865,"../constants":818,"./layout_attributes":823}],823:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,s={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({domain:i({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:s,lataxis:s},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"../constants":818}],824:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!M.hasOwnProperty(e.type))return null;var i=M[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){return t>1?S:t<-1?-S:Math.asin(t)}function a(t){return t>1?0:t<-1?T:Math.acos(t)}function o(t,e){var r=(2+S)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>k;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function s(t,e){function r(r,n){var i=D(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?D:e===1/0?l:(r.invert=function(r,n){var i=D.invert(r/t,n);return i[0]*=e,i},r)}function l(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function c(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function u(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function f(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>k&&--i>0);return e/2}}function h(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function d(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=P[i])[0],s=r[1],l=(r=P[++i])[0],c=r[1],u=(r=P[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?S:-S)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function p(t,e){return[t*Math.cos(e),e]}function m(t,e){var r=Math.cos(e),n=function(t){return t?t/Math.sin(t):1}(a(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function g(t,e){var r=m(t,e);return[(r[0]+t/S)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&v.hasOwnProperty(t.type)?v[t.type]:r)(t,n)};var v={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},y=[],x=[],b={point:function(t,e){y.push([t,e])},result:function(){var t=y.length?y.length<2?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y}:null;return y=[],t}},_={lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){y.length&&(x.push(y),y=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},w={polygonStart:n,lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){var t=y.length;if(t){do{y.push(y[0].slice())}while(++t<4);x.push(y),y=[]}},polygonEnd:n,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(h-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},M={Point:b,MultiPoint:b,LineString:_,MultiLineString:_,Polygon:w,MultiPolygon:w,Sphere:w},k=1e-6,A=k*k,T=Math.PI,S=T/2,E=(Math.sqrt(T),T/180),L=180/T,C=t.geo.projection,z=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=a[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],l}function n(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a=0;--r){var f;o=180*(f=a[1][r])[0][0]/T,s=180*f[0][1]/T,l=180*f[1][1]/T,c=180*f[2][0]/T,u=180*f[2][1]/T,e.push(n([[c-1e-6,u-1e-6],[c-1e-6,l+1e-6],[o+1e-6,l+1e-6],[o+1e-6,s-1e-6]],30))}return{type:"Polygon",coordinates:[t.merge(e)]}}(),l)},i},o.lobes=function(t){return arguments.length?(a=t.map(function(t){return t.map(function(t){return[[t[0][0]*T/180,t[0][1]*T/180],[t[1][0]*T/180,t[1][1]*T/180],[t[2][0]*T/180,t[2][1]*T/180]]})}),i=a.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),o):a.map(function(t){return t.map(function(t){return[[180*t[0][0]/T,180*t[0][1]/T],[180*t[1][0]/T,180*t[1][1]/T],[180*t[2][0]/T,180*t[2][1]/T]]})})},o},o.invert=function(t,e){var r=.5*e*Math.sqrt((4+T)/T),n=i(r),a=Math.cos(n);return[t/(2/Math.sqrt(T*(4+T))*(1+a)),i((n+r*(a+2))/(2+S))]},(t.geo.eckert4=function(){return C(o)}).raw=o;var D=t.geo.azimuthalEqualArea.raw;l.invert=function(t,e){var r=2*i(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=z(s),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=s,c.invert=function(t,e){return[2/3*T*t/Math.sqrt(T*T/3-e*e),e]},(t.geo.kavrayskiy7=function(){return C(c)}).raw=c,u.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*T]},(t.geo.miller=function(){return C(u)}).raw=u,f(T);var I=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=a(n)),e*Math.sin(n)]}var a=f(r);return n.invert=function(n,a){var o=i(a/e);return[n/(t*Math.cos(o)),i((2*o+Math.sin(2*o))/r)]},n}(Math.SQRT2/S,Math.SQRT2,T);(t.geo.mollweide=function(){return C(I)}).raw=I,h.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>k&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return C(h)}).raw=h;var P=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];P.forEach(function(t){t[1]*=1.0144}),d.invert=function(t,e){var r=e/S,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],n-=(p=(e>=0?S:-S)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*L}while(Math.abs(p)>A&&--m>0);break}}while(--a>=0);var g=P[a][0],v=P[a+1][0],y=P[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*E]},(t.geo.robinson=function(){return C(d)}).raw=d,p.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return C(p)}).raw=p,m.invert=function(t,e){if(!(t*t+4*e*e>T*T+k)){var r=t,n=e,i=25;do{var o,s=Math.sin(r),l=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,m=l*l,g=1-p*c*c,v=g?a(f*c)*Math.sqrt(o=1/g):o=0,y=2*v*f*l-t,x=v*u-e,b=o*(p*m+v*f*c*d),_=o*(.5*s*h-2*v*u*l),w=.25*o*(h*l-v*u*p*s),M=o*(d*c+v*m*f),A=_*w-M*b;if(!A)break;var S=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=S,n-=E}while((Math.abs(S)>k||Math.abs(E)>k)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return C(m)}).raw=m,g.invert=function(t,e){var r=t,n=e,i=25;do{var o,s=Math.cos(n),l=Math.sin(n),c=Math.sin(2*n),u=l*l,f=s*s,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-f*d*d,v=g?a(s*d)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*s*p+r/S)-t,x=.5*(v*l+n)-e,b=.5*o*(f*m+v*s*d*u)+.5/S,_=o*(h*c/4-v*l*p),w=.125*o*(c*p-v*l*f*h),M=.5*o*(u*d+v*m*s)+.5,A=_*w-M*b,T=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=T,n-=E}while((Math.abs(T)>k||Math.abs(E)>k)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return C(g)}).raw=g}},{}],825:[function(t,e,r){"use strict";function n(t,e){return d.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,r){function n(t,e){var r=p.nestedProperty(s,t);r.get()!==e&&(r.set(e),p.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function a(t,e){function r(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}var a=n(0,e);return a.on("zoomstart",function(){d.select(this).style(v)}).on("zoom",function(){e.scale(d.event.scale).translate(d.event.translate),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,r)}),a}function o(t,e){function r(t){return e.invert(t)}function a(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var o,s,l,c,u,f,h,p,m=n(0,e),g=2;return m.on("zoomstart",function(){d.select(this).style(v),o=d.mouse(this),s=e.rotate(),l=e.translate(),c=s,u=r(o)}).on("zoom",function(){if(f=d.mouse(this),function(t){var n=e(r(t));return Math.abs(n[0]-t[0])>g||Math.abs(n[1]-t[1])>g}(o))return m.scale(e.scale()),void m.translate(e.translate());e.scale(d.event.scale),e.translate([l[0],d.event.translate[1]]),u?r(f)&&(p=r(f),h=[c[0]+(p[0]-u[0]),s[1],s[2]],e.rotate(h),c=h):u=r(o=f),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,a)}),m}function s(t,e){function r(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var a,o={r:e.rotate(),k:e.scale()},s=n(0,e),u=function(t){var e=0,r=arguments.length,n=[];for(;++em?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/m)*g-p,i=Math.sqrt(m*m-h*h));var v=180-a-2*p,y=(Math.atan2(d,u)-Math.atan2(l,i))*g,x=(Math.atan2(d,u)-Math.atan2(l,-i))*g,b=c(r[0],r[1],a,y),_=c(r[0],r[1],v,x);return b<=_?[a,y,r[2]]:[v,x,r[2]]}(v,a,n);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=n),e.rotate(x),n=x}}else a=l(e,t=s);!function(t){t({type:"zoom"})}(u.of(this,arguments))}),function(t){p++||t({type:"zoomstart"})}(u.of(this,arguments))}).on("zoomend",function(){d.select(this).style(y),x.call(s,"zoom",null),function(t){--p||t({type:"zoomend"})}(u.of(this,arguments)),i(t,e,r)}).on("zoom.redraw",function(){t.render()}),d.rebind(s,u,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*m,r=t[1]*m,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function c(t,e,r,n){var i=u(r-t),a=u(n-e);return Math.sqrt(i*i+a*a)}function u(t){return(t%360+540)%360-180}function f(t,e,r){var n=r*m,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function h(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(s)*_*(u>=0?1:-1),c.boxEnd[1]f[3]&&(c.boxEnd[1]=f[3],c.boxEnd[0]=c.boxStart[0]+(f[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(u)/_*(s>=0?1:-1),c.boxEnd[0]f[2]&&(c.boxEnd[0]=f[2],c.boxEnd[1]=c.boxStart[1]+(f[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(s=c.boxStart[0]!==c.boxEnd[0],u=c.boxStart[1]!==c.boxEnd[1],s||u?(s&&(a(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,r?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)h[p+2]&&(h[p]=-1,h[p+2]=1),(d=this[b[p]])._length=o.viewBox[p+2]-o.viewBox[p],s.doAutoRange(d),d.setScale();y(l),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],832:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return i.validate(t[e],c[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":618,"../../../lib":743,"../../../registry":873,"../../subplot_defaults":865,"./axis_defaults":835,"./layout_attributes":838}],838:[function(t,e,r){"use strict";function n(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"}}var i=t("./axis_attributes"),a=t("../../domain_attributes"),o=t("../../../lib/extend").extendFlat,s=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[s("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:o(n(0,0,1),{}),center:o(n(0,0,0),{}),eye:o(n(1.25,1.25,1.25),{}),editType:"camera"},domain:a({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:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":743,"../../../lib/extend":732,"../../domain_attributes":815,"./axis_attributes":834}],839:[function(t,e,r){"use strict";function n(){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]}var i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=i(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new n;return e.merge(t),e}},{"../../../lib/str2rgbarray":765}],840:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var f=l[o[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||i.constrain(f._length/40,4,9);n.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=n.calcTicks(f),m=0;mh[1][s]?d[s]=1:h[1][s]===h[0][s]?d[s]=1:d[s]=1/(h[1][s]-h[0][s]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var T=m[1][a]-m[0][a];m[0][a]-=T/32,m[1][a]+=T/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){var L=y[c=(l=u[k[a]]).type];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=E;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=u.aspectratio;C=[z.x,z.y,z.z]}u.aspectratio.x=f.aspectratio.x=C[0],u.aspectratio.y=f.aspectratio.y=C[1],u.aspectratio.z=f.aspectratio.z=C[2],this.glplot.aspect=C;var D=u.domain||null,I=e._size||null;if(D&&I){var P=this.container.style;P.position="absolute",P.left=I.l+D.x[0]*I.w+"px",P.top=I.t+(1-D.y[1])*I.h+"px",P.width=I.w*(D.x[1]-D.x[0])+"px",P.height=I.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),s(this.glplot.camera)},M.setCamera=function(t){this.glplot.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(t))},M.saveCamera=function(t){function e(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 r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}var a=t("../../lib"),o=t("./convert_text_opts"),s=n.prototype;s.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},s.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},s.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":a.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":a.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":a.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=o(n.textposition,n.iconsize);a.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),a.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},s.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":743,"./convert_text_opts":845}],848:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain_attributes"),o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:c,textposition:n.extendFlat({},s,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":618,"../../lib":743,"../../plot_api/edit_types":773,"../../traces/scatter/attributes":1066,"../domain_attributes":815,"../font_attributes":816}],849:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){function r(t,e){return i.coerce(n,a,o.layers,t,e)}var n,a,s=t.layers||[],l=e.layers=[];for(var c=0;c=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(){p.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()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=i.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],h=t.data||[];t._transitionData||p.createTransitionData(t),n._dfltTitle={plot:f(t,"Click to enter Plot title"),x:f(t,"Click to enter X axis title"),y:f(t,"Click to enter Y axis title"),colorbar:f(t,"Click to enter Colorscale title"),annotation:f(t,"new text")},n._traceWord=f(t,"trace");var d=function(t){function e(t){for(var e=!0,r=0;r=0)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,d=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(m.width-f)),i=Math.round(d*(m.height-h))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var v=p.layoutAttributes.width.min,y=p.layoutAttributes.height.min;n1,b=!e.height&&Math.abs(r.height-i)>1;(b||x)&&(x&&(r.width=n),b&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand){u.base={l:{val:0,size:i},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}};for(var f in u){var h=u[f].l||{},d=u[f].b||{},p=h.val,m=h.size,g=d.val,v=d.size;for(var y in u){if(a(m)&&u[y].r){var x=u[y].r.val,b=u[y].r.size;if(x>p){var _=(m*x+(b-e.width)*p)/(x-p),w=(b*(1-p)+(m-e.width)*(1-x))/(x-p);_>=0&&w>=0&&_+w>i+s&&(i=_,s=w)}}if(a(v)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>g){var A=(v*M+(k-e.height)*g)/(M-g),T=(k*(1-g)+(v-e.height)*(1-M))/(M-g);A>=0&&T>=0&&A+T>c+l&&(c=A,l=T)}}}}}if(r.l=Math.round(i),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(u.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var s,l,c=0,f=0,p=t._fullLayout._basePlotModules,m=!1;if(r)for(l=0;l=0;o--)if(_[o].enabled){r._indexToPoints=_[o]._indexToPoints;break}i&&i.calc&&(b=i.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:d,y:d}]),b[0].t||(b[0].t={}),b[0].trace=r,p[a]=b}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i=0?h.angularAxis.domain:n.extent(M),E=Math.abs(M[1]-M[0]);A&&!k&&(E=0);var L=S.slice();T&&k&&(L[1]+=E);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var z=h.angularAxis.ticksStep||(L[1]-L[0])/(C*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),L[2]||(L[2]=z);var D=n.range.apply(this,L);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=T?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),P=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(P)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,F=t.select(".chart-group"),R={fill:"none",stroke:h.tickColor},N={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=O.node().getBBox();x=Math.min(h.width-B.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*x+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title){var V=t.select("g.title-group text").style(N).text(h.title),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(R),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(R);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),H.selectAll(".domain").style(R),H.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+c(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(R),Z.selectAll(".minor").style({stroke:h.minorTickColor}),X.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(N);var J=X.select("text.axis-text").attr({x:x+h.labelOffset,dy:a+"em",transform:function(t,e){var r=c(t),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(N);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[x+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(p);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),p[0]||Q){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!k){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ct.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ot.text(o.util.round(rt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(Y).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=t.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(e){return t.radialScale(l+(e[2]||0))}).outerRadius(function(e){return t.radialScale(l+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(e,r){return"rotate("+(t.orientation+s(e[0])+90)+")"}})};var p={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(p).each(c[t.geometryType]),g.exit().remove(),m.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],o.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),g=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,f]);if(u){var v=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){return function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()}(t.symbol,c)},fill:function(t,e){return m(e)}}),y.exit().remove()}var x=n.svg.axis().scale(g).orient("right"),b=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),b.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*h+l,g=d.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../../constants/alignment":716,"../../../lib":743,d3:128}],862:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(f=i),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":618,"../../../lib":743,"./micropolar":861,"./undo_manager":863,d3:128}],863:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n0?1:-1}function d(t){return h(Math.cos(t))}function p(t){return h(Math.sin(t))}var m=t("d3"),g=t("tinycolor2"),v=t("../../plotly"),y=t("../../registry"),x=t("../../lib"),b=t("../../components/color"),_=t("../../components/drawing"),w=t("../plots"),M=t("../cartesian/axes"),k=t("../../components/dragelement"),A=t("../cartesian/dragbox"),T=t("../../components/fx"),S=t("../../components/titles"),E=t("../cartesian/select"),L=t("../../lib/setcursor"),C=t("../../constants/alignment").MID_SHIFT,z=x._,D=x.deg2rad,I=x.rad2deg,P=x.wrap360,O=x.wrap180,F=t("./helpers").setConvertAngular,R=t("./constants"),N=n.prototype;e.exports=function(t,e){return new n(t,e)},N.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h),e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f),r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h),n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f),[e,r,n,i]}(g),y=v[2]-v[0],x=v[3]-v[1],w=m/p,k=Math.abs(x/y);w>k?(l=p,d=(m-(c=p*k))/i.h/2,f=[a[0],a[1]],h=[o[0]+d,o[1]-d]):(c=m,d=(p-(l=m/k))/i.w/2,f=[a[0]+d,a[1]-d],h=[o[0],o[1]]),r.xLength2=l,r.yLength2=c,r.xDomain2=f,r.yDomain2=h;var A=r.xOffset2=i.l+i.w*f[0],T=r.yOffset2=i.t+i.h*(1-h[1]),S=r.radius=l/y,E=r.cx=A-S*v[0],L=r.cy=T+S*v[3],C=r.cxx=E-A,z=r.cyy=L-T;r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.updateAngularAxis(t,e);var I=r.radialAxis.range,O=I[1]-I[0],F=r.xaxis={type:"linear",_id:"x",range:[v[0]*O,v[2]*O],domain:f};M.setConvert(F,t),F.setScale();var R=r.yaxis={type:"linear",_id:"y",range:[v[1]*O,v[3]*O],domain:h};M.setConvert(R,t),R.setScale(),F.isPtWithinRange=function(t){return r.isPtWithinSector(t)},R.isPtWithinRange=function(){return!0},n.frontplot.attr("transform",u(A,T)).call(_.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.circle),n.bgcircle.attr({d:s(S,g),transform:u(E,L)}).call(b.fill,e.bgcolor),r.clipPaths.circle.select("path").attr("d",s(S,g)).attr("transform",u(C,z)),r.framework.selectAll(".crisp").classed("crisp",0)},N.updateRadialAxis=function(t,e){var r=this.gd,n=this.layers,s=this.radius,l=this.cx,h=this.cy,d=t._size,p=e.radialaxis,m=e.sector,g=P(m[0]);this.fillViewInitialKey("radialaxis.angle",p.angle);var v=this.radialAxis=x.extendFlat({},p,{_axislayer:n["radial-axis"],_gridlayer:n["radial-grid"],_id:"x",_pos:0,side:{counterclockwise:"top",clockwise:"bottom"}[p.side],domain:[0,s/d.w],anchor:"free",position:0,_counteraxis:!0});i(v,p,t),M.doAutoRange(v),p.range=v.range.slice(),p._input.range=v.range.slice(),this.fillViewInitialKey("radialaxis.range",v.range.slice()),"auto"===v.tickangle&&g>90&&g<=270&&(v.tickangle=180),v._transfn=function(t){return"translate("+v.l2p(t.x)+",0)"},v._gridpath=function(t){return o(v.r2p(t.x),m)};var y=a(p);this.radialTickLayout!==y&&(n["radial-axis"].selectAll(".xtick").remove(),this.radialTickLayout=y),M.doTicks(r,v,!0),c(n["radial-axis"],p.showticklabels||p.ticks,{transform:u(l,h)+f(-p.angle)}),c(n["radial-grid"],p.showgrid,{transform:u(l,h)}).selectAll("path").attr("transform",null),c(n["radial-line"].select("line"),p.showline,{x1:0,y1:0,x2:s,y2:0,transform:u(l,h)+f(-p.angle)}).attr("stroke-width",p.linewidth).call(b.stroke,p.linecolor)},N.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:s.angle,u=D(c),f=Math.cos(u),h=Math.sin(u),d=0;if(s.title){var p=_.bBox(this.layers["radial-axis"].node()).height,m=s.titlefont.size;d="counterclockwise"===s.side?-p-.4*m:p+.8*m}this.layers["radial-axis-title"]=S.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:a+i/2*f+d*h,y:o-i/2*h+d*f,"text-anchor":"middle"},transform:{rotate:-c}})},N.updateAngularAxis=function(t,e){function r(t){return T.c2rad(t.x,"degrees")}function n(t){return[v*Math.cos(t),v*Math.sin(t)]}var o=this,h=o.gd,g=o.layers,v=o.radius,y=o.cx,_=o.cy,w=e.angularaxis,k=e.sector,A=k.map(D);o.fillViewInitialKey("angularaxis.rotation",w.rotation);var T=o.angularAxis=x.extendFlat({},w,{_axislayer:g["angular-axis"],_gridlayer:g["angular-grid"],_id:"angular",_pos:0,side:"right",domain:[0,Math.PI],anchor:"free",position:0,_counteraxis:!0});"linear"===T.type?(T.autorange=!1,l(k)?T.range=k.slice():T.range=A.map(T.unTransformRad).map(I),"radians"===T.thetaunit&&(T.tick0=I(T.tick0),T.dtick=I(T.dtick))):"category"===T.type&&(T._tickFilter=function(t){return o.isPtWithinSector({r:o.radialAxis.range[1],rad:T.c2rad(t.x)})}),i(T,w,t),M.doAutoRange(T),T._transfn=function(t){var e=r(t),i=n(e),a=u(y+i[0],_-i[1]),o=m.select(this);return o&&o.node()&&o.classed("ticks")&&(a+=f(-I(e))),a},T._gridpath=function(t){var e=n(r(t));return"M0,0L"+-e[0]+","+e[1]};var S="outside"!==w.ticks?.7:.5;T._labelx=function(t){var e=r(t),n=T._labelStandoff,i=T._pad;return(0===p(e)?0:Math.cos(e)*(n+i+S*t.fontSize))+d(e)*(t.dx+n+i)},T._labely=function(t){var e=r(t),n=T._labelStandoff,i=T._labelShift,a=T._pad;return t.dy+t.fontSize*C-i+-Math.sin(e)*(n+a+S*t.fontSize)},T._labelanchor=function(t,e){var n=r(e);return 0===p(n)?d(n)>0?"start":"end":"middle"};var E=a(w);o.angularTickLayout!==E&&(g["angular-axis"].selectAll(".angulartick").remove(),o.angularTickLayout=E),M.doTicks(h,T,!0),c(g["angular-line"].select("path"),w.showline,{d:s(v,k),transform:u(y,_)}).attr("stroke-width",w.linewidth).call(b.stroke,w.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t,e),this.updateRadialDrag(t,e),this.updateMainDrag(t,e))},N.updateMainDrag=function(t,e){function r(t,e){var r=t-w,n=e-M;return Math.sqrt(r*r+n*n)}function n(t,e){return Math.atan2(M-e,t-w)}function i(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function a(t,e){var r=R.cornerLen,n=R.cornerHalfWidth;if(0===t)return s(2*n,S);var a=r/t/2,o=e-a,l=e+a,c=Math.max(0,Math.min(t,x)),u=c-n,f=c+n;return"M"+i(u,o)+"A"+[u,u]+" 0,0,0 "+i(u,l)+"L"+i(f,l)+"A"+[f,f]+" 0,0,1 "+i(f,o)+"Z"}function o(t,e){var i=C+t,o=z+e,l=r(C,z),c=Math.min(r(i,o),x),u=n(C,z),f=n(i,o);lp?(l0==n>_[0]){F=p.range[1]=n,M.doTicks(s,o.radialAxis,!0),l["radial-grid"].attr("transform",u(h,d)).selectAll("path").attr("transform",null);var i=F-_[0],a=o.sectorBBox;o.xaxis.range=[a[0]*i,a[2]*i],o.yaxis.range=[a[1]*i,a[3]*i],o.xaxis.setScale(),o.yaxis.setScale();for(var f in o.traceHash){var m=o.traceHash[f],g=x.filterVisible(m),v=m[0][0].trace._module,k=s._fullLayout[o.id];if(v.plot(s,o,g,k),!y.traceIs(f,"gl"))for(var A=0;Ao&&(o+=360);var s,c,u=P(I(t.rad)),f=u+360;return n[1]>=n[0]?(s=n[0],c=n[1]):(s=n[1],c=n[0]),i>=s&&i<=c&&(l(e)||u>=a&&u<=o||f>=a&&f<=o)},N.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../constants/alignment":716,"../../lib":743,"../../lib/setcursor":762,"../../plotly":784,"../../registry":873,"../cartesian/axes":789,"../cartesian/dragbox":797,"../cartesian/select":807,"../plots":852,"./constants":853,"./helpers":854,d3:128,tinycolor2:546}],865:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r,i){function a(t,e){return n.coerce(o,s,c,t,e)}for(var o,s,l=i.type,c=i.attributes,u=i.handleDefaults,f=i.partition||"x",h=e._subplots[l],d=h.length,p=0;p=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":618,"../../subplot_defaults":865,"./axis_defaults":869,"./layout_attributes":871}],871:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("./axis_attributes"),o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"./axis_attributes":868}],872:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=l._,u=t("../../components/color"),f=t("../../components/drawing"),h=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),m=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),x=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var _=n.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*x?i=(a=x)*w:a=(i=y)/w,o=g*i/y,s=v*a/x,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[_+2*k-b,b-_-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[_,b-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=d({},t.aaxis,{visible:!0,range:[_,b-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*w],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=d({},t.baxis,{visible:!0,range:[b-_-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=d({},t.caxis,{visible:!0,range:[b-_-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*w],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var z="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),l.clipDefRelative.select("path").attr("transform",null);var D="translate("+(r-S._offset)+","+(n+a)+")";l.layers.baxis.attr("transform",D),l.layers.bgrid.attr("transform",D);var I="translate("+(r+i/2)+","+n+")rotate(30)translate(0,-"+T._offset+")";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,-"+E._offset+")";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),f.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(m.doTicks(e,n,!0),m.doTicks(e,i,!0),m.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));this.layers["a-title"]=y.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:c(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var s=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;this.layers["b-title"]=y.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:c(e,"Click to enter Component B title"),attributes:{x:this.x0-s,y:this.y0+this.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),this.layers["c-title"]=y.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:c(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+s,y:this.y0+this.h+.83*a.titlefont.size+s,"text-anchor":"middle"}})}};var M=b.MINZOOM/2+.87,k="m-0.87,.5h"+M+"v3h-"+(M+5.2)+"l"+(M/2+2.6)+",-"+(.87*M+4.5)+"l2.6,1.5l-"+M/2+","+.87*M+"Z",A="m0.87,.5h-"+M+"v3h"+(M+5.2)+"l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-2.6,1.5l"+M/2+","+.87*M+"Z",T="m0,1l"+M/2+","+.87*M+"l2.6,-1.5l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-"+(M/2+2.6)+","+(.87*M+4.5)+"l2.6,1.5l"+M/2+",-"+.87*M+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;_.initInteractions=function(){function t(t,e){return 1-e/O.h}function e(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function r(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function n(n,i){var a=m+n,o=y+i,s=Math.max(0,Math.min(1,t(0,y),t(0,o))),l=Math.max(0,Math.min(1,e(m,y),e(a,o))),c=Math.max(0,Math.min(1,r(m,y),r(a,o))),u=(s/2+c)*O.w,f=(1-s/2-l)*O.w,h=(u+f)/2,d=f-u,p=(1-s)*O.h,g=p-d/w;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),P.transition().style("opacity",1).duration(200),D=!0)}function a(){if(i(R),L!==_){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t),E&&R.data&&R._context.showTips&&(l.notifier(c(R,"Double-click to zoom back out"),"long"),E=!1)}}function h(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m,i=[(L={a:_.a-n,b:_.b+(r+n)/2,c:_.c-(r-n)/2}).a,L.b,L.c].sort(),a=i.indexOf(L.a),o=i.indexOf(L.b),s=i.indexOf(L.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),L={a:i[a],b:i[o],c:i[s]},e=(_.a-L.a)*O.yaxis._m,t=(_.c-L.c-_.b+L.b)*O.xaxis._m);var l="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",l);var c="translate("+-t+","+-e+")";O.clipDefRelative.select("path").attr("transform",c),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(f.hideOutsideRangePoints,O)}function d(){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t)}function p(){N.selectAll(".select-outline").remove()}var m,y,_,M,L,C,z,D,I,P,O=this,F=O.layers.plotbg.select("path").node(),R=O.graphDiv,N=R._fullLayout._zoomlayer,j={element:F,gd:R,plotinfo:{xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(t,e,r){j.xaxes=[O.xaxis],j.yaxes=[O.yaxis];var i=R._fullLayout.dragmode;t.shiftKey&&(i="pan"===i?"zoom":"pan"),j.minDrag="lasso"===i?1:void 0,"zoom"===i?(j.moveFn=n,j.doneFn=a,function(t,e,r){var n=F.getBoundingClientRect();m=e-n.left,y=r-n.top,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,M=O.aaxis.range[1]-_.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),z="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",D=!1,I=N.append("path").attr("class","zoombox").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),P=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}(0,e,r)):"pan"===i?(j.moveFn=h,j.doneFn=d,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,p()):"select"!==i&&"lasso"!==i||x(t,e,r,j,i)},clickFn:function(t,e){if(i(R),2===t){var r={};r[O.id+".aaxis.min"]=0,r[O.id+".baxis.min"]=0,r[O.id+".caxis.min"]=0,R.emit("plotly_doubleclick",null),s.relayout(R,r)}v.click(R,e,O.id)}};F.onmousemove=function(t){v.hover(R,t,O.id),R._fullLayout._lasthover=F,R._fullLayout._hoversubplot=O.id},F.onmouseout=function(t){R._dragging||g.unhover(R,t)},g.init(j)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../lib":743,"../../lib/extend":732,"../../plotly":784,"../cartesian/axes":789,"../cartesian/constants":794,"../cartesian/select":807,"../cartesian/set_convert":808,"../plots":852,d3:128,tinycolor2:546}],873:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=a.extendFlat,s=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,l=t.layout,c=s([],a),u=s({},l,n(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var h=Object.keys(u);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(w),w=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}(w),w=w.replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},{"../components/color":618,"../components/drawing":643,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],882:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&E>0&&(S<=F&&E<=R||S<=R&&E<=F||("h"===M?F>=S*(R/E):R>=E*(F/S)))?m="inside":(m="outside",A.remove(),A=null)}else m="inside";if(!A&&(A=d(e,k,"outside"===m?z:C),T=p.bBox(A.node()),S=T.width,E=T.height,S<=0||E<=0))A.remove();else{var N;N="outside"===m?function(t,e,r,n,a,o,s){var l,c="h"===o?Math.abs(n-r):Math.abs(e-t);c>2*w&&(l=w);var u=1;s&&(u="h"===o?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,h,d,p,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2;f=u*a.width,h=u*a.height,"h"===o?er?(d=(t+e)/2,p=n+l+h/2):(d=(t+e)/2,p=n-l-h/2);return i(m,g,d,p,u,!1)}(l,c,u,f,T,M,"both"===g.constraintext||"outside"===g.constraintext):function(t,e,r,n,a,o,s){var l,c,u,f,h,d=a.width,p=a.height,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*w&&y>2*w?(v-=2*(h=w),y-=2*h):h=0;var x,b;d<=v&&p<=y?(x=!1,b=1):d<=y&&p<=v?(x=!0,b=1):dr?(u=(t+e)/2,f=n-h-c/2):(u=(t+e)/2,f=n+h+c/2);return i(m,g,u,f,b,x)}(l,c,u,f,T,M,"both"===g.constraintext||"inside"===g.constraintext),A.attr("transform",N)}}}function i(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");return"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function a(t,e,r,n){var i=o((e=e||{}).family,r),a=o(e.size,r),l=o(e.color,r);return{family:s(t.family,i,n.family),size:function(t,e,r){if(c(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&ei;if(!a)return e}return void 0!==r?r:t.dflt}(t.size,a,n.size),color:function(t,e,r){return u(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function o(t,e){var r;return Array.isArray(t)?e=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var g,v,y,x,b=r.p+(p?h[s]:h),_=b+r.w,w=r.b,M=w+r.s;if("h"===u.orientation?(y=a.c2p(b,!0),x=a.c2p(_,!0),g=i.c2p(w,!0),v=i.c2p(M,!0),r.ct=[v,(y+x)/2]):(g=i.c2p(b,!0),v=i.c2p(_,!0),y=a.c2p(w,!0),x=a.c2p(M,!0),r.ct=[(g+v)/2,x]),c(g)&&c(v)&&c(y)&&c(x)&&g!==v&&y!==x){var k=(r.mlw+1||u.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=l.round(k/2%1,2);if(!t._context.staticPlot){var T=d.opacity(r.mc||u.marker.color)<1||k>.01?f:m;v=T(v,g=T(g,v)),x=T(x,y=T(y,x))}var S=l.select(this);S.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+g+","+y+"V"+x+"H"+v+"V"+y+"Z"),n(t,S,e,s,g,v,y,x)}else l.select(this).remove()})}),s.call(m.plot,e)}},{"../../components/color":618,"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/svg_text_utils":766,"./attributes":883,d3:128,"fast-isnumeric":140,tinycolor2:546}],891:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;ru+s||!p(l))&&(h=!0,c(f,t))}for(var i=r.traces,a=d(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,f=[l,u],h=!1,g=0;g1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){function e(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}var r,a=n.select(this);a.classed("bartext-inside")?r=s.insidetextfont:a.classed("bartext-outside")&&(r=s.outsidetextfont),r||(r=s.textfont),i.font(a,e("family"),e("size"),e("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":643,"../../components/errorbars":649,d3:128}],895:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],896:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../scatter/attributes":1066}],897:[function(t,e,r){"use strict";function n(t,e){return t.v-e.v}function i(t){return t.v}var a=t("fast-isnumeric"),o=t("../../lib"),s=o._,l=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,c,u,f,h,d=t._fullLayout,p=l.getFromId(t,e.xaxis||"x"),m=l.getFromId(t,e.yaxis||"y"),g=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=p,u="x",f=m,h="y"):(c=m,u="y",f=p,h="x");var y=c.makeCalcdata(e,u),x=function(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||a(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;var l=r.d2c(s,0,t[e+"calendar"]);return n.map(function(){return l})}(e,h,f,y,d[v]),b=o.distinctVals(x),_=b.vals,w=b.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var C=T[r].sort(n),z=C.map(i),D=z.length,I={pos:_[r],pts:C};I.min=z[0],I.max=z[D-1],I.mean=o.mean(z,D),I.sd=o.stdev(z,D,I.mean),I.q1=o.interp(z,.25),I.med=o.interp(z,.5),I.q3=o.interp(z,.75),I.lf=Math.min(I.q1,z[Math.min(o.findBin(2.5*I.q1-1.5*I.q3,z,!0)+1,D-1)]),I.uf=Math.max(I.q3,z[Math.max(o.findBin(2.5*I.q3-1.5*I.q1,z),0)]),I.lo=4*I.q1-3*I.q3,I.uo=4*I.q3-3*I.q1,g.push(I)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r0?(g[0].t={num:d[v],dPos:w,posLetter:h,valLetter:u,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete g[0].t.labels,d[v]++,g):[{t:{empty:!0}}]}},{"../../lib":743,"../../plots/cartesian/axes":789,"fast-isnumeric":140}],898:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a=r("y"),s=r("x");if(a&&a.length)i="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",r("y0")}o.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function i(t,e,r,n){var i=n.prefix,o=a.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",o||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),a.coerceSelectionMarkerOpacity(e,r)}var a=t("../../lib"),o=t("../../registry"),s=t("../../components/color"),l=t("./attributes");e.exports={supplyDefaults:function(t,e,r,o){function c(r,n){return a.coerce(t,e,l,r,n)}n(t,e,c,o),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",s.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),i(t,e,c,{prefix:"box"}))},handleSampleDefaults:n,handlePointsDefaults:i}},{"../../components/color":618,"../../lib":743,"../../registry":873,"./attributes":896}],899:[function(t,e,r){"use strict";function n(t,e,r,n){var i,c,u,f,h,d,p,m,g,v=t.cd,y=t.xa,x=t.ya,b=v[0].trace,_=v[0].t,w="violin"===b.type,M=[],k="closest"!==n||w?_.bdPos:2.5*_.bdPos,A=function(t){return t.pos+_.bPos-d};w&&"both"!==b.side?("positive"===b.side&&(g=function(t){var e=A(t);return s.inbox(e,e+k)}),"negative"===b.side&&(g=function(t){var e=A(t);return s.inbox(e-k,e)})):g=function(t){var e=A(t);return s.inbox(e-k,e+k)};var T;T=w?function(t){return s.inbox(t.span[0]-h,t.span[1]-h)}:function(t){return s.inbox(t.min-h,t.max-h)},"h"===b.orientation?(h=e,d=r,p=T,m=g,i="y",u=x,c="x",f=y):(h=r,d=e,p=g,m=T,i="x",u=y,c="y",f=x);var S=s.getDistanceFunction(n,p,m);if(s.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],L=b.line.color,C=(b.marker||{}).color;l.opacity(L)&&b.line.width?t.color=L:l.opacity(C)&&b.boxpoints?t.color=C:t.color=b.fillcolor,t[i+"0"]=u.c2p(E.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(E.pos+_.bPos+_.bdPos,!0),a.tickText(u,u.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var z={},D=["med","min","q1","q3","max"];(b.boxmean||(b.meanline||{}).visible)&&D.push("mean"),(b.boxpoints||b.points)&&D.push("lf","uf");for(var I=0;It.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*o,u=o*h,m=[],g=0;if(r.jitter){if(0===o)for(g=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(c.translatePoints,a,o)}function o(t,e,r,n){var i,a,o=e.pos,c=e.val,u=n.bPos,f=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(l.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+u,!0)+f,n=o.c2p(t.pos+u-i,!0)+f,l=o.c2p(t.pos+u+a,!0)+f,h=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?s.select(this).attr("d","M"+h+","+n+"V"+l+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+h+","+n+"L"+p+","+e+"Z":"")):s.select(this).attr("d","M"+n+","+h+"H"+l+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+h+"L"+e+","+p+"Z":""))})}var s=t("d3"),l=t("../../lib"),c=t("../../components/drawing"),u=2e9,f=5,h=.01;e.exports={plot:function(t,e,r){var n=t._fullLayout,l=e.xaxis,c=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e=t[0],r=e.t,u=e.trace,f=e.node3=s.select(this),h=n._numBoxes,d="group"===n.boxmode&&h>1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?h:1),m=d?2*r.dPos*((r.num+.5)/h-.5)*(1-n.boxgap):0,g=p*u.whiskerwidth;if(!0!==u.visible||r.empty)s.select(this).remove();else{var v,y;"h"===u.orientation?(v=c,y=l):(v=l,y=c),r.bPos=m,r.bdPos=p,r.wdPos=g,i(f,{pos:v,val:y},u,r),u.boxpoints&&a(f,{x:l,y:c},u,r),u.boxmean&&o(f,{pos:v,val:y},u,r)}})},plotBoxAndWhiskers:i,plotPoints:a,plotBoxMean:o}},{"../../components/drawing":643,"../../lib":743,d3:128}],904:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,z=E>0?Math.ceil:Math.floor,D=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,P=C(T+L),O=z(S-L),F=[[u=A(T)]];for(i=P;i*E=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],919:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,f,h,d,p,g,v=[],y=[],x={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,x.length=P,x.crossLength=I,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(h=t.dxydi([],n-1,o,0,s),v.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=P,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],c,i-1,u,1),v.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=r,x.axis=M,x.crossAxis=E,x.value=e,x.constvar=a,x.index=m,x.x=v,x.y=y,x.smoothing=E.smoothing,x}function s(e){var n,i,o,s,l,c=[],u=[],f={};if(f.length=w.length,f.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),f.xy=function(r){return t.evalxy([],r,e)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(x=w[u],b=w[y],l=0;lw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(f=5e-15,d=(h=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+f)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+f))].sort(function(t,e){return t-e}))[0],p=h[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":732,"../../plots/cartesian/axes":789}],920:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],936:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],l=r[0].trace,c=e.xaxis,h=e.yaxis,d=l.aaxis,p=l.baxis,m=t._fullLayout,g=e.plot.selectAll(".carpetlayer"),v=m._clips,y=n(g,"g","carpet"+l.uid).classed("trace",!0),x=n(y,"g","minorlayer"),b=n(y,"g","majorlayer"),_=n(y,"g","boundarylayer"),w=n(y,"g","labellayer");y.style("opacity",l.opacity),a(c,h,b,d,"a",d._gridlines),a(c,h,b,p,"b",p._gridlines),a(c,h,x,d,"a",d._minorgridlines),a(c,h,x,p,"b",p._minorgridlines),a(c,h,_,d,"a-boundary",d._boundarylines),a(c,h,_,p,"b-boundary",p._boundarylines);!function(t,e,r,n,i,a,o,l){var c,u,f,h;c=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],f=r.ab2xy(c,u,!0),h=r.dxyda_rough(c,u),s(t,e,r,n,f,h,r.aaxis,i,a,o,"a-title"),c=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),f=r.ab2xy(c,u,!0),h=r.dxydb_rough(c,u),s(t,e,r,n,f,h,r.baxis,i,a,l,"b-title")}(t,w,l,i,c,h,o(t,c,h,l,i,w,d._labels,"a-label"),o(t,c,h,l,i,w,p._labels,"b-label")),function(t,e,r,i,a){var o,s,l,c,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var d=n(h,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(c.font,i.font).text(i.text).call(d.convertToTspans,t),p=c.bBox(this);u.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*p.height+")"),f=Math.max(f,p.width+i.axis.labelpadding)}),u.exit().remove(),f}function s(t,e,r,n,i,a,o,s,u,f,p){var m=[];o.title&&m.push(o.title);var g=e.selectAll("text."+p).data(m);g.enter().append("text").classed(p,!0),g.each(function(){var e=h(r,s,u,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(f=0),f+=o.titlefont.size+o.titleoffset;l.select(this).text(o.title||"").call(d.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+f+")").classed("user-select-none",!0).attr("text-anchor","middle").call(c.font,o.titlefont)}),g.exit().remove()}var l=t("d3"),c=t("../../components/drawing"),u=t("./map_1d_array"),f=t("./makepath"),h=t("./orient_text"),d=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},f.c2p=function(t){return t},h.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,f.smoothing,h.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t.xctrl,t.yctrl],f.smoothing,h.smoothing),t.dxydj=l([t.xctrl,t.yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,d,p,m=0,g=0,v=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(d=u-2,p=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,d,h,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,d,h,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":761,"./compute_control_points":923,"./constants":924,"./create_i_derivative_evaluator":925,"./create_j_derivative_evaluator":926,"./create_spline_evaluator":927}],938:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){function i(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&o0&&a1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":743}],939:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":981,"./has_columns":929}],940:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plots/attributes":787,"../scattergeo/attributes":1104}],941:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;cl&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":628,"../../lib":743,"./attributes":940}],943:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],944:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,f=u[0].trace,h=t.subplot;for(s=0;s")}(t,f,o,h.mockAxis),[t]}},{"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"./attributes":940}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":820,"../heatmap/colorbar":980,"./attributes":940,"./calc":941,"./defaults":942,"./event_data":943,"./hover":944,"./plot":946,"./select":947,"./style":948}],946:[function(t,e,r){"use strict";function n(t,e){for(var r=t[0].trace,n=t.length,i=s(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,s=t.geometry,l=s.coordinates,c=t.id,u=[];r="RUS"===c||"FJI"===c?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var s=o.tester(n);s.pts.pop(),u.push(s)}:function(t){u.push(o.tester(t))};switch(s.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,f=e._input.contours;if(c>u&&(s.start=f.start=u,u=s.end=f.end=c,c=s.start),!(s.size>0)){var h;h=c===u?1:n(c,u,e.ncontours).dtick,f.size=s.size=h}}return r}},{"../../lib":743,"../../plots/cartesian/axes":789,"../heatmap/calc":978}],951:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,f=c.size||1,h=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":622,"../../plots/plots":852,"./end_plus":955,"./make_color_map":959}],952:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],953:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,"contours.start"),o=n.coerce2(t,e,i,"contours.end"),s=!1===a||!1===o,l=r("contours.size");!(s?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{"../../lib":743,"./attributes":949}],954:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)):e.visible=!1}},{"../../lib":743,"../heatmap/has_columns":984,"../heatmap/xyz_defaults":993,"./attributes":949,"./contours_defaults":953,"./style_defaults":963}],955:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],956:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==l.BOTTOMSTART.indexOf(t)?i=1:-1!==l.LEFTSTART.indexOf(t)?n=1:-1!==l.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),g=[o(t,e,[-m[0],-m[1]])],v=m.join(","),y=t.z.length,x=t.z[0].length;for(f=0;f<1e4;f++){if(p>20?(p=l.CHOOSESADDLE[p][(m[0]||m[1])<0?0:1],t.crossings[d]=l.SADDLEREMAINDER[p]):delete t.crossings[d],!(m=l.NEWDELTA[p])){s.log("Found bad marching index:",p,e,t.level);break}g.push(o(t,e,m)),e[0]+=m[0],e[1]+=m[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),d=e.join(",");var b=m[0]&&(e[0]<0||e[0]>x-2)||m[1]&&(e[1]<0||e[1]>y-2);if(d===h&&m.join(",")===v||r&&b)break;p=t.crossings[d]}1e4===f&&s.log("Infinite loop in contour?");var _,w,M,k,A,T,S,E,L,C,z,D=n(g[0],g[g.length-1],a,c),I=0,P=.2*t.smoothing,O=[],F=0;for(f=1;f=F;f--)if((_=O[f])=F&&_+O[w]E&&L--,t.edgepaths[L]=z.concat(g,C));break}j||(t.edgepaths[E]=g.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r)return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208;return 15===r?0:r}((c=t[u]).level,s))&&(c.crossings[o]=l,-1!==i.indexOf(l)&&(c.starts.push([e,r]),p&&-1!==i.indexOf(l,i.indexOf(l)+1)&&c.starts.push([e,r])))}},{"./constants":952}],961:[function(t,e,r){"use strict";function n(t,e,n){var l=n[0].trace,c=n[0].x,u=n[0].y,g=l.contours,v=l.uid,y=e.xaxis,x=e.yaxis,b=t._fullLayout,_="contour"+v,w=function(t,e,r){for(var n=t.size,i=[],a=p(t),s=t.start;s1e3){o.warn("Too many contours, clipping at 1000",t);break}return i}(g,e,n[0]);if(!0!==l.visible)return b._paper.selectAll("."+_+",.hm"+v).remove(),void b._infolayer.selectAll(".cb"+v).remove();"heatmap"===g.coloring?(l.zauto&&!1===l.autocontour&&(l._input.zmin=l.zmin=g.start-g.size/2,l._input.zmax=l.zmax=l.zmin+w.length*g.size),f(t,e,[n])):(b._paper.selectAll(".hm"+v).remove(),b._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+v).remove()),h(w),d(w);var M=y.c2p(c[0],!0),k=y.c2p(c[c.length-1],!0),A=x.c2p(u[0],!0),T=x.c2p(u[u.length-1],!0),S=[[M,T],[k,T],[k,A],[M,A]],E=r.makeContourGroup(e,n,_);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(E,S,g),function(t,e,r,n){var o=t.selectAll("g.contourfill").data([0]);o.enter().append("g").classed("contourfill",!0);var s=o.selectAll("path").data("fill"===n.coloring?e:[]);s.enter().append("path"),s.exit().remove(),s.each(function(t){var e=i(t,r);e?a.select(this).attr("d",e).style("stroke","none"):a.select(this).remove()})}(E,w,S,g),function(t,e,n,i,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var f=!1!==l.showlines,h=l.showlabels,d=f&&h,p=r.createLines(u,f||h,e),g=r.createLineClip(u,d,n._fullLayout._clips,i.trace.uid),v=t.selectAll("g.contourlabels").data(h?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),h){var y=[c],x=[];o.clearLocationCache();var b=r.labelFormatter(l,i.t.cb,n._fullLayout),_=s.tester.append("text").attr("data-notex",1).call(s.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var A=Math.sqrt(w*w+M*M),T=m.LABELDISTANCE*A/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,b,_,n);a.select(this).selectAll("path").each(function(){var t=o.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/T),m.LABELMAX),i=0;i=0&&(c=x,f=h):Math.abs(l[1]-c[1])<.01?Math.abs(l[1]-x[1])<.01&&(x[0]-l[0])*(c[0]-x[0])>=0&&(c=x,f=h):o.log("endpt to newendpt is not vert. or horz.",l,c,x)}if(l=c,f>=0)break;m+="L"+c}if(f===t.edgepaths.length){o.log("unclosed perimeter path");break}g=f,(y=-1===v.indexOf(g))&&(g=v[0],m+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*a)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*a);if(h<1||d<1)return 1/0;var p=g.EDGECOST*(1/(h-1)+1/(d-1));p+=g.ANGLECOST*c*c;for(var m=s-u,v=l-f,y=s+u,x=l+f,b=0;b2*g.MAXCOST)break;d&&(s/=2),l=(a=c-s/2)+1.5*s}if(h<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=i*u,h=a*c,d=i*c,p=-a*u,m=[[o-f-h,s-d-p],[o+f-h,s+d-p],[o+f+h,s+d+p],[o-f+h,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;a.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(l.convertToTspans,r)}),i){for(var s="",c=0;cx.end&&(x.start=x.end=(x.start+x.end)/2),e._input.contours=a({},x)}else{var _=x.start,w=x.end,M=e._input.contours;if(_>w&&(x.start=M.start=w,w=x.end=M.end=_,_=x.start),!(x.size>0)){var k;k=_===w?1:n(_,w,e.ncontours).dtick,M.size=x.size=k}}return y}}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../carpet/lookup_carpetid":931,"../heatmap/clean_2d_array":979,"../heatmap/convert_column_xyz":981,"../heatmap/find_empties":983,"../heatmap/has_columns":984,"../heatmap/interp2d":987,"../heatmap/make_bound_array":988,"../heatmap/max_row_length":989,"./defaults":971}],966:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-1/0,f=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],967:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],968:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":967,"fast-isnumeric":140}],969:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":968,"fast-isnumeric":140}],970:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":743}],973:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../contour/colorbar":951,"../contour/style":962,"./attributes":964,"./calc":965,"./defaults":971,"./plot":976}],974:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function f(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,b=_):Math.abs(v[1]-y[1])=0&&(y=L,b=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(b>=0)break;M+=m(v,y),v=y}if(b===e.edgepaths.length){a.log("unclosed perimeter path");break}g=b,(A=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;U--)N=k.clipsegments[U],j=l([],N.x,L.c2p),B=l([],N.y,C.c2p),j.reverse(),B.reverse(),q.push(c(j,B,N.bicubic));var H="M"+q.join("L")+"Z";!function(t,e,r,n,i,a){var o,s,u,f,h=t.selectAll("g.contourbg").data([0]);h.enter().append("g").classed("contourbg",!0);var d=h.selectAll("path").data("fill"!==a||i?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(f=0;fx&&(n.max=x);n.len=n.max-n.min}(this,r,t,n,h,e.height),!(n.len<(e.width+e.height)*m.LABELMIN)))for(var s=Math.min(Math.ceil(n.len/D),m.LABELMAX),l=0;lz){r("x scale is not linear");break}}if(y.length&&"fast"===L){var D=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(D/100);for(w=0;wI){r("y scale is not linear");break}}}var P=u(_),O="scaled"===e.xtype?"":m,F=p(e,O,g,v,P,k),R="scaled"===e.ytype?"":y,N=p(e,R,x,b,_.length,A);E||(a.expand(k,F),a.expand(A,N));var j={x:F,y:N,z:_,text:e.text};if(S&&(j.xRanges=M.xRanges,j.yRanges=M.yRanges,j.pts=M.pts),s(e,_,"","z"),T&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=p(B,O,g,v,P,k),j.yfill=p(B,R,x,b,_.length,A)}return[j]}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../../registry":873,"../histogram2d/calc":1010,"./clean_2d_array":979,"./convert_column_xyz":981,"./find_empties":983,"./has_columns":984,"./interp2d":987,"./make_bound_array":988,"./max_row_length":989}],979:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,c;if(e){for(i=0,l=0;l=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":989}],984:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],985:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=b[0].length||d<0||d>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-x[0],r-x[x.length-1])>o)return;if(c){var T;for(k=[2*y[0]-y[1]],T=1;Tm&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":743}],988:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)b=m.c2p(T[k]),k--;for(b0;)M=g.c2p(S[k]),k--;if(M0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c){var l=a(e,i,o),u=a(r,i,o),f=t===s?0:1;return l[f]!==u[f]}return Math.floor(r/t)-Math.floor(e/t)>.1}(h,t,e,l,r,n))break;u=h}return u}function i(t,e){return e&&t>h?t>c?t>1.1*s?s:t>1.1*l?l:c:t>u?u:t>f?f:h:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r){var n=e.c2d(t,s,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var o=t("../../constants/numerical"),s=o.ONEAVGYEAR,l=o.ONEAVGMONTH,c=o.ONEDAY,u=o.ONEHOUR,f=o.ONEMIN,h=o.ONESEC,d=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,l,u=-1.1*e,f=-.1*e,h=t-f,p=r[0],m=r[1],g=Math.min(n(p+f,p+h,i,a),n(m+f,m+h,i,a)),v=Math.min(n(p+u,p+f,i,a),n(m+u,m+f,i,a));if(g>v&&vc){var y=o===s?1:6,x=o===s?"M12":"M1";return function(e,r){var n=i.c2d(e,s,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cp.size/1.9?p.size:p.size/Math.ceil(p.size/b);var T=p.start+(p.size-b)/2;_=T-b*Math.ceil((T-_)/b)}for(f=0;f=0&&w=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}(a,x.direction,x.currentbin);var Z=Math.min(i.length,a.length),J=[],K=0,Q=Z-1;for(r=0;r=K;r--)if(a[r]){Q=r;break}for(r=K;r<=Q;r++)if(o(i[r])&&o(a[r])){var $={p:i[r],s:a[r],b:0};x.enabled||($.pts=z[r],q?$.p0=$.p1=z[r].length?A[z[r][0]]:i[r]:($.p0=X(S[r]),$.p1=X(S[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=l.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),c(J,e),Array.isArray(e.selectedpoints)&&s.tagSelected(J,e,Y),J}}},{"../../constants/numerical":721,"../../lib":743,"../../plots/cartesian/axes":789,"../bar/arrays_to_calcdata":882,"./average":998,"./bin_functions":1e3,"./bin_label_vals":1001,"./clean_bins":1003,"./norm_functions":1008,"fast-isnumeric":140}],1003:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===a?o:1,h=c.size;if(n(h))c.size=h>0?Number(h):f;else if("string"!=typeof h)c.size=f;else{var d=h.charAt(0),p=h.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=f)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],1004:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return i.coerce(t,e,c,r,n)}var h=f("x"),d=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var p=f("orientation",d&&!h?"h":"v"),m=e["v"===p?"x":"y"];if(m&&m.length){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u);e["h"===p?"x":"y"]&&f("histfunc");o(t,e,f,"h"===p?["y"]:["x"]),s(t,e,f,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../components/color":618,"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../bar/style_defaults":895,"./attributes":997,"./bin_defaults":999}],1005:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;t.pointNumbers=a,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex;var o;if(r._indexToPoints){o=[];for(var s=0;sA&&g.splice(A,g.length-A),y.length>A&&y.splice(A,y.length-A),n(e,"x",g,m,_,M,x),n(e,"y",y,v,w,k,b);var T=[],S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,z=[],D=[],I=L?z:e.xbins,P=C?D:e.ybins,O=0,F=[],R=[],N=e.histnorm,j=e.histfunc,B=-1!==N.indexOf("density"),U="max"===j||"min"===j?null:0,V=c.count,q=u[N],H=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(H="avg"===j,V=c[j]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-l.tickIncrement(Z,X.size,!1,x))/1e6;for(r=Z;r=0&&d=0&&p0)o=c(t.alphahull,h);else{var d=["x","y","z"].indexOf(t.delaunayaxis);o=l(h.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:h,cells:o,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:f(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=function(t){return t.map(function(t){var e=t[0],r=s(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=i(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=i(t.facecolor)):(this.color=t.color,p.meshColor=f(t.color)),this.mesh.update(p)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=o({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":765,"alpha-shape":47,"convex-hull":109,"delaunay-triangulate":130,"gl-mesh3d":210,tinycolor2:546}],1022:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),f=c(["i","j","k"]);if(u){f&&f.forEach(function(t){for(var e=0;ei?r=!0:e1)){var f=a.simpleMap(u.x,e.d2c,0,r.xcalendar),h=a.distinctVals(f).minDiff;o=Math.min(o,h)}}for(o===1/0&&(o=1),c=0;c");S.push(o,o,o,o,o,o,null)},R=0;Rs&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),c.splice(s)),l=0;l0)&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),f=Math.min(f,o.values.length)),o._index=l,u.push(o));if(isFinite(f))for(l=0;lf&&(o.values=o.values.slice(0,f));return u}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var f={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",f),n.coerceFont(c,"tickfont",f),n.coerceFont(c,"rangefont",f)}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"../../lib":743,"./attributes":1031,"./constants":1035}],1037:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1031,"./base_plot":1032,"./calc":1033,"./colorbar":1034,"./defaults":1036,"./plot":1040}],1038:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function i(t,e,r,i,a,o){function s(c){var u;u=Math.min(i,a-c*i),o.offset=h*c*i,o.count=h*u,0===c&&(window.cancelAnimationFrame(r.currentRafs[l]),delete r.currentRafs[l],n(t,o.scissorX,o.scissorY,o.scissorWidth,o.viewBoxSize[1])),r.clearOnly||(e(o),c*i+u>>8*e)%256/255}function s(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i=f-4?o(s,f-2-l):.5);return i}(E,S,T,C),O=s(E,P),F=e.regl,R=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?p:a).concat(r))}return n}(w,M,Math.round(255*(M?z:1)))}),N=F({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:k?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:R,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),j=[0,1],B=[];return{setColorDomain:function(t){j[0]=t[0],j[1]=t[1]},render:function(t,e,a){var o,s,l,c=1/0,f=-1/0;for(o=0;of&&(f=t[o].dim2.canvasX,l=o),t[o].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t){return d.scale.linear().domain(i(t))}function s(t,e,r){var i=v(e),a=i.trace,s=i.lineColor,l=i.cscale,c=a.line,u=a.domain,p=a.dimensions,m=t.width,g=a.labelfont,y=a.tickfont,x=a.rangefont,b=h.extendDeep({},c,{color:s.map(o({values:s,range:[c.cmin,c.cmax]})),blockLineCount:f.blockLineCount,canvasOverdrag:f.overdrag*f.canvasPixelRatio}),_=Math.floor(m*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w;return{key:r,colCount:p.filter(n).length,dimensions:p,tickDistance:f.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return d.rgb(t)}),n="rgb".split("").map(function(t){return d.scale.linear().clamp(!0).domain(e).range(r.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return n.map(function(e){return e(t)})}}(l),lines:b,labelFont:g,tickFont:y,rangeFont:x,layoutWidth:m,layoutHeight:t.height,domain:u,translateX:u.x[0]*m,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*f.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:A*f.canvasPixelRatio,width:k,height:A,canvasPixelRatio:f.canvasPixelRatio}}function l(t){var e=t.width,r=t.height,a=t.dimensions,s=t.canvasPixelRatio,l=function(r){return e*r/Math.max(1,t.colCount-1)},c=f.verticalPadding/(r*s),u=1-2*c,h=function(t){return c+u*t},p={key:t.key,xScale:l,model:t},m={};return p.dimensions=a.filter(n).map(function(e,n){var a=o(e),c=m[e.label];m[e.label]=(c||0)+1;return{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:f.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(h),xScale:l,x:l(n),canvasX:l(n)*s,unitScale:function(t,e){return d.scale.linear().range([t-e,e])}(r,f.verticalPadding),domainScale:function(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?d.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(d.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):d.scale.linear().domain(n).range([t-e,e])}(r,f.verticalPadding,e),ordinalScale:function(t){var e=i(t);return t.tickvals&&d.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function c(t){t.classed(f.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var u=t("./lines"),f=t("./constants"),h=t("../../lib"),d=t("d3"),p=t("../../components/drawing"),m=t("../../lib/gup").keyFun,g=t("../../lib/gup").repeat,v=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i,o){function y(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function x(t,e){return(f.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,f={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==L&&(c?o.hover(f):o.unhover&&o.unhover(f),L=u)}}),S.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var C=e.selectAll("."+f.cn.parcoords).data(T,m);C.exit().remove(),C.enter().append("g").classed(f.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(g,m);e.enter().append("defs");var r=e.selectAll("#"+f.id.filterBarPattern).data(g,m);r.enter().append("pattern").attr("id",f.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-f.bar.width).attr("width",f.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(g,m);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",f.bar.width).attr("x",f.bar.width/2).attr("fill",f.bar.fillcolor).attr("fill-opacity",f.bar.fillopacity).attr("stroke",f.bar.strokecolor).attr("stroke-opacity",f.bar.strokeopacity).attr("stroke-width",f.bar.strokewidth)}),C.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var z=C.selectAll("."+f.cn.parcoordsControlView).data(g,m);z.enter().append("g").classed(f.cn.parcoordsControlView,!0).style("box-sizing","content-box"),z.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var D=z.selectAll("."+f.cn.yAxis).data(function(t){return t.dimensions},m);D.enter().append("g").classed(f.cn.yAxis,!0).each(function(t){E.dimensions.push(t)}),z.each(function(t){x(D,t)}),S.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=u(this,t,f.scatter),t.viewModel[t.key]=t.lineLayer,E.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),D.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),D.call(d.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;A=!1,k||(t.x=Math.max(-f.overdrag,Math.min(t.model.width+f.overdrag,d.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,D.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),x(D,e),D.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),d.select(this).attr("transform","translate("+t.x+", 0)"),D.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;k?"ending"===k&&(k=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,x(D,e),d.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),D.exit().remove();var I=D.selectAll("."+f.cn.axisOverlays).data(g,m);I.enter().append("g").classed(f.cn.axisOverlays,!0),I.selectAll("."+f.cn.axis).remove();var P=I.selectAll("."+f.cn.axis).data(g,m);P.enter().append("g").classed(f.cn.axis,!0),P.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),p.font(P.selectAll("text"),t.model.tickFont)}),P.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),P.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var O=I.selectAll("."+f.cn.axisHeading).data(g,m);O.enter().append("g").classed(f.cn.axisHeading,!0);var F=O.selectAll("."+f.cn.axisTitle).data(g,m);F.enter().append("text").classed(f.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-f.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){p.font(F,t.model.labelFont)});var R=I.selectAll("."+f.cn.axisExtent).data(g,m);R.enter().append("g").classed(f.cn.axisExtent,!0);var N=R.selectAll("."+f.cn.axisExtentTop).data(g,m);N.enter().append("g").classed(f.cn.axisExtentTop,!0),N.attr("transform","translate(0,"+-f.axisExtentOffset+")");var j=N.selectAll("."+f.cn.axisExtentTopText).data(g,m);j.enter().append("text").classed(f.cn.axisExtentTopText,!0).call(c),j.text(function(t){return b(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){p.font(j,t.model.rangeFont)});var B=R.selectAll("."+f.cn.axisExtentBottom).data(g,m);B.enter().append("g").classed(f.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+f.axisExtentOffset)+")"});var U=B.selectAll("."+f.cn.axisExtentBottomText).data(g,m);U.enter().append("text").classed(f.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(c),U.text(function(t){return b(t)(t.domainScale.domain()[0])}).each(function(t){p.font(U,t.model.rangeFont)});var V=I.selectAll("."+f.cn.axisBrush).data(g,m),q=V.enter().append("g").classed(f.cn.axisBrush,!0);V.each(function(t){t.brush||(t.brush=d.svg.brush().y(t.unitScale).on("brushstart",_).on("brush",w).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),d.select(this).call(t.brush))}),q.selectAll("rect").attr("x",-f.bar.capturewidth/2).attr("width",f.bar.capturewidth),q.selectAll("rect.extent").attr("fill","url(#"+f.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),q.selectAll(".resize rect").attr("height",f.bar.handleheight).attr("opacity",0).style("visibility","visible"),q.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",f.bar.handleoverlap-f.bar.handleheight),q.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",f.bar.handleoverlap);var H=!1,G=!1;return E}},{"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1035,"./lines":1038,d3:128}],1040:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},f=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1039,regl:506}],1041:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../plots/domain_attributes"),s=t("../../lib/extend").extendFlat,l=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},l,{}),insidetextfont:s({},l,{}),outsidetextfont:s({},l,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1042:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n")}}return y};var l},{"../../components/color":618,"./helpers":1046,"fast-isnumeric":140,tinycolor2:546}],1044:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),h=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),h&&"none"!==h){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":743,"./attributes":1041}],1045:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":657}],1046:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}var a=t("d3"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./helpers"),f=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,f=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===f.indexOf(s.scalegroup)&&f.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}(e),h.each(function(){var h=a.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove();var m=[[[],[]],[[],[]]],g=!1;h.each(function(e){function s(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)a.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var h=d.cx,v=d.cy,y=a.select(this),x=y.selectAll("path.surface").data([e]),b=!1,_=!1;if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==i.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=o.castHoverinfo({hoverinfo:[u.castOption(l,e.pts)],_module:p._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var c=n(e,d),m=h+e.pxmid[0]*(1-c),g=v+e.pxmid[1]*(1-c),y=r.separators,x=[];if(-1!==l.indexOf("label")&&x.push(e.label),-1!==l.indexOf("text")){var w=u.castOption(s.hovertext||s.text,e.pts);w&&x.push(w)}-1!==l.indexOf("value")&&x.push(u.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&x.push(u.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;o.loneHover({x0:m-c*d.r,x1:m+c*d.r,y:g,text:x.join("
"),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:u.castOption(M.bgcolor,e.pts)||e.color,borderColor:u.castOption(M.bordercolor,e.pts),fontFamily:u.castOption(k.family,e.pts),fontSize:u.castOption(k.size,e.pts),fontColor:u.castOption(k.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[f(e,s)],event:a.event}),_=!0}}).on("mouseout",function(r){var n=t._fullLayout,i=t._fullData[p.index];_&&(r.originalEvent=a.event,t.emit("plotly_unhover",{points:[f(e,i)],event:a.event}),_=!1),b&&(o.loneUnhover(n._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,n=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[f(e,n)],o.click(t,a.event))}),p.pull){var w=+u.castOption(p.pull,e.pts)||0;w>0&&(h+=w*e.pxmid[0],v+=w*e.pxmid[1])}e.cxFinal=h,e.cyFinal=v;var M=p.hole;if(e.v===d.vTotal){var k="M"+(h+e.px0[0])+","+(v+e.px0[1])+s(e.px0,e.pxmid,!0,1)+s(e.pxmid,e.px0,!0,1)+"Z";M?x.attr("d","M"+(h+M*e.px0[0])+","+(v+M*e.px0[1])+s(e.px0,e.pxmid,!1,M)+s(e.pxmid,e.px0,!1,M)+"Z"+k):x.attr("d",k)}else{var A=s(e.px0,e.px1,!0,1);if(M){var T=1-M;x.attr("d","M"+(h+M*e.px1[0])+","+(v+M*e.px1[1])+s(e.px1,e.px0,!1,M)+"l"+T*e.px0[0]+","+T*e.px0[1]+A+"Z")}else x.attr("d","M"+h+","+v+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var S=u.castOption(p.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=a.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,"outside"===S?p.outsidetextfont:p.insidetextfont).call(c.convertToTspans,t);var o,s=l.bBox(r.node());"outside"===S?o=i(s,e):(o=function(t,e,r){var i=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=n(e,r),c={scale:l*r.r*2/i,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>h.scale?g:h;return c.scale<1&&v.scale>c.scale?v:c}(s,e,d),"auto"===S&&o.scale<1&&(r.call(l.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(s=l.bBox(r.node())),o=i(s,e)));var u=h+e.pxmid[0]*o.rCenter+(o.x||0),f=v+e.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(e.yLabelMin=f-s.height/2,e.yLabelMid=f,e.yLabelMax=f+s.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+u+","+f+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}}),g&&function(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,d=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),p=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,v=t.cyFinal+c(t.px0[1],t.px1[1]),y=d-p;if(y*h>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(i=0;i=(u.castOption(e.pull,a.pts)||0)||((t.pxmid[1]-a.pxmid[1])*h>0?(y=a.cyFinal+c(a.px0[1],a.px1[1])-p-t.labelExtraY)*h>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*h>0&&(n=3*f*Math.abs(i-m.indexOf(t)),(s=a.cxFinal+l(a.px0[0],a.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*f>0&&(t.labelExtraX+=s)))}var a,o,s,l,c,f,h,d,p,m,g,v,y;for(o=0;o<2;o++)for(s=o?r:n,c=o?Math.max:Math.min,h=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,f=a?1:-1,(d=t[o][a]).sort(s),p=t[1-o][a],m=p.concat(d),v=[],g=0;gMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(s.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){h.selectAll("tspan").each(function(){var t=a.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":618,"../../components/drawing":643,"../../components/fx":660,"../../lib/svg_text_utils":766,"./event_data":1045,"./helpers":1046,d3:128}],1051:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1052,d3:128}],1052:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":618,"./helpers":1046}],1053:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scatter/attributes":1066}],1054:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),o=t("../scatter/get_trace_color"),s=["xaxis","yaxis"],l=n.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,i,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);if(h)r=h;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=a(t.marker.color),m=a(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,x/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[s[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new n(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":765,"../scatter/get_trace_color":1076,"gl-pointcloud2d":235}],1055:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":743,"./attributes":1053}],1056:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":829,"../scatter3d/calc":1092,"./attributes":1053,"./convert":1054,"./defaults":1055}],1057:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain_attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;e.exports=c({hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":617,"../../components/fx/attributes":652,"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1058:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":661,"../../plot_api/edit_types":773,"../../plots/get_data":826,"./plot":1063}],1059:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":743,"../../lib/gup":740,"strongly-connected-components":537}],1060:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1061:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}c("node.label"),c("node.pad"),c("node.thickness"),c("node.line.color"),c("node.line.width");c("node.color",e.node.label.map(function(t,e){return o.addOpacity(function(t){return a[t%a.length]}(e),.8)})),c("link.label"),c("link.source"),c("link.target"),c("link.value"),c("link.line.color"),c("link.line.width"),c("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),c("domain.x"),c("domain.y"),c("orientation"),c("valueformat"),c("valuesuffix"),c("arrangement"),n.coerceFont(c,"textfont",n.extendFlat({},l.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":618,"../../components/color/attributes":617,"../../lib":743,"./attributes":1057,tinycolor2:546}],1062:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1057,"./base_plot":1058,"./calc":1059,"./defaults":1061,"./plot":1063}],1063:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+x.sankeyNode).filter(l(t)).call(c)}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(x.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),x=t("./constants").cn,b=y._;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=b(t,"source:")+" ",y=b(t,"target:")+" ",_=b(t,"incoming flow count:")+" ",w=b(t,"outgoing flow count:")+" ";m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,r,n){p.select(e).call(f.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,c=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left+u.width/2,h=u.top+u.height/2,m=g.loneHover({x:f-c.left,y:h-c.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",l+i.link.source.label,y+i.link.target.label].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},unhover:function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())},select:function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(u,r,n),g.click(t,{target:!0})}}})}},{"../../components/color":618,"../../components/fx":660,"../../lib":743,"./constants":1060,"./render":1064,d3:128}],1064:[function(t,e,r){"use strict";function n(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function i(t){return function(e){return e.node.originalX===t.node.originalX}}function a(t){for(var e=0;e1||t.linkLineWidth>0}function h(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function d(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function p(t){return w.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+_.nodeTextOffsetHorizontal:_.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-_.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-_.nodeTextOffsetHorizontal,0]])}function m(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function g(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function v(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function y(t){return t.horizontal&&t.left?"100%":"0%"}function x(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function b(t,e,r){var a=w.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(E.raiseToTop(this),a.interactionState.dragInProgress=a.node,n(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+Math.floor(a.node.originalX);a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=S.forceSimulation(n).alphaDecay(0).force("collide",S.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(_.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}(0,e,n,r)).stop()}(0,o,a),function(t,e,r,n){window.requestAnimationFrame(function a(){for(var o=0;o<_.forceTicksPerFrame;o++)r.forceLayouts[n].tick();r.sankey.relayout(),c(t.filter(i(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,a,o)}}).on("drag",function(r){if("fixed"!==r.arrangement){var a=w.event.x,o=w.event.y;"snap"===r.arrangement?(r.node.x=a,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=a),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),n(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),c(t.filter(i(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}var _=t("./constants"),w=t("d3"),M=t("tinycolor2"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("@plotly/d3-sankey").sankey,S=t("d3-force"),E=t("../../lib"),L=t("../../lib/gup").keyFun,C=t("../../lib/gup").repeat,z=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n){var i=t.selectAll("."+_.cn.sankey).data(e.filter(function(t){return z(t).trace.visible}).map(function(t,e,r){for(var n,i=z(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,u="h"===i.orientation,f=i.node.pad,h=i.node.thickness,d=i.node.line.color,p=i.node.line.width,m=i.link.line.color,g=i.link.line.width,v=i.valueformat,y=i.valuesuffix,x=i.textfont,b=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{pointNumber:e,label:t,color:E.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{pointNumber:e,label:l.label[e],color:E.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),A=T().size(u?[b,w]:[w,b]).nodeWidth(h).nodePadding(f).nodes(M).links(k).layout(_.sankeyIterations),S=A.nodes(),L=0;L5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),R.transition().ease(_.ease).duration(_.duration).attr("startOffset",y).style("fill",v)}},{"../../components/color":618,"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1060,"@plotly/d3-sankey":41,d3:128,"d3-force":124,tinycolor2:546}],1065:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;re&&l.splice(e,l.length-e),l.map(r)}return r(n.size)}}var i=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("./subtypes"),l=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),h=r.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=Math.min(h.length,d.length);r._minDtick=0,f._minDtick=0,h.length>p&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0},v=n(e,p);v&&(m.ppad=g.ppad=v),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(s.hasMarkers(e)||s.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,a.expand(r,h,m),a.expand(f,d,g);for(var y=new Array(p),x=0;x=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1070:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1071:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":625,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1072:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1073:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=(F=z[L][1])>=H&&(I=z[L-1][0],P=z[L][0],F-O&&(D=I+(P-I)*(H-O)/(F-O),B=Math.min(B,D),U=Math.max(U,D)));B=Math.max(B,0),U=Math.min(U,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),n.extendFlat(t,{distance:c+10,x0:B,x1:U,y0:H,y1:H,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":618,"../../components/errorbars":649,"../../components/fx":660,"../../lib":743,"./fill_hover_text":1074,"./get_trace_color":1076}],1078:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"./arrays_to_calcdata":1065,"./attributes":1066,"./calc":1067,"./clean_data":1069,"./colorbar":1070,"./defaults":1073,"./hover":1077,"./plot":1085,"./select":1086,"./style":1087,"./subtypes":1088}],1079:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],1080:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=t[e],i=P.c2p(r.x),a=O.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function l(t){var e=t[0]/P._length,r=t[1]/O._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=nt[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)tt||t[1]rt)return[o(t[0],$,tt),o(t[1],et,rt)]}function h(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function d(t,e){var r=[],n=f(t),i=f(e);return n&&i&&h(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=f(n),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){(o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c}return l}}function m(t){var e=t[0],r=t[1],n=e===q[H-1][0],i=r===q[H-1][1];if(!n||!i)if(H>1){var a=e===q[H-2][0],o=r===q[H-2][1];n&&(e===$||e===tt)&&a?o?H--:q[H-1]=t:i&&(r===et||r===rt)&&o?a?H--:q[H-1]=t:q[H++]=t}else q[H++]=t}function g(t){q[H-1][0]!==t[0]&&q[H-1][1]!==t[1]&&m([W,X]),m(t),Z=null,W=X=0}function v(t){if(G=t[0]<$?$:t[0]>tt?tt:0,Y=t[1]rt?rt:0,G||Y){if(H)if(Z){var e=K(Z,t);e.length>1&&(g(e[0]),q[H++]=e[1])}else J=K(q[H-1],t)[0],q[H++]=J;else q[H++]=[G||t[0],Y||t[1]];var r=q[H-1];G&&Y&&(r[0]!==G||r[1]!==Y)?(Z&&(W!==G&&X!==Y?m(W&&X?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?$:tt,rt]:[n>0?tt:$,et]}(Z,t):[W||G,X||Y]):W&&X&&m([W,X])),m([G,Y])):W-G&&X-Y&&m([G||W,Y||X]),Z=t,W=G,X=Y}else Z&&g(K(Z,t)[0]),q[H++]=t}var y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P=e.xaxis,O=e.yaxis,F=e.simplify,R=e.connectGaps,N=e.baseTolerance,j=e.shape,B="linear"===j,U=[],V=s.minTolerance,q=new Array(t.length),H=0;F||(N=V=-1);var G,Y,W,X,Z,J,K,Q=s.maxScreensAway,$=-P._length*Q,tt=P._length*(1+Q),et=-O._length*Q,rt=O._length*(1+Q),nt=[[$,et,tt,et],[tt,et,tt,rt],[tt,rt,$,rt],[$,rt,$,et]];for("linear"===j||"spline"===j?K=u:"hv"===j||"vh"===j?K=d:"hvh"===j?K=p(0,$,tt):"vhv"===j&&(K=p(1,et,rt)),y=0;yl(M))break;b=M,(C=T[0]*A[0]+T[1]*A[1])>E?(E=C,_=M,k=!1):C=t.length||!M)break;v(M),x=M}}else v(_)}Z&&m([W||Z[0],X||Z[1]]),U.push(q.slice(0,H))}return U}},{"../../constants/numerical":721,"../../lib":743,"./constants":1072}],1081:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1082:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i=null,a=0;a0?Math.max(e,i):0}}},{"fast-isnumeric":140}],1084:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;if(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1085:[function(t,e,r){"use strict";function n(t,e,r,n,u,h,d){function p(t){return _?t.transition():t}function m(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function v(){return!1}function y(e){var n,s=e[0].trace,c=i.select(this),u=l.hasMarkers(s),f=l.hasText(s),h=function(t){if(t.ids)return g}(s),d=v,y=v;u&&(d=s.marker.maxdisplayed||s._needsCull?m:a.identity),f&&(y=s.marker.maxdisplayed||s._needsCull?m:a.identity);var x=(n=c.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);_&&x.call(o.pointStyle,s,t).call(o.translatePoints,w,M).style("opacity",0).transition().style("opacity",1);var b=u&&o.tryColorscale(s.marker,""),k=u&&o.tryColorscale(s.marker,"line");n.order(),n.each(function(e){var n=i.select(this),a=p(n);o.translatePoint(e,a,w,M)?(o.singlePointStyle(e,a,s,b,k,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,w,M,s.xcalendar,s.ycalendar),s.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),_?n.exit().transition().style("opacity",0).remove():n.exit().remove(),(n=c.selectAll("g").data(y,h)).enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=i.select(this),n=p(e.select("text"));o.translatePoint(t,n,w,M)?r.layerClipId&&o.hideOutsideRangePoint(t,e,w,M,s.xcalendar,s.ycalendar):e.remove()}),n.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=w.c2p(t.x),r=M.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){p(i.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var x,b;!function(t,e,r,n,o){var s=r.xaxis,c=r.yaxis,u=i.extent(a.simpleMap(s.range,s.r2c)),f=i.extent(a.simpleMap(c.range,c.r2c)),h=n[0].trace;if(!l.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0,w=r.xaxis,M=r.yaxis,k=n[0].trace,A=k.line,T=i.select(h);if(T.call(s.plot,r,d),!0===k.visible){p(T).style("opacity",k.opacity);var S,E,L=k.fill.charAt(k.fill.length-1);"x"!==L&&"y"!==L&&(L=""),n[0].node3=T;var C="",z=[],D=k._prevtrace;D&&(C=D._prevRevpath||"",E=D._nextFill,z=D._polygons);var I,P,O,F,R,N,j,B,U,V="",q="",H=[],G=a.noop;if(S=k._ownFill,l.hasLines(k)||"none"!==k.fill){for(E&&E.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(A.shape)?(O=o.steps(A.shape),F=o.steps(A.shape.split("").reverse().join(""))):O=F="spline"===A.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),A.smoothing):o.smoothopen(t,A.smoothing)}:function(t){return"M"+t.join("L")},R=function(t){return F(t.reverse())},H=c(n,{xaxis:w,yaxis:M,connectGaps:k.connectgaps,baseTolerance:Math.max(A.width||1,3)/4,shape:A.shape,simplify:A.simplify}),U=k._polygons=new Array(H.length),b=0;b1){var r=i.select(this);if(r.datum(n),t)p(r.style("opacity",0).attr("d",I).call(o.lineGroupStyle)).style("opacity",1);else{var a=p(r);a.attr("d",I),o.singleLineStyle(n,a)}}}}}var Y=T.selectAll(".js-line").data(H);p(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(G(!0)),o.setClipUrl(Y,r.layerClipId),H.length&&(S?N&&B&&(L?("y"===L?N[1]=B[1]=M.c2p(0,!0):"x"===L&&(N[0]=B[0]=w.c2p(0,!0)),p(S).attr("d","M"+B+"L"+N+"L"+V.substr(1)).call(o.singleFillStyle)):p(S).attr("d",V+"Z").call(o.singleFillStyle)):"tonext"===k.fill.substr(0,6)&&V&&C&&("tonext"===k.fill?p(E).attr("d",V+"Z"+C+"Z").call(o.singleFillStyle):p(E).attr("d",V+"L"+C.substr(1)+"Z").call(o.singleFillStyle),k._polygons=k._polygons.concat(z)),k._prevRevpath=q,k._prevPolygons=U);var W=T.selectAll(".points");x=W.data([n]),W.each(y),x.enter().append("g").classed("points",!0).each(y),x.exit().remove(),x.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(i.select(this),e?null:r.layerClipId)})}}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./line_points"),u=t("./link_traces"),f=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,c,f,h,d=e.plot.select("g.scatterlayer"),p=!a,m=!!a&&a.duration>0;for((f=d.selectAll("g.trace").data(r,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),u(t,e,r),function(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=i.select(this);if((n=t[0].trace)._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,d,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),m){s&&(h=s());i.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)})})}else d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)});p&&f.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/polygon":755,"./line_points":1080,"./link_traces":1082,"./subtypes":1088,d3:128}],1086:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}(e.textposition),r.textColor=g(e.textfont,1,S),r.textSize=o(e.textfont.size,S,p.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var D=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var I=e.projection[D[n]];(r.project[n]=I.show)&&(r.projectOpacity[n]=I.opacity,r.projectScale[n]=I.scale)}r.errorBounds=b(e,d);var P=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=m(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=P.color,r.errorLineWidth=P.lineWidth,r.errorCapSize=P.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=m(e.surfacecolor),r}function l(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}var c=t("gl-line3d"),u=t("gl-scatter3d"),f=t("gl-error3d"),h=t("gl-mesh3d"),d=t("delaunay-triangulate"),p=t("../../lib"),m=t("../../lib/str2rgbarray"),g=t("../../lib/gl_format_color"),v=t("../scatter/make_bubble_size_func"),y=t("../../constants/gl3d_dashes"),x=t("../../constants/gl3d_markers"),b=t("./calc_errors"),_=n.prototype;_.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},_.update=function(t){var e,r,n,i,a=this.scene.glplot.gl,o=y.solid;this.data=t;var p=s(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in y&&(o=y[p.lineDashes]),this.color=l(p.scatterColor)||l(p.lineColor),this.dataPoints=p.position,e={gl:a,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:o[0],dashScale:o[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=c(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var m=t.opacity;if(t.marker&&t.marker.opacity&&(m*=t.marker.opacity),r={gl:a,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:m,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=u(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),i={gl:a,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(i):(this.textMarkers=u(i),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=f(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n=0&&h("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];h(v+".show")&&(h(v+".opacity"),h(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../scatter/line_defaults":1079,"../scatter/marker_defaults":1084,"../scatter/subtypes":1088,"../scatter/text_defaults":1089,"./attributes":1091}],1096:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":719,"../../plots/gl3d":832,"../scatter/colorbar":1070,"./attributes":1091,"./calc":1092,"./convert":1094,"./defaults":1095}],1097:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1098:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e.a.length,d=new Array(h),p=!1;for(c=0;c0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(h.hi||d.hoverinfo).split("+"),g=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,h.a),-1!==m.indexOf("b")&&a(p.baxis,h.b);var v=p.ab2ij([h.a,h.b]),y=Math.floor(v[0]),x=v[0]-y,b=Math.floor(v[1]),_=v[1]-b,w=p.evalxy([],y,b,x,_);return g.push("y: "+w[1].toFixed(3)),s.extraText=g.join("
"),o}}},{"../scatter/hover":1077}],1102:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1097,"./calc":1098,"./defaults":1099,"./event_data":1100,"./hover":1101,"./plot":1103}],1103:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}(u,g,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076,"./attributes":1104}],1109:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":820,"../scatter/colorbar":1070,"./attributes":1104,"./calc":1105,"./defaults":1106,"./event_data":1107,"./hover":1108,"./plot":1110,"./select":1111,"./style":1112}],1110:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");e.exports=function(t,e,r){function f(t,e){t.lonlat[0]===a&&n.select(e).remove()}for(var h=0;h1,f=r.error_x&&!0===r.error_x.visible,h=r.error_y&&!0===r.error_y.visible,p=f||h,m=d.hasMarkers(r),x=!!r.fill&&"none"!==r.fill);var E,L,C,z,D,I,O,F,R=p?l.calcFromTrace(r,b):null;if(f){(C={}).positions=n;var N=new Float64Array(4*_);if("log"===T.type)for(o=0;o<_;++o)N[k++]=n[2*o]-T.d2l(R[o].xs)||0,N[k++]=T.d2l(R[o].xh)-n[2*o]||0,N[k++]=0,N[k++]=0;else for(o=0;o<_;++o)N[k++]=n[2*o]-R[o].xs||0,N[k++]=R[o].xh-n[2*o]||0,N[k++]=0,N[k++]=0;r.error_x.copy_ystyle&&(r.error_x=r.error_y),C.errors=N,C.capSize=2*r.error_x.width,C.lineWidth=r.error_x.thickness,C.color=r.error_x.color}if(h){(z={}).positions=n;var j=new Float64Array(4*_);if("log"===S.type)for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-S.d2l(R[o].ys)||0,j[A++]=S.d2l(R[o].yh)-n[2*o+1]||0;else for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-R[o].ys||0,j[A++]=R[o].yh-n[2*o+1]||0;z.errors=j,z.capSize=2*r.error_y.width,z.lineWidth=r.error_y.thickness,z.color=r.error_y.color}if(s){(E={}).thickness=r.line.width,E.color=r.line.color,E.opacity=r.opacity,E.overlay=!0;var B=(v[r.line.dash]||[1]).slice();for(o=0;oP?"rect":m?"rect":"round",U&&r.connectgaps){var V=F[0],q=F[1];for(o=0;os&&(A[0]=s),A[1]l&&(T[0]=l),T[1]=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),h=e-f;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([h,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+f,p[1]],g=c.c2p(m),v=u.c2p(m),y=d.mrc||1;return t.x0=g-y,t.x1=g+y,t.y0=v-y,t.y1=v+y,t.color=i(l,d),t.extraText=function(t,e,r){function n(t){return t+"\xb0"}var i=(e.hi||t.hoverinfo).split("+"),o=-1!==i.indexOf("all"),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),c=e.lonlat,u=[];return o||s&&l?u.push("("+n(c[0])+", "+n(c[1])+")"):s?u.push(r.lon+n(c[0])):l&&u.push(r.lat+n(c[1])),(o||-1!==i.indexOf("text"))&&a(e,t,u),u.join("
")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076}],1121:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){if(e){e[0].trace._glTrace.update(e)}},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":846,"../scatter/colorbar":1070,"../scattergeo/calc":1105,"./attributes":1116,"./defaults":1118,"./event_data":1119,"./hover":1120,"./plot":1122,"./select":1123}],1122:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1117}],1123:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(!n.hasMarkers(h))return[];if(!1===e)for(s=0;s")}var i=t("../scatter/hover"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports={hoverPoints:function(t,e,r,a){var o=i(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtWithinSector(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,s.extraText=n(c,u,l),o}},makeHoverPointText:n}},{"../../lib":743,"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1128:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":855,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1124,"./calc":1125,"./defaults":1126,"./hover":1127,"./plot":1129}],1129:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var a,o,s,l={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.circle:null},c=e.radialAxis,u=c.range;for(s=u[0]>u[1]?function(t){return t<=0}:function(t){return t>=0},a=0;a=0?(g=o.c2r(m)-l[0],y=d(v),E[p]=S[2*p]=g*Math.cos(y),L[p]=S[2*p+1]=g*Math.sin(y)):E[p]=L[p]=S[2*p]=S[2*p+1]=NaN;var C=a.sceneOptions(t,e,b,S);C.fill&&!u.fill2d&&(u.fill2d=!0),C.marker&&!u.scatter2d&&(u.scatter2d=!0),C.line&&!u.line2d&&(u.line2d=!0),!C.errorX&&!C.errorY||u.error2d||(u.error2d=!0),c.hasMarkers(b)&&(C.selected.positions=C.unselected.positions=C.marker.positions),u.lineOptions.push(C.line),u.errorXOptions.push(C.errorX),u.errorYOptions.push(C.errorY),u.fillOptions.push(C.fill),u.markerOptions.push(C.marker),u.selectedOptions.push(C.selected),u.unselectedOptions.push(C.unselected),u.count=r.length,_.scene=u,_.index=h,_.x=E,_.y=L,_.rawx=E,_.rawy=L,_.r=w,_.theta=M,_.positions=S,_.count=T,_.tree=n(S,512)}}),a.plot(t,e,r)},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,c=a.hoverPoints(t,e,r,n);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var f=t.subplot,h=f.angularAxis,d=u.cd[u.index],p=u.trace;if(d.r=o[u.index],d.theta=s[u.index],d.rad=h.c2rad(d.theta,p.thetaunit),f.isPtWithinSector(d))return u.xLabelVal=void 0,u.yLabelVal=void 0,u.extraText=l(d,p,f),c}},style:a.style,selectPoints:a.selectPoints,meta:{}}},{"../../plots/cartesian/axes":789,"../../plots/polar":855,"../scatter/colorscale_calc":1071,"../scatter/subtypes":1088,"../scattergl":1115,"../scatterpolar/hover":1127,"./attributes":1130,"./defaults":1131,"fast-isnumeric":140,kdgrass:292}],1133:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:s,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker"),{showscale:c.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../components/drawing/attributes":642,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1134:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,d,p,m=t._fullLayout[e.subplot].sum,g=e.sum||m;for(r=0;r"),s}}},{"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1138:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":866,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1133,"./calc":1134,"./defaults":1135,"./event_data":1136,"./hover":1137,"./plot":1139}],1139:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null};n(t,a,r)}},{"../scatter/plot":1085}],1140:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:i.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:i.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var i=t("../../components/color"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=e.exports=l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:a.zauto,cmin:a.zmin,cmax:a.zmax,colorscale:a.colorscale,autocolorscale:s({},a.autocolorscale,{dflt:!1}),reversescale:a.reversescale,showscale:a.showscale,colorbar:o,contours:{x:n(),y:n(),z:n()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":618,"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plot_api/edit_types":773}],1141:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":625}],1142:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,c=r.cmin,u=r.cmax,f=r.surfacecolor||r.z;if(n(c)||(c=i.aggNums(Math.min,null,f)),n(u)||(u=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1143:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=o(new Float32Array(r[0]*r[1]),r);return c.assign(n.lo(1,1).hi(e[0],e[1]),t),c.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),c.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),c.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),c.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}var a=t("gl-surface3d"),o=t("ndarray"),s=t("ndarray-homography"),l=t("ndarray-fill"),c=t("ndarray-ops"),u=t("tinycolor2"),f=t("../../lib/str2rgbarray"),h=128,d=n.prototype;d.handlePick=function(t){if(t.object===this.surface){var e=t.index=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},d.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},d.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,c=t.opacity,d=function(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=u(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}})}(t.colorscale,c),p=t.z,m=t.x,g=t.y,v=n.xaxis,y=n.yaxis,x=n.zaxis,b=r.dataScale,_=p[0].length,w=p.length,M=[o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w])],k=M[0],A=M[1],T=r.contourLevels;this.data=t;var S=t.xcalendar,E=t.ycalendar,L=t.zcalendar;l(M[2],function(t,e){return x.d2l(p[e][t],0,L)*b[2]}),Array.isArray(m[0])?l(k,function(t,e){return v.d2l(m[e][t],0,S)*b[0]}):l(k,function(t){return v.d2l(m[t],0,S)*b[0]}),Array.isArray(g[0])?l(A,function(t,e){return y.d2l(g[e][t],0,E)*b[1]}):l(A,function(t,e){return y.d2l(g[e],0,E)*b[1]});var C={colormap:d,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(C.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var z=o(new Float32Array(_*w),[_,w]);l(z,function(e,r){return t.surfacecolor[r][e]}),M.push(z)}else C.intensityBounds[0]*=b[2],C.intensityBounds[1]*=b[2];this.dataScale=function(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1150:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}var o=t("./constants"),s=t("../../lib/extend").extendFlat,l=t("fast-isnumeric");e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),c=e.cells.values,u=e.domain,f=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),h=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),d=r.length?r[0].map(function(){return e.header.height}):[],p=c.length?c[0].map(function(){return e.cells.height}):[],m=d.reduce(function(t,e){return t+e},0),g=a(p,h-m+o.uplift),v=i(a(d,m),[]),y=i(g,v),x={},b=e._fullInput.columnorder,_=r.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return l(n)?Number(n):1}),w=_.reduce(function(t,e){return t+e},0);_=_.map(function(t){return t/w*f});var M={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:f,height:h,columnOrder:b,groupHeight:h,rowBlocks:y,headerRowBlocks:v,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=x[t];x[t]=(r||0)+1;return{key:t+"__"+x[t],label:t,specIndex:e,xIndex:b[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:_[e]}})};return M.columns.forEach(function(t){t.calcdata=M,t.x=n(t)}),M}},{"../../lib/extend":732,"./constants":1149,"fast-isnumeric":140}],1151:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":732}],1152:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=function(t){return"string"==typeof t&&t.match(A.latexCheck)}(n);t.latex=s;var l,f=s?"":u(t.calcdata.cells.prefix,e,r)||"",h=s?"":u(t.calcdata.cells.suffix,e,r)||"",d=s?null:u(t.calcdata.cells.format,e,r)||null,p=f+(d?T.format(d)(t.value):t.value)+h;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=c(p)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?c(p):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var m;if(t.wrappingNeeded){var g=(" "===A.wrapSplitCharacter?p.replace(/
i&&n.push(a),i+=l}return n}(i,u,c);1===f.length&&(f[0]===i.length-1?f.unshift(f[0]-1):f.push(f[0]+1)),f[0]%2&&f.reverse(),e.each(function(t,e){t.page=f[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(w(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(v(t,r,e,f,n.prevPages,n,0),v(t,r,e,f,n.prevPages,n,1),o(r,t))}}function g(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*T.event.dy:n;var l=o.selectAll("."+A.cn.yColumn).selectAll("."+A.cn.columnBlock).filter(h);m(t,l,o)}}function v(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function y(t,e,r){return function(){var n=T.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,c=t.column.columnWidth-2*A.cellPad;for(t.value="";o.length;)l+(i=(r=o.shift()).width+a)>c&&(t.value+=s.join(A.wrapSpacer)+A.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(A.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),l(n.select("."+A.cn.cellText),r,t),T.select(e.parentNode.parentNode).call(_)}}function x(t,e,r,n,i){return function(){if(!i.settledY){var a=T.select(e.parentNode),s=k(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*A.cellPad:c,f=Math.max(u,c);f-s.rows[l].rowHeight&&(s.rows[l].rowHeight=f,t.selectAll("."+A.cn.columnCell).call(_),m(null,t.filter(h),0),o(r,n,!0)),a.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),e=T.select(this.parentNode).select("."+A.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),n=e.top-t.top+(r?r.matrix.f:A.cellPad);return"translate("+b(i,T.select(this.parentNode).select("."+A.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+n+")"}),i.settledY=!0}}}function b(t,e){switch(t.align){case"left":return A.cellPad;case"right":return t.column.columnWidth-(e||0)-A.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return A.cellPad}}function _(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+M(e,1/0)},0);return"translate(0 "+(M(k(t),t.key)+e)+")"}).selectAll("."+A.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(k(t),t.key).rowHeight})}function w(t,e){for(var r=0,n=e-1;n>=0;n--)r+=function(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n0){var y,x,b,_,w,M=t.xa,k=t.ya;"h"===h.orientation?(w=e,y="y",b=k,x="x",_=M):(w=r,y="x",b=M,x="y",_=k);var A=f[t.index];if(w>=A.span[0]&&w<=A.span[1]){var T=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,h,w),L=o.getPositionOnKdePath(A,h,S),C=b._offset,z=b._length;T[y+"0"]=L[0],T[y+"1"]=L[1],T[x+"0"]=T[x+"1"]=S,T[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+E.toFixed(3),g.push(T),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+z),u[y+"2"]=n.constrain(C+L[1],C,C+z),u[x+"1"]=u[x+"2"]=_._offset+S}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var D=l.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":743,"../../plots/cartesian/axes":789,"../box/hover":899,"./helpers":1158}],1160:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":800,"../box/select":904,"./attributes":1155,"./calc":1156,"./defaults":1157,"./hover":1159,"./layout_attributes":1161,"./layout_defaults":1162,"./plot":1163,"./set_positions":1164,"./style":1165}],1161:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":743,"../box/layout_attributes":901}],1162:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":743,"../box/layout_defaults":902,"./layout_attributes":1161}],1163:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,f=e.xaxis,h=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,g=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),v=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-u.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],x=e[a.posLetter+"axis"],b="both"===s.side,_=b||"positive"===s.side,w=b||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,A=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+v,u=x.c2p(l);switch(s.scalemode){case"width":e=A.maxWidth/g;break;case"count":e=A.maxWidth/g*(A.maxCount/t.pts.length)}var f,h,d,p,m,M,k;if(_){for(M=new Array(o),p=0;pi&&(i=c,a=l)}}return i?s(a):f};case"rms":return function(t,e){for(var r=0,i=0,a=0;a=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,i){return n.coerce(t,a,r.attributes,e,i)}var a={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,a,"valuecalendar",null),o(t,a,"targetcalendar",null)}return a},r.calcTransform=function(t,e,r){function i(t,r){for(var i=0;i":return function(t){return h(t)>i};case">=":return function(t){return h(t)>=i};case"[]":return function(t){var e=h(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=h(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=h(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=h(t);return ei[1]};case"](":return function(t){var e=h(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=h(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(h(t))};case"}{":return function(t){return-1===i.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,f,u),d),x={},b={},_=0;r.preservegaps?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=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([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),i(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;o Date: Tue, 23 Jan 2018 11:02:20 -0600 Subject: [PATCH 05/15] Add a message about persistence via 'shift' button -- seems as though this 'just works' --- R/highlight.R | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/R/highlight.R b/R/highlight.R index d5d4df9810..922e84da6f 100644 --- a/R/highlight.R +++ b/R/highlight.R @@ -137,6 +137,15 @@ highlight <- function(p, on = "plotly_click", off, off <- default(off_default %||% "plotly_relayout") } + if (isTRUE(persistent)) { + message( + "Persistent selection can now be enabled via the 'shift' button. ", + "Thus, it's recommended to use the default (persistent = FALSE) since ", + "this allows one to switch between persistent/transient selection ", + "'on-demand' (in the browser)." + ) + } + # main (non-plotly.js) spec passed along to HTMLwidgets.renderValue() p$x$highlight <- list( # NULL may be used to disable on/off events From 8822670c2c85fb26032fdf19e18aa35bec1054cf Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 23 Jan 2018 11:02:33 -0600 Subject: [PATCH 06/15] add to news --- NEWS.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index a1d725cb46..c33cfb92fc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,14 +2,16 @@ ## NEW FEATURES & IMPROVEMENTS +* Upgraded to plotly.js v1.33.0. A _huge_ amount of features and improvements have been made since v1.29.2 (i.e., the version included in the last CRAN release of the R package - v4.7.1). Read the complete list of changes here: . +* Persistent selection can now be enabled via the 'shift' button. It's still possible to _force_ persistent selection by setting `persistent = TRUE` in `highlight()`, but `persistent = FALSE` (the default) is now recommended since it allows one to switch between [transient/persistent selection](https://plotly-book.cpsievert.me/linking-views-without-shiny.html#transient-versus-persistent-selection) in the browser, rather than at the command line. + ## CHANGES * The `elementId` field is no longer populated, which fixes the "Ignoring explicitly provided widget ID" warning in shiny applications (see #985). -* Upgraded to plotly.js v1.32.0 -- https://github.com/plotly/plotly.js/releases/tag/v1.32.0 ## BUG FIXES -Fixed algorithm for coercing the proposed layout to the plot schema (see #1156). +* Fixed algorithm for coercing the proposed layout to the plot schema (see #1156). # 4.7.1 From e9d14716429ea2180f0604a62f5c8dc6ad530ece Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 23 Jan 2018 12:47:16 -0600 Subject: [PATCH 07/15] override unselected.marker.opacity since it conflicts with opacityDim perhaps it'd be more elegant to have opacityDim map to unselected.marker.opacity? --- inst/htmlwidgets/plotly.js | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index 46e6a43fef..b41b703163 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -431,15 +431,7 @@ HTMLWidgets.widget({ } }); } - - - - - - - - - } + } // end of selectionChange } // end of renderValue }); // end of widget definition @@ -712,6 +704,9 @@ TraceManager.prototype.updateSelection = function(group, keys) { if (tracesToDim.length > 0) { Plotly.restyle(this.gd, {"opacity": opacities}, tracesToDim); + // this is an unfortunate consequence of the selected/unselected API + // https://codepen.io/cpsievert/pen/opOawp + Plotly.restyle(this.gd, {"unselected": {"marker": {"opacity": 1}}}); } } From 81460bc3aa5b4bb4971daa9b3875451123c6b7db Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 23 Jan 2018 16:30:55 -0600 Subject: [PATCH 08/15] crosstalk selection traces now inherit attributes from new plotly.js selected attribute also cleans up some old/messy code --- inst/htmlwidgets/plotly.js | 46 ++++++++++---------------------------- 1 file changed, 12 insertions(+), 34 deletions(-) diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index b41b703163..7c3e3353e8 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -543,9 +543,6 @@ TraceManager.prototype.updateSelection = function(group, keys) { var selectionColour = crosstalk.group(group).var("plotlySelectionColour").get() || this.highlight.color[0]; - // selection brush attributes - var selectAttrs = Object.keys(this.highlight.selected); - for (var i = 0; i < this.origData.length; i++) { // TODO: try using Lib.extendFlat() as done in // https://github.com/plotly/plotly.js/pull/1136 @@ -562,50 +559,31 @@ TraceManager.prototype.updateSelection = function(group, keys) { if (!trace._isSimpleKey) { trace = subsetArrayAttrs(trace, matches); } - // Apply selection brush attributes (supplied from R) - // TODO: it would be neat to have a dropdown to dynamically specify these - for (var j = 0; j < selectAttrs.length; j++) { - var attr = selectAttrs[j]; - trace[attr] = this.highlight.selected[attr]; - } + // reach into the full trace object so we can properly reflect the + // selection attributes in every view + var d = this.gd._fullData[i]; + + /* + / Recursively inherit selection attributes from various sources, + / in order of preference: + / (1) official plotly.js selected attribute + / (2) highlight(selected = attrs_selected(...)) + */ + // TODO: it would be neat to have a dropdown to dynamically specify these! + $.extend(true, trace, this.highlight.selected, d.selected); // if it is defined, override color with the "dynamic brush color"" - // TODO: DRY this up - var d = this.gd._fullData[i]; if (d.marker) { trace.marker = trace.marker || {}; trace.marker.color = selectionColour || trace.marker.color || d.marker.color; - - // adopt any user-defined styling for the selection - var selected = this.highlight.selected.marker || {}; - var attrs = Object.keys(selected); - for (var j = 0; j < attrs.length; j++) { - trace.marker[attrs[j]] = selected[attrs[j]]; - } } - if (d.line) { trace.line = trace.line || {}; trace.line.color = selectionColour || trace.line.color || d.line.color; - - // adopt any user-defined styling for the selection - var selected = this.highlight.selected.line || {}; - var attrs = Object.keys(selected); - for (var j = 0; j < attrs.length; j++) { - trace.line[attrs[j]] = selected[attrs[j]]; - } } - if (d.textfont) { trace.textfont = trace.textfont || {}; trace.textfont.color = selectionColour || trace.textfont.color || d.textfont.color; - - // adopt any user-defined styling for the selection - var selected = this.highlight.selected.textfont || {}; - var attrs = Object.keys(selected); - for (var j = 0; j < attrs.length; j++) { - trace.textfont[attrs[j]] = selected[attrs[j]]; - } } // attach a sensible name/legendgroup trace.name = trace.name || keys.join("
"); From e81268ba83fb644f53fbc7126944b256508fe0e0 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Tue, 23 Jan 2018 18:09:16 -0600 Subject: [PATCH 09/15] enable persistent selection when shift key is down --- NEWS.md | 2 +- R/highlight.R | 2 +- inst/htmlwidgets/plotly.js | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index c33cfb92fc..aed0ae94ac 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,7 @@ ## NEW FEATURES & IMPROVEMENTS * Upgraded to plotly.js v1.33.0. A _huge_ amount of features and improvements have been made since v1.29.2 (i.e., the version included in the last CRAN release of the R package - v4.7.1). Read the complete list of changes here: . -* Persistent selection can now be enabled via the 'shift' button. It's still possible to _force_ persistent selection by setting `persistent = TRUE` in `highlight()`, but `persistent = FALSE` (the default) is now recommended since it allows one to switch between [transient/persistent selection](https://plotly-book.cpsievert.me/linking-views-without-shiny.html#transient-versus-persistent-selection) in the browser, rather than at the command line. +* Persistent selection can now be enabled via the 'shift' key. It's still possible to _force_ persistent selection by setting `persistent = TRUE` in `highlight()`, but `persistent = FALSE` (the default) is now recommended since it allows one to switch between [transient/persistent selection](https://plotly-book.cpsievert.me/linking-views-without-shiny.html#transient-versus-persistent-selection) in the browser, rather than at the command line. ## CHANGES diff --git a/R/highlight.R b/R/highlight.R index 922e84da6f..21d8cd6a02 100644 --- a/R/highlight.R +++ b/R/highlight.R @@ -139,7 +139,7 @@ highlight <- function(p, on = "plotly_click", off, if (isTRUE(persistent)) { message( - "Persistent selection can now be enabled via the 'shift' button. ", + "Persistent selection can now be enabled via the 'shift' key. ", "Thus, it's recommended to use the default (persistent = FALSE) since ", "this allows one to switch between persistent/transient selection ", "'on-demand' (in the browser)." diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index 7c3e3353e8..2bd8e9dddb 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -21,6 +21,22 @@ HTMLWidgets.widget({ // make sure plots don't get created outside the network (for on-prem) window.PLOTLYENV = window.PLOTLYENV || {}; window.PLOTLYENV.BASE_URL = x.base_url; + + // Enable persistent selection when shift key is down + // https://stackoverflow.com/questions/1828613/check-if-a-key-is-down + var persistOnShift = function(e) { + if (!e) window.event; + if (e.shiftKey) { + x.highlight.persistent = true; + } else { + x.highlight.persistent = false; + } + }; + + // Only relevant if we haven't forced persistent mode at command line + if (!x.highlight.persistent) { + window.onmousemove = persistOnShift; + } } var graphDiv = document.getElementById(el.id); From 35fe715b8b789dbf376b7930b2fdbce9b13372a1 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Wed, 24 Jan 2018 09:53:24 -0600 Subject: [PATCH 10/15] clean up wording --- NEWS.md | 4 ++-- R/highlight.R | 11 +++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/NEWS.md b/NEWS.md index aed0ae94ac..b0e8dab38f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,8 +2,8 @@ ## NEW FEATURES & IMPROVEMENTS -* Upgraded to plotly.js v1.33.0. A _huge_ amount of features and improvements have been made since v1.29.2 (i.e., the version included in the last CRAN release of the R package - v4.7.1). Read the complete list of changes here: . -* Persistent selection can now be enabled via the 'shift' key. It's still possible to _force_ persistent selection by setting `persistent = TRUE` in `highlight()`, but `persistent = FALSE` (the default) is now recommended since it allows one to switch between [transient/persistent selection](https://plotly-book.cpsievert.me/linking-views-without-shiny.html#transient-versus-persistent-selection) in the browser, rather than at the command line. +* Upgraded to plotly.js v1.33.0. A _huge_ amount of features and improvements have been made since v1.29.2 (i.e., the version included in the last CRAN release of the R package - v4.7.1). Highlights include a complete re-write of `scattergl` to make it nearly feature complete with `scatter`, localization of text rendering (i.e., international translations), and two new trace types (`violin` & `table`). Read more about the v1.32.0 release [here](https://codeburst.io/notes-from-the-latest-plotly-js-release-b035a5b43e21) and the complete list of changes [here](https://github.com/plotly/plotly.js/releases). +* The selection mode can now switch from 'transient' to 'persistent' by holding the 'shift' key. It's still possible to _force_ persistent selection by setting `persistent = TRUE` in `highlight()`, but `persistent = FALSE` (the default) is now recommended since it allows one to switch between [persistent/transient selection](https://plotly-book.cpsievert.me/linking-views-without-shiny.html#transient-versus-persistent-selection) in the browser, rather than at the command line. ## CHANGES diff --git a/R/highlight.R b/R/highlight.R index 21d8cd6a02..5b0af26bb8 100644 --- a/R/highlight.R +++ b/R/highlight.R @@ -102,12 +102,12 @@ highlight <- function(p, on = "plotly_click", off, stop("opacityDim must be between 0 and 1", call. = FALSE) } if (dynamic && length(color) < 2) { - message("Adding more colors to the selection color palette") + message("Adding more colors to the selection color palette.") color <- c(color, RColorBrewer::brewer.pal(4, "Set1")) } if (!dynamic && length(color) > 1) { warning( - "Can only use a single color for selections when dynamic=FALSE", + "Can only use a single color for selections when `dynamic = FALSE`.", call. = FALSE ) color <- color[1] @@ -139,10 +139,9 @@ highlight <- function(p, on = "plotly_click", off, if (isTRUE(persistent)) { message( - "Persistent selection can now be enabled via the 'shift' key. ", - "Thus, it's recommended to use the default (persistent = FALSE) since ", - "this allows one to switch between persistent/transient selection ", - "'on-demand' (in the browser)." + "We recommend setting `persistent` to `FALSE` (the default) because ", + "persistent selection mode can now be used by holding the shift key ", + "(while triggering the `on` event)." ) } From fe507cc335bfd1efb6329b9e8c1bf557d70c759c Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Wed, 24 Jan 2018 10:07:17 -0600 Subject: [PATCH 11/15] Directly document recommendation for persistent argument --- R/highlight.R | 6 +++++- man/highlight.Rd | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/R/highlight.R b/R/highlight.R index 5b0af26bb8..28b98bb422 100644 --- a/R/highlight.R +++ b/R/highlight.R @@ -28,7 +28,10 @@ #' (i.e., clicking the home button in the modebar) or whenever the height/width #' of the plot changes. #' } -#' @param persistent should selections persist (i.e., accumulate)? +#' @param persistent should selections persist (i.e., accumulate)? We often +#' refer to the default (`FALSE`) as a 'transient' selection mode; +#' which is recommended, because one may switch from 'transient' to +#' 'persistent' selection by holding the shift key. #' @param dynamic should a widget for changing selection colors be included? #' @param color character string of color(s) to use for #' highlighting selections. See [toRGB()] for valid color @@ -41,6 +44,7 @@ #' @param opacityDim a number between 0 and 1 used to reduce the #' opacity of non-selected traces (by multiplying with the existing opacity). #' @param selected attributes of the selection, see [attrs_selected()]. +#' @param unselected attributes of the non-selected marks, see [attrs_unselected()]. #' @param ... currently not supported. #' @export #' @author Carson Sievert diff --git a/man/highlight.Rd b/man/highlight.Rd index fa1ba110e5..42e3a613ab 100644 --- a/man/highlight.Rd +++ b/man/highlight.Rd @@ -34,7 +34,10 @@ events altogether, use \code{NULL}. Currently the following are supported: of the plot changes. }} -\item{persistent}{should selections persist (i.e., accumulate)?} +\item{persistent}{should selections persist (i.e., accumulate)? We often +refer to the default (\code{FALSE}) as a 'transient' selection mode; +which is recommended, because one may switch from 'transient' to +'persistent' selection by holding the shift key.} \item{dynamic}{should a widget for changing selection colors be included?} @@ -55,6 +58,8 @@ opacity of non-selected traces (by multiplying with the existing opacity).} \item{selected}{attributes of the selection, see \code{\link[=attrs_selected]{attrs_selected()}}.} \item{...}{currently not supported.} + +\item{unselected}{attributes of the non-selected marks, see \code{\link[=attrs_unselected]{attrs_unselected()}}.} } \description{ This function sets a variety of options for brushing (i.e., highlighting) From 9d77dcdf1b8dceb771608097c5c584e84b38746d Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Wed, 24 Jan 2018 10:52:50 -0600 Subject: [PATCH 12/15] move an unnecessary onRender callback directly to the htmlwidget binding js --- R/utils.R | 6 ------ inst/htmlwidgets/plotly.js | 9 +++++++++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/R/utils.R b/R/utils.R index 512d9578d5..4e6073dbe4 100644 --- a/R/utils.R +++ b/R/utils.R @@ -267,12 +267,6 @@ supply_defaults <- function(p) { supply_highlight_attrs <- function(p) { # set "global" options via crosstalk variable p$x$highlight <- p$x$highlight %||% highlight_defaults() - p <- htmlwidgets::onRender( - p, sprintf( - "function(el, x) { var ctConfig = crosstalk.var('plotlyCrosstalkOpts').set(%s); }", - to_JSON(p$x$highlight) - ) - ) # defaults are now populated, allowing us to populate some other # attributes such as the selectize widget definition diff --git a/inst/htmlwidgets/plotly.js b/inst/htmlwidgets/plotly.js index 2bd8e9dddb..34e51a42d7 100644 --- a/inst/htmlwidgets/plotly.js +++ b/inst/htmlwidgets/plotly.js @@ -16,6 +16,15 @@ HTMLWidgets.widget({ }, renderValue: function(el, x, instance) { + + /* + / 'inform the world' about highlighting options this is so other + / crosstalk libraries have a chance to respond to special settings + / such as persistent selection. + / AFAIK, leaflet is the only library with such intergration + / https://github.com/rstudio/leaflet/pull/346/files#diff-ad0c2d51ce5fdf8c90c7395b102f4265R154 + */ + var ctConfig = crosstalk.var('plotlyCrosstalkOpts').set(x.highlight); if (typeof(window) !== "undefined") { // make sure plots don't get created outside the network (for on-prem) From bfb75cbbf51b7ff8381d72fecc50c818b7cb1e65 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Wed, 24 Jan 2018 13:45:15 -0600 Subject: [PATCH 13/15] demo improvements --- demo/crosstalk-highlight-binned-target-a.R | 19 ++++++++++++++----- demo/crosstalk-highlight-ggplotly.R | 2 +- demo/crosstalk-highlight-leaflet.R | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/demo/crosstalk-highlight-binned-target-a.R b/demo/crosstalk-highlight-binned-target-a.R index 58460c10b7..a247e5946d 100644 --- a/demo/crosstalk-highlight-binned-target-a.R +++ b/demo/crosstalk-highlight-binned-target-a.R @@ -3,15 +3,24 @@ library(crosstalk) library(plotly) d <- SharedData$new(mpg) -dots <- plot_ly(d, color = ~class, x = ~displ, y = ~cyl) -boxs <- plot_ly(d, color = ~class, x = ~class, y = ~cty) %>% add_boxplot() -bars <- plot_ly(d, x = ~class, color = ~class) +dots <- plot_ly(d, colors = "Set1", color = ~class, x = ~displ, y = ~cyl) %>% + layout( + xaxis = list(title = "Engine displacement"), + yaxis = list(title = "Number of cylinders") + ) +boxs <- plot_ly(d, colors = "Set1", color = ~class, x = ~class, y = ~cty) %>% + add_boxplot() %>% + layout( + xaxis = list(title = ""), + yaxis = list(title = "Miles per gallon (city)") + ) +bars <- plot_ly(d, colors = "Set1", x = ~class, color = ~class) subplot(dots, boxs, titleX = TRUE, titleY = TRUE) %>% subplot(bars, nrows = 2, titleX = TRUE, titleY = TRUE) %>% layout( - title = "Click and drag on scatterplot", + title = "Dynamic 2-way ANOVA (clik & drag on scatterplot)", barmode = "overlay", showlegend = FALSE ) %>% - highlight("plotly_selected") + highlight("plotly_selected", opacityDim = 0.6) diff --git a/demo/crosstalk-highlight-ggplotly.R b/demo/crosstalk-highlight-ggplotly.R index f28566aebd..c4d970a25b 100644 --- a/demo/crosstalk-highlight-ggplotly.R +++ b/demo/crosstalk-highlight-ggplotly.R @@ -6,7 +6,7 @@ d <- SharedData$new(txhousing, ~city, "Select a city") p <- ggplot(d, aes(date, median, group = city)) + geom_line() ggplotly(p, tooltip = "city") %>% layout(title = "Click on a line to highlight a year") %>% - highlight(dynamic = TRUE, selectize = TRUE, persistent = TRUE) + highlight(dynamic = TRUE, selectize = TRUE) # crosstalk keys are automatically added to the group aesthetic... # if you want to avoid adding the key to group for a layer, diff --git a/demo/crosstalk-highlight-leaflet.R b/demo/crosstalk-highlight-leaflet.R index 07a50e3bd8..cf55dd02ae 100644 --- a/demo/crosstalk-highlight-leaflet.R +++ b/demo/crosstalk-highlight-leaflet.R @@ -6,7 +6,7 @@ library(htmltools) # leaflet should respect these "global" highlight() options options( - opacityDim = 1, persistent = TRUE + opacityDim = 0.5, persistent = TRUE ) sd <- SharedData$new(quakes) From e8d195f7bf1a8688421a383190aff5e5dc635561 Mon Sep 17 00:00:00 2001 From: Carson Sievert Date: Wed, 24 Jan 2018 16:20:54 -0600 Subject: [PATCH 14/15] upgrade to plotly.js v1.33.1 --- NEWS.md | 2 +- R/plotly.R | 2 +- inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js | 4 ++-- inst/plotlyjs.R | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index b0e8dab38f..67426d3ce0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,7 +2,7 @@ ## NEW FEATURES & IMPROVEMENTS -* Upgraded to plotly.js v1.33.0. A _huge_ amount of features and improvements have been made since v1.29.2 (i.e., the version included in the last CRAN release of the R package - v4.7.1). Highlights include a complete re-write of `scattergl` to make it nearly feature complete with `scatter`, localization of text rendering (i.e., international translations), and two new trace types (`violin` & `table`). Read more about the v1.32.0 release [here](https://codeburst.io/notes-from-the-latest-plotly-js-release-b035a5b43e21) and the complete list of changes [here](https://github.com/plotly/plotly.js/releases). +* Upgraded to plotly.js v1.33.1. A _huge_ amount of features and improvements have been made since v1.29.2 (i.e., the version included in the last CRAN release of the R package - v4.7.1). Highlights include a complete re-write of `scattergl` to make it nearly feature complete with `scatter`, localization of text rendering (i.e., international translations), and two new trace types (`violin` & `table`). Read more about the v1.32.0 release [here](https://codeburst.io/notes-from-the-latest-plotly-js-release-b035a5b43e21) and the complete list of changes [here](https://github.com/plotly/plotly.js/releases). * The selection mode can now switch from 'transient' to 'persistent' by holding the 'shift' key. It's still possible to _force_ persistent selection by setting `persistent = TRUE` in `highlight()`, but `persistent = FALSE` (the default) is now recommended since it allows one to switch between [persistent/transient selection](https://plotly-book.cpsievert.me/linking-views-without-shiny.html#transient-versus-persistent-selection) in the browser, rather than at the command line. ## CHANGES diff --git a/R/plotly.R b/R/plotly.R index e354749c9f..3d230c962f 100644 --- a/R/plotly.R +++ b/R/plotly.R @@ -373,7 +373,7 @@ typedArrayPolyfill <- function() { # and bundle size at print time. plotlyMainBundle <- function() { htmltools::htmlDependency( - "plotlyjs", "1.33.0", + "plotlyjs", "1.33.1", src = depPath("plotlyjs"), script = "plotly-latest.min.js", stylesheet = "plotly-htmlwidgets.css" diff --git a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js index f30d039ff3..dab8338bf8 100644 --- a/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js +++ b/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js @@ -1,7 +1,7 @@ /** -* plotly.js v1.33.0 +* plotly.js v1.33.1 * Copyright 2012-2018, Plotly, Inc. * All rights reserved. * Licensed under the MIT license */ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Plotly=t()}}(function(){return function t(e,r,n){function i(o,s){if(!r[o]){if(!e[o]){var l="function"==typeof require&&require;if(!s&&l)return l(o,!0);if(a)return a(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[o]={exports:{}};e[o][0].call(u.exports,function(t){var r=e[o][1][t];return i(r||t)},u,u.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof require&&require,o=0;oMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],40:[function(t,e,r){"use strict";function n(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}e.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],c=t.mode||"turntable",u=i(),f=a(),h=o();return u.setDistanceLimits(l[0],l[1]),u.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 n({turntable:u,orbit:f,matrix:h},c)};var i=t("turntable-camera-controller"),a=t("orbit-camera-controller"),o=t("matrix-camera-controller"),s=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+u;if((r=a-u-f[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)(r=(e=t[n]).y+e.dy+u-a)>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(h).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(f[1]-(t.length-1)*u)/e.sum(t,s)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),d.forEach(function(e){e.dy=e.value*t})}(),n();for(var l=1;t>0;--t)!function(t){function r(t){return o(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,s);n.y+=(i-o(n))*t}})})}(l*=.99),n(),function(t){function r(t){return o(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,s);n.y+=(i-o(n))*t}})})}(l),n()}function a(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}h.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),h.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function o(t){return t.y+t.dy/2}function s(t){return t.value}var l={},c=24,u=8,f=[1,1],h=[],d=[];return l.nodeWidth=function(t){return arguments.length?(c=+t,l):c},l.nodePadding=function(t){return arguments.length?(u=+t,l):u},l.nodes=function(t){return arguments.length?(h=t,l):h},l.links=function(t){return arguments.length?(d=t,l):d},l.size=function(t){return arguments.length?(f=t,l):f},l.layout=function(r){return h.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),d.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=h[t.source]),"number"==typeof n&&(n=t.target=h[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),h.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,s),e.sum(t.targetLinks,s))}),t(),i(r),a(),l},l.relayout=function(){return a(),l},l.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,f=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+f+"C"+s+","+f+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},l},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":120,"d3-collection":121,"d3-interpolate":125}],42:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":165,"gl-vao":259,"weak-map":573}],43:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=t[o]),t[o]>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3])),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t.str2RgbaArray=function(t,n){var i,a;if("string"!=typeof t)return t;if(i=[],"#"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),a=parseInt(t,16),i[0]=a>>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3]),a[4]?i[3]=parseFloat(a[4]):i[3]=1),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t}()},{}],51:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!h(t[o],e[o],r,n))return!1;return!0}(t,e,r,s))}return r?t===e:t==e}function d(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function p(t,e,r){h(t,e,!0)&&u(t,e,r,"notDeepStrictEqual",p)}function m(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function g(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&u(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&v.isError(i),s=!t&&i&&!r;if((o&&a&&m(i,r)||s)&&u(i,r,"Got unwanted exception"+n),t&&i&&r&&!m(i,r)||!t&&i)throw i}var v=t("util/"),y=Object.prototype.hasOwnProperty,x=Array.prototype.slice,b="foo"===function(){}.name,_=e.exports=f,w=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return l(c(t.actual),128)+" "+t.operator+" "+l(c(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=u,_.ok=f,_.equal=function(t,e,r){t!=e&&u(t,e,r,"==",_.equal)},_.notEqual=function(t,e,r){t==e&&u(t,e,r,"!=",_.notEqual)},_.deepEqual=function(t,e,r){h(t,e,!1)||u(t,e,r,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,e,r){h(t,e,!0)||u(t,e,r,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,e,r){h(t,e,!1)&&u(t,e,r,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=p,_.strictEqual=function(t,e,r){t!==e&&u(t,e,r,"===",_.strictEqual)},_.notStrictEqual=function(t,e,r){t===e&&u(t,e,r,"!==",_.notStrictEqual)},_.throws=function(t,e,r){g(!0,t,e,r)},_.doesNotThrow=function(t,e,r){g(!1,t,e,r)},_.ifError=function(t){if(t)throw t};var M=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":563}],52:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],53:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(f):f<0&&(u=u.ushln(-f)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":56,"./is-rat":58,"./lib/is-bn":62,"./lib/num-to-bn":63,"./lib/rationalize":64,"./lib/str-to-bn":65}],58:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":62}],59:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":73}],60:[function(t,e,r){"use strict";var n=t("./bn-sign");e.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}},{"bit-twiddle":71,"double-bits":131}],62:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":73}],63:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.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)}},{"bn.js":73,"double-bits":131}],64:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.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]}},{"./bn-sign":59,"./num-to-bn":63}],65:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":73}],66:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":64}],67:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":59}],68:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":64}],69:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.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,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(h=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":60,"./lib/ctz":61}],70:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],71:[function(t,e,r){"use strict";"use restrict";function n(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}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.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},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=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|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],72:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s){for(var l=0;l=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(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}function l(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 c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}function c(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function f(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 h(){f.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){f.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){f.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){f.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(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 v(t){g.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)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var y;try{y=t("buffer").Buffer}catch(t){}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++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;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){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),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,l=Math.min(a,a-o)+r,c=0,u=r;u1&&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 x=["","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"],b=[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],_=[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];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?x[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 c=b[t],u=_[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modn(u).toString(t);r=(f=f.idivn(u)).isZero()?h+r:x[c-h.length]+h+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!==y),this.toArrayLike(y,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,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[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=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=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,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],D=8191&z,I=z>>>13,P=0|o[8],O=8191&P,F=P>>>13,R=0|o[9],N=8191&R,j=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>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,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((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,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((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,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|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(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,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(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,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(v,$)|0,i=(i=i+Math.imul(v,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(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,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(v,rt)|0,i=(i=i+Math.imul(v,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(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(F,U)|0,a=Math.imul(F,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,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(v,at)|0,i=(i=i+Math.imul(v,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,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(F,H)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,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(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,X))+Math.imul(j,W)|0,a=Math.imul(j,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,K)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|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 St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,K))+Math.imul(j,J)|0,a=Math.imul(j,K),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(F,rt)|0,a=a+Math.imul(F,nt)|0,n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(F,at)|0,a=a+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,at),i=(i=Math.imul(N,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(F,lt)|0,a=a+Math.imul(F,ct)|0,n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(I,ft)|0,a=a+Math.imul(I,ht)|0;var zt=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(N,lt),i=(i=Math.imul(N,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(F,ft)|0,a=a+Math.imul(F,ht)|0;var Dt=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var It=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(F,pt)|0))<<13)|0;c=((a=a+Math.imul(F,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Pt=(c+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=Dt,l[17]=It,l[18]=Pt,0!==c&&(l[19]=c,r.length++),r};Math.imul||(w=l),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):r<63?l(this,t,e):r<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):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},u.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);var i;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,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),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&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;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 c=0;c=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){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 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)},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),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=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(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),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(c)}},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=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,f=1;0==(r.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var h;return(h=0===e.cmpn(1)?i:o).cmpn(0)<0&&h.iadd(t),h},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=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=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 g(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};f.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},f.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):r.strip(),r},f.prototype.split=function(t,e){t.iushrn(this.n,0,e)},f.prototype.imulK=function(t){return t.imul(this.k)},i(h,f),h.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},h.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 h;else if("p224"===t)e=new d;else if("p192"===t)e=new p;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new m}return M[t]=e,e},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.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")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.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)},g.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},g.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)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.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(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new v(t)},i(v,g),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.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)},v.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)},v.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],74:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var f,h=l.mallocDouble(2*s*a),d=l.mallocInt32(a);if((a=i(t,s,h,d))>0){if(1===s&&n)c.init(a),f=c.sweepComplete(s,r,0,a,h,d,0,a,h,d);else{var p=l.mallocDouble(2*s*o),m=l.mallocInt32(o);(o=i(e,s,p,m))>0&&(c.init(a+o),f=1===s?c.sweepBipartite(s,r,0,a,h,d,0,o,p,m):u(s,r,n,a,h,d,o,p,m),l.free(p),l.free(m))}l.free(h),l.free(d)}return f}}}function o(t,e){s.push([t,e])}e.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return s=[],a(t,t,o,!0),s}(t);case 2:return"function"==typeof e?a(t,t,e,!0):function(t,e){return s=[],a(t,e,o,!1),s}(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var s,l=t("typedarray-pool"),c=t("./lib/sweep"),u=t("./lib/intersect")},{"./lib/intersect":77,"./lib/sweep":81,"typedarray-pool":554}],76:[function(t,e,r){"use strict";function n(t){function e(e,r){var s=function(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),s=["function ",n,"(",_.join(),"){","var ",l,"=2*",i,";"],w="for(var i="+c+","+d+"="+l+"*"+c+";i<"+u+";++i,"+d+"+="+l+"){var x0="+f+"["+a+"+"+d+"],x1="+f+"["+a+"+"+d+"+"+i+"],xi="+h+"[i];",M="for(var j="+p+","+y+"="+l+"*"+p+";j<"+m+";++j,"+y+"+="+l+"){var y0="+g+"["+a+"+"+y+"],"+(r?"y1="+g+"["+a+"+"+y+"+"+i+"],":"")+"yi="+v+"[j];";return t?s.push(w,b,":",M):s.push(M,b,":",w),r?s.push("if(y1"+m+"-"+p+"){"),t?(e(!0,!1),M.push("}else{"),e(!1,!1)):(M.push("if("+s+"){"),e(!0,!0),M.push("}else{"),e(!0,!1),M.push("}}else{if("+s+"){"),e(!1,!0),M.push("}else{"),e(!1,!1),M.push("}")),M.push("}}return "+r);var k=n.join("")+M.join("");return new Function(k)()}var i="d",a="ax",o="vv",s="fp",l="es",c="rs",u="re",f="rb",h="ri",d="rp",p="bs",m="be",g="bb",v="bi",y="bp",x="rv",b="Q",_=[i,a,o,c,u,f,h,p,m,g,v];r.partial=n(!1),r.full=n(!0)},{}],77:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){var c=M*t;A[c]=e,A[c+1]=r,A[c+2]=n,A[c+3]=i,A[c+4]=a,A[c+5]=o;var u=k*t;T[u]=s,T[u+1]=l}function i(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,m=i*f;p0;){var P=(D-=1)*M,O=A[P],F=A[P+1],R=A[P+2],N=A[P+3],j=A[P+4],B=A[P+5],U=D*k,V=T[U],q=T[U+1],H=1&B,G=!!(16&B),Y=d,W=S,X=L,Z=C;if(H&&(Y=L,W=C,X=d,Z=S),!(2&B&&(R=x(t,O,F,R,Y,W,q),F>=R)||4&B&&(F=b(t,O,F,R,Y,W,V))>=R)){var J=R-F,K=j-N;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),y=d("lo===p0",["p0"]),x=d("lor&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p>>1,h=2*t,d=f,p=s[h*f+e];c=x?(d=y,p=x):v>=_?(d=g,p=v):(d=b,p=_):x>=_?(d=y,p=x):_>=v?(d=g,p=v):(d=b,p=_);for(var w=h*(u-1),M=h*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],80:[function(t,e,r){"use strict";function n(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 c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>1,g=m-h,v=m+h,y=d,x=g,b=m,_=v,w=p,M=t+1,k=e-1,A=0;l(y,x,r)&&(A=y,y=x,x=A),l(_,w,r)&&(A=_,_=w,w=A),l(y,b,r)&&(A=y,y=b,b=A),l(x,b,r)&&(A=x,x=b,b=A),l(y,_,r)&&(A=y,y=_,_=A),l(b,_,r)&&(A=b,b=_,_=A),l(x,w,r)&&(A=x,x=w,w=A),l(x,b,r)&&(A=x,x=b,b=A),l(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*x],S=r[2*x+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*b,D=2*w,I=2*d,P=2*m,O=2*p,F=0;F<2;++F){var R=r[C+F],N=r[z+F],j=r[D+F];r[I+F]=R,r[P+F]=N,r[O+F]=j}a(g,t,r),a(v,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&i(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(o(B,M,k,r),++M,--k):(i(B,k,r),--k);break}if(--k>>1;s(m,S);var E=0,L=0;for(M=0;M=l)n(f,h,L--,C=C-l|0);else if(C>=0)n(c,u,E--,C);else if(C<=-l){C=-C-l|0;for(var z=0;z>>1;s(m,E);var L=0,C=0,z=0;for(k=0;k>1==m[2*k+3]>>1&&(I=2,k+=1),D<0){for(var P=-(D>>1)-1,O=0;O>1)-1,0===I?n(c,u,L--,P):1===I?n(f,h,C--,P):2===I&&n(d,p,z--,P)}},scanBipartite:function(t,e,r,a,o,f,h,d,p,g,v,y){var x=0,b=2*t,_=e,w=e+t,M=1,k=1;a?k=l:M=l;for(var A=o;A>>1;s(m,L);var C=0;for(A=0;A=l?(D=!a,T-=l):(D=!!a,T-=1),D)i(c,u,C++,T);else{var I=y[T],P=b*T,O=v[P+e+1],F=v[P+e+1+t];t:for(var R=0;R>>1;s(m,M);var k=0;for(x=0;x=l)c[k++]=b-l;else{var T=d[b-=1],S=g*b,E=h[S+e+1],L=h[S+e+1+t];t:for(var C=0;C=0;--C)if(c[C]===b){for(P=C+1;PP)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?function(t,e,r){if(e<0||t.byteLength=P)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P.toString(16)+" bytes");return 0|t}function u(t,e){if(i.isBuffer(t))return t.length;if(C(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function f(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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,z(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:p(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var 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}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function _(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,c,u,f;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],c=t[i+2],128==(192&l)&&128==(192&c)&&(f=(15&a)<<12|(63&l)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(f=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>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<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function k(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 A(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),I.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),I.write(t,e,r,n,52,8),r+8}function S(t,e){e=e||1/0;for(var r,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 E(t){return D.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function z(t){return t!=t}var D=t("base64-js"),I=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var P=2147483647;r.kMaxLength=P,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=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 m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){M(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){M(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},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var n,a=[],o=e;o0?u-4:u;var f=0;for(e=0,r=0;e>16&255,c[f++]=a>>8&255,c[f++]=255&a;return 2===o?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,c[f++]=255&a):1===o&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,c[f++]=a>>8&255,c[f++]=255&a),c},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",s=[],l=0,c=r-n;lc?c:l+16383));return 1===n?(e=t[r-1],i+=o[e>>2],i+=o[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=o[e>>10],i+=o[e>>4&63],i+=o[e<<2&63],i+="="),s.push(i),s.join("")};for(var o=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=c.length;u0;){for(var d=r.pop(),p=(u=-1,f=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),n(t,e,r,u,s,f),n(t,e,r,s,f,u),n(t,e,r,f,d,u),n(t,e,r,d,u,f))}}},{"binary-search-bounds":89,"robust-in-sphere":513}],86:[function(t,e,r){"use strict";function n(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 i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}var a=t("binary-search-bounds");e.exports=function(t,e,r){var a=function(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var p=0;p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var v=function(t,e,r){for(var n=0,i=0;i1&&h(r[u[d-2]],r[u[d-1]],n)>0;)t.push([u[d-1],u[d-2],i]),d-=1;u.length=d,u.push(i);var p=c.upperIds;for(d=p.length;d>1&&h(r[p[d-2]],r[p[d-1]],n)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var r;return(r=t.a[0]v[0]&&l.push(new i(v,g,m,f),new i(g,v,p,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),x=[new n([y,1],[y,0],-1,[],[],[],[])],b=[],_=(f=0,l.length);f<_;++f){var w=l[f],M=w.type;M===d?s(b,x,t,w.a,w.idx):M===m?c(x,0,w):u(x,0,w)}return b}},{"binary-search-bounds":89,"robust-orientation":515}],88:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],90:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],94:[function(t,e,r){"use strict";function n(t){var e=m(t);return[v(e,-1/0),v(e,1/0)]}function i(t){for(var e=new Array(t.length),r=0;re[2]?1:0)}function l(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[o=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=b;b=_,_=k}x[0]=b;var A,T=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===o;){var S,E=(S=n[--a])[1];i?e.push([T,E,A]):e.push([T,E]),T=E}i?e.push([T,_,A]):e.push([T,_])}return s}(t,e,o,c,r));return l(e,u,r),!!u||(o.length>0||c.length>0)}e.exports=function(t,e,r){var n;if(r){n=e;for(var o=new Array(e.length),s=0;s>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:93}],98:[function(t,e,r){"use strict";e.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]}},{}],99:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:93,"color-rgba":101,dtype:133}],100:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1);c=1,(h=u.length)<=4?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1];s=u=f.replace(/a$/,"");var h="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===u&&l.push(1),c=void 0===l[h]?1:l[h],l=l.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":98,defined:129,"is-plain-obj":286}],101:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?(e=Array(3),e[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):[]}},{clamp:93,"color-parse":100,"color-space/hsl":102}],102:[function(t,e,r){"use strict";var n=t("./rgb");e.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,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-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[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":103}],103:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],104:[function(t,e,r){e.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]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,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:0,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]}]}},{}],105:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,c,u,f,h,d,p,m,g,v,y,x=[],b=[],_=[],w=[];if(a.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!s[h])throw Error(h+" not a supported colorscale");f=o(s[h])}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);f=o(h)}if(f.length>p)throw new Error(h+" map requires nshades to be at least size "+f.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:o(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=f.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y=0}e.exports=function(t,e,r,o){var s=i(e,r,o);if(0===s){var l=a(i(t,e,r)),c=a(i(t,e,o));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,o)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,o)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:a(c-l)}var f=i(t,e,r);return f>0?s>0&&i(t,e,o)>0?1:-1:f<0?s>0||i(t,e,o)>0?1:-1:i(t,e,o)>0?1:n(t,e,r)?1:-1};var i=t("robust-orientation"),a=t("signum"),o=t("two-sum"),s=t("robust-product"),l=t("robust-sum")},{"robust-orientation":515,"robust-product":516,"robust-sum":520,signum:522,"two-sum":553}],107:[function(t,e,r){function n(t,e){return t-e}e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]);return i(l,t[2])-i(c,e[2])||i(l+t[2],o)-i(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+d-(p+m+g+v)||i(u,f,h,d)-i(p,m,g,v,p)||i(u+f,u+h,u+d,f+h,f+d,h+d)-i(p+m,p+g,p+v,m+g,m+v,g+v)||i(u+f+h,u+f+d,u+h+d,f+h+d)-i(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),x=e.slice().sort(n),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],111:[function(t,e,r){"use strict";e.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=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":45,"incremental-convex-hull":278}],113:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],114:[function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return"%"===t[t.length-1]?n(parseFloat(t)/100*255):n(parseInt(t))}function o(t){return"%"===t[t.length-1]?i(parseFloat(t)/100):i(parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r;return(r=parseInt(e.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var u=e.substr(0,i),f=e.substr(i+1,l-(i+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=o(f[1]),m=o(f[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),h];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],115:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=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]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n},e.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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],116:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":118}],117:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n0&&l.push("var "+c.join(",")),n=a-1;n>=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(l=0;l0&&v.push("var "+y.join(",")),l=0;l3&&v.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&v.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var A=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",A,"(",g.join(","),"){",v.join("\n"),"} return ",A].join(""))()}},{uniq:556}],118:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u=0?(a>=b?10:a>=_?5:a>=w?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=b?10:a>=_?5:a>=w?2:1)}function n(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=b?i*=10:a>=_?i*=5:a>=w&&(i*=2),ee?1:t>=e?0:NaN},o=function(t){return 1===t.length&&(t=function(t){return function(e,r){return a(t(e),r)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},s=o(a),l=s.right,c=s.left,u=function(t){return null===t?NaN:+t},f=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},h=function(t,e){var r=f(t,e);return r?Math.sqrt(r):r},d=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},A=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},T=function(t){if(!(a=t.length))return[];for(var e=-1,r=A(t,i),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=h,t.extent=d,t.histogram=function(){function t(t){var a,o,s=t.length,c=new Array(s);for(a=0;ah;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)(m=g[a]=[]).x0=a>0?d[a-1]:f,m.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=A,t.pairs=function(t,r){null==r&&(r=e);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l=u.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,c,f,h=-1,d=e.length,p=u[n++],m=r(),g=i();++hu.length)return t;var n,i=f[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],f=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return f[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},t.set=l,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],122:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=E.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=L.exec(t))?i(parseInt(e[1],16)):(e=C.exec(t))?new l(e[1],e[2],e[3],1):(e=z.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=D.exec(t))?a(e[1],e[2],e[3],e[4]):(e=I.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=P.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=O.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,r,n)}function u(t,e,i,a){return 1===arguments.length?function(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;var e=(t=t.rgb()).r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new f(l,c,u,t.opacity)}(t):new f(t,e,i,null==a?1:a)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function h(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function d(t){if(t instanceof m)return new m(t.l,t.a,t.b,t.opacity);if(t instanceof _){var e=t.h*R;return new m(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/j),s=g((.2126729*r+.7151522*n+.072175*i)/B);return new m(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/U)),t.opacity)}function p(t,e,r,n){return 1===arguments.length?d(t):new m(t,e,r,null==n?1:n)}function m(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>G?Math.pow(t,1/3):t/H+V}function v(t){return t>q?t*t*t:H*(t-V)}function y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function b(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof _)return new _(t.h,t.c,t.l,t.opacity);t instanceof m||(t=d(t));var e=Math.atan2(t.b,t.a)*N;return new _(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function w(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,s=(X*(r-i)-Y*a)/W,c=Math.sqrt(s*s+a*a)/(X*i*(1-i)),u=c?Math.atan2(s,a)*N-120:NaN;return new M(u<0?u+360:u,c,i,t.opacity)}(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var k=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},A="\\s*([+-]?\\d+)\\s*",T="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E=/^#([0-9a-f]{3})$/,L=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[A,A,A]+"\\)$"),z=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),D=new RegExp("^rgba\\("+[A,A,A,T]+"\\)$"),I=new RegExp("^rgba\\("+[S,S,S,T]+"\\)$"),P=new RegExp("^hsl\\("+[T,S,S]+"\\)$"),O=new RegExp("^hsla\\("+[T,S,S,T]+"\\)$"),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),k(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),k(f,u,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(h(t>=240?t-240:t+120,i,n),h(t,i,n),h(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var R=Math.PI/180,N=180/Math.PI,j=.95047,B=1,U=1.08883,V=4/29,q=6/29,H=3*q*q,G=q*q*q;k(m,p,e(r,{brighter:function(t){return new m(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new m(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=B*v(t),e=j*v(e),r=U*v(r),new l(y(3.2404542*e-1.5371385*t-.4985314*r),y(-.969266*e+1.8760108*t+.041556*r),y(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),k(_,b,e(r,{brighter:function(t){return new _(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}));var Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=1.78277*X,K=1.78277*Y- -.14861*W;k(M,w,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*R,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(-.14861*n+1.78277*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=u,t.lab=p,t.hcl=b,t.cubehelix=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],123:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",i),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;ad+s||np+s||if.index){var l=d-a.x-a.vx,u=p-a.y-a.vy,v=l*l+u*u;vt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e=m)){(t.data!==o||t.next)&&(0===i&&(i=h(),u+=i*i),0===a&&(a=h(),u+=a*a),u1?(null==e?g.remove(t):g.set(t,s(e)),l):g.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,r=0,o=n.length;r180||r<-180?r-360*Math.round(r/360):r):x(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?o:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):x(isNaN(e)?r:e)}}function o(t,e){var r=e-t;return r?n(t,r):x(isNaN(t)?e:t)}function s(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:A(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:A(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:A(t,r)},{i:s-2,x:A(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(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:A(r,n)})),a=E.lastIndex;return a=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}function r(t){return t[0]}function n(t){return t[1]}function i(t,e,i){var o=new a(null==e?r:e,null==i?n:i,NaN,NaN,NaN,NaN);return null==t?o:o.addAll(t)}function a(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function o(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var s=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},l=i.prototype=a.prototype;l.copy=function(){var t,e,r=new a(this._x,this._y,this._x0,this._y0,this._x1,this._y1),n=this._root;if(!n)return r;if(!n.length)return r._root=o(n),r;for(t=[{source:n,target:r._root=new Array(4)}];n=t.pop();)for(var i=0;i<4;++i)(e=n.source[i])&&(e.length?t.push({source:e,target:n.target[i]=new Array(4)}):n.target[i]=o(e));return r},l.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},l.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},l.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},l.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},l.find=function(t,e,r){var n,i,a,o,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new s(g,f,h,d,p)),null==r?r=1/0:(f=t-r,h=e-r,d=t+r,p=e+r,r*=r);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(a=c.y0)>p||(o=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(p+g)/2))?p=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},l.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--f}function o(){g=(m=y.now())+v,f=h=0;try{a()}finally{f=0,function(){var t,e,r=c,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);u=t,l(n)}(),g=0}}function s(){var t=y.now(),e=t-m;e>p&&(v-=e,m=t)}function l(t){if(!f){h&&(h=clearTimeout(h));var e=t-g;e>24?(t<1/0&&(h=setTimeout(o,e)),d&&(d=clearInterval(d))):(d||(m=g,d=setInterval(s,p)),f=1,x(o))}}var c,u,f=0,h=0,d=0,p=1e3,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,x="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||u===this||(u?u._next=this:c=this,u=this),this._call=t,this._time=n,l()},stop:function(){this._call&&(this._call=null,this._time=1/0,l())}};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},t.interval=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],128:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(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}}}function s(t){return t.length}function l(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function u(t){return(t+="")===ua||t[0]===fa?fa+t:t}function f(t){return(t+="")[0]===fa?t.slice(1):t}function h(t){return u(t)in this._}function d(t){return(t=u(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(f(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=ha.length;r0&&(t=t.slice(0,a));var s=wa.get(t);return s&&(t=s,o=G),a?e?function(){var a=o(e,ea(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}:n:e?b:function(){var e,r=new RegExp("^__on([^.]+)"+$i.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]}}}function H(t,e){return function(r){var n=$i.event;$i.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{$i.event=n}}}function G(t,e){var r=H(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}function Y(e){var n=".dragsuppress-"+ ++ka,i="click"+n,a=$i.select(r(e)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==Ma&&(Ma=!("onselectstart"in e)&&x(e.style,"userSelect")),Ma){var o=t(e).style,s=o[Ma];o[Ma]="none"}return function(t){if(a.on(n,null),Ma&&(o[Ma]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(Aa<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=$i.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();Aa=!(o.f||o.e),n.remove()}}return Aa?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function X(){return $i.event.changedTouches[0].identifier}function Z(t){return t>0?1:t<0?-1:0}function J(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function K(t){return t>1?0:t<-1?Ea:Math.acos(t)}function Q(t){return t>1?za:t<-1?-za:Math.asin(t)}function $(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return(t=Math.sin(t/2))*t}function et(){}function rt(t,e,r){return this instanceof rt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof rt?new rt(t.h,t.s,t.l):gt(""+t,vt,rt):new rt(t,e,r)}function nt(t,e,r){function n(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(a-i)*t/60:t<180?a:t<240?i+(a-i)*(240-t)/60:i}(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,a=r<=.5?r*(1+e):r+e-r*e,i=2*r-a,new ht(n(t+120),n(t),n(t-120))}function it(t,e,r){return this instanceof it?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof it?new it(t.h,t.c,t.l):lt(t instanceof ot?t.l:(t=yt((t=$i.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new it(t,e,r)}function at(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ot(r,Math.cos(t*=Da)*e,Math.sin(t)*e)}function ot(t,e,r){return this instanceof ot?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ot?new ot(t.l,t.a,t.b):t instanceof it?at(t.h,t.c,t.l):yt((t=ht(t)).r,t.g,t.b):new ot(t,e,r)}function st(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=ct(i)*Ua,n=ct(n)*Va,a=ct(a)*qa,new ht(ft(3.2404542*i-1.5371385*n-.4985314*a),ft(-.969266*i+1.8760108*n+.041556*a),ft(.0556434*i-.2040259*n+1.0572252*a))}function lt(t,e,r){return t>0?new it(Math.atan2(r,e)*Ia,Math.sqrt(e*e+r*r),t):new it(NaN,NaN,t)}function ct(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ut(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ft(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ht(t,e,r){return this instanceof ht?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ht?new ht(t.r,t.g,t.b):gt(""+t,ht,nt):new ht(t,e,r)}function dt(t){return new ht(t>>16,t>>8&255,255&t)}function pt(t){return dt(t)+""}function mt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function gt(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(bt(i[0]),bt(i[1]),bt(i[2]))}return(a=Ya.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 vt(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 rt(n,i,l)}function yt(t,e,r){var n=ut((.4124564*(t=xt(t))+.3575761*(e=xt(e))+.1804375*(r=xt(r)))/Ua),i=ut((.2126729*t+.7151522*e+.072175*r)/Va);return ot(116*i-16,500*(n-i),200*(i-ut((.0193339*t+.119192*e+.9503041*r)/qa)))}function xt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function _t(t){return"function"==typeof t?t:function(){return t}}function wt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Mt(e,r,t,n)}}function Mt(t,e,r,n){function i(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=$i.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=$i.event;$i.event=t;try{o.progress.call(a,l)}finally{$i.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(ea(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},$i.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}function kt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return Xa?Xa.n=i:Wa=i,Xa=i,Za||(Ja=clearTimeout(Ja),Za=1,Ka(At)),i}function At(){var t=Tt(),e=St()-t;e>24?(isFinite(e)&&(clearTimeout(Ja),Ja=setTimeout(At,e)),Za=0):(Za=1,Ka(At))}function Tt(){for(var t=Date.now(),e=Wa;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function St(){for(var t,e=Wa,r=1/0;e;)e.c?(e.t1?Date.UTC.apply(this,arguments):arguments[0])}function Ct(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3)}(+n[0]),r+n[0].length):-1}function Bt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ut(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Vt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function qt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function Ht(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Gt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Yt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Wt(t,e,r){ao.lastIndex=0;var n=ao.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Xt(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=ca(e)/60|0,i=ca(e)%60;return r+Dt(n,"0",2)+Dt(i,"0",2)}function Zt(t,e,r){oo.lastIndex=0;var n=oo.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jt(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,f=i*l+u*Math.cos(s),h=u*o*Math.sin(s);ho.add(Math.atan2(h,f)),n=t,i=l,a=c}var e,r,n,i,a;po.point=function(o,s){po.point=t,n=(e=o)*Da,i=Math.cos(s=(r=s)*Da/2+Ea/4),a=Math.sin(s)},po.lineEnd=function(){t(e,r)}}function ne(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function oe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function se(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function le(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ce(t){return[Math.atan2(t[1],t[0]),Q(t[2])]}function ue(t,e){return ca(t[0]-e[0])=0;--s)i.point((f=u[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function xe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(we))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=$i.merge(d);var t=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;ho.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>Ea,A=p*x;if(ho.add(Math.atan2(A*w*Math.sin(M),m*b+A*Math.cos(M))),a+=k?_+w*La:_,k^h>=r^v>=r){var T=ae(ne(f),ne(t));le(T);var S=ae(i,T);le(S);var E=(k^_>=0?-1:1)*Q(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;h=v,p=x,m=b,f=t}}return(a<-Ta||a1}function Me(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:b,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ke(t,e){return((t=t.x)[0]<0?t[1]-za-Ta:za-t[1])-((e=e.x)[0]<0?e[1]-za-Ta:za-e[1])}function Ae(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,d=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>u&&(u=a)}else if(d>0){if(a0&&(i.a={x:l+u*h,y:c+u*d}),f<1&&(i.b={x:l+f*h,y:c+f*d}),i}}}}}}function Te(t,e,r,n){function i(n,i){return ca(n[0]-t)0?0:3:ca(n[0]-r)0?2:1:ca(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(a,s,l,c){var u=0,f=0;if(null==a||(u=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==f);else c.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function u(t,e){c(t,e)&&s.point(t,e)}function f(t,e){var r=c(t=Math.max(-Eo,Math.min(Eo,t)),e=Math.max(-Eo,Math.min(Eo,e)));if(d&&p.push([t,e]),_)m=t,g=e,v=r,_=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&b)s.point(t,e);else{var n={a:{x:y,y:x},b:{x:t,y:e}};A(n)?(b||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),w=!1):r&&(s.lineStart(),s.point(t,e),w=!1)}y=t,x=e,b=r}var h,d,p,m,g,v,y,x,b,_,w,M=s,k=Me(),A=Ae(t,e,r,n),T={point:u,lineStart:function(){T.point=f,d&&d.push(p=[]),_=!0,b=!1,y=x=NaN},lineEnd:function(){h&&(f(m,g),v&&b&&k.rejoin(),h.push(k.buffer())),T.point=u,b&&s.lineEnd()},polygonStart:function(){s=k,h=[],d=[],w=!0},polygonEnd:function(){s=M,h=$i.merge(h);var e=function(t){for(var e=0,r=d.length,n=t[1],i=0;in&&J(c,a,t)>0&&++e:a[1]<=n&&J(c,a,t)<0&&--e,c=a;return 0!==e}([t,n]),r=w&&e,i=h.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&ye(h,a,e,l,s),s.polygonEnd()),h=d=p=null}};return T}}function Se(t){var e=0,r=Ea/3,n=je(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*Ea/180,r=t[1]*Ea/180):[e/Ea*180,r/Ea*180]},i}function Ee(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,Q((a-(t*t+r*r)*i*i)/(2*i))]},r}function Le(){function t(t,e){Co+=i*t-n*e,n=t,i=e}var e,r,n,i;Oo.point=function(a,o){Oo.point=t,e=n=a,r=i=o},Oo.lineEnd=function(){t(e,r)}}function Ce(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ze(t,e){vo+=t,yo+=e,++xo}function De(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);bo+=o*(e+t)/2,_o+=o*(r+n)/2,wo+=o,ze(e=t,r=n)}var e,r;Ro.point=function(n,i){Ro.point=t,ze(e=n,r=i)}}function Ie(){Ro.point=ze}function Pe(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);bo+=o*(n+t)/2,_o+=o*(i+e)/2,wo+=o,Mo+=(o=i*t-n*e)*(n+t),ko+=o*(i+e),Ao+=3*o,ze(n=t,i=e)}var e,r,n,i;Ro.point=function(a,o){Ro.point=t,ze(e=n=a,r=i=o)},Ro.lineEnd=function(){t(e,r)}}function Oe(t){function e(e){return(a?function(e){function n(r,n){r=t(r,n),e.point(r[0],r[1])}function i(){y=NaN,M.point=o,e.lineStart()}function o(n,i){var o=ne([n,i]),s=t(n,i);r(y,x,v,b,_,w,y=s[0],x=s[1],v=n,b=o[0],_=o[1],w=o[2],a,e),e.point(y,x)}function s(){M.point=n,e.lineEnd()}function l(){i(),M.point=c,M.lineEnd=u}function c(t,e){o(f=t,e),h=y,d=x,p=b,m=_,g=w,M.point=o}function u(){r(y,x,v,b,_,w,h,d,f,p,m,g,a,e),M.lineEnd=s,s()}var f,h,d,p,m,g,v,y,x,b,_,w,M={point:n,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),M.lineStart=l},polygonEnd:function(){e.polygonEnd(),M.lineStart=i}};return M}:function(e){return Re(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function r(e,a,o,s,l,c,u,f,h,d,p,m,g,v){var y=u-e,x=f-a,b=y*y+x*x;if(b>4*n&&g--){var _=s+d,w=l+p,M=c+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=ca(ca(M)-1)n||ca((y*C+x*z)/b-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(n)},e}function Fe(t){this.stream=t}function Re(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ne(t){return je(function(){return t})()}function je(t){function e(t){return t=o(t[0]*Da,t[1]*Da),[t[0]*f+s,l-t[1]*f]}function r(){o=ge(a=qe(g,v,x),i);var t=i(p,m);return s=h-t[0]*f,l=d+t[1]*f,n()}function n(){return c&&(c.valid=!1,c=null),e}var i,a,o,s,l,c,u=Oe(function(t,e){return t=i(t,e),[t[0]*f+s,l-t[1]*f]}),f=150,h=480,d=250,p=0,m=0,g=0,v=0,x=0,b=So,_=y,w=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=Be(b(a,u(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(b=null==t?(w=t,So):function(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t,e,r){var n=[1,0,0],a=ae(ne(t),ne(e)),o=ie(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=i*o/l,u=-i*s/l,f=ae(n,a),h=se(n,c);oe(h,se(a,u));var d=f,p=ie(h,d),m=ie(d,d),g=p*p-m*(ie(h,h)-1);if(!(g<0)){var v=Math.sqrt(g),y=se(d,(-p-v)/m);if(oe(y,h),y=ce(y),!r)return y;var x,b=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(ca(y[0]-b)Ea^(b<=y[0]&&y[0]<=_)){var T=se(d,(-p+v)/m);return oe(T,h),[y,ce(T)]}}}function n(e,r){var n=a?t:Ea-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var i=Math.cos(t),a=i>0,o=ca(i)>Ta;return _e(e,function(t){var i,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=e(f,h),g=a?m?0:n(f,h):m?n(f+(f<0?Ea:-Ea),h):0;if(!i&&(c=l=m)&&t.lineStart(),m!==l&&(d=r(i,p),(ue(i,d)||ue(p,d))&&(p[0]+=Ta,p[1]+=Ta,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=r(p,i),t.point(d[0],d[1])):(d=r(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(o&&i&&a^m){var v;g&s||!(v=r(p,i,!0))||(u=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||i&&ue(i,p)||t.point(p[0],p[1]),i=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},We(t,6*Da),a?[0,-t]:[-Ea,t-Ea])}((w=+t)*Da),n()):w},e.clipExtent=function(t){return arguments.length?(M=t,_=t?Te(t[0][0],t[0][1],t[1][0],t[1][1]):y,n()):M},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],r()):[h,d]},e.center=function(t){return arguments.length?(p=t[0]%360*Da,m=t[1]%360*Da,r()):[p*Ia,m*Ia]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Da,v=t[1]%360*Da,x=t.length>2?t[2]%360*Da:0,r()):[g*Ia,v*Ia,x*Ia]},$i.rebind(e,u,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&function(t){return(t=o.invert((t[0]-s)/f,(l-t[1])/f))&&[t[0]*Ia,t[1]*Ia]},r()}}function Be(t){return Re(t,function(e,r){t.point(e*Da,r*Da)})}function Ue(t,e){return[t,e]}function Ve(t,e){return[t>Ea?t-La:t<-Ea?t+La:t,e]}function qe(t,e,r){return t?e||r?ge(Ge(t),Ye(e,r)):Ge(t):e||r?Ye(e,r):Ve}function He(t){return function(e,r){return e+=t,[e>Ea?e-La:e<-Ea?e+La:e,r]}}function Ge(t){var e=He(t);return e.invert=He(-t),e}function Ye(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),Q(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),Q(u*n-s*i)]},r}function We(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Xe(r,i),a=Xe(r,a),(o>0?ia)&&(i+=o*La)):(i=t+o*La,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-za+Ta&&(e=-za+Ta):e>za-Ta&&(e=za-Ta);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(Ea/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=Z(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-za]},r):rr}function er(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return ca(i)1&&J(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function lr(t,e){return t[0]-e[0]||t[1]-e[1]}function cr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ur(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function fr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function hr(t){var e=Ko.pop()||new function(){Sr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function dr(t){_r(t),Xo.remove(t),Ko.push(t),Sr(t)}function pr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];dr(t);for(var l=a;l.circle&&ca(r-l.circle.x)Ta)s=s.L;else{if(!((i=a-function(t,e){var r=t.N;if(r)return gr(r,e);var n=t.site;return n.y===e?n.x:1/0}(s,o))>Ta)){n>-Ta?(e=s.P,r=s):i>-Ta?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=hr(t);if(Xo.insert(e,l),e||r){if(e===r)return _r(e),r=hr(e.site),Xo.insert(l,r),l.edge=r.edge=Mr(e.site,l.site),br(e),void br(r);if(r){_r(e),_r(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,g=p.y-f,v=2*(h*g-d*m),y=h*h+d*d,x=m*m+g*g,b={x:(g*y-d*x)/v+u,y:(h*x-m*y)/v+f};kr(r.edge,c,p,b),l.edge=Mr(c,t,null,b),r.edge=Mr(t,p,null,b),br(e),br(r)}else l.edge=Mr(e.site,l.site)}}function gr(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,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function vr(t){this.site=t,this.edges=[]}function yr(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=Wo,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;oTa||ca(i-r)>Ta)&&(s.splice(o,0,new Ar(function(t,e,r){var n=new wr(t,null);return n.a=e,n.b=r,Yo.push(n),n}(a.site,u,ca(n-f)Ta?{x:f,y:ca(e-f)Ta?{x:ca(r-p)Ta?{x:h,y:ca(e-h)Ta?{x:ca(r-d)=-Sa)){var h=l*l+c*c,d=u*u+g*g,p=(g*h-c*d)/f,m=(l*d-u*h)/f,g=m+s,v=Qo.pop()||new function(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,x=Jo._;x;)if(v.y=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}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.xa&&(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:Nr(r,n)})),a=es.lastIndex;return a=0&&!(r=$i.interpolators[n](t,e)););return r}function Ur(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(tn(r)+"rotate(",null,")")-2,x:Nr(t,e)})):e&&r.push(tn(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(tn(r)+"skewX(",null,")")-2,x:Nr(t,e)}):e&&r.push(tn(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(tn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Nr(t[0],e[0])},{i:i-2,x:Nr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(tn(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function pn(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;++oi&&(n=r,i=e);return n}function An(t){return t.reduce(Tn,0)}function Tn(t,e){return t+e[1]}function Sn(t,e){return En(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function En(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 Ln(t){return[$i.min(t),$i.max(t)]}function Cn(t,e){return t.value-e.value}function zn(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Dn(t,e){t._pack_next=e,e._pack_prev=t}function In(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 Pn(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,f=-1/0,h=1/0,d=-1/0;if(r.forEach(On),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(Nn(n,i,a=r[2]),e(a),zn(n,a),n._pack_prev=a,zn(a,i),i=n._pack_next,o=3;o2?Kn:Xn,l=n?nn:rn;return o=i(t,e,l,r),s=i(e,t,l,Br),a}function a(t){return o(t)}var o,s;return a.invert=function(t){return s(t)},a.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},a.range=function(t){return arguments.length?(e=t,i()):e},a.rangeRound=function(t){return a.range(t).interpolate(Jr)},a.clamp=function(t){return arguments.length?(n=t,i()):n},a.interpolate=function(t){return arguments.length?(r=t,i()):r},a.ticks=function(e){return ri(t,e)},a.tickFormat=function(e,r){return ni(t,e,r)},a.nice=function(e){return ti(t,e),i()},a.copy=function(){return Qn(t,e,r,n)},i()}function $n(t,e){return $i.rebind(t,e,"range","rangeRound","interpolate","clamp")}function ti(t,e){return Zn(t,Jn(ei(t,e)[2])),Zn(t,Jn(ei(t,e)[2])),t}function ei(t,e){null==e&&(e=10);var r=Yn(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 ri(t,e){return $i.range.apply($i,ei(t,e))}function ni(t,e,r){var n=ei(t,e);if(r){var i=$a.exec(r);if(i.shift(),"s"===i[8]){var a=$i.formatPrefix(Math.max(ca(n[0]),ca(n[1])));return i[7]||(i[7]="."+ii(a.scale(n[2]))),i[8]="f",r=$i.format(i.join("")),function(t){return r(a.scale(t))+a.symbol}}i[7]||(i[7]="."+function(t,e){var r=ii(e[2]);return t in ds?Math.abs(r-ii(Math.max(ca(e[0]),ca(e[1]))))+ +("e"!==t):r-2*("%"===t)}(i[8],n)),r=i.join("")}else r=",."+ii(n[2])+"f";return $i.format(r)}function ii(t){return-Math.floor(Math.log(t)/Math.LN10+.01)}function ai(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=Zn(n.map(i),r?Math:ms);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Yn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;h--)o.push(a(c)*h);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return ps;arguments.length<2?r=ps:"function"!=typeof r&&(r=$i.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function bi(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,g=h-u,v=d-f,y=g*g+v*v,x=r-n,b=u*d-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,M=(-b*g-v*_)/y,k=(b*v+g*_)/y,A=(-b*g+v*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-c],[w*r/x,M*r/x]]}function _i(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],f=-1,h=e.length,d=_t(r),p=_t(n);++f1?t.join("L"):t+"Z"}function Mi(t){return t.join("L")+"Z"}function ki(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 c=2;c9&&(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}function Ii(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,f,h,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=kt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function Yi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function Wi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function Xi(t){return t.toISOString()}function Zi(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=$i.bisect(Bs,n);return i==Bs.length?[e.year,ei(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Bs[i-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=Ji(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=Ji(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Yn(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],Ji(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Zi(t.copy(),e,r)},$n(n,t)}function Ji(t){return new Date(t)}function Ki(t){return JSON.parse(t.responseText)}function Qi(t){var e=ra.createRange();return e.selectNode(ra.body),e.createContextualFragment(t.responseText)}var $i={version:"3.5.17"},ta=[].slice,ea=function(t){return ta.call(t)},ra=this.document;if(ra)try{ea(ra.documentElement.childNodes)[0].nodeType}catch(t){ea=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}),ra)try{ra.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var na=this.Element.prototype,ia=na.setAttribute,aa=na.setAttributeNS,oa=this.CSSStyleDeclaration.prototype,sa=oa.setProperty;na.setAttribute=function(t,e){ia.call(this,t,e+"")},na.setAttributeNS=function(t,e,r){aa.call(this,t,e,r+"")},oa.setProperty=function(t,e,r){sa.call(this,t,e+"",r)}}$i.ascending=n,$i.descending=function(t,e){return et?1:e>=t?0:NaN},$i.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},$i.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},$i.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 l/(u-1)},$i.deviation=function(){var t=$i.variance.apply(this,arguments);return t?Math.sqrt(t):t};var la=o(n);$i.bisectLeft=la.left,$i.bisect=$i.bisectRight=la.right,$i.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},$i.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},$i.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},$i.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 ca=Math.abs;$i.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}(ca(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)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,f,h,d=-1,p=o.length,m=a[s++],g=new c;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t($i.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},$i.set=function(t){var e=new v;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}},$i.event=null,$i.requote=function(t){return t.replace(da,"\\$&")};var da=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,pa={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},ma=function(t,e){return e.querySelector(t)},ga=function(t,e){return e.querySelectorAll(t)},va=function(t,e){var r=t.matches||t[x(t,"matchesSelector")];return(va=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(ma=function(t,e){return Sizzle(t,e)[0]||null},ga=Sizzle,va=Sizzle.matchesSelector),$i.selection=function(){return $i.select(ra.documentElement)};var ya=$i.selection.prototype=[];ya.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),ba.hasOwnProperty(r)?{space:ba[r],local:t}:t}},ya.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=$i.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},ya.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=D(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},ya.sort=function(t){t=function(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.transition().duration(E)),e.call(t.event)}function o(){b&&b.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){L++||t({type:"zoomstart"})}function l(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=P.of(t,arguments),a=0,o=$i.select(r(t)).on(z,function(){a=1,i($i.mouse(t),u),l(n)}).on(D,function(){o.on(z,null).on(D,null),f(a),c(n)}),u=e($i.mouse(t)),f=Y(t);Cs.call(t),s(n)}function f(){function t(){var t=$i.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=$i.event.target;$i.select(e).on(b,o).on(_,h),w.push(e);for(var r=$i.event.changedTouches,n=0,i=r.length;n1){c=s[0];var u=s[1],f=c[0]-u[0],d=c[1]-u[1];v=f*f+d*d}}function o(){var t,e,r,a,o=$i.touches(p);Cs.call(p);for(var s=0,c=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++8?function(t){return t/r}:function(t){return t*r},symbol:t}});$i.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=$i.round(t,Et(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Qa[8+r/3]};var $a=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,to=$i.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=$i.round(t,Et(t,e))).toFixed(Math.max(0,Math.min(20,Et(t*(1+1e-15),e))))}}),eo=$i.time={},ro=Date;Lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){no.setUTCDate.apply(this._,arguments)},setDay:function(){no.setUTCDay.apply(this._,arguments)},setFullYear:function(){no.setUTCFullYear.apply(this._,arguments)},setHours:function(){no.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){no.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){no.setUTCMinutes.apply(this._,arguments)},setMonth:function(){no.setUTCMonth.apply(this._,arguments)},setSeconds:function(){no.setUTCSeconds.apply(this._,arguments)},setTime:function(){no.setTime.apply(this._,arguments)}};var no=Date.prototype;eo.year=Ct(function(t){return(t=eo.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),eo.years=eo.year.range,eo.years.utc=eo.year.utc.range,eo.day=Ct(function(t){var e=new ro(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),eo.days=eo.day.range,eo.days.utc=eo.day.utc.range,eo.dayOfYear=function(t){var e=eo.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=eo[t]=Ct(function(t){return(t=eo.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});eo[t+"s"]=r.range,eo[t+"s"].utc=r.utc.range,eo[t+"OfYear"]=function(t){var r=eo.year(t).getDay();return Math.floor((eo.dayOfYear(t)+(r+e)%7)/7)}}),eo.week=eo.sunday,eo.weeks=eo.sunday.range,eo.weeks.utc=eo.sunday.utc.range,eo.weekOfYear=eo.sundayOfYear;var io={"-":"",_:" ",0:"0"},ao=/^\s*\d+/,oo=/^%/;$i.locale=function(t){return{numberFormat:function(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:y;return function(t){var r=$a.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],f=r[7],h=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=to.get(d)||function(t){return t+""};var x=c&&f;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=$i.formatPrefix(t,h);t=l.scale(t),r=l.symbol+g}else t*=p;var b,_,w=(t=d(t,h)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(b=t,_=""):(b=t.substring(0,M),_=t.substring(M))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=a(b,1/0));var k=m.length+b.length+_.length+(x?0:i.length),A=k"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(x?t:A+t))+r}}}(t),timeFormat:function(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=_[o in io?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}var n=t.dateTime,i=t.date,a=t.time,o=t.periods,s=t.days,l=t.shortDays,c=t.months,u=t.shortMonths;e.multi=(e.utc=function(t){function r(t){try{var e=new(ro=Lt);return e._=t,n(e)}finally{ro=Date}}var n=e(t);return r.parse=function(t){try{ro=Lt;var e=n.parse(t);return e&&e._}finally{ro=Date}},r.toString=n.toString,r}).multi=Jt;var f=$i.map(),h=It(s),d=Pt(s),p=It(l),m=Pt(l),g=It(c),v=Pt(c),y=It(u),x=Pt(u);o.forEach(function(t,e){f.set(t.toLowerCase(),e)});var b={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Dt(t.getDate(),e,2)},e:function(t,e){return Dt(t.getDate(),e,2)},H:function(t,e){return Dt(t.getHours(),e,2)},I:function(t,e){return Dt(t.getHours()%12||12,e,2)},j:function(t,e){return Dt(1+eo.dayOfYear(t),e,3)},L:function(t,e){return Dt(t.getMilliseconds(),e,3)},m:function(t,e){return Dt(t.getMonth()+1,e,2)},M:function(t,e){return Dt(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Dt(t.getSeconds(),e,2)},U:function(t,e){return Dt(eo.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Dt(eo.mondayOfYear(t),e,2)},x:e(i),X:e(a),y:function(t,e){return Dt(t.getFullYear()%100,e,2)},Y:function(t,e){return Dt(t.getFullYear()%1e4,e,4)},Z:Xt,"%":function(){return"%"}},_={a:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){h.lastIndex=0;var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,n){return r(t,b.c.toString(),e,n)},d:Vt,e:Vt,H:Ht,I:Ht,j:qt,L:Wt,m:Ut,M:Gt,p:function(t,e,r){var n=f.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Yt,U:Ft,w:Ot,W:Rt,x:function(t,e,n){return r(t,b.x.toString(),e,n)},X:function(t,e,n){return r(t,b.X.toString(),e,n)},y:jt,Y:Nt,Z:Bt,"%":Zt};return e}(t)}};var so=$i.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});$i.format=so.numberFormat,$i.geo={},Kt.prototype={s:0,t:0,add:function(t){Qt(t,this.t,lo),Qt(lo.s,this.s,this),this.s?this.t+=lo.t:this.s=lo.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var lo=new Kt;$i.geo.stream=function(t,e){t&&co.hasOwnProperty(t.type)?co[t.type](t,e):$t(t,e)};var co={Feature:function(t,e){$t(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ne([e*Da,r*Da]);if(v){var i=ae(v,n),a=ae([i[1],-i[0],0],i);le(a),a=ce(a);var o=e-p,l=o>0?1:-1,c=a[0]*Ia*l,m=ca(o)>180;if(m^(l*pd&&(d=g)}else if(c=(c+360)%360-180,m^(l*pd&&(d=r);m?es(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e):h>=u?(eh&&(h=e)):e>p?s(u,e)>s(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=h,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=ca(n)>180?n+(n>0?360:-360):n}else m=t,g=r;po.point(t,r),e(t,r)}function a(){po.lineStart()}function o(){i(m,g),po.lineEnd(),ca(y)>Ta&&(u=-(h=180)),b[0]=u,b[1]=h,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:tTa?d=90:y<-Ta&&(f=-90),b[0]=u,b[1]=h}};return function(t){d=h=-(u=f=1/0),x=[],$i.geo.stream(t,_);if(i=x.length){x.sort(l);for(var e=1,r=[p=x[0]];es(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):r.push(p=a);for(var n,i,a,o=-1/0,p=(e=0,r[i=r.length-1]);e<=i;p=a,++e)a=r[e],(n=s(p[1],a[0]))>o&&(o=n,u=a[0],h=p[1])}return x=b=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[h,d]]}}(),$i.geo.centroid=function(t){mo=go=vo=yo=xo=bo=_o=wo=Mo=ko=Ao=0,$i.geo.stream(t,To);var e=Mo,r=ko,n=Ao,i=e*e+r*r+n*n;return i0?Ea:-Ea,l=ca(a-r);ca(l-Ea)0?za:-za),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=Ea&&(ca(r-i)Ta?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*za,n.point(-Ea,i),n.point(0,i),n.point(Ea,i),n.point(Ea,0),n.point(Ea,-i),n.point(0,-i),n.point(-Ea,-i),n.point(-Ea,0),n.point(-Ea,i);else if(ca(t[0]-e[0])>Ta){var a=t[0]=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],f=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(l).point,n=o.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+Ta,f+.12*c+Ta],[u-.214*c-Ta,f+.234*c-Ta]]).stream(l).point,i=s.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+Ta,f+.166*c+Ta],[u-.115*c-Ta,f+.234*c-Ta]]).stream(l).point,t},t.scale(1070)};var Lo,Co,zo,Do,Io,Po,Oo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Co=0,Oo.lineStart=Le},polygonEnd:function(){Oo.lineStart=Oo.lineEnd=Oo.point=b,Lo+=ca(Co/2)}},Fo={point:function(t,e){tIo&&(Io=t),ePo&&(Po=e)},lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ro={point:ze,lineStart:De,lineEnd:Ie,polygonStart:function(){Ro.lineStart=Pe},polygonEnd:function(){Ro.point=ze,Ro.lineStart=De,Ro.lineEnd=Ie}};$i.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),$i.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Lo=0,$i.geo.stream(t,i(Oo)),Lo},t.centroid=function(t){return vo=yo=xo=bo=_o=wo=Mo=ko=Ao=0,$i.geo.stream(t,i(Ro)),Ao?[Mo/Ao,ko/Ao]:wo?[bo/wo,_o/wo]:xo?[vo/xo,yo/xo]:[NaN,NaN]},t.bounds=function(t){return Io=Po=-(zo=Do=1/0),$i.geo.stream(t,i(Fo)),[[zo,Do],[Io,Po]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||function(t){var e=Oe(function(e,r){return t([e*Ia,r*Ia])});return function(t){return Be(e(t))}}(t):y,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new function(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ce(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ce(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}:new function(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,La)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:b};return s}(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection($i.geo.albersUsa()).context(null)},$i.geo.transform=function(t){return{stream:function(e){var r=new Fe(e);for(var n in t)r[n]=t[n];return r}}},Fe.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},$i.geo.projection=Ne,$i.geo.projectionMutator=je,($i.geo.equirectangular=function(){return Ne(Ue)}).raw=Ue.invert=Ue,$i.geo.rotation=function(t){function e(e){return e=t(e[0]*Da,e[1]*Da),e[0]*=Ia,e[1]*=Ia,e}return t=qe(t[0]%360*Da,t[1]*Da,t.length>2?t[2]*Da:0),e.invert=function(e){return e=t.invert(e[0]*Da,e[1]*Da),e[0]*=Ia,e[1]*=Ia,e},e},Ve.invert=Ue,$i.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=qe(-t[0]*Da,-t[1]*Da,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=Ia,t[1]*=Ia}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=We((e=+n)*Da,i*Da),t):e},t.precision=function(n){return arguments.length?(r=We(e*Da,(i=+n)*Da),t):i},t.angle(90)},$i.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Da,i=t[1]*Da,a=e[1]*Da,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},$i.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return $i.range(Math.ceil(a/g)*g,i,g).map(h).concat($i.range(Math.ceil(c/v)*v,l,v).map(d)).concat($i.range(Math.ceil(n/p)*p,r,p).filter(function(t){return ca(t%g)>Ta}).map(u)).concat($i.range(Math.ceil(s/m)*m,o,m).filter(function(t){return ca(t%v)>Ta}).map(f))}var r,n,i,a,o,s,l,c,u,f,h,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=Ze(s,o,90),f=Je(n,r,y),h=Ze(c,l,90),d=Je(a,i,y),t):y},t.majorExtent([[-180,-90+Ta],[180,90-Ta]]).minorExtent([[-180,-80-Ta],[180,80+Ta]])},$i.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=Ke,i=Qe;return t.distance=function(){return $i.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},$i.geo.interpolate=function(t,e){return function(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),c=i*Math.sin(t),u=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(tt(n-e)+i*o*tt(r-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,r=Math.sin(h-t)*d,n=r*l+e*u,i=r*c+e*f,o=r*a+e*s;return[Math.atan2(i,n)*Ia,Math.atan2(o,Math.sqrt(n*n+i*i))*Ia]}:function(){return[t*Ia,e*Ia]};return p.distance=h,p}(t[0]*Da,t[1]*Da,e[0]*Da,e[1]*Da)},$i.geo.length=function(t){return No=0,$i.geo.stream(t,jo),No};var No,jo={sphere:b,point:b,lineStart:function(){function t(t,i){var a=Math.sin(i*=Da),o=Math.cos(i),s=ca((t*=Da)-e),l=Math.cos(s);No+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;jo.point=function(i,a){e=i*Da,r=Math.sin(a*=Da),n=Math.cos(a),jo.point=t},jo.lineEnd=function(){jo.point=jo.lineEnd=b}},lineEnd:b,polygonStart:b,polygonEnd:b},Bo=$e(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});($i.geo.azimuthalEqualArea=function(){return Ne(Bo)}).raw=Bo;var Uo=$e(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);($i.geo.azimuthalEquidistant=function(){return Ne(Uo)}).raw=Uo,($i.geo.conicConformal=function(){return Se(tr)}).raw=tr,($i.geo.conicEquidistant=function(){return Se(er)}).raw=er;var Vo=$e(function(t){return 1/t},Math.atan);($i.geo.gnomonic=function(){return Ne(Vo)}).raw=Vo,rr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-za]},($i.geo.mercator=function(){return nr(rr)}).raw=rr;var qo=$e(function(){return 1},Math.asin);($i.geo.orthographic=function(){return Ne(qo)}).raw=qo;var Ho=$e(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});($i.geo.stereographic=function(){return Ne(Ho)}).raw=Ho,ir.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-za]},($i.geo.transverseMercator=function(){var t=nr(ir),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=ir,$i.geom={},$i.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=_t(r),a=_t(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+f;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/Ta)*Ta,y:Math.round(o(t,e)/Ta)*Ta,i:e}})}var n=ar,i=or,a=n,o=i,s=$o;return t?e(t):(e.links=function(t){return zr(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return zr(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(xr),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,h=n>=u,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),f?i=c:s=c,h?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,f,h,d,p,m,g,v,y,x=_t(s),b=_t(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),f=[],h=[],p=t.length,o)for(d=0;dv&&(v=u.x),u.y>y&&(y=u.y),f.push(u.x),h.push(u.y);else for(d=0;dv&&(v=_),w>y&&(y=w),f.push(_),h.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null};if(A.add=function(t){a(A,t,+x(t,++d),+b(t,d),m,g,v,y)},A.visit=function(t){Or(t,A,m,g,v,y)},A.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,d){if(!(u>a||f>o||h=_)<<1|e>=b,M=w+4;w=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=ns.get(r)||rs,n=is.get(n)||y,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}(n(r.apply(null,ta.call(arguments,1))))},$i.interpolateHcl=function(t,e){t=$i.hcl(t),e=$i.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return at(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateHsl=function(t,e){t=$i.hsl(t),e=$i.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return nt(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateLab=function(t,e){t=$i.lab(t),e=$i.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return st(r+a*t,n+o*t,i+s*t)+""}},$i.interpolateRound=Jr,$i.transform=function(t){var e=ra.createElementNS($i.ns.prefix.svg,"g");return($i.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Kr(r?r.matrix:as)})(t)},Kr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var as={a:1,b:0,c:0,d:1,e:0,f:0};$i.interpolateTransform=en,$i.layout={},$i.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=kt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return pn(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=vn,r=mn,n=gn;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(dn(e,function(t){t.children&&(t.value=0)}),pn(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},$i.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&((o=l[$i.bisect(f,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Ln,i=Sn;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=_t(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return En(t,e)}:_t(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},$i.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,pn(s,function(t){t.r=+u(t.value)}),pn(s,Pn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;pn(s,function(t){t.r+=f}),pn(s,Pn),pn(s,function(t){t.r-=f})}return Rn(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=$i.layout.hierarchy().sort(Cn),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},hn(t,r)},$i.layout.tree=function(){function t(t,l){var c=i.call(this,t,l),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;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 m=a(h,d)/2-h.x,g=o[0]/(d.x+a(d,h)/2+m),v=o[1]/(p.depth||1);dn(u,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return c}function e(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.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 i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+a(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+a(t._,n._));t.parent.A=function(t,e,r){if(e){for(var n,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,f=s.m,h=l.m;s=Un(s),i=Bn(i),s&&i;)l=Bn(l),(o=Un(o)).a=t,(n=s.z+f-i.z-c+a(s._,i._))>0&&(!function(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}(function(t,e,r){return t.a.parent===e.parent?t.a:r}(s,t,r),t,n),c+=n,u+=n),f+=s.m,c+=i.m,h+=l.m,u+=o.m;s&&!Un(o)&&(o.t=s,o.m+=f-u),i&&!Bn(l)&&(l.t=i,l.m+=c-h,r=t)}return r}(t,n,t.parent.A||r[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function n(t){t.x*=o[0],t.y=t.depth*o[1]}var i=$i.layout.hierarchy().sort(null).value(null),a=jn,o=[1,1],s=null;return t.separation=function(e){return arguments.length?(a=e,t):a},t.size=function(e){return arguments.length?(s=null==(o=e)?n:null,t):s?null:o},t.nodeSize=function(e){return arguments.length?(s=null==(o=e)?null:n,t):s?o:null},hn(t,i)},$i.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;pn(l,function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(e),t.y=function(t){return 1+$i.max(t,function(t){return t.y})}(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Vn(l),f=qn(l),h=u.x-r(u,f)/2,d=f.x+r(f,u)/2;return pn(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=$i.layout.hierarchy().sort(null).value(null),r=jn,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},hn(t,e)},$i.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(a=f[s-1]),c.area+=a.area,"squarify"!==h||(o=function(t,e){var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;for(;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}(c,m))<=p?(f.pop(),p=o):(c.area-=c.pop().area,n(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(n(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function r(e){var i=e.children;if(i&&i.length){var a,o=u(e),s=i.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(n(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);i.forEach(r)}}function n(t,e,r,n){var i,a=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=$i.random.normal.apply($i,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=$i.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rf?0:1;if(c=Ca)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,x,b,_,w,M,k,A,T=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===bs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(S*=-1),c&&(S=Q(g/c*Math.sin(v))),t&&(T=Q(g/t*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var L=Math.abs(f-u-2*S)<=Ea?0:1;if(S&&xi(y,x,b,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),M=t*Math.sin(f-T),k=t*Math.cos(u+T),A=t*Math.sin(u+T);var z=Math.abs(u-f+2*T)<=Ea?0:1;if(T&&xi(w,M,k,A)===1-d^z){var D=(u+f)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(h>Ta&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",n[0]),i.join("")},"step-before":ki,"step-after":Ai,basis:Ei,"basis-open":function(t){if(t.length<4)return wi(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(Li(ks,a)+","+Li(ks,o)),--n;++nEa)+",1 "+e}function n(t,e,r,n){return"Q 0,0 "+n}var i=Ke,a=Qe,o=Oi,s=gi,l=vi;return t.radius=function(e){return arguments.length?(o=_t(e),t):o},t.source=function(e){return arguments.length?(i=_t(e),t):i},t.target=function(e){return arguments.length?(a=_t(e),t):a},t.startAngle=function(e){return arguments.length?(s=_t(e),t):s},t.endAngle=function(e){return arguments.length?(l=_t(e),t):l},t},$i.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,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(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Ke,r=Qe,n=Fi;return t.source=function(r){return arguments.length?(e=_t(r),t):e},t.target=function(e){return arguments.length?(r=_t(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},$i.svg.diagonal.radial=function(){var t=$i.svg.diagonal(),e=Fi,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]-za;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},$i.svg.symbol=function(){function t(t,n){return(As.get(e.call(this,t,n))||ji)(r.call(this,t,n))}var e=Ni,r=Ri;return t.type=function(r){return arguments.length?(e=_t(r),t):e},t.size=function(e){return arguments.length?(r=_t(e),t):r},t};var As=$i.map({circle:ji,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*Ss)),r=e*Ss;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/Ts),r=e*Ts/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Ts),r=e*Ts/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});$i.svg.symbolTypes=As.keys();var Ts=Math.sqrt(3),Ss=Math.tan(30*Da);ya.transition=function(t){for(var e,r,n=Es||++Ds,i=Hi(t),a=[],o=Ls||{time:Date.now(),ease:function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){var t=$i.mouse(x),r=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||($i.event.altKey?(v||(v=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(t[0]=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(u=0;u<_.length;++u)h=(b=_[u])[0],b[0]=b[1],b[1]=h;return _}},{"incremental-convex-hull":278,uniq:556}],131:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]};function a(t,e){return i[0]=t,i[1]=e,n[0]}e.exports.pack=a;function o(t){return n[0]=t,i[0]}e.exports.lo=o;function s(t){return n[0]=t,i[1]}e.exports.hi=s}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]};function l(t,e){return i[1]=t,i[0]=e,n[0]}e.exports.pack=l;function c(t){return n[0]=t,i[1]}e.exports.lo=c;function u(t){return n[0]=t,i[0]}e.exports.hi=u}else r=!1}if(!r){var f=new t(8);e.exports=function(t){return f.writeDoubleLE(t,0,!0),[f.readUInt32LE(0,!0),f.readUInt32LE(4,!0)]};function h(t,e){return f.writeUInt32LE(t,0,!0),f.writeUInt32LE(e,4,!0),f.readDoubleLE(0,!0)}e.exports.pack=h;function d(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(0,!0)}e.exports.lo=d;function p(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(4,!0)}e.exports.hi=p}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:82}],132:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":43,"normalize-svg-path":460}],133:[function(t,e,r){e.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}}},{}],134:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=f&&c(ar.x)&&d(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=p(e,t);a(r,r.next)}}(m[o],r),r=a(r,r.next);return r}(t,e,u,r)),t.length>80*r){h=g=t[0],m=v=t[1];for(var _=r;_g&&(g=y),x>v&&(v=x);b=Math.max(g-h,v-m)}return o(u,f,r,h,m,b),f}function i(t,e,r,n,i){var a,o;if(i===y(t,e,r,n)>0)for(a=e;a=e;a-=n)o=m(a,t[a],t[a+1],o);return o&&f(o,o.next)&&(g(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!f(n,n.next)&&0!==u(n.prev,n,n.next))n=n.next;else{if(g(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,s,m){if(t){!m&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=l(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,s);for(var v,y,x=t;t.prev!==t.next;)if(v=t.prev,y=t.next,s?function(t,e,r,n){var i=t.prev,a=t,o=t.next;if(u(i,a,o)>=0)return!1;var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,d=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=l(s,f,e,r,n),m=l(h,d,e,r,n),g=t.nextZ;for(;g&&g.z<=m;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.nextZ}g=t.prevZ;for(;g&&g.z>=p;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}(t,n,i,s):function(t){var e=t.prev,r=t,n=t.next;if(u(e,r,n)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(c(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&u(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(v.i/r),e.push(t.i/r),e.push(y.i/r),g(t),t=y.next,x=y.next;else if((t=y)===x){m?1===m?o(t=function(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!f(i,a)&&h(i,n,n.next,a)&&d(i,a)&&d(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),g(n),g(n.next),n=t=a),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,s,2):2===m&&function(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&h(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&d(t,e)&&d(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(l,c)){var u=p(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}(t,e,r,n,i,s):o(a(t),e,r,n,i,s,1);break}}}function s(t,e){return t.x-e.x}function l(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function c(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function u(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function f(t,e){return t.x===e.x&&t.y===e.y}function h(t,e,r,n){return!!(f(t,e)&&f(r,n)||f(t,n)&&f(r,e))||u(t,e,r)>0!=u(t,e,n)>0&&u(r,n,t)>0!=u(r,n,e)>0}function d(t,e){return u(t.prev,t,t.next)<0?u(t,e,t.next)>=0&&u(t,t.prev,e)>=0:u(t,e,t.prev)<0||u(t,t.next,e)<0}function p(t,e){var r=new v(t.i,t.x,t.y),n=new v(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function m(t,e,r,n){var i=new v(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function g(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],136:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],139:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],140:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&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}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],141:[function(t,e,r){"use strict";function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";return"("+("=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?o(t.slice(1),"||"):"all"===e?o(t.slice(1),"&&"):"none"===e?c(o(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?c(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var a=i(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+a+"=== typeof "+o+"&&":"")+a+r+o}function o(t,e){return t.map(n).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(u)),n=i(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function u(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))};var f=["Unknown","Point","LineString","Polygon"]},{}],142:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var u=a.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},l.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=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":70,"cubic-hermite":115}],143:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&"string"!=typeof e||(e=new(n(e||"float32"))(a+r));var o=e.length-r;if(a!==o)throw new Error("source length "+a+" ("+i+"x"+t.length+") does not match destination length "+o);for(var s=0,l=r;s0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(t,e,r,n,i.right)}function f(t,e){this.tree=t,this._stack=e}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}e.exports=function(t){return new s(t||function(t,e){return te?1:0},null)};var d=0,p=1,m=s.prototype;Object.defineProperty(m,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(m,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(d,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(h._color===p||i._color===p)break;var m=l[f-2];if(m.left===h)if(h.left===i){if(!(g=m.right)||g._color!==d){if(m._color=d,m.left=h.right,h._color=p,h.right=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).left===m?v.left=h:v.right=h}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else{if(!(g=m.right)||g._color!==d){if(h.right=i.left,m._color=d,m.left=i.right,i._color=p,i.left=h,i.right=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){(v=l[f-3]).left===m?v.left=i:v.right=i}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else if(h.right===i){if(!(g=m.left)||g._color!==d){if(m._color=d,m.right=h.left,h._color=p,h.left=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).right===m?v.right=h:v.left=h}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}else{var g;if(!(g=m.left)||g._color!==d){if(h.left=i.right,m._color=d,m.right=i.left,i._color=p,i.right=h,i.left=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){var v;(v=l[f-3]).right===m?v.right=i:v.left=i}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}}return l[0]._color=p,new s(r,l[0])},m.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(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(m,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(m,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),m.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},m.remove=function(t){var e=this.find(t);return e?e.remove():this},m.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 g=f.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new f(this.tree,this._stack.slice())},g.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if((r=e[e.length-1])._color===d){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=p);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===d)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=p,r._color=p,s._color=p,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),void(t[l-1]=n);if(n.left&&n.left._color===d)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).left===r?c.left=s:c.right=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.right=a(d,n));r.right=a(d,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=d,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11&&((c=t[l-2]).right===r?c.right=n:c.left=n),void(t[l-1]=n);if(n.right&&n.right._color===d)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).right===r?c.right=s:c.left=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.left=a(d,n));r.left=a(d,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=d,o(r),o(n),l>1){var c;(c=t[l-2]).right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"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}),g.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(g,"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}}),g.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},g.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(g,"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}})},{}],145:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],146:[function(t,e,r){function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}(t)===e?t:t.reverse()}var s=t("geojson-area");e.exports=n},{"geojson-area":146}],148:[function(t,e,r){"use strict";function n(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,r,a,o,s,l,c){if(r/=e,a/=e,l>=r&&c<=a)return t;if(l>a||c=r&&d<=a)u.push(p);else if(!(h>a||d=e&&s<=r&&i.push(o)}return i}(m,r,a,o):function(t,e,r,i,a,o){for(var s=[],l=0;lr?(b.push(a(c,p,e),a(c,p,r)),o||(b=n(s,b,g,v,y))):d>=e&&b.push(a(c,p,e)):h>r?dr&&(b.push(a(c,p,r)),o||(b=n(s,b,g,v,y))));c=m[x-1],(h=c[i])>=e&&h<=r&&b.push(c),f=b[b.length-1],o&&f&&(b[0][0]!==f[0]||b[0][1]!==f[1])&&b.push(b[0]),n(s,b,g,v,y)}return s}(m,r,a,o,s,3===g);v.length&&u.push(i(p.tags,g,v,p.id))}}return u.length?u:null};var i=t("./feature")},{"./feature":150}],149:[function(t,e,r){"use strict";function n(t,e,r){if(null!==e.geometry){var o,l,c,u,f=e.geometry,h=f.type,d=f.coordinates,p=e.properties,m=e.id;if("Point"===h)t.push(s(p,1,[a(d)],m));else if("MultiPoint"===h)t.push(s(p,1,i(d),m));else if("LineString"===h)t.push(s(p,2,[i(d,r)],m));else if("MultiLineString"===h||"Polygon"===h){for(c=[],o=0;o1?1:n,[r,n,0]}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),x=this.tiles[y]=h(t,v,r,n,b,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(x.source=t,l){if(e===p.maxZoom||e===l)continue;var w=1<1&&console.time("clipping");var M,k,A,T,S,E,L=.5*p.buffer/p.extent,C=.5-L,z=.5+L,D=1+L;M=k=A=T=null,S=u(t,v,r-L,r+z,0,a,x.min[0],x.max[0]),E=u(t,v,r+C,r+D,0,a,x.min[0],x.max[0]),S&&(M=u(S,v,n-L,n+z,1,o,x.min[1],x.max[1]),k=u(S,v,n+C,n+D,1,o,x.min[1],x.max[1])),E&&(A=u(E,v,n-L,n+z,1,o,x.min[1],x.max[1]),T=u(E,v,n+C,n+D,1,o,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(A||[],e+1,2*r+1,2*n),d.push(T||[],e+1,2*r+1,2*n+1))}else l&&(g=e)}return g},n.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,l=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var f,h=t,d=e,p=r;!f&&h>0;)h--,d=Math.floor(d/2),p=Math.floor(p/2),f=this.tiles[i(h,d,p)];if(!f||!f.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",h,d,p),s(f,a,n.buffer))return c.tile(f,a);o>1&&console.time("drilling down");var m=this.splitTile(f.source,h,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return c=s-n,u=l-i,c*c+u*u}(t[r],t[s],t[l]))>n&&(a=r,n=i);n>o?(t[a][2]=n,c.push(s),c.push(a),s=a):(l=c.pop(),s=c.pop())}}},{}],153:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){for(var o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},s=0;sf)&&(h.push(s),t.numSimplified++),t.numPoints++;3===c&&function(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;io.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1])}return o}},{}],154:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}e.exports=function(t,e){var r=new i(t);return r.update(e),r};var s=t("./lib/text.js"),l=t("./lib/lines.js"),c=t("./lib/background.js"),u=t("./lib/cube.js"),f=t("./lib/ticks.js"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(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,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(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,u=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,c=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?c=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(c=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new a,new a,new a],m=[0,0,0],g={model:h,view:h,projection:h};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];d.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||h,i=t.view||h,a=t.projection||h,s=this.bounds,l=u(r,i,a,s),c=l.cubeEdges,f=l.axis,d=i[12],b=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*d+a[7]*b+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=c[k],this.lastCubeProps.axis[k]=f[k];var A=p;for(k=0;k<3;++k)o(p[k],k,this.bounds,c,f);e=this.gl;var T=m;for(k=0;k<3;++k)this.backgroundEnable[k]?T[k]=f[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];f[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(E=0;E<2;++E){L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var z=n(v,A[k].primalMinor),D=n(y,A[k].mirrorMinor),I=this.lineTickLength;for(E=0;E<3;++E){var P=M/r[5*E];z[E]*=I[E]*P,D[E]*=I[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,D,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){var O=A[k].primalMinor,F=n(x,A[k].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[k]&&(F[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],F,this.tickColor[k])}if(this.labelEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.labelPad[E]/r[5*E];F[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],F,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":158,"./lib/cube.js":159,"./lib/lines.js":160,"./lib/text.js":162,"./lib/ticks.js":163}],158:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(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[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=i(t,new Float32Array(e)),y=i(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=o(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new n(t,v,x,b)};var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders").bg,s=n.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),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":161,"gl-buffer":165,"gl-vao":259}],159:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<f[y][1]&&(O=y));var F=-1;for(y=0;y<3;++y)(N=O^1<f[R][0]&&(R=N))}var j=m;j[0]=j[1]=j[2]=0,j[a.log2(F^O)]=O&F,j[a.log2(O^R)]=O&R;var B=7^R;B===_||B===P?(B=7^F,j[a.log2(R^B)]=B&R):j[a.log2(F^B)]=B&F;var U=g,V=_;for(k=0;k<3;++k)U[k]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 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 colorChannel = abs(normal);\n}","precision mediump 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}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":243}],162:[function(t,e,r){(function(r){"use strict";function n(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}e.exports=function(t,e,r,o,l,c){var u=i(t),f=a(t,[{buffer:u,size:3}]),h=s(t);h.attributes.position.location=0;var d=new n(t,h,u,f);return d.update(e,r,o,l,c),d};var i=t("gl-buffer"),a=t("gl-vao"),o=t("vectorize-text"),s=t("./shaders").text,l=window||r.global||{},c=l.__TEXT_CACHE||{};l.__TEXT_CACHE={};var u=n.prototype,f=[0,0];u.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,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.update=function(t,e,r,n,i){function a(t,e,r,n){var i=c[r];i||(i=c[r]={});var a=i[e];a||(a=i[e]=function(t,e){try{return o(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,f=a.cells,h=0,d=f.length;h=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(s.length/3|0)-f[d],l[d]=s.length/3|0;for(var p=0;p=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.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 a(t,e){for(var r=o.malloc(t.length,e),n=t.length,i=0;i=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=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=o.malloc(t.size,r),u=l(n,t.shape);s.assign(u,t),this.length=i(this.gl,this.type,this.length,this.usage,e<0?n:n.subarray(0,t.size),e),o.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=i(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),o.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(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}},e.exports=function(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||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(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==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 a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],166:[function(t,e,r){e.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"}},{}],167:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":166}],168:[function(t,e,r){"use strict";function n(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}function i(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])}function a(t,e,r,n){for(var i=f[n],a=0;a=1},u.isTransparent=function(){return this.opacity<1},u.drawTransparent=u.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var f=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}();u.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m;(m=f.slice())[c]+=d[1][c],o.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":170,"gl-buffer":165,"gl-vao":259}],169:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&h.drawBuffersWEBGL(m[f]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=o(r,c,u,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=o(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=s(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=s(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=s(r,c,u,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),v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),c=0;ca||r<0||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");var o=1;if("color"in(n=n||{})){if((o=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(o>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(o>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+o+" draw buffers")}}var s=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&o>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");s=t.FLOAT}else n.preferFloat&&o>0&&c&&(s=t.FLOAT);var u=!0;"depth"in n&&(u=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new l(t,e,r,s,o,u,g,i)};var f,h,d,p,m=null,g=l.prototype;Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return c(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,c(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,c(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),u.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]]}},u.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),n=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=1/((h[2]=r[r.length-1])-d),g=1/((h[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var x=(v-1)*(y-1)*(f.length>>>1);this.numVertices=x;for(var b=o.mallocUint8(4*x),_=o.mallocFloat32(2*x),w=o.mallocUint8(2*x),M=o.mallocUint32(x),k=0,A=0;A 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 highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp 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 highp 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\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":243}],177:[function(t,e,r){"use strict";function n(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 i(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 a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(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.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=p(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 n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=s(e),a=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),u=h(new Array(1024),[256,1,4]),f=0;f<1024;++f)u.data[f]=255;var d=c(e,u);d.wrap=e.REPEAT;var g=new o(e,r,n,i,a,d);return g.update(t),g};var s=t("gl-buffer"),l=t("gl-vao"),c=t("gl-texture2d"),u=t("glsl-read-float"),f=t("binary-search-bounds"),h=t("ndarray"),d=t("./lib/shaders"),p=d.createShader,m=d.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v=o.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(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)},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e0){for(var x=0;x<24;++x)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var b,_;Array.isArray(o[0])?(b=o[e-1],_=o[e]):b=_=o,3===b.length&&(b=[b[0],b[1],b[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,b[0],b[1],b[2],b[3],y[0],y[1],y[2],v[0],v[1],v[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(d),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,b=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*b,t[1]=(h+x)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(h-x)*_,t[5]=(1-(f+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,g=o*f,v=s*f,y=l*c,x=l*u,b=l*f,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+b)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(h+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(g-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-f-p,t[1]=u+v,t[2]=h-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,f,h,d,p,m,g=e[0],v=e[1],y=e[2],x=a[0],b=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=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,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":199,"./mat3.js":202,"./vec3.js":206,"./vec4.js":207}],205:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=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},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=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},i.transformMat3=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=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.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":199}],207:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=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},i.subtract=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},i.sub=i.subtract,i.multiply=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},i.mul=i.multiply,i.divide=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},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=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},i.max=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},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=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},i.scaleAndAdd=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},i.distance=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)},i.dist=i.distance,i.squaredDistance=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},i.sqrDist=i.squaredDistance,i.length=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)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=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},i.normalize=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},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=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},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[u]}return Math.abs(g-1)>.001?null:[f,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump 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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump 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}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],210:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,g,v,y,x,b,_,w,k,A,T,S){this.gl=t,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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!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._model=M,this._view=M,this._projection=M,this._resolution=[1,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("gl-vao"),s=t("gl-texture2d"),l=t("normals"),c=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),f=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),p=t("typedarray-pool"),m=t("./lib/shaders"),g=t("./lib/closest-point"),v=m.meshShader,y=m.wireShader,x=m.pointShader,b=m.pickShader,_=m.pointPickShader,w=m.contourShader,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=n.prototype;k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){(p=this.triShader).bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){(p=this.lineShader).bind(),p.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){(p=this.pointShader).bind(),p.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p;(p=this.contourShader).bind(),p.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||M,n=t.view||M,i=t.projection||M,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,pickId:this.pickId/255};if((l=this.pickShader).bind(),l.uniforms=s,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),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l;(l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},k.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;al[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n]&&M&&(e[1^n]-=T*d*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=T*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],kl[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n+2]&&M&&(e[1^n]+=T*d*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),c.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],f=a[c+2]-u,h=.5*(o[c+2]+o[c]),d=o[c+2]-o[c],p=l[c],m=l[c+2]-p,g=s[c],v=s[c+2]-g;e[c]=2*f/d*m/v,t[c]=2*(u-h)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;w[x]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,b,w),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":218,"./lib/create-attributes":219,"./lib/create-uniforms":220,"./lib/reflect":221,"./lib/runtime-reflect":222,"./lib/shader-cache":223}],218:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}(n.prototype=new Error).name="GLError",n.prototype.constructor=n,e.exports=n},{}],219:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,s,f)}else{if(!(h.indexOf("mat")>=0))throw new o("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,s,f)}}}return s};var o=t("./GLError"),s=n.prototype;s.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(s,"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}})},{"./GLError":218}],220:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new o("","Unknown uniform data type for "+name+": "+r)}var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new o("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new o("","Unrecognized data type for vector "+name+": "+r)}}}function c(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,c(a,i)):r.push([a,i])}return r}function u(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a4)throw new o("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(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 o("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new o("","Unknown uniform data type for "+name+": "+t)}}(r[c].type)}function h(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){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function i(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!x&&U.autoResize){var t=b.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*U.pixelRatio),i=0|Math.ceil(r*U.pixelRatio);if(n!==b.width||i!==b.height){b.width=n,b.height=i;var a=b.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",O=!0}}}function r(){for(var t=z.length,e=P.length,r=0;r0&&0===I[e-1];)I.pop(),P.pop().dispose()}function g(){if(U.contextLost)return!0;_.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}function v(){if(!g()){e();var t=U.camera.tick();j.view=U.camera.matrix,O=O||t,F=F||t,E.pixelRatio=U.pixelRatio,C.pixelRatio=U.pixelRatio;var r=z.length,i=G[0],a=G[1];i[0]=i[1]=i[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;oM.distance)continue;for(var c=0;c>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),r=0;r>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,o),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/s,t[4]=2/l,t[6]=-2*o[0]/s-1,t[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=u<5,i.uniforms.pointSize=u,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var f=a.getParameter(a.BLEND),h=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),h&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),h&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.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]]}}},{"./lib/shader":227,"gl-buffer":165,"gl-shader":228,"typedarray-pool":554}],236:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],237:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];if(r||(r=i[e]={}),t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(F[1])){var R=O;O=F,F=R,R=I,I=P,P=R;var N=z;z=D,D=N}O[0]<0&&(I[z]=-1),F[1]>0&&(P[D]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(d[4*z+C],2),B+=Math.pow(d[4*D+C],2);I[z]/=Math.sqrt(j),P[D]/=Math.sqrt(B),h.axes[0]=I,h.axes[1]=P,h.fragClipBounds[0]=l(A,S[0],E,-1e8),h.fragClipBounds[1]=l(A,S[1],E,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function u(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||v,s.view=n.view||v,s.projection=n.projection||v,x[0]=2/o.drawingBufferWidth,x[1]=2/o.drawingBufferHeight,s.screenSize=x,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}c(e,r,n,i),r.vao.unbind()}var f=t("gl-buffer"),h=t("gl-vao"),d=t("typedarray-pool"),p=t("gl-mat4/multiply"),m=t("./lib/shaders"),g=t("./lib/glyphs"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,r=m.createPerspective(e),n=m.createOrtho(e),i=m.createProject(e),o=m.createPickPerspective(e),s=m.createPickOrtho(e),l=m.createPickProject(e),c=f(e),u=f(e),d=f(e),p=f(e),g=new a(e,r,n,i,c,u,d,p,h(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return g.update(t),g};var y=a.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},y.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var x=[0,0],b=[0,0,0],_=[0,0,0],w=[0,0,0,1],M=[0,0,0,1],k=v.slice(),A=[0,0,0],T=[[0,0,0],[0,0,0]],S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];y.draw=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},y.drawTransparent=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},y.drawPick=function(t){u(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(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},y.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]},y.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(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,c=t.color,u=t.size,f=t.angle,h=t.lineColor,p=0,m=0,v=0,y=n.length;t:for(var x=0;x0&&(C[0]=-a[0]*(1+k[0][0]));var q=w.cells,H=w.positions;for(_=0;_0){var v=r*u;o.drawBox(f-v,h-v,d+v,h+v,a),o.drawBox(f-v,p-v,d+v,p+v,a),o.drawBox(f-v,h-v,f+v,p+v,a),o.drawBox(d-v,h-v,d+v,p+v,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)}},{"./lib/shaders":240,"gl-buffer":165,"gl-shader":243}],242:[function(t,e,r){"use strict";function n(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)}}e.exports=function(t,e){return new n(t,i(t,e),a.mallocUint8(e[0]*e[1]*4))};var i=t("gl-fbo"),a=t("typedarray-pool"),o=t("ndarray"),s=t("bit-twiddle").nextPow2,l=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,x,_),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":244,"./lib/create-attributes":245,"./lib/create-uniforms":246,"./lib/reflect":247,"./lib/runtime-reflect":248,"./lib/shader-cache":249}],244:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],245:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":244,dup:219}],246:[function(t,e,r){arguments[4][220][0].apply(r,arguments)},{"./GLError":244,"./reflect":247,dup:220}],247:[function(t,e,r){arguments[4][221][0].apply(r,arguments)},{dup:221}],248:[function(t,e,r){arguments[4][222][0].apply(r,arguments)},{dup:222}],249:[function(t,e,r){arguments[4][223][0].apply(r,arguments)},{"./GLError":244,dup:223,"gl-format-compiler-error":172,"weakmap-shim":576}],250:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],251:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":243}],252:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders/index");e.exports=function(t,e){function r(t,e,r,n,i,a){var o=[t,e,r,0,0,0,1];o[n+3]=1,o[n]=i,s.push.apply(s,o),o[6]=-1,s.push.apply(s,o),o[n]=a,s.push.apply(s,o),s.push.apply(s,o),o[6]=1,s.push.apply(s,o),o[n]=i,s.push.apply(s,o)}var s=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=i(t,s),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=o(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new n(t,l,c,u);return f.update(e),f};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=n.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||s,o=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,d=u,p=0;p<3;++p)i&&i[p]<0?(h[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(h[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":251,"gl-buffer":165,"gl-vao":259}],253:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\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 worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(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\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\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 (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\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_1_1(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 \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + 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",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\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 vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\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",s="precision mediump float;\n#define GLSLIFY 1\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 any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n 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";r.createShader=function(t){var e=n(t,i,a,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},r.createPickShader=function(t){var e=n(t,i,s,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},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":243}],254:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=s,this._contourShader=l,this._contourPickShader=c,this._contourBuffer=u,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=d,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=[y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0]),y(p.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.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}function i(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=F.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],b(l,t.model,l);var c=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function a(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||C,n.view=t.view||C,n.projection=t.projection||C,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.contourColor=this.contourColor[0],n.inverseModel=_(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var o=n.clipBounds[a],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[a][s],-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=j,n.vertexColor=this.vertexColor;var l=N;for(b(l,n.view,n.model),b(l,n.projection,l),_(l,l),a=0;a<3;++a)n.eyePosition[a]=l[12+a]/l[15];var c=l[15];for(a=0;a<3;++a)c+=this.lightPosition[a]*l[4*a+3];for(a=0;a<3;++a){var u=l[12+a];for(s=0;s<3;++s)u+=l[4*s+a]*this.lightPosition[s];n.lightPosition[a]=u/c}var f=i(n,this);if(f.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=f.projections[a],this._shader.uniforms.clipBounds=f.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(h.uniforms.permutation=D[a],r.lineWidth(this.contourWidth[a]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t};var O=[0,0,0],F={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},R={model:C,view:C,projection:C,inverseModel:C.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,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},N=C.slice(),j=[1,0,0,0,1,0,0,0,1];P.draw=function(t){return a.call(this,t,!1)},P.drawTransparent=function(t){return a.call(this,t,!0)};var B={model:C,view:C,projection:C,inverseModel:C,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};P.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=B;r.model=t.model||C,r.view=t.view||C,r.projection=t.projection||C,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=j;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=i(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=D[o],n=0;n>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=i+u,p=s+h,m=f*(h?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=w.le(this.contourLevels[y],c[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]Math.abs(b-c[y])&&(v[y]+=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],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},P.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=s(t.contourWidth,Number)),"showContour"in t&&(this.showContour=s(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=s(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=c(t.contourColor)),"contourProject"in t&&(this.contourProject=s(t.contourProject,function(t){return s(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=c(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=s(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=s(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);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 n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(p.freeFloat(this._field[2].data),this._field[2].data=p.mallocFloat(u.nextPow2(n))),this._field[2]=y(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),o(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(p.freeFloat(this._field[a].data),this._field[a].data=p.mallocFloat(this._field[2].size)),this._field[a]=y(this._field[a].data,[i[0]+2,i[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(a=0;a<2;++a){var f=l[a];for(w=0;w<2;++w)if(f.shape[w]!==i[w])throw new Error("gl-surface: coords have incorrect shape");o(this._field[a],f)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var d=h[a];if((Array.isArray(d)||d.length)&&(d=y(d)),d.shape[0]!==i[a])throw new Error("gl-surface: invalid tick length");var b=y(d.data,i);b.stride[a]=d.stride[0],b.stride[1^a]=0,o(this._field[a],b)}}else{for(a=0;a<2;++a){var _=[0,0];_[a]=1,this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var w=0;w0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=p.mallocFloat(nt.length);for(a=0;ai||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 a(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}function o(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 s(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 l(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)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 l=s(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,l,e,r,n,i)}var c=t("ndarray"),u=t("ndarray-ops"),f=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(h||function(t){h=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],d=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],p=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return l(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return l(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=n(e)?e:e.raw;if(r)return function(t,e,r,n,i,o){var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,l,r,n,i,o)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var l=o(n,e.stride.slice()),h=0;"float32"===r?h=t.FLOAT:"float64"===r?(h=t.FLOAT,l=!1,r="float32"):"uint8"===r?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,l=!1,r="uint8");var d=0;if(2===n.length)d=t.LUMINANCE,n=[n[0],n[1],1],e=c(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])d=t.ALPHA;else if(2===n[2])d=t.LUMINANCE_ALPHA;else if(3===n[2])d=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}h!==t.FLOAT||t.getExtension("OES_texture_float")||(h=t.UNSIGNED_BYTE,l=!1);var p,g,v=e.size;if(l)p=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[n[2],n[2]*n[0],1];g=f.malloc(v,r);var x=c(g,n,y,0);"float32"!==r&&"float64"!==r||h!==t.UNSIGNED_BYTE?u.assign(x,e):m(x,e),p=g.subarray(0,v)}var b=s(t);return t.texImage2D(t.TEXTURE_2D,0,d,n[0],n[1],0,d,h,p),l||f.free(g),new a(t,b,n[0],n[1],d,h)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var h=null,d=null,p=null,m=function(t,e){u.muls(t,e,255)},g=a.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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(),p.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(),p.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(p.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 i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),g.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},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.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)},g.setPixels=function(t,e,r,i){var a=this.gl;this.bind(),Array.isArray(e)?(i=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),i=i||0;var s=n(t)?t:t.raw;if(s){this._mipLevels.indexOf(i)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(i)):a.texSubImage2D(a.TEXTURE_2D,i,e,r,this.format,this.type,s)}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]>>>i||r+t.shape[0]>this._shape[0]>>>i||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,n,i,a,s,l){var h=l.dtype,d=l.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,g=0,v=o(d,l.stride.slice());if("float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,v=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,v=!1,h="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],l=c(l.data,d,[l.stride[0],l.stride[1],1],l.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||i!==t.LUMINANCE&&i!==t.ALPHA||(g=i),g!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),p===a&&v)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var b;b=a===t.FLOAT?f.mallocFloat32(y):f.mallocUint8(y);var _=c(b,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&a===t.UNSIGNED_BYTE?m(_,l):u.assign(_,l),x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,b.subarray(0,y)),a===t.FLOAT?f.freeFloat32(b):f.freeUint8(b)}}(a,e,r,i,this.format,this.type,this._mipLevels,t)}}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],256:[function(t,e,r){"use strict";e.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;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],265:[function(t,e,r){e.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}},{}],266:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],267:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r-1?y:j.indexOf(t)>-1?v:g,e(z.join("")),C=l,E}return z.push(A),T=A,E+1}();break;case x:E=/[^\s]/g.test(A)?(e(z.join("")),C=l,E):(z.push(A),T=A,E+1);break;case l:z=z.length?[]:z,E="/"===T&&"*"===A?(O=L+E-1,C=u,T=A,E+1):"/"===T&&"/"===A?(O=L+E-1,C=f,T=A,E+1):"#"===A?(C=h,O=L+E,E):/\s/.test(A)?(C=x,O=L+E,E):(F=/\d/.test(A),R=/[^\w_]/.test(A),O=L+E,C=F?p:R?d:c,E)}if(r!==E)switch(N[r]){case"\n":P=0,++I;break;default:++P}}return L+=E,N=N.slice(E),D}function M(){return"\r"!==A&&"\n"!==A||"\\"===T?(z.push(A),T=A,E+1):(e(z.join("")),C=l,E)}function k(t){for(var r,n,a=0;;){if(r=i.indexOf(t.slice(0,t.length+a).join("")),n=i[r],-1===r){if(a--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),O+=n.length,(z=z.slice(n.length)).length}}var A,T,S,E=0,L=0,C=l,z=[],D=[],I=1,P=0,O=0,F=!1,R=!1,N="",j=a,B=n;return"300 es"===(t=t||{}).version&&(j=s,B=o),function(t){return D=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):(z.length&&e(z.join("")),C=b,e("(eof)"),D)}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,f=1,h=2,d=3,p=4,m=5,g=6,v=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":270,"./lib/builtins-300es":269,"./lib/literals":272,"./lib/literals-300es":271,"./lib/operators":273}],269:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.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"])},{"./builtins":270}],270:[function(t,e,r){e.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"]},{}],271:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","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"])},{"./literals":272}],272:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","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"]},{}],273:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],274:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=i.concat(r(t)),i=i.concat(r(null))}},{"./index":268}],275:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=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=u):(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>=u?(s=0,o=u):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,c-=8);t[r+d-p]|=128*m}},{}],278:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return l(t.vertices,e.vertices)}function o(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=c[t];i||(i=c[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=s[t+1];return i||(i=s),n(i)}(t)),this.orient=i}e.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 a=t.slice(0,i+1),l=s.apply(void 0,a);if(0===l)throw new Error("Input not in general position");for(var c=new Array(i+1),u=0;u<=i;++u)c[u]=u;l<0&&(c[0]=1,c[1]=0);var f=new n(c,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var p=c.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);h[u]=v,d[u]=v}for(d[i+1]=f,u=0;u<=i;++u){p=h[u].vertices;var y=h[u].adjacent;for(m=0;m<=i;++m){var x=p[m];if(x<0)y[m]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[m]=h[b])}}var _=new o(i,a,d),w=!!e;for(u=i+1;u0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=o;++b)y[b]<0?(x=b,l[b]=t):l[b]=s[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=d.slice(),M=p.slice(),k=new n(w,M,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,M[m]=v,w[g]=-1,M[g]=e,p[g]=k,k.flip();for(b=0;b<=o;++b){var T=w[b];if(!(T<0||T===r)){for(var S=new Array(o-1),E=0,L=0;L<=o;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new i(S,k,b))}}}}}}h.sort(a);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":515,"simplicial-complex":526}],279:[function(t,e,r){"use strict";function n(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}function i(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 a(t,e){var r=p(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 o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?v:(r.splice(n,1),a(t,r),y)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,h),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);return 2===(o=this.left.remove(t))?(this.left=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return v;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);return 2===(o=this.right.remove(t))?(this.right=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:v;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(a=g.ge(this.leftPoints,t,h);athis.mid){if(this.right){var r;if(r=this.right.queryPoint(t,e))return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n;if(n=this.right.queryInterval(t,e,r))return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var b=m.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==v}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":70}],280:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r4))}},{}],288:[function(t,e,r){"use strict";function n(t,e,r,n,a){e=e||function(t){return t[0]},r=r||function(t){return t[1]},a=a||Array,this.nodeSize=n||64,this.points=t,this.ids=new a(t.length),this.coords=new a(2*t.length);for(var o=0;o=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(g))}}return u}},{}],290:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(o,Math.floor(r+(l-c)*f/l+h)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],291:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],g=e[2*p+1];n(m,g,r,i)<=c&&l.push(t[p]);var v=(u+1)%2;(0===u?r-a<=m:i-a<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?r+a>=m:i+a>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],292:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);this.nodeSize=e||64,this.coords=t.slice();var r=Math.floor(t.length/2);this.ids=Array(r);for(var i=0;in;){if(i-n>600){var l=i-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);o(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(i,Math.floor(r+(l-c)*f/l+h)),a)}var d=e[2*r+a],p=n,m=i;for(s(t,e,n,r),e[2*i+a]>d&&s(t,e,n,i);pd;)m--}e[2*n+a]===d?s(t,e,n,m):s(t,e,++m,i),m<=r&&(n=m+1),r<=m&&(i=m-1)}}function s(t,e,r,n){l(t,r,n),l(e,2*r,2*n),l(e,2*r+1,2*n+1)}function l(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype.range=function(t,e,r,n){for(var i,a,o=this.ids,s=this.coords,l=this.nodeSize,c=[0,o.length-1,0],u=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=l)for(var p=d;p<=h;p++)i=s[2*p],a=s[2*p+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[p]);else{var m=Math.floor((d+h)/2);i=s[2*m],a=s[2*m+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[m]);var g=(f+1)%2;(0===f?t<=i:e<=a)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?r>=i:n>=a)&&(c.push(m+1),c.push(h),c.push(g))}}return u},n.prototype.within=function(t,e,r){for(var n=this.ids,a=this.coords,o=this.nodeSize,s=[0,n.length-1,0],l=[],c=r*r;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(a[2*d],a[2*d+1],t,e)<=c&&l.push(n[d]);else{var p=Math.floor((h+f)/2),m=a[2*p],g=a[2*p+1];i(m,g,t,e)<=c&&l.push(n[p]);var v=(u+1)%2;(0===u?t-r<=m:e-r<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?t+r>=m:e+r>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],293:[function(t,e,r){"use strict";function n(t,e){var r;if(u(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],f=c||void 0!==t.property,h=c||!f,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],g=0;g=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?function(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:468}],295:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:563}],296:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{"../error/validation_error":295,"../util/extend":296,"../util/get_type":297,"./validate_array":300,"./validate_boolean":301,"./validate_color":302,"./validate_constants":303,"./validate_enum":304,"./validate_filter":305,"./validate_function":306,"./validate_layer":308,"./validate_number":310,"./validate_object":311,"./validate_source":313,"./validate_string":314}],300:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":295,"../util/get_type":297}],304:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298}],305:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f=8&&(f&&!t.valueSpec["property-function"]?d.push(new n(t.key,t.value,"property functions not supported")):h&&!t.valueSpec["zoom-function"]&&d.push(new n(t.key,t.value,"zoom functions not supported"))),d}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299,"./validate_array":300,"./validate_number":310,"./validate_object":311}],307:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":295,"./validate_string":314}],308:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],311:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],f=i(r);if("object"!==f)return[new n(e,r,"object expected, %s found",f)];for(var h in r){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299}],312:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":295,"./validate":299}],313:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298,"./validate_enum":304,"./validate_object":311}],314:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],315:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":316,"./validate/validate":299,"./validate/validate_constants":303,"./validate/validate_filter":305,"./validate/validate_glyphs_url":307,"./validate/validate_layer":308,"./validate/validate_layout_property":309,"./validate/validate_paint_property":312,"./validate/validate_source":313}],316:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":317}],317:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],318:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],319:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":433}],320:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},a=0;a1?p.name+b:p.name]=m[b]*g}}},n.VertexArrayType=function(t){return new c({members:t,alignment:4})},n.ElementArrayType=function(t){return new c({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":431,"../util/util":433,"./array_group":319,"./bucket/circle_bucket":321,"./bucket/fill_bucket":322,"./bucket/line_bucket":323,"./bucket/symbol_bucket":324,"./buffer_group":326,assert:51,"feature-filter":141}],321:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,(n.prototype=a.inherit(i,{})).addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],322:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,(n.prototype=a.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var h,d,p,m,g,v,y,x=r,b=f?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],g=c.sub(h)._unit()._perp());for(var w=0;w0){var S=h.dist(d);if(S>2*o){var E=h.sub(h.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?x:b;if(L&&"round"===C&&(An&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A100)M=g.clone();else{var z=m.x*g.y-m.y*g.x>0?-1:1,D=A*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(D*z)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var I=m.x*g.y-m.y*g.x>0,P=-Math.sqrt(A*A-1);if(I?(y=0,v=P):(v=0,y=P),_||this.addCurrentVertex(h,this.distance,m,v,y,!1),"fakeround"===C){for(var O,F=Math.floor(8*(.5-(k-.5))),R=0;R=0;N--)O=m.mult((N+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(h,this.distance,O,I)}p&&this.addCurrentVertex(h,this.distance,g,-v,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,g,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,g,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,g,-1,-1,!0),this.addCurrentVertex(h,this.distance,g,0,0,!1)));if(T&&w2*o){var B=h.add(p.sub(h)._mult(o/j)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),h=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,f=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],324:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),f=t("../../symbol/shaping"),h=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=f.shapeText,x=f.shapeIcon,b=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,(n.prototype=m.inherit(o,{})).serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var f="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,h=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,v=24*a["text-letter-spacing"],b=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var z=C||b;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,g,x,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,x=p.br,b=p.tex,_=p.anchorPoint,w=Math.max(f+Math.log(p.minScale)/Math.LN2,h),M=Math.min(f+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===h&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(u,_.x,_.y,g.x,g.y,b.x,b.y,w,M,h,k);i(u,_.x,_.y,v.x,v.y,b.x+b.w,b.y,w,M,h,k),i(u,_.x,_.y,y.x,y.y,b.x,b.y+b.h,w,M,h,k),i(u,_.x,_.y,x.x,x.y,b.x+b.w,b.y+b.h,w,M,h,k),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(I,P,O,F,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":382,"../../symbol/clip_line":384,"../../symbol/collision_feature":386,"../../symbol/get_anchors":388,"../../symbol/mergelines":391,"../../symbol/quads":392,"../../symbol/resolve_text":393,"../../symbol/shaping":394,"../../util/token":432,"../../util/util":433,"../bucket":320,"../load_geometry":328,"point-geometry":477}],325:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=l.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||h.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":433,"./bucket":320,assert:51}],329:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],330:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":433}],331:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":330}],332:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,f=t("gl-matrix"),h=f.vec4,d=f.mat4,p=f.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.locationCoordinate(this.center)._zoomTo(e),i=new a(n.column-.5,n.row-.5);return c.cover(e,[this.pointCoordinate(new a(0,0))._zoomTo(e),this.pointCoordinate(new a(this.width,0))._zoomTo(e),this.pointCoordinate(new a(this.width,this.height))._zoomTo(e),this.pointCoordinate(new a(0,this.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return i.dist(t)-i.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];h.transformMat4(e,e,this.pixelMatrixInverse),h.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,f=e[2]/n,d=r[2]/i,p=f===d?0:(0-f)/(d-f),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return h.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":320,"../source/tile_coord":360,"../util/interpolate":427,"../util/util":433,"./coordinate":329,"./lng_lat":330,"gl-matrix":198,"point-geometry":477}],333:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,f,h,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&b,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":354,"./create_uniform_pragmas":335}],337:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,h>>16),s.uniform2f(o.u_pixel_coord_lower,65535&f,65535&h),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}var i=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){var a=t.gl;a.enable(a.STENCIL_TEST);var o;if(o=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"],t.isOpaquePass===o){t.setDepthSublayer(1);for(var s=0;s0?1-1/(1.001-t):-t}(r.paint["raster-saturation"])),a.uniform1f(l.u_contrast_factor,function(t){return t>0?1/(1-t):1+t}(r.paint["raster-contrast"])),a.uniform3fv(l.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var c,u,f=o.source&&o.source.findLoadedParent(n,0,{}),h=function(t,e,r,n){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=n.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(a[0]=i.clamp(l,0,1),a[1]=1-a[0]):(a[0]=i.clamp(1-c,0,1),a[1]=1-a[0])}var h=r.paint["raster-opacity"];return a[0]*=h,a[1]*=h,a}(o,f,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o.texture),a.activeTexture(a.TEXTURE1),f?(a.bindTexture(a.TEXTURE_2D,f.texture),c=Math.pow(2,f.coord.z-o.coord.z),u=[o.coord.x*c%1,o.coord.y*c%1]):(a.bindTexture(a.TEXTURE_2D,o.texture),h[1]=0);a.uniform2fv(l.u_tl_parent,u||[0,0]),a.uniform1f(l.u_scale_parent,c||1),a.uniform1f(l.u_buffer_scale,1),a.uniform1f(l.u_opacity0,h[0]),a.uniform1f(l.u_opacity1,h[1]),a.uniform1i(l.u_image0,0),a.uniform1i(l.u_image1,1);var d=o.boundsBuffer||t.rasterBoundsBuffer;(o.boundsVAO||t.rasterBoundsVAO).bind(a,l,d),a.drawArrays(a.TRIANGLE_STRIP,0,d.length)}(t,e,r,l)}a.depthFunc(a.LEQUAL)}}var i=t("../util/util"),a=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new a({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":431,"../util/util":433}],343:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,l,c,u,f,h,d,p,m,g){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],345:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":320,"../data/buffer":325,"../source/pixels_to_tile_units":354,"../source/source_cache":358,"../util/browser":417,"../util/struct_array":431,"../util/util":433,"./create_uniform_pragmas":335,"./draw_background":336,"./draw_circle":337,"./draw_debug":339,"./draw_fill":340,"./draw_line":341,"./draw_raster":342,"./draw_symbol":343,"./frame_history":344,"./painter/use_program":347,"./vertex_array_object":348,"gl-matrix":198}],347:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=o[t],h="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":320,"../util/evented":425,"../util/util":433,"resolve-url":508}],350:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),f.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),f=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(f,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":416,"../util/util":433,"./geojson_wrapper":351,"./vector_tile_worker_source":362,"geojson-rewind":147,"geojson-vt":151,supercluster:538,"vt-pbf":570}],351:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},f=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rf-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var x=h.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,u=0;u=0&&v[1].y>=0){for(var y=[],x=0;x=0&&t%1==0),s(!isNaN(e)&&e>=0&&e%1==0),s(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hu.dy&&(l=c,c=u,u=l),c.dy>f.dy&&(l=c,c=f,f=l),u.dy>f.dy&&(l=u,u=f,f=l),c.dy&&a(f,c,n,o,s),u.dy&&a(f,u,n,o,s)}var s=t("assert"),l=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<0;a--)i+=(e&(n=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var o,l;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":425,"../util/mapbox":430,"../util/util":433,"./load_tilejson":353}],362:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new s(t);i.abort=this.loadVectorData(t,function(t,a){return delete this.loading[r][n],t?e(t):a?(i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][n]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=i.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":416,"./worker_tile":365,pbf:470,"vector-tile":564}],363:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,h=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new f;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new h(e.serialize(),f.serialize(),h.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":320,"../data/buffer":325,"../geo/lng_lat":330,"../render/draw_raster":342,"../render/vertex_array_object":348,"../util/ajax":416,"../util/evented":425,"../util/util":433,"./tile_coord":360,"point-geometry":477}],364:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)x(E,P[e]);b()}}function x(t,e){if(e.populateArrays(A,N,R),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=u.create({layer:w,index:z++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var F in L)0!==(k=L[F]).features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),I.push(k),"symbol"===k.type?P.push(k):O.push(k));var R={},N={},j=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(R),P[_].updateFont(N);for(var B in N)N[B]=Object.keys(N[B]).map(Number);R=Object.keys(R),r.send("get glyphs",{uid:this.uid,stacks:N},function(t,e){N=e,y(t)}),R.length?r.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)x(0,O[_]);if(0===P.length)return b()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),f=s.filter(i);return{result:{buckets:f.map(a),collisionTile:u.data},transferables:o(f).concat(u.transferables)}}},{"../data/bucket":320,"../data/feature_index":327,"../symbol/collision_box":385,"../symbol/collision_tile":387,"../symbol/symbol_instances":396,"../symbol/symbol_quads":397,"../util/dictionary_coder":423,"../util/util":433}],366:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],367:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":416,"../util/browser":417,"../util/evented":425,"../util/mapbox":430}],368:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":433,"./style_function":371,csscolorparser:114}],369:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire("error",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?f.getJSON(h(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),f=t("../util/ajax"),h=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),x=t("../source/source_cache"),b=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);return!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,f*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),f/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:f,to:a,toScale:1,t:n}}}(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var o=[],s=this.value.stops,l=0;l=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}},{}],384:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s=i&&h.x>=i||(f.x>=i?f=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}},{"point-geometry":477}],385:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":431,"../util/util":433,"point-geometry":477}],386:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=h-f,g=p-d;if(m>0)if(m=Math.max(10*s,m),u){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,f,p,h,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),f=-a/2,h=this.boxes,d=r,p=n+1,m=f;do{if(--p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return h;g=e[p].dist(e[p+1])}var x=y-m,b=e[p],_=e[p+1].sub(b)._unit()._mult(x)._add(b)._round(),w=i/2/Math.max(Math.abs(y-f)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return h}},{}],387:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),k=new i(c.x2,c.y1).matMult(w),A=new i(c.x1,c.y2).matMult(w),T=new i(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=c.maxScale}else _=c;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),f=this.tempCollisionBox;f.anchorX=u.x,f.anchorY=u.y,f.x1=0,f.y1=0,f.x2=r-t,f.y2=n-e,f.maxScale=a,a=f.maxScale;for(var h=[u.x+f.x1/a,u.y+f.y1/a*this.yStretch,u.x+f.x2/a,u.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m=a&&(o[y][x]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var f=Math.min(Math.max(s,l),Math.max(c,u)),h=i.maxScale,d=r.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&A=0&&T=0&&v+d<=p){var S=new a(A,T,M,x)._round();s&&!o(t,S,c,s,l)||y.push(S)}}g+=w}return f||y.length||u||(y=n(t,g/2,r,s,l,c,u,!0,h)),y}var i=t("../util/interpolate"),a=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,i,a,o,s,l,c){var u=i?.6*o*s:0,f=Math.max(i?i.right-i.left:0,a?a.right-a.left:0),h=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return e-f*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);o(i,function(t,r){for(var i=!t&&new s(new c(new Uint8Array(r))),a=0;an&&null!==f){var x=g[f+1].x;m=Math.max(x,m);for(var b=f+1;b<=v;b++)g[b].y+=r,g[b].x-=x;if(c){var _=f;a[g[f].codePoint]&&_--,i(g,e,d,_,c)}d=f+1,f=null,h+=x,p++}o[y.codePoint]&&(f=v)}var w=g[g.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;i(g,e,d,g.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(f?(clearTimeout(f),f=null,o("dblclick",e)):f=setTimeout(r,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){n.mousePos(l,t).equals(u)&&o("click",t)},!1),l.addEventListener("dblclick",function(t){o("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){c=t,t.preventDefault()},!1)}},{"../util/dom":419,"./handler/box_zoom":404,"./handler/dblclick_zoom":405,"./handler/drag_pan":406,"./handler/drag_rotate":407,"./handler/keyboard":408,"./handler/scroll_zoom":409,"./handler/touch_zoom_rotate":410,"point-geometry":477}],399:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&p.lng<0?p.lng+=360:c.center.lng<0&&p.lng>0&&(p.lng-=360));var y=c.zoomScale(m-f),x=c.point,b="center"in t?c.project(p).sub(u.div(y)):x,_=c.worldSize,w=t.curve,M=Math.max(c.width,c.height),k=M/y,A=b.sub(x).mag();if("minZoom"in t){var T=n.clamp(Math.min(t.minZoom,f,m),c.minZoom,c.maxZoom),S=M/c.zoomScale(T-f);w=Math.sqrt(S/A*2)}var E=w*w,L=r(0),C=function(t){return s(L)/s(L+w*t)},z=function(t){return M*((s(L)*function(t){return a(t)/s(t)}(L+w*t)-a(L))/E)/A},D=(r(1)-L)/w;if(Math.abs(A)<1e-6){if(Math.abs(M-k)<1e-6)return this.easeTo(t);var I=k=0)return!1;return!0})).join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],401:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":425,"../../util/util":433}],402:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433,"./control":401}],403:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],404:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":331,"../../util/dom":419,"../../util/util":433}],405:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],406:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,f=l.mult(-u/2);this._map.panBy(f,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],407:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=f*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433,"point-geometry":477}],408:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],409:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),c=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433}],410:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&a!==s){var f=.15*l/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),d=a+f*h/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:h,easing:o,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],411:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":433}],412:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),f=t("../style/animation_loop"),h=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),x=t("point-geometry"),b=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new f,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new b(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof x||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof x||"number"==typeof t[0]){e=[x.convert(t)]}else{var r=[x.convert(t[0]),x.convert(t[1])];e=[r[0],new x(r[1].x,r[0].y),r[1],new x(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new h(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":330,"../geo/lng_lat_bounds":331,"../geo/transform":332,"../render/painter":346,"../style/animation_loop":366,"../style/style":369,"../util/browser":417,"../util/canvas":418,"../util/dom":419,"../util/evented":425,"../util/util":433,"./bind_handlers":398,"./camera":399,"./control/attribution":400,"./hash":411,"point-geometry":477}],413:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":330,"../util/dom":419,"point-geometry":477}],414:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)r.appendChild(e);return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":330,"../util/dom":419,"../util/evented":425,"../util/util":433}],415:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],416:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":318}],418:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":433,"mapbox-gl-supported":318}],419:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var u=0;u=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i(e.y-t.y)*(r.x-t.x)}function a(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}(t,e[i-1],e[i])e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function s(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var n=0;n=3)for(var u=0;u1){if(n(t,e))return!0;for(var i=0;ithis.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],430:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}var a=t("./config"),o=t("./browser"),s=t("url"),l=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=s.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==s.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=s.parse(t);if("mapbox:"!==r.protocol)return t;return n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=s.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,s.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=s.parse(t,!0);if(!e)return t;if("mapbox:"!==s.parse(e).protocol)return t;var i=o.supportsWebp?".webp":"$1",c=o.devicePixelRatio>=2||512===r?"@2x":"";return s.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,c+i),query:function(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?l.extend({},t,{access_token:a.ACCESS_TOKEN}):t}(n.query)})}},{"./browser":417,"./config":422,"./util":433,url:559}],431:[function(t,e,r){"use strict";function n(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function a(t){return f[t].BYTES_PER_ELEMENT}function o(t){return t.toLowerCase()}function s(t,e){var r="this._pos"+a(t.type).toFixed(0)+" + "+(t.offset/a(t.type)+e).toFixed(0);return"this._structArray."+o(t.type)+"["+r+"]"}function l(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function c(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var u=t("assert");e.exports=function(t){function e(){l.apply(this,arguments)}function r(){c.apply(this,arguments),this.members=e.prototype.members}var d=JSON.stringify(t);if(h[d])return h[d];void 0===t.alignment&&(t.alignment=1);var p=0,m=0,g=["Uint8"];return(e.prototype=Object.create(l.prototype)).members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},u(r.name.length),u(r.type in f),g.indexOf(r.type)<0&&g.push(r.type);var n=a(r.type);m=Math.max(m,n),r.offset=p=i(p,Math.max(t.alignment,n));for(var o=0;othis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},c.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":329,unitbezier:557}],434:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],435:[function(t,e,r){e.exports={_args:[[{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},"/home/etienne/Documents/plotly/plotly.js"]],_from:"mapbox-gl@>=0.22.0 <0.23.0",_id:"mapbox-gl@0.22.1",_inCache:!0,_location:"/mapbox-gl",_nodeVersion:"4.4.5",_npmOperationalInternal:{host:"packages-12-west.internal.npmjs.com",tmp:"tmp/mapbox-gl-0.22.1.tgz_1471549891670_0.8762630566488951"},_npmUser:{name:"lucaswoj",email:"lucas@lucaswoj.com"},_npmVersion:"2.15.5",_phantomChildren:{},_requested:{raw:"mapbox-gl@^0.22.0",scope:null,escapedName:"mapbox-gl",name:"mapbox-gl",rawSpec:"^0.22.0",spec:">=0.22.0 <0.23.0",type:"range"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",_shrinkwrap:null,_spec:"mapbox-gl@^0.22.0",_where:"/home/etienne/Documents/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},directories:{},dist:{shasum:"92a965547d4c2f24c22cbc487eeda48694cb627a",tarball:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz"},engines:{node:">=4.0.0"},gitHead:"13a9015341f0602ccb55c98c53079838ad4b70b5",homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",maintainers:[{name:"aaronlidman",email:"aaronlidman@gmail.com"},{name:"ajashton",email:"aj.ashton@gmail.com"},{name:"ansis",email:"ansis.brammanis@gmail.com"},{name:"bergwerkgis",email:"wb@bergwerk-gis.at"},{name:"bhousel",email:"bryan@mapbox.com"},{name:"bsudekum",email:"bobby@mapbox.com"},{name:"camilleanne",email:"camille@mapbox.com"},{name:"dnomadb",email:"damon@mapbox.com"},{name:"dthompson",email:"dthompson@gmail.com"},{name:"emilymcafee",email:"emily@mapbox.com"},{name:"flippmoke",email:"flippmoke@gmail.com"},{name:"freenerd",email:"spam@freenerd.de"},{name:"gretacb",email:"carol@mapbox.com"},{name:"ian29",email:"ian.villeda@gmail.com"},{name:"ianshward",email:"ian@mapbox.com"},{name:"ingalls",email:"nicholas.ingalls@gmail.com"},{name:"jfirebaugh",email:"john.firebaugh@gmail.com"},{name:"jrpruit1",email:"jake@jakepruitt.com"},{name:"karenzshea",email:"karen@mapbox.com"},{name:"kkaefer",email:"kkaefer@gmail.com"},{name:"lbud",email:"lauren@mapbox.com"},{name:"lucaswoj",email:"lucas@lucaswoj.com"},{name:"lxbarth",email:"alex@mapbox.com"},{name:"lyzidiamond",email:"lyzi@mapbox.com"},{name:"mapbox-admin",email:"accounts@mapbox.com"},{name:"mateov",email:"matt@mapbox.com"},{name:"mcwhittemore",email:"mcwhittemore@gmail.com"},{name:"miccolis",email:"jeff@miccolis.net"},{name:"mikemorris",email:"michael.patrick.morris@gmail.com"},{name:"morganherlocker",email:"morgan.herlocker@gmail.com"},{name:"mourner",email:"agafonkin@gmail.com"},{name:"nickidlugash",email:"nicki@mapbox.com"},{name:"rclark",email:"ryan.clark.j@gmail.com"},{name:"samanbb",email:"saman@mapbox.com"},{name:"sbma44",email:"tlee@mapbox.com"},{name:"scothis",email:"scothis@gmail.com"},{name:"sgillies",email:"sean@mapbox.com"},{name:"springmeyer",email:"dane@mapbox.com"},{name:"themarex",email:"patrick@mapbox.com"},{name:"tmcw",email:"tom@macwright.org"},{name:"tristen",email:"tristen.brown@gmail.com"},{name:"willwhite",email:"will@mapbox.com"},{name:"yhahn",email:"young@mapbox.com"}],name:"mapbox-gl",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],436:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ip[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":438,"gl-mat4/clone":180,"gl-mat4/create":181,"gl-mat4/determinant":182,"gl-mat4/invert":186,"gl-mat4/transpose":196,"gl-vec3/cross":260,"gl-vec3/dot":261,"gl-vec3/length":262,"gl-vec3/normalize":264}],438:[function(t,e,r){e.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}},{}],439:[function(t,e,r){function n(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var a=t("gl-vec3/lerp"),o=t("mat4-recompose"),s=t("mat4-decompose"),l=t("gl-mat4/determinant"),c=t("quat-slerp"),u=n(),f=n(),h=n();e.exports=function(t,e,r,n){if(0===l(e)||0===l(r))return!1;var i=s(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),d=s(r,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!(!i||!d||(a(h.translate,u.translate,f.translate,n),a(h.skew,u.skew,f.skew,n),a(h.scale,u.scale,f.scale,n),a(h.perspective,u.perspective,f.perspective,n),c(h.quaternion,u.quaternion,f.quaternion,n),o(t,h.translate,h.scale,h.skew,h.perspective,h.quaternion),0))}},{"gl-mat4/determinant":182,"gl-vec3/lerp":263,"mat4-decompose":437,"mat4-recompose":440,"quat-slerp":490}],440:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.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}},{"gl-mat4/create":181,"gl-mat4/fromRotationTranslation":184,"gl-mat4/identity":185,"gl-mat4/multiply":188,"gl-mat4/scale":194,"gl-mat4/translate":195}],441:[function(t,e,r){"use strict";function n(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]}var i=t("binary-search-bounds"),a=t("mat4-interpolate"),o=t("gl-mat4/invert"),s=t("gl-mat4/rotateX"),l=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];e.exports=function(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=n.prototype;p.recalcMatrix=function(t){var e=this._time,r=i.le(e,t),n=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)f[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&f[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)n[c]=f[c];else a(n,f,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],h(m,m);var g=this.computedInverse;o(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-n[2+4*c]*b}},p.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=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=t("robust-orientation")[3]},{"robust-orientation":515}],443:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==m.alt,m.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==m.shift,m.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==m.control,m.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==m.meta,m.meta=!!t.metaKey),e}function i(t,i){var a=n.x(i),o=n.y(i);"buttons"in i&&(t=0|i.buttons),(t!==h||a!==d||o!==p||r(i))&&(h=0|t,d=a||0,p=o||0,e&&e(h,d,p,m))}function a(t){i(0,t)}function o(){(h||d||p||m.shift||m.alt||m.meta||m.control)&&(d=p=0,h=0,m.shift=m.alt=m.control=m.meta=!1,e&&e(0,0,0,m))}function s(t){r(t)&&e&&e(h,d,p,m)}function l(t){0===n.buttons(t)?i(0,t):i(h,t)}function c(t){i(h|n.buttons(t),t)}function u(t){i(h&~n.buttons(t),t)}function f(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var h=0,d=0,p=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;f();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return g},set:function(e){e?f():g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":445}],444:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-o.left,r[1]=a-o.top,r}},{}],445:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.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;k=k-1&m)b.push(_+"["+A+"+"+g(k)+"]");for(b.push(v(0)),k=0;k=0;--e)L(e,0);var r=[];for(e=0;e0){",h(S[t]),"=1;"),D(t-1,e|1<0&&q.push(s(j,S[B-1])+"*"+o(S[B-1])),R.push(d(j,S[B])+"=("+q.join("-")+")|0")}for(j=0;j=0;--j)H.push(o(S[j]));R.push(k+"=("+H.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",A+"=0"),R.push(p(0)+"=0");for(B=1;B<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 a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return x(t.vertex,t.cell,t.phase,i,r,o)};var _="V",w="P",M="N",k="Q",A="X",T="T"},{"typedarray-pool":554}],448:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":119}],449:[function(t,e,r){"use strict";function n(t){if(t in o)return o[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){for(a.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");for(a.push("){grad",r,"(src.pick(",s.join(),")",c),l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join();if(v=s[r])return v;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],l=0;l<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:o,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":116}],453:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":454,ndarray:458}],454:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":116}],455:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[a.mallocUint8,a.freeUint8];case"uint16":return[a.mallocUint16,a.freeUint16];case"uint32":return[a.mallocUint32,a.freeUint32];case"int8":return[a.mallocInt8,a.freeInt8];case"int16":return[a.mallocInt16,a.freeInt16];case"int32":return[a.mallocInt32,a.freeInt32];case"float32":return[a.mallocFloat,a.freeFloat];case"float64":return[a.mallocDouble,a.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",f,"*n",f].join("")):s.push(["d",d,"=s",d].join("")),f=d);var p;0!=(p=t.length-1-l)&&(h>0?s.push(["e",p,"=s",p,"-e",h,"*n",h,",f",p,"=",c[p],"-f",h,"*n",h].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),h=p)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",o,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+a);var g=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var f=[],h=1;h1){for(o.push("dptr=0;sptr=ptr"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");for(o.push("dptr=cptr;sptr=cptr-s0"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));return o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c?new Function("malloc","free",o.join("\n"))(c[0],c[1]):new Function(o.join("\n"))()}(t,e);return g(v,function(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function s(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function l(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function c(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i)0!==(o=t[i])&&_.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function f(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++A;u(o,[n,i],!1,["comp=",s("ptr0"),"-",s("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else _.push(["if(",s(a(n)),">",s(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?c([e,r],!1,l("ptr0",s("ptr1"))):_.push(l(a(e),s(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;u(i,[r],!0,[e,"=",s("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",s(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?c([e,r],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(c([e,r,n],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?c([e,r],!0,[l("ptr0",s("ptr1")),"\n",l("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(l(a(e),s(a(r))),l(a(r),"pivot"+n))}function x(e,r){_.push(["if((",r,"-",e,")<=",o,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function b(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),c([e],!0,["if(",s("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",s(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?c(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",s("ptr1"),"\n","pivot2[pivot_ptr]=",s("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",s("ptr0"),"\n","y=",s("ptr2"),"\n","z=",s("ptr4"),"\n",l("ptr5","x"),"\n",l("ptr6","y"),"\n",l("ptr7","z")].join("")):_.push(["pivot1=",s(a("el2")),"\n","pivot2=",s(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",s(a("el1")),"\n","y=",s(a("el3")),"\n","z=",s(a("el5")),"\n",l(a("index1"),"x"),"\n",l(a("index3"),"y"),"\n",l(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),b("less",1,"++less"),b("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k?new Function("insertionSort","malloc","free",_.join("\n"))(r,k[0],k[1]):new Function("insertionSort",_.join("\n"))(r)}(t,e,v))}},{"typedarray-pool":554}],456:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.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}},{"./lib/compile_sort.js":455}],457:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":119,"ndarray-linear-interpolate":451}],458:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");return new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],i)}var o=t("iota-array"),s=t("is-buffer"),l="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var o=i-1,u=1;o>=0;--o)r[o]=u,u*=e[o]}if(void 0===n)for(n=0,o=0;o>>0;e.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)}},{"double-bits":131}],460:[function(t,e,r){function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function a(t,e,r,n,i,s,u,f,h,d){if(d)M=d[0],k=d[1],_=d[2],w=d[3];else{var p=o(t,e,-i);t=p.x,e=p.y;var m=(t-(f=(p=o(f,h,-i)).x))/2,g=(e-(h=p.y))/2,v=m*m/(r*r)+g*g/(n*n);v>1&&(r*=v=Math.sqrt(v),n*=v);var y=r*r,x=n*n,b=(s==u?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*m*m)/(y*g*g+x*m*m)));b==1/0&&(b=1);var _=b*r*g/n+(t+f)/2,w=b*-n*m/r+(e+h)/2,M=Math.asin(((e-w)/n).toFixed(9)),k=Math.asin(((h-w)/n).toFixed(9));M=t<_?l-M:M,k=f<_?l-k:k,M<0&&(M=2*l+M),k<0&&(k=2*l+k),u&&M>k&&(M-=2*l),!u&&k>M&&(k-=2*l)}if(Math.abs(k-M)>c){var A=k,T=f,S=h;k=M+c*(u&&k>M?1:-1);var E=a(f=_+r*Math.cos(k),h=w+n*Math.sin(k),r,n,i,0,u,T,S,[k,A,_,w])}var L=Math.tan((k-M)/4),C=4/3*r*L,z=4/3*n*L,D=[2*t-(t+C*Math.sin(M)),2*e-(e-z*Math.cos(M)),f+C*Math.sin(k),h-z*Math.cos(k),f,h];if(d)return D;E&&(D=D.concat(E));for(var I=0;I7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=d,b=p;"C"!=e&&"S"!=e||(x+=x-o,b+=b-l),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),v=i(d,p,f,h,v[1],v[2]);break;case"Q":f=v[1],h=v[2],v=i(d,p,v[1],v[2],v[3],v[4]);break;case"L":v=n(d,p,v[1],v[2]);break;case"H":v=n(d,p,v[1],p);break;case"V":v=n(d,p,d,v[1]);break;case"Z":v=n(d,p,c,u)}e=y,d=v[v.length-2],p=v[v.length-1],v.length>4?(o=v[v.length-4],l=v[v.length-3]):(o=d,l=p),r.push(v)}return r}},{}],461:[function(t,e,r){r.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[c],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,M=(x+2)%3;b[x]+=_*(v[w]*m[M]-v[M]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.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;for(c=0;c<3;++c)h[c]*=d;i[o]=h}return i}},{}],462:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var f=Math.sqrt(u+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,c);f=Math.sqrt(2*h-u+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}},{}],464:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=s([r]),this.center=s(e),this.rotation=s(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)}e.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),a(r=[].slice.call(r,0,4),r);var i=new o(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 s=t("filtered-vector"),l=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),u=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),h=o.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;a(e,e);var r=this.computedMatrix;c(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,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d);u/=p,f/=p,h/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,x=m*u+g*f+v*h,b=n(m-=y*o+x*u,g-=y*s+x*f,v-=y*l+x*h);m/=b,g/=b,v/=b;var _=u*e+o*r,w=f*e+s*r,M=h*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*u,v=e*l+r*f,y=e*c+r*h,x=-(p*y-m*v),b=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=i(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*x+T*_-S*b,C=T*w+E*b+S*x-A*_,z=S*w+E*_+A*b-T*x,D=E*w-A*x-T*b-S*_;if(a){x=d,b=p,_=m;var I=Math.sin(a)/n(x,b,_);x*=I,b*=I,_*=I,D=D*(w=Math.cos(e))-(L=L*w+D*x+C*_-z*b)*x-(C=C*w+D*b+z*x-L*_)*b-(z=z*w+D*_+L*b-C*x)*_}var P=i(L,C,z,D);P>1e-6?(L/=P,C/=P,z/=P,D/=P):(L=C=z=0,D=1),this.rotation.set(t,L,C,z,D)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;l(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,c=0;c<3;++c)s+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(s,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;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;u(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),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)}},{"./lib/quatFromFrame":463,"filtered-vector":142,"gl-mat4/fromQuat":183,"gl-mat4/invert":186,"gl-mat4/lookAt":187}],465:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":507}],466:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:function(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?function(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=d.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&function(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,i,e)},writePackedSVarint:function(t,e){this.writeMessage(t,a,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,o,e)},writePackedDouble:function(t,e){this.writeMessage(t,s,e)},writePackedFixed32:function(t,e){this.writeMessage(t,c,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,u,e)},writePackedFixed64:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,h,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":469}],471:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":280,"typedarray-pool":554}],473:[function(t,e,r){"use strict";function n(t){return i[t]?i[t]:("string"==typeof t&&(t=i[t]=t.split(/\s*,\s*|\s+/)),t)}e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a0){o=c[u][i][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=c[f][i],d=0;d0&&(o=p,s=m,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=i(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],f=t,h=s[1],d=i(u,f,!0);if(n(e[u],e[f],e[h],e[d])<0)break;s.push(t),l=i(u,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;u0;){c[0][u].length;var m=a(u,d);o(0,m)?p.push.apply(p,m):(p.length>0&&h.push(p),p=m)}p.length>0&&h.push(p)}return h};var n=t("compare-angle")},{"compare-angle":106}],475:[function(t,e,r){"use strict";e.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 c=r[d];for(s=0;s0})).length,g=new Array(m),v=new Array(m);for(d=0;d0;){var N=O.pop(),j=E[N];c(j,function(t,e){return t-e});var B,U=j.length,V=F[N];for(0===V&&(B=[H=p[N]]),d=0;d=0)&&(F[q]=1^V,O.push(q),0===V)){var H;r(H=p[q])||(H.reverse(),B.push(H))}}0===V&&R.push(B)}return R};var i=t("edges-to-adjacency-list"),a=t("planar-dual"),o=t("point-in-big-polygon"),s=t("two-product"),l=t("robust-sum"),c=t("uniq"),u=t("./lib/trim-leaves")},{"./lib/trim-leaves":475,"edges-to-adjacency-list":136,"planar-dual":474,"point-in-big-polygon":478,"robust-sum":520,"two-product":552,uniq:556}],477:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],478:[function(t,e,r){function n(){return!0}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var s=i.key,l=o(r,s[0],s[1]);if(s[0][0]0))return 0;a=-1,i=i.right}else if(l>0)i=i.left;else{if(!(l<0))return 0;a=1,i=i.right}}return a}}(g.slabs,g.coordinates);return 0===n.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(i(n),v)};var o=t("robust-orientation")[3],s=t("slab-decomposition"),l=t("interval-tree-1d"),c=t("binary-search-bounds")},{"binary-search-bounds":70,"interval-tree-1d":279,"robust-orientation":515,"slab-decomposition":532}],479:[function(t,e,r){function n(t,e,r){var n=i.segments(t),a=i.segments(e),o=r(i.combine(n,a));return i.polygon(o)}var i,a=t("./lib/build-log"),o=t("./lib/epsilon"),s=t("./lib/intersecter"),l=t("./lib/segment-chainer"),c=t("./lib/segment-selector"),u=t("./lib/geojson"),f=!1,h=o();i={buildLog:function(t){return!0===t?f=a():!1===t&&(f=!1),!1!==f&&f.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=s(!0,h,f);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:s(!1,h,f).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:c.union(t.combined,f),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:c.intersect(t.combined,f),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:c.difference(t.combined,f),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:c.differenceRev(t.combined,f),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:c.xor(t.combined,f),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,h,f),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(i,t)},polygonToGeoJSON:function(t){return u.fromPolygon(i,h,t)},union:function(t,e){return n(t,e,i.selectUnion)},intersect:function(t,e){return n(t,e,i.selectIntersect)},difference:function(t,e){return n(t,e,i.selectDifference)},differenceRev:function(t,e){return n(t,e,i.selectDifferenceRev)},xor:function(t,e){return n(t,e,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),e.exports=i},{"./lib/build-log":480,"./lib/epsilon":481,"./lib/geojson":482,"./lib/intersecter":483,"./lib/segment-chainer":485,"./lib/segment-selector":486}],480:[function(t,e,r){e.exports=function(){function t(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}var e,r=0,n=!1;return e={list:[],segmentId:function(){return r++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,n){return t("temp_status",{seg:e,above:r,below:n})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,n){return t("status",{seg:e,above:r,below:n})},vert:function(r){return r===n?e:(n=r,t("vert",{x:r}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}}}},{}],481:[function(t,e,r){e.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-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],482:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}if(e.length<=0)return t.segments({inverted:!1,regions:[]});for(var n=r(e[0]),i=1;i0})}function s(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),m=!d&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;p&&(d||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),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 c=n.create(),f=[];!u.isEmpty();){var h=u.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=o(h),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(h.seg,!!p&&p.seg,!!m&&m.seg);var g=function(){if(p){var t=s(h,p);if(t)return t}return!!m&&s(h,m)}();if(g&&(t?(v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(g.seg),h.other.remove(),h.remove()),u.getHead()!==h){r&&r.rewind(h.seg);continue}if(t){var v;v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=v?!h.seg.myFill.below:h.seg.myFill.below}else if(null===h.seg.otherFill){var y;y=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?a:i,h.seg.otherFill={above:y,below:y}}r&&r.status(h.seg,!!p&&p.seg,!!m&&m.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(c.exists(x.prev)&&c.exists(x.next)&&s(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}f.push(h.seg)}u.getHead().remove()}return r&&r.done(),f}var u=n.create();return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p):(b=0,d>=0?(_=0,y=p):-d>=f?(_=1,y=f+2*d+p):y=d*(_=-d/f)+p);else if(_<0)_=0,h>=0?(b=0,y=p):-h>=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p;else{var w=1/x;y=(b*=w)*(c*b+u*(_*=w)+2*h)+_*(u*b+f*_+2*d)+p}else{var M,k,A,T;b<0?(k=f+d)>(M=u+h)?(A=k-M)>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p:(b=0,k<=0?(_=1,y=f+2*d+p):d>=0?(_=0,y=p):y=d*(_=-d/f)+p):_<0?(k=c+h)>(M=u+d)?(A=k-M)>=(T=c-2*u+f)?(_=1,b=0,y=f+2*d+p):y=(b=1-(_=A/T))*(c*b+u*_+2*h)+_*(u*b+f*_+2*d)+p:(_=0,k<=0?(b=1,y=c+2*h+p):h>=0?(b=0,y=p):y=h*(b=-h/c)+p):(A=f+d-u-h)<=0?(b=0,_=1,y=f+2*d+p):A>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p}var S=1-b-_;for(l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]);return n+a((t=t.replace(C,".")).split("."),e).join(".")}function s(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(e+=P((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=P(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:b}function u(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?I(t/k):t>>1,t+=I(t/e);t>D*w>>1;n+=b)t=I(t/D);return I(n+(D+1)*t/(t+M))}function h(t){var e,r,n,a,o,s,u,h,d,p,m=[],g=t.length,v=0,y=T,M=A;for((r=t.lastIndexOf(S))<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a=g&&i("invalid-input"),((h=c(t.charCodeAt(a++)))>=b||h>I((x-v)/s))&&i("overflow"),v+=h*s,d=u<=M?_:u>=M+w?w:u-M,!(hI(x/(p=b-d))&&i("overflow"),s*=p;M=f(v-o,e=m.length+1,0==o),I(v/e)>x-y&&i("overflow"),y+=I(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,c,h,d,p,m,g,v,y,M,k=[];for(g=(t=s(t)).length,e=T,r=0,o=A,l=0;l=e&&mI((x-r)/(v=n+1))&&i("overflow"),r+=(c-e)*v,e=c,l=0;lx&&i("overflow"),m==e){for(h=r,d=b;p=d<=o?_:d>=o+w?w:d-o,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=b-_,I=Math.floor,P=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:h,encode:d,toASCII:function(t){return o(t,function(t){return L.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return o(t,function(t){return E.test(t)?h(t.slice(4).toLowerCase()):t})}},p&&m)if(e.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],490:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":236}],491:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(f=m.substr(0,g),h=m.substr(g+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],492:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne?1:0};a>r;){if(a-r>600){var s=a-r+1,l=e-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-l*u/s+f)),Math.min(a,Math.floor(e+(s-l)*u/s+f)),o)}var h=t[e],d=r,p=a;for(i(t,r,e),o(t[a],h)>0&&i(t,r,a);d0;)p--}0===o(t[r],h)?i(t,r,p):i(t,++p,a),p<=e&&(r=p+1),e<=p&&(a=p-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],495:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":90,"compare-cell":107,"compare-oriented-cell":108}],500:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){function r(t){t?p(t):null===t&&m(),c()}function c(e){if("number"==typeof e)return d(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),k.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?d(r):t.draw=!0)})}function d(t){"number"==typeof t&&(t=k[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],g(t),t.after&&t.after(t))}function p(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(k=t.map(function(t,c){var u=k[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(k[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},M,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a2&&(t._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&x(e),e.thickness&&e.color&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],e.scaleRatio[0]>L||e.scaleRatio[1]>L?y(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.positions.length>=C)?y(e):v(e),e.after&&e.after(e)))}function m(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0;if(S=t.map(function(t,r){var s=S[r];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=l(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color stroke colors stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",after:"after callback done pass"}),s||(S[r]=s={id:r,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,offset:0,dashLength:0,hole:!0},t=o({},T,t)),c(s,t,[{thickness:parseFloat,opacity:parseFloat,miterLimit:parseFloat,overlay:Boolean,join:function(t){return t},after:function(t){return t},hole:function(t){return t||[]},positions:function(t,r,n){t=u(t,"float64");var i=Math.floor(t.length/2),o=a(t,2);return r.range||n.range||(n.range=o),r.count=i,r.bounds=o,e+=i,t},fill:function(t){return t?i(t,"uint8"):null},dashes:function(t,e,r){var n,i=e.dashLength;if(!t||t.length<2)i=1,n=new Uint8Array([255,255,255,255,255,255,255,255]);else{i=0;for(var a=0;a=4&&e.positions[0]===e.positions[e.positions.length-2]&&e.positions[1]===e.positions[e.positions.length-1]},positions:function(t,e,r){if(e.fill&&t.length){for(var n=[],i={},a=0,o=0,s=0,l=e.count;o 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord + translate) * scale;\n\tvec2 aBotPosition = (aBotCoord + translate) * scale;\n\n\tvec2 bTopPosition = (bTopCoord + translate) * scale;\n\tvec2 bBotPosition = (bBotCoord + translate) * scale;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = (aCoord + translate) * scaleRatio + viewport.xy;\n\tendCoord = (bCoord + translate) * scaleRatio + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1},bColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset+4},divisor:1},prevCoord:{buffer:w,stride:8,offset:function(t,e){return 8*e.offset},divisor:1},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},nextCoord:{buffer:w,stride:8,offset:function(t,e){return 24+8*e.offset},divisor:1}}},z)),y=t(o({vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float thickness, pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nconst float MAX_LINES = 256.;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n return (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n}\n\nvoid main() {\n\t// vec2 scaleRatio = scale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\tfloat depth = (MAX_LINES - 1. - id) / (MAX_LINES);\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scaleRatio);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},aCoordFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoordFract:{buffer:M,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},color:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1}}},z)),x=t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= opacity;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset}},positionFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset}}},blend:z.blend,depth:{enable:!1},scissor:z.scissor,stencil:z.stencil,viewport:z.viewport}),o(r,{update:m,draw:d,destroy:g,regl:t,gl:A,canvas:A.canvas,lines:S}),r}},{"array-bounds":48,"array-normalize":49,"color-normalize":99,earcut:135,"flatten-vertex-data":143,glslify:502,"object-assign":462,"pick-by-alias":473,"update-diff":558}],502:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],503:[function(t,e,r){"use strict";var n=t("color-normalize"),i=t("array-bounds"),a=t("color-id"),o=t("snap-points-2d"),s=t("object-assign"),l=t("glslify"),c=t("binary-search-bounds"),u=t("pick-by-alias"),f=t("update-diff"),h=t("flatten-vertex-data"),d=t("is-iexplorer"),p=t("to-float32"),m=p.float32,g=p.fract32;e.exports=function(t,e){function r(t){t?x(t):null===t&&M(),p()}function p(t){if("number"==typeof t)return v(t);Array.isArray(t)?t.forEach(function(t,e){if(null!=t)return t.length?v(t,e):v(t)}):O.forEach(function(t,e){t&&v(e)})}function v(e,r){"number"==typeof e&&(e=O[e]);var n;if(Array.isArray(e)&&(n=e,e=O[r]),e&&e.count&&e.opacity){var i;if(n){i=Array(e.count);for(var a=0;a1)){var g=m.offset,v=m.count+g,y=c.ge(f,i[0],g,v-1),x=c.lt(f,i[2],y,v-1)+1;if(!(x<=y))if(r){var b=n(t.data.subarray(y,x),r);l.push(s({},e,{elements:b,marker:F[h],offset:0,count:b.length}))}else l.push(s({},e,{elements:t.elements,marker:F[h],offset:y,count:x-y}))}}return l}function x(e){if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=0,n=0,a=0;O=e.map(function(e,l){var c=O[l];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=u(e,{positions:"positions data points",snap:"snap cluster",size:"sizes size radius",borderSize:"borderSizes borderSize stroke-width strokeWidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",palette:"palette swatch",marker:"markers marker shape",range:"range dataBox",viewport:"viewport viewBox",opacity:"opacity alpha"}),c||(O[l]=c={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,markerIds:[]},e=s({},P,e)),!e.positions||"marker"in e||(e.marker=c.marker,delete c.marker),f(c,e,[{snap:!0,size:function(t){return n+=t.length?1:0,t},borderSize:function(t){return n+=t.length?1:0,t},opacity:parseFloat,color:function(t){return t=w(t),a++,t},borderColor:function(t){return t=w(t),a++,t},positions:function(t,e,n){t=h(t,"float64");var a=e.count=Math.floor(t.length/2),o=e.bounds=a?i(t,2):null;return n.range||e.range||(delete e.range,n.range=o),e.offset=r,r+=a,n.marker||e.marker||(delete e.marker,n.marker=null),t}},{marker:function(t,e,r){if(e.markerIds.length=0,t&&"number"!=typeof t[0])for(var n=0,i=t.length;ni)){c.snap=!0;var h=c.x=Array(u),d=c.w=Array(u),p=void 0;if(n.length>1){p=Array(2*u);for(var m=0;m=0)return r;var n;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)n=e;else{n=new Uint8Array(e.length);for(var i=0,a=e.length;i 1.0) {\n discard;\n }\n\n float centerFraction = fragBorderSize == 0. ? 2. : fragSize / (fragSize + fragBorderSize + 1.25);\n\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, 1.);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n"]),vert:l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth, fragBorderSize, fragSize;\n\nvoid main() {\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n fragBorderSize = borderSize;\n fragSize = size;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragWidth = 1. / gl_PointSize;\n}\n"]),uniforms:{color:function(t,e){var r=e.color.length?e.color[0]:e.color;return D.slice(4*r,4*r+4).map(function(t){return t/255})},borderColor:function(t,e){var r=e.borderColor.length?e.borderColor[0]:e.borderColor;return D.slice(4*r,4*r+4).map(function(t){return t/255})},pixelRatio:t.context("pixelRatio"),palette:C,scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("marker")},attributes:{position:S,positionFract:E,size:B.attributes.size,borderSize:B.attributes.borderSize}}));else{var U=s({},B);U.frag=l(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float pixelRatio, opacity;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n //max-distance alpha\n if (dist < 0.003) discard;\n\n //null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a);\n return;\n }\n\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n}\n"]),U.vert=l(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius,\n\t\tfragWidth, fragBorderColorLevel, fragColorLevel;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pixelRatio;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),k=t(U);var V=s({},B);V.frag=l(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif(radius > 1.0 + delta) {\n\t\tdiscard;\n\t\treturn;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),V.vert=l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),A=t(V)}return s(r,{update:x,draw:p,destroy:M,regl:t,gl:z,canvas:z.canvas,groups:O,markers:R}),r}},{"array-bounds":48,"binary-search-bounds":504,"color-id":97,"color-normalize":99,"flatten-vertex-data":143,glslify:505,"is-iexplorer":284,"object-assign":462,"pick-by-alias":473,"snap-points-2d":534,"to-float32":547,"update-diff":558}],504:[function(t,e,r){arguments[4][89][0].apply(r,arguments)},{dup:89}],505:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],506:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){function t(t,e){this.id=j++,this.type=t,this.data=e}function e(t){if(0===t.length)return[];var r=t.charAt(0),n=t.charAt(t.length-1);if(1>>=e,r=(255>>=r,e|=r,r=(15>>=r,e|=r,r=(3>>r>>1}function c(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=G[l(t)>>2]).length?e.pop():new ArrayBuffer(t)}function u(t){G[l(t.byteLength)>>2].push(t)}function f(t,e,r,n,i,a){for(var o=0;o>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),s.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(ft).forEach(function(e){t+=ft[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;C.call(r);var a=E();return"number"==typeof t?A(a,0|t,"number"==typeof e?0|e:0|t):t?(z(r,t),T(a,t)):A(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,P(i),S(a,3553),D(r,3553),O(),L(a),s.profile&&(i.stats.size=M(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=$[i.internalformat],n.type=tt[i.type],n.mag=et[r.magFilter],n.min=rt[r.minFilter],n.wrapS=ot[r.wrapS],n.wrapT=ot[r.wrapT],n}var i=new I(3553);return ft[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return c(o,i),o.width=0,o.height=0,d(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,P(i),p(o,3553,e,r,a),O(),k(o),n},n.resize=function(e,r){var a=0|e,o=0|r||a;if(a===i.width&&o===i.height)return n;n.width=i.width=a,n.height=i.height=o,P(i);for(var l=0;i.mipmask>>l;++l)t.texImage2D(3553,l,i.format,a>>l,o>>l,0,i.format,i.type,null);return O(),s.profile&&(i.stats.size=M(i.internalformat,i.type,a,o,!1,!1)),n},n._reglType="texture2d",n._texture=i,s.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,o,l){function f(t,e,r,n,i,a){var o,l=h.texInfo;for(C.call(l),o=0;6>o;++o)g[o]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)T(g[0],t),T(g[1],e),T(g[2],r),T(g[3],n),T(g[4],i),T(g[5],a);else if(z(l,t),u(h,t),"faces"in t)for(t=t.faces,o=0;6>o;++o)c(g[o],h),T(g[o],t[o]);else for(o=0;6>o;++o)T(g[o],t)}else for(t=0|t||1,o=0;6>o;++o)A(g[o],t,t);for(c(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),o=0;6>o;++o)S(g[o],34069+o);for(D(l,34067),O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=$[h.internalformat],f.type=tt[h.type],f.mag=et[l.magFilter],f.min=rt[l.minFilter],f.wrapS=ot[l.wrapS],f.wrapT=ot[l.wrapT],o=0;6>o;++o)L(g[o]);return f}var h=new I(34067);ft[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,o,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return c(a,h),a.width=0,a.height=0,d(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,P(h),p(a,34069+t,r,n,i),O(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,s.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);D(e.texInfo,e.target)})}}}function A(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function T(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);H(l).forEach(e),l={},H(c).forEach(e),c={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,u={},r.shaderCount=0},program:function(t,e,i){var a=u[e];a||(a=u[e]={});var o=a[t];return o||(o=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(e,t),r.shaderCount++,s(o),a[t]=o,f.push(o)),o},restore:function(){l={},c={};for(var t=0;t="+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",u,"=",s,".createStream(",34962,",",i,".buffer);","}else{",u,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l})}),o}(r),u.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=P(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=O(e,function(t,r){return t.invoke(r,e)})}),n}(o),u}function w(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a),i(n,".",a,"=",r[a].append(t,e),";")}),e(i)}function M(t,e,r,n){var i,a=(s=t.shared).gl,o=s.framebuffer;J&&(i=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",a,".bindFramebuffer(",36160,",",t,".framebuffer);"),J&&e(i,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),J&&e(i,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function k(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,l=n.current,c=n.next,u=t.cond(l,".dirty");$.forEach(function(e){if(!((e=g(e))in r.state)){var n,f;if(e in o){n=o[e],f=a[e];var h=s(K[e].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(h.map(function(t,e){return t+"!=="+f+"["+e+"]"}).join("||")).then(i,".",rt[e],"(",h,");",h.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";"))}else n=u.def(c,".",e),h=t.cond(n,"!==",l,".",e),u(h),e in et?h(t.cond(n).then(i,".enable(",et[e],");").else(i,".disable(",et[e],");"),l,".",e,"=",n,";"):h(i,".",rt[e],"(",n,");",l,".",e,"=",n,";")}}),0===Object.keys(r.state).length&&u(l,".dirty=false;"),e(u)}function A(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;z(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(et[i]){var u=et[i];I(l)?e(s,c?".enable(":".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(v(c)){var f=a[i];e(s,".",rt[i],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",rt[i],"(",c,");",o,".",i,"=",c,";")}})}function T(t,e){X&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function S(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(h,".count+=",i,";"):t(h,".count++;"),p&&(n?(u=e.def(),t(u,"=",m,".getNumPendingQueries();")):t(m,".beginQuery(",h,");"))}function s(t){t(h,".cpuTime+=",a(),"-",c,";"),p&&(n?t(m,".pushScopeStats(",u,",",m,".getNumPendingQueries(),",h,");"):t(m,".endQuery();"))}function l(t){var r=e.def(d,".profile");e(d,".profile=",t,";"),e.exit(d,".profile=",r,";")}var c,u,f=t.shared,h=t.stats,d=f.current,m=f.timer;if(r=r.profile){if(I(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(d,".profile");o(f=t.block()),e("if(",r,"){",f,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function F(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(yt))return;var c=t.scopeAttrib(s);o={},Object.keys(new Y).forEach(function(t){o[t]=e.def(c,".",t)})}!function(r,n,i){function o(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",d.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",d.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),X&&(a=i.divisor,e("if(",u,".divisor!==",a,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,a],");",u,".divisor=",a,";}"))}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",ht.map(function(t,e){return u+"."+t+"!=="+h[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",h,");",ht.map(function(t,e){return u+"."+t+"="+h[e]+";"}).join(""),"}")}var l=a.gl,c=e.def(r,".location"),u=e.def(a.attributes,"[",c,"]");r=i.state;var f=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];1===r?o():2===r?s():(e("if(",r,"===",1,"){"),o(),e("}else{"),s(),e("}"))}(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)})}function R(t,r,n,i,a){for(var o,l=t.shared,c=l.gl,u=0;u>1)",m],");")}function e(){r(g,".drawArraysInstancedANGLE(",[h,d,p,m],");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[h,d,p]+");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,f=function(){var i=u.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","elements"),i&&a("if("+i+")"+l+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),h=i("primitive"),d=i("offset"),p=function(){var i=u.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","count"),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,g;X&&(m=i("instances"),g=t.instancing);var v=f+".type",y=u.elements&&I(u.elements);X&&("number"!=typeof m||0<=m)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function U(t,e,r,n,i){return e=b(),i=e.proc("body",i),X&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function V(t,e,r,n){T(t,e),F(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),j(t,e,e,r)}function q(t,e,r,n){function i(){return!0}t.batchId="a1",T(t,e),F(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),j(t,e,e,r)}function H(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}T(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&w(t,u,r.context),r.needsFramebuffer&&M(t,u,r.framebuffer),A(t,u,r.state,i),r.profile&&i(r.profile)&&S(t,u,r,!1,!0),n?(F(t,c,r,n.attributes,a),F(t,u,r,n.attributes,i),R(t,c,r,n.uniforms,a),R(t,u,r,n.uniforms,i),j(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link(function(e){return U(q,t,r,e,2)}),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function G(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];B.isDynamic(n)&&(n=t.invoke(e,n),e(u,".",r,"=",n,";"))})}var i=e.static[r];if(i&&function(t){if("object"==typeof t&&!v(t)){for(var e=Object.keys(t),r=0;r":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},gt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vt={cw:2304,ccw:2305},yt=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===it.length)E&&E.update(),lt=null;else{lt=U.next(e),h();for(var t=it.length-1;0<=t;--t){var r=it[t];r&&r(D,null,0)}y.flush(),E&&E.update()}}function r(){!lt&&0=it.length&&n()}var r=R(it,t);it[r]=e}}}function f(){var t=rt.viewport,e=rt.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=y.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=y.drawingBufferHeight}function h(){D.tick+=1,D.time=v(),f(),et.procs.poll()}function g(){f(),et.procs.refresh(),E&&E.update()}function v(){return(V()-L)/1e3}if(!(t=a(t)))return null;var y=t.gl,x=y.getContextAttributes();y.isContextLost();var b=function(t,e){function r(e){e=e.toLowerCase();var r;try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;i(i=l)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=s,0>s&&(i=4,1===(s=n.buffer.dimension)&&(i=0),2===s&&(i=1),3===s&&(i=4)),n.primType=i}function s(t){n.elementsCount--,delete l[t.id],t.buffer.destroy(),t.buffer=null}var l={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function l(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,s=0,h=0;Array.isArray(t)||q(t)||o(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=J[t.usage]),"primitive"in t&&(n=tt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?s=0|t.length:(s=i,5123===h||5122===h?s*=2:5125!==h&&5124!==h||(s*=4))),a(f,e,r,n,i,s,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return l}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,l(t),l._reglType="elements",l._elements=f,l.subdata=function(t,e){return c.subdata(t,e),l},l.destroy=function(){s(f)},l},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){H(l).forEach(s)}}}(y,M,P,w),j=(C=function(t,e,r,n,i){for(t=r.maxAttributes,e=Array(t),r=0;r=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach(function(e){t+=u[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(a=e.shape,n=0|a[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height?o:(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){H(u).forEach(o)},restore:function(){H(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}}(y,M,0,w,t),X=function(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?(t=n.create2D({width:t,height:e,format:a,type:s}),t._texture.refCount=0,new o(3553,t,null)):(t=i.create({width:t,height:e,format:a}),t._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=M++,k[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete k[e.id]}function v(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){H(k).forEach(g)},restore:function(){H(k).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}})}(y,M,I,G,W,w),et=F(y,_,M,I,P,O,0,X,{},C,j,{elements:null,primitive:4,count:-1,offset:0,instances:-1},D,E,t),rt=(_=S(y,X,et.procs.poll,D),et.next),nt=y.canvas,it=[],at=[],ot=[],st=[t.onDestroy],lt=null;nt&&(nt.addEventListener("webglcontextlost",i,!1),nt.addEventListener("webglcontextrestored",s,!1));var ht=X.setFBO=l({framebuffer:B.define.call(null,1,"framebuffer")});return g(),x=N(l,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)ht(N({framebuffer:t.framebuffer.faces[e]},t),c);else ht(t,c);else c(0,t)},prop:B.define.bind(null,1),context:B.define.bind(null,2),this:B.define.bind(null,3),draw:l({}),buffer:function(t){return P.create(t,34962,!1,!1)},elements:function(t){return O.create(t,!1)},texture:G.create2D,cube:G.createCube,renderbuffer:W.create,framebuffer:X.create,framebufferCube:X.createCube,attributes:x,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=at;break;case"restore":r=ot;break;case"destroy":r=st}return r.push(e),{cancel:function(){for(var t=0;t=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,r)}},{}],508:[function(t,e,r){!function(t,n){"object"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",i(t.slice(0,e)),",",i(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function o(t){return!0&t?"-":""}function s(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===n?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?i[t]:i)}var i=t("robust-determinant"),a=6,o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:d(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],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+f*(g-v)+h*(y-x),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(h));return b>_||-b>_?b:p(t,e,r,n)}];!function(){for(;m.length<=h;)m.push(s(m.length));for(var t=[],r=["slow"],n=0;n<=h;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=h;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&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),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(c+=1)=n?(i=h,(c+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(f=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(f,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],522:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],523:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":74,"reduce-simplicial-complex":499}],524:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,a=new Array(t+1);a[0]=[[]];for(var o=1;o<=t;++o)for(var s=a[o]=i(o),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--o){o>1,s=n(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(i=o-1)}return a}function l(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==n(t[g],o)););}return r}function c(t,e){if(e<0)return[];for(var r=[],n=(1<>>u&1&&c.push(i[u]);e.push(c)}return a(e)},r.skeleton=c,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=l(t);if(!(r>=0&&e0){var t=A[0];return o(0,S-1),S-=1,c(0),t}return-1}function h(t,e){var r=A[t];return x[r]===e?t:(x[r]=-1/0,u(t),f(),x[r]=e,S+=1,u(S-1))}function d(t){if(!b[t]){b[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],a(e)),T[r]>=0&&h(T[r],a(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),x=new Array(m),b=new Array(m),_=0;_>1;_>=0;--_)c(_);for(;;){var E=f();if(E<0||x[E]>r)break;d(E)}var L=[];for(_=0;_=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":515,"simplicial-complex":528}],531:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var a=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?a-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],a=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=i(r,a,s),c=i(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=i(s,o,a),c=i(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var i=t("robust-orientation")},{"robust-orientation":515}],532:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=a(t.right,e))return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}e.exports=function(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var c=this.horizontal[e];if(c.length>0){var h=l.ge(c,t[1],i);if(h=c.length)return n;d=c[h]}}if(d.start)if(o){var p=u(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":531,"binary-search-bounds":70,"functional-red-black-tree":144,"robust-orientation":515}],533:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],f=a[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function i(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function a(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function o(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],f=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=f}function s(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function l(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function u(t,e,r,h,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,x=y-m,b=y+m,_=g,w=x,M=y,k=b,A=v,T=t+1,S=e-1,E=0;l(_,w,r,h,d)&&(E=_,_=w,w=E),l(k,A,r,h,d)&&(E=k,k=A,A=E),l(_,M,r,h,d)&&(E=_,_=M,M=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(_,k,r,h,d)&&(E=_,_=k,k=E),l(M,k,r,h,d)&&(E=M,M=k,k=E),l(w,A,r,h,d)&&(E=w,w=A,A=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(k,A,r,h,d)&&(E=k,k=A,A=E);var L=r[w],C=h[2*w],z=h[2*w+1],D=d[w],I=p[w],P=r[k],O=h[2*k],F=h[2*k+1],R=d[k],N=p[k],j=_,B=M,U=A,V=g,q=y,H=v,G=r[j],Y=r[B],W=r[U];r[V]=G,r[q]=Y,r[H]=W;for(var X=0;X<2;++X){var Z=h[2*j+X],J=h[2*B+X],K=h[2*U+X];h[2*V+X]=Z,h[2*q+X]=J,h[2*H+X]=K}var Q=d[j],$=d[B],tt=d[U];d[V]=Q,d[q]=$,d[H]=tt;var et=p[j],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,a(x,t,r,h,d,p),a(b,e,r,h,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,0,D,r,h,d))it!==T&&i(it,T,r,h,d,p),++T;else if(!c(it,P,O,0,R,r,h,d))for(;;){if(c(S,P,O,0,R,r,h,d)){c(S,L,C,0,D,r,h,d)?(o(it,T,S,r,h,d,p),++T,--S):(i(it,S,r,h,d,p),--S);break}if(--S=Math.max(.9*d,32)){var _=c+s>>>1;l(g,v,f,h,_,u+1),h=_}l(g,v,f,h,y,u+1),h=y}}}var c=t.length>>>1;if(c<1)return[];e||(e=Array(c)),r||(r=Array(c)),s||(s=[]);for(var u=0;u=s[2]||s[1]>=s[3]){var f=o(t,2);f[0]===f[2]&&(f[2]+=1),f[1]===f[3]&&(f[3]+=1),s[0]=f[0],s[1]=f[1],s[2]=f[2],s[3]=f[3]}var h=s[0],d=s[1],p=s[2],m=s[3],g=1/(p-h),v=1/(m-d),y=Math.max(p-h,m-d),x=new Int32Array(c),b=0;l(h,d,y,0,c,0),a(x,t,e,r,c);var _=[],w=0,M=c;for(b=c-1;b>=0;--b){t[2*b]=(t[2*b]-h)*g,t[2*b+1]=(t[2*b+1]-d)*v;var k=x[b];k!==w&&(_.push(new i(y*Math.pow(.5,k),b+1,M-(b+1))),M=b+1,w=k)}return _.push(new i(y*Math.pow(.5,k+1),0,M)),_}},{"./lib/sort":533,"array-bounds":48}],535:[function(t,e,r){"use strict";function n(t,e){var r=o(a(t,e),[e[e.length-1]]);return r[r.length-1]}function i(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||o>0&&u<0){var f=i(s,u,l,o);r.push(f),a.push(f.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}},e.exports.positive=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r},e.exports.negative=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}},{"robust-dot-product":512,"robust-sum":520}],536:[function(t,e,r){!function(){"use strict";function t(e){return function(e,r){var i,a,o,s,l,c,u,f,h,d=1,p=e.length,m="";for(a=0;a=0),s[8]){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,s[6]?parseInt(s[6]):0);break;case"e":i=s[7]?parseFloat(i).toExponential(s[7]):parseFloat(i).toExponential();break;case"f":i=s[7]?parseFloat(i).toFixed(s[7]):parseFloat(i);break;case"g":i=s[7]?String(Number(i.toPrecision(s[7]))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=s[7]?i.substring(0,s[7]):i;break;case"t":i=String(!!i),i=s[7]?i.substring(0,s[7]):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=s[7]?i.substring(0,s[7]):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=s[7]?i.substring(0,s[7]):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}n.json.test(s[8])?m+=i:(!n.number.test(s[8])||f&&!s[3]?h="":(h=f?"+":"-",i=i.toString().replace(n.sign,"")),c=s[4]?"0"===s[4]?"0":s[4].charAt(1):" ",u=s[6]-(h+i).length,l=s[6]&&u>0?c.repeat(u):"",m+=s[5]?h+i+l:"0"===c?h+l+i:l+h+i)}return m}(function(t){if(i[t])return i[t];var e,r=t,a=[],o=0;for(;r;){if(null!==(e=n.text.exec(r)))a.push(e[0]);else if(null!==(e=n.modulo.exec(r)))a.push("%");else{if(null===(e=n.placeholder.exec(r)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],l=e[2],c=[];if(null===(c=n.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(c[1]);""!==(l=l.substring(c[0].length));)if(null!==(c=n.key_access.exec(l)))s.push(c[1]);else{if(null===(c=n.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(c[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push(e)}r=r.substring(e[0].length)}return i[t]=a}(e),arguments)}function e(e,r){return t.apply(null,[e].concat(r||[]))}var n={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:/^[\+\-]/},i=Object.create(null);void 0!==r&&(r.sprintf=t,r.vsprintf=e),"undefined"!=typeof window&&(window.sprintf=t,window.vsprintf=e)}()},{}],537:[function(t,e,r){"use strict";e.exports=function(t){function e(e){var r=[e],c=[e];for(n[e]=i[e]=u,a[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(o[e]=0&&l[e].push(s[m])}o[e]=p}else{if(i[e]===n[e]){var g=[],v=[],y=0;for(p=r.length-1;p>=0;--p){var x=r[p];if(a[x]=!1,g.push(x),v.push(l[x]),y+=l[x].length,s[x]=f.length,x===e){r.length=p;break}}f.push(g);var b=new Array(y);for(p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function u(t){return t.x}function f(t){return t.y}var h=t("kdbush");e.exports=function(t){return new n(t)},n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(i);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var o=+Date.now();this.trees[a+1]=h(n,u,f,this.options.nodeSize,Float32Array),n=this._cluster(n,a),e&&console.log("z%d: %d clusters in %dms",a,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=h(n,u,f,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(s(t[0]),l(t[3]),s(t[2]),l(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+g[b]+"*c");var T=p[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+T+"*("+p[b].join("+")+A+")/("+m[b].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var E=[];for(c=0;c<1<1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,m=void 0===p?0:p,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(d*i/360),b=Math.cos(d*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var M=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);M>1&&(u*=Math.sqrt(M),f*=Math.sqrt(M));var k=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(d,2),y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,M=(h-x)/a,k=(d-b)/o,A=(-h-x)/a,T=(-d-b)/o,S=s(1,0,M,k),E=s(M,k,A,T);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,m,v,x,b,_,w),A=n(k,4),T=A[0],S=A[1],E=A[2],L=A[3],C=Math.max(Math.ceil(Math.abs(L)/(i/4)),1);L/=C;for(var z=0;ze[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":43,assert:51,"is-svg-path":287,"normalize-svg-path":543,"parse-svg-path":466}],543:[function(t,e,r){"use strict";function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,d=0,p=0,m=t.length;p4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=d),r.push(g)}return r};var a=t("svg-arc-to-cubic-bezier")},{"svg-arc-to-cubic-bezier":541}],544:[function(t,e,r){(function(r){"use strict";var n=t("svg-path-bounds"),i=t("parse-svg-path"),a=t("draw-svg-path"),o=t("is-svg-path"),s=t("bitmap-sdf"),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");e||(e={});var u,f;e.shape?(u=e.shape[0],f=e.shape[1]):(u=l.width=e.w||e.width||200,f=l.height=e.h||e.height||200);var h=Math.min(u,f),d=e.stroke||0,p=e.viewbox||e.viewBox||n(t),m=[u/(p[2]-p[0]),f/(p[3]-p[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d)),c.translate(.5*u,.5*f),c.scale(g,g),r.Path2D){var v=new Path2D(t);c.fill(v),d&&c.stroke(v)}else{var y=i(t);a(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bitmap-sdf":72,"draw-svg-path":132,"is-svg-path":287,"parse-svg-path":466,"svg-path-bounds":542}],545:[function(t,e,r){(function(r){"use strict";function n(t,e,r){r=r||{};var a=o[t];a||(a=o[t]={" ":{data:new Float32Array(0),shape:.2}});var s=a[e];if(!s)if(e.length<=1||!/\d/.test(e))s=a[e]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var d=new Float32Array(u),p=0,m=-.5*f;for(h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;t=_(t,360),e=_(e,100),r=_(r,100);if(0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(e.h,i,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=b(n),{ok:s,format:e.format||l,r:I(255,P(r.r,0)),g:I(255,P(r.g,0)),b:I(255,P(r.b,0)),a:n}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=D(100*this._a)/100,this._format=n.format||i.format,this._gradientType=n.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=i.ok,this._tc_id=z++}function n(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n,i,a=P(t,e,r),o=I(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;)i.h=(i.h+a)%360,o.push(r(i));return o}function x(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function b(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=I(r,P(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function w(t){return I(1,P(0,t))}function M(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function A(t){return t<=1&&(t=100*t+"%"),t}function T(e){return t.round(255*parseFloat(e)).toString(16)}function S(t){return M(t)/255}function E(t){return!!N.CSS_UNIT.exec(t)}var L=/^\s+/,C=/\s+$/,z=0,D=t.round,I=t.min,P=t.max,O=t.random;r.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 e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=b(t),this._roundA=D(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),n=D(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),i=D(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return a(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=[k(D(t).toString(16)),k(D(e).toString(16)),k(D(r).toString(16)),k(T(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:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(100*_(this._r,255))+"%",g:D(100*_(this._g,255))+"%",b:D(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%)":"rgba("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+o(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},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 r(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(u,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:A(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:O(),g:O(),b:O()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=function(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(n)).level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,c=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=r(e[u]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var F=r.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"},R=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(F),N=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],547:[function(t,e,r){"use strict";function n(t){if(t instanceof Float32Array)return t;if("number"==typeof t)return new Float32Array([t])[0];var e=new Float32Array(t);return e.set(t),e}e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t){if("number"==typeof t)return n(t-n(t));for(var e=n(t),r=0,i=e.length;r1)n=function(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(o);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":!function(t){t.forEach(a)}(t.arcs)}}var s,l=[],c=[];return o(e),c.forEach(null==r?function(t){l.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var i,s,l=1,u=a(n[0]);lu&&(s=n[0],n[0]=n[l],n[l]=s,u=i);return n})}}var a=function(t){return t},o=function(t){if(null==(e=t.transform))return a;var e,r,n,i=e.scale[0],o=e.scale[1],s=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+s,t[1]=(n+=t[1])*o+l,t}},s=function(t){function e(t){l[0]=t[0],l[1]=t[1],s(l),l[0]f&&(f=l[0]),l[1]h&&(h=l[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,s=o(t),l=new Array(2),c=1/0,u=c,f=-c,h=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]h&&(h=l[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,f,h]}return n},l=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},c=function(t,e){function r(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}var n={},i={},a={},o=[],s=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++s],e[s]=r,e[n]=i)}),e.forEach(function(e){var r,n,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,n=i[l]){delete i[n.start];var c=n===r?r:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[r.start]=a[r.end]=r;else if(r=i[l])if(delete i[r.start],r.unshift(e),r.start=s,n=a[s]){delete a[n.end];var u=n===r?r:n.concat(r);i[u.start=n.start]=a[u.end=r.end]=u}else i[r.start]=a[r.end]=r;else i[(r=[e]).start=s]=a[r.end=l]=r}),r(a,i),r(i,a),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=s(t),o=a[0],l=(a[2]-o)/(e-1)||1,c=a[1],u=(a[3]-c)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,s=t.length,f=t[0],h=f[0]=Math.round((f[0]-o)/l),d=f[1]=Math.round((f[1]-c)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,l){this.center=s(r),this.up=s(n),this.right=s(i),this.radius=s([a]),this.angle=s([o,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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];u(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=h(r,p)/s,g=h(i,p)/s;c=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)};var s=t("filtered-vector"),l=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),u=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),h=t("gl-vec3/dot"),d=o.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,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];var s=Math.sqrt(i),l=0;for(o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;var c=Math.sqrt(l);for(o=0;o<3;++o)r[o]/=c;var h=this.computedToward;u(h,e,r),f(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,M=x,k=-g*x,A=-v*x,T=y,S=this.computedEye,E=this.computedMatrix;for(o=0;o<3;++o){var L=_*r[o]+w*h[o]+M*e[o];E[4*o+1]=k*r[o]+A*h[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],D=E[9],I=E[2],P=E[6],O=E[10],F=z*O-D*P,R=D*I-C*O,N=C*P-z*I,j=n(F,R,N);F/=j,R/=j,N/=j,E[0]=F,E[4]=R,E[8]=N;for(o=0;o<3;++o)S[o]=b[o]+E[2+4*o]*d;for(o=0;o<3;++o){l=0;for(var B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[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 a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,p);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d),m=(u/=p)*e+o*r,g=(f/=p)*e+s*r,v=(h/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),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,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var c=e[o],u=e[o+4],f=e[o+8];if(a){var h=Math.abs(c),d=Math.abs(u),p=Math.abs(f),m=Math.max(h,d,p);h===m?(c=c<0?-1:1,u=f=0):p===m?(f=f<0?-1:1,c=u=0):(u=u<0?-1:1,c=f=0)}else{var g=n(c,u,f);c/=g,u/=g,f/=g}var v=e[s],y=e[s+4],x=e[s+8],b=v*c+y*u+x*f,_=n(v-=c*b,y-=u*b,x-=f*b),w=u*(x/=_)-f*(y/=_),M=f*(v/=_)-c*x,k=c*y-u*v,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,c,u,f),this.right.jump(t,v,y,x);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*v+L*y+C*x,D=E*w+L*M+C*k;T=F<0?-Math.PI/2:Math.PI/2,S=Math.atan2(D,z)}else{var I=e[2],P=e[6],O=e[10],F=I*c+P*u+O*f,R=I*v+P*y+O*x,N=I*w+P*M+O*k;T=Math.asin(i(F)),S=Math.atan2(N,R)}this.angle.jump(t,S,T),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*W,G-B*W,Y-U*W)},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,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(u,f,h);if(!(d<1e-6)){u/=d,f/=d,h/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,x=n(m-=y*o,g-=y*s,v-=y*l);if(!(x<.01&&(m=s*h-l*f,g=l*u-o*h,v=o*f-s*u,(x=n(m,g,v))<1e-6))){m/=x,g/=x,v/=x,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var b=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(b,_,w),k=o*u+s*f+l*h,A=m*u+g*f+v*h,T=(b/=M)*u+(_/=M)*f+(w/=M)*h,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);D0?r.pop():new ArrayBuffer(t)}function o(t){return new Uint8Array(a(t),0,t)}function s(t){return new Uint16Array(a(2*t),0,t)}function l(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function u(t){return new Int16Array(a(2*t),0,t)}function f(t){return new Int32Array(a(4*t),0,t)}function h(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function p(t){return x?new Uint8ClampedArray(a(t),0,t):o(t)}function m(t){return new DataView(a(t),0,t)}function g(t){t=v.nextPow2(t);var e=v.log2(t),r=w[e];return r.length>0?r.pop():new n(t)}var v=t("bit-twiddle"),y=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var x="undefined"!=typeof Uint8ClampedArray,b=e.__TYPEDARRAY_POOL;b.UINT8C||(b.UINT8C=y([32,0])),b.BUFFER||(b.BUFFER=y([32,0]));var _=b.DATA,w=b.BUFFER;r.free=function(t){if(n.isBuffer(t))w[v.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|v.log2(e);_[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){i(t.buffer)},r.freeArrayBuffer=i,r.freeBuffer=function(t){w[v.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return o(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return c(t);case"int16":return u(t);case"int32":return f(t);case"float":case"float32":return h(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return g(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=o,r.mallocUint16=s,r.mallocUint32=l,r.mallocInt8=c,r.mallocInt16=u,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=h,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=p,r.mallocDataView=m,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)b.UINT8[t].length=0,b.UINT16[t].length=0,b.UINT32[t].length=0,b.INT8[t].length=0,b.INT16[t].length=0,b.INT32[t].length=0,b.FLOAT[t].length=0,b.DOUBLE[t].length=0,b.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":71,buffer:82,dup:134}],555:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],558:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),h=["%","/","?",";","#"].concat(f),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=t("querystring");n.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?I+="x":I+=D[P];if(!I.match(p)){var F=C.slice(0,A),R=C.slice(A+1),N=D.match(m);N&&(F.push(N[1]),R.unshift(N[2])),R.length&&(u="/"+R.join(".")+u),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=a.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[w])for(A=0,z=f.length;A0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=M.slice(-1)[0],T=(r.host||t.host||M.length>1)&&("."===A||".."===A)||""===A,S=0,E=M.length;E>=0;E--)"."===(A=M[E])?M.splice(E,1):".."===A?(M.splice(E,1),S++):S&&(M.splice(E,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),T&&"/"!==M.join("/").substr(-1)&&M.push("");var L=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=L?"":M.length?M.shift():"";var C;(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(_=_||r.host&&M.length)&&!L&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":560,punycode:489,querystring:493}],560:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],561:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],562:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],563:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&b(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return p(i)||(i=s(t,i,n)),i}var a=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),v=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),x(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(b(e)){var _=e.name?": "+e.name:"";return t.stylize("[Function"+_+"]","special")}if(g(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(y(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return l(e)}var w="",k=!1,A=["{","}"];if(u(e)&&(k=!0,A=["[","]"]),b(e)){w=" [Function"+(e.name?": "+e.name:"")+"]"}if(g(e)&&(w=" "+RegExp.prototype.toString.call(e)),y(e)&&(w=" "+Date.prototype.toUTCString.call(e)),x(e)&&(w=" "+l(e)),0===o.length&&(!k||0==e.length))return A[0]+w+A[1];if(n<0)return g(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var T;return T=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(T,w,A)}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),l||(t.seen.indexOf(c.value)<0?(l=h(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+l.split("\n").map(function(t){return" "+t}).join("\n")):l=t.stylize("[Circular]","special")),m(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+l}function u(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function h(t){return null===t}function d(t){return"number"==typeof t}function p(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return v(t)&&"[object RegExp]"===_(t)}function v(t){return"object"==typeof t&&null!==t}function y(t){return v(t)&&"[object Date]"===_(t)}function x(t){return v(t)&&("[object Error]"===_(t)||t instanceof Error)}function b(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!p(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":566}],568:[function(t,e,r){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":569}],569:[function(t,e,r){"use strict";function n(t,e,r,n){var i=function(t,e){var r=a(t,128);return e?s(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,n),o=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;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}var o=t("pbf"),s=t("./vector-tile-pb"),l=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new l(t[r].features),e[r].name=r;return n({layers:e})},e.exports.GeoJSONWrapper=l},{"./lib/geojson_wrapper":571,"./vector-tile-pb":572,pbf:470}],571:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e=0?e[o]:a})},has___:{value:i(function(e){var i=n(e);return i?r in i:t.indexOf(e)>=0})},set___:{value:i(function(i,a){var o,s=n(i);return s?s[r]=a:(o=t.indexOf(i))>=0?e[o]=a:(o=t.length,e[o]=a,t[o]=i),this})},delete___:{value:i(function(i){var a,o,s=n(i);return s?r in s&&delete s[r]:!((a=t.indexOf(i))<0||(o=t.length-1,t[a]=void 0,e[a]=e[o],t[a]=t[o],t.length=o,e.length=o,0))})}})};b.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 s?function(){function r(){this instanceof b||a();var e,r=new s,n=void 0,l=!1;return e=o?function(t,e){return r.set(t,e),r.has(t)||(n||(n=new b),n.set(t,e)),this}:function(t,e){if(l)try{r.set(t,e)}catch(r){n||(n=new b),n.set___(t,e)}else r.set(t,e);return this},Object.create(b.prototype,{get___:{value:i(function(t,e){return n?r.has(t)?r.get(t):n.get___(t,e):r.get(t,e)})},has___:{value:i(function(t){return r.has(t)||!!n&&n.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!r.delete(t);return n?n.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=b.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=b)}}()},{}],574:[function(t,e,r){var n=t("./hidden-store.js");e.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)}}},{"./hidden-store.js":575}],575:[function(t,e,r){e.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}},{}],576:[function(t,e,r){var n=t("./create-store.js");e.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}}}},{"./create-store.js":574}],577:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":156}],578:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,a=this._validateYear(t,i.local.invalidyear),s=h[a-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(n=o.newDate(l,c,u)).add(4-(n.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-n.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 i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,i.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var a=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{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");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var p=0;p>9&4095,v=m>>5&15,y=31&m,x=new Date(g,v-1,y+l);return a.year=x.getFullYear(),a.month=1+x.getMonth(),a.day=x.getDate(),a}(t,s,r,a);return o.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=o.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=n||{}}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;var l,c=(o=h[a.year-h[0]])>>9&4095,u=o>>5&15,d=31&o,p=new Date(c,u-1,d),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-p)/864e5);var g,v=f[a.year-f[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l>13;return!x||g=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:a[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var a={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":595,"object-assign":462}],584:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":595,"object-assign":462}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main");t("object-assign")(n.prototype=new a.baseCalendar,{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,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.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,a.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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+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)}}),a.calendars.hebrew=n},{"../main":595,"object-assign":462}],586:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":595,"object-assign":462}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),i.calendars.julian=n},{"../main":595,"object-assign":462}],588:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main");t("object-assign")(n.prototype=new o.baseCalendar,{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,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);t%=400,t+=t<0?400:0;return 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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":595,"object-assign":462}],589:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.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)}}),i.calendars.nanakshahi=n},{"../main":595,"object-assign":462}],590:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),r=e.year(),n=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;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,c)},_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,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/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=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":595,"object-assign":462}],592:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.taiwan=n},{"../main":595,"object-assign":462}],593:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.thai=n},{"../main":595,"object-assign":462}],594:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth).toJD()-24e5+.5,n=0,o=0;or)return a[n]-a[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),o=12*(n.year()-1)+n.month()-15292;return n.day()+a[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,o=Math.floor((i-1)/12),s=o+1,l=i-12*o,c=e-a[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var a=[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]},{"../main":595,"object-assign":462}],595:[function(t,e,r){function n(){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 i(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.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]}}}),l(i.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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,c.local.invalidDate||c.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),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":462}],596:[function(t,e,r){var n=t("object-assign"),i=t("./main");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=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n1}),u=function(t,e,r,n){var i=""+e;if(c(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=m;for(var E=this.daysInMonth(h,d);p>E;E=this.daysInMonth(h,d))d++,p-=E}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,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":595,"object-assign":462}],597:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":116}],598:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":597}],599:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;a(t,e,r,c);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},g=0;g<2;g++){var v=d[g],y=i.coerceRef(t,e,m,v,"","paper");if(i.coercePosition(e,m,c,y,v,.5),h){var x="a"+v,b=i.coerceRef(t,e,m,x,"pixel");"pixel"!==b&&b!==y&&(b=e[x]="pixel");var _="pixel"===b?p[g]:.4;i.coercePosition(e,m,c,b,x,_)}c(v+"anchor"),c(v+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":743,"../../plots/cartesian/axes":789,"./attributes":601,"./common_defaults":604}],600:[function(t,e,r){"use strict";e.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}]},{}],601:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},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:"calcIfAutorange"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":794,"../../plots/font_attributes":816,"./arrow_paths":600}],602:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,s=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=1,s[t.yref]=1});for(var l in s){var c=a.getFromId(t,l);if(c&&c.autorange)return i.syncOrAsync([o,n],t)}}}},{"../../lib":743,"../../plots/cartesian/axes":789,"./draw":607}],603:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,i=n(t,e),o=i.on,s=i.off.concat(i.explicitOff),l={};if(o.length||s.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var a=N.selectAll("a");if(1===a.size()&&a.text()===N.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(P.node())}var c=C.select(".annotation-text-math-group"),h=!c.empty(),v=f.bBox((h?c:N).node()),y=v.width,L=v.height,D=e.width||y,R=e.height||L,j=Math.round(D+2*I),B=Math.round(R+2*I);e._w=D,e._h=R;for(var U=!1,V=["x","y"],q=0;q1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;H=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],H=_.l+_.w*Y):(Y=1-e[Z],H=_.t+_.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=H;var st=e["a"+Z];X=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=H+st,G=X+st),at.text=at.tail+X;var lt=b["x"===Z?"width":"height"];if("paper"===J&&(at.head=l.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*r(W,nt),at.text=H+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)C.remove();else{var ft=0,ht=0;if("left"!==e.align&&(ft=(D-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(R-L)*("middle"===e.valign?.5:1)),h)c.select("svg").attr({x:I+ft-1,y:I+ht}).call(f.setClipUrl,O?M:null);else{var dt=I+ht-v.top,pt=I+ft-v.left;N.call(d.positionText,pt,dt).call(f.setClipUrl,O?M:null)}F.select("rect").call(f.setRect,I,I,D,R),P.call(f.setRect,z/2,z/2,j-z,B-z),C.call(f.setTranslate,Math.round(k.x.text-j/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+A+","+k.x.text+","+k.y.text+")"});var mt=function(r,a){T.selectAll(".annotation-arrow-g").remove();var c=k.x.head,h=k.y.head,d=k.x.tail+r,p=k.y.tail+a,v=k.x.text+r,y=k.y.text+a,b=l.rotationXYMatrix(A,v,y),M=l.apply2DTransform(b),E=l.apply2DTransform2(b),L=+P.attr("width"),z=+P.attr("height"),D=v-.5*L,I=D+L,O=y-.5*z,F=O+z,R=[[D,O,D,F],[D,F,I,F],[I,F,I,O],[I,O,D,O]].map(E);if(!R.reduce(function(t,e){return t^!!l.segmentsIntersect(c,h,c+1e6,h+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=l.segmentsIntersect(d,p,c,h,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var N=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,U=T.append("g").style({opacity:u.opacity(j)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+h).style("stroke-width",N+"px").call(u.stroke,u.rgb(j));if(g(V,B,e),w.annotationPosition&&V.node().parentNode&&!n){var q=c,H=h;if(e.standoff){var G=Math.sqrt(Math.pow(c-d,2)+Math.pow(h-p,2));q+=e.standoff*(d-c)/G,H+=e.standoff*(p-h)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-q)+","+(p-H),transform:"translate("+q+","+H+")"}).style("stroke-width",N+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),gd:t,prepFn:function(){var t=f.getTranslate(C);W=t.x,X=t.y,Y={},i&&i.autorange&&(Y[i._name+".autorange"]=!0),s&&s.autorange&&(Y[s._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(W,X),a=n[0]+t,o=n[1]+r;C.call(f.setTranslate,a,o),Y[x+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,Y[x+".y"]=s?s.p2r(s.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(Y[x+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[x+".ay"]=s.p2r(s.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+A+","+a+","+o+")"})},doneFn:function(){o.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),E){var gt,vt;m.init({element:C.node(),gd:t,prepFn:function(){vt=S.attr("transform"),gt={}},moveFn:function(t,r){var a="pointer";if(e.showarrow)e.axref===e.xref?gt[x+".ax"]=i.p2r(i.r2p(e.ax)+t):gt[x+".ax"]=e.ax+t,e.ayref===e.yref?gt[x+".ay"]=s.p2r(s.r2p(e.ay)+r):gt[x+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)gt[x+".x"]=e.x+t/i._m;else{var o=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-o/2;gt[x+".x"]=m.align(l+t/_.w,o,0,1,e.xanchor)}if(s)gt[x+".y"]=e.y+r/s._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;gt[x+".y"]=m.align(u-r/_.h,c,0,1,e.yanchor)}i&&s||(a=m.getCursor(i?.5:gt[x+".x"],s?.5:gt[x+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+vt}),p(C,a)},doneFn:function(){p(C),o.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}var y,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,x=n+".annotations["+r+"]"):(y="annotation",x="annotations["+r+"]"),b._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+b._uid+"_ann"+r;if(e._input&&!1!==e.visible){var k={x:{},y:{}},A=+e.textangle||0,T=b._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=T.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:a.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){h.loneUnhover(b._hoverlayer.node())});var z=e.borderwidth,D=e.borderpad,I=z+D,P=C.append("rect").attr("class","bg").style("stroke-width",z+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),O=e.width||e.height,F=b._topclips.selectAll("#"+M).data(O?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),F.exit().remove();var R=e.font,N=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?N.call(d.makeEditable,{delegate:C,gd:t}).call(c).on("edit",function(r){e.text=r,this.call(c);var n={};n[x+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),s&&s.autorange&&(n[s._name+".autorange"]=!0),o.relayout(t,n)}):N.call(c)}else a.selectAll("#"+M).remove()}var a=t("d3"),o=t("../../plotly"),s=t("../../plots/plots"),l=t("../../lib"),c=t("../../plots/cartesian/axes"),u=t("../color"),f=t("../drawing"),h=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,x=d.backoff*m+r.standoff,b=p.backoff*g+r.startstandoff;if("line"===h.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var _=l.x-c.x,w=l.y-c.y;if(u=Math.atan2(w,_),f=u+Math.PI,x&&b&&x+b>Math.sqrt(_*_+w*w))return void o();if(x){if(x*x>_*_+w*w)return void o();var M=x*Math.cos(u),k=x*Math.sin(u);c.x+=M,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>_*_+w*w)return void o();var A=b*Math.cos(u),T=b*Math.sin(u);l.x-=A,l.y-=T,t.attr({x1:l.x,y1:l.y})}}else if("path"===h.nodeName){var S=h.getTotalLength(),E="";if(S1){c=!0;break}}c?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))}}},{"../../plots/gl3d/project":841,"../annotations/draw":607}],614:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);1!==n.getAlpha()&&(n=i(o.combine(t,c)));return(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e0?E>=O:E<=O));L++)E>R&&E0?E>=O:E<=O));L++)E>C[0]&&E1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[K+X,K+G-X],et.setScale();var st=T._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");et._axislayer=st.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ut,ft=S.l+(k.x+Y)*S.w,ht=et.titlefont.size;ut="top"===k.titleside?(1-(K+G-X))*S.h+S.t+3+.75*ht:(1-(K+X))*S.h+S.t-3-.25*ht,A(et._id+"title",{attributes:{x:ft,y:ut,"text-anchor":"start"}})}var dt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),a=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+et._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=parseInt(r.node().style.fontSize,10)*v),o?(ct=d.bBox(o).height)>s&&(a[1]-=(ct-s)/2):r.node()&&!r.classed(w.jsPlaceholder)&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===k.titleside)et.domain[1]-=ct/S.h,a[1]*=-1;else{et.domain[0]+=ct/S.h;var c=g.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(S.h*(1-et.domain[1]))+")"),et._axislayer.attr("transform","translate(0,"+Math.round(-S.t)+")");var f=st.select(".cbfills").selectAll("rect.cbfill").data(D);f.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(D[e]+D[e-1])/2,e===D.length-1?C[1]:(D[e]+D[e+1])/2].map(et.c2p).map(Math.round);e!==D.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=P(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var h=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?z:[]);return h.enter().append("path").classed(w.cbline,!0),h.exit().remove(),h.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+k.line.width/2%1)+"h"+V).call(d.lineGroupStyle,k.line.width,I(t),k.line.dash)}),et._axislayer.selectAll("g."+et._id+"tick,path").remove(),et._pos=Z+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),et.side="right",u.syncOrAsync([function(){return l.doTicks(t,et,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=et.titlefont.size,r=et._offset+et._length/2,i=S.l+(et.position||0)*S.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));A("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:k.titleside,offsetLeft:S.l,offsetTop:0,maxShift:T.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var r=V+k.outlinewidth/2+d.bBox(et._axislayer.node()).width;if((j=lt.select("text")).node()&&!j.classed(w.jsPlaceholder)){var n,i=lt.select(".h"+et._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(k.titleside)?d.bBox(i).width:d.bBox(lt.node()).right-Z-S.l,r=Math.max(r,n)}var a=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,s=Q-$;st.select(".cbbg").attr({x:Z-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:$-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:$+k.ypad+("top"===k.titleside?ct:0),width:Math.max(V,2),height:Math.max(s-2*k.ypad-ct,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var l=({center:.5,right:1}[k.xanchor]||0)*a;st.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:a*({right:1,center:.5}[k.xanchor]||0),r:a*({left:1,center:.5}[k.xanchor]||0),t:s*({bottom:1,middle:.5}[k.yanchor]||0),b:s*({top:1,middle:.5}[k.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition){var pt,mt,gt;c.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),h(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),mt=c.align(J+t/S.w,q,0,1,k.xanchor),gt=c.align(K-e/S.h,G,0,1,k.yanchor);var r=c.getCursor(mt,gt,k.xanchor,k.yanchor);h(st,r)},doneFn:function(){h(st),void 0!==mt&&void 0!==gt&&a.restyle(t,{"colorbar.x":mt,"colorbar.y":gt},M().index)}})}return dt}T._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":743,"./flip_scale":630,"./scales":637}],626:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":732,"./attributes":624,"./scales.js":637}],627:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":637}],628:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,g=p[h+"min"],v=p[h+"max"],y=p.colorscale;c(f+h+"auto",!(n(g)&&n(v)&&g=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],631:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":627,"./is_valid_scale_array":635,"./scales":637}],632:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],639:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.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]}},{"../../lib":743}],640:[function(t,e,r){"use strict";function n(){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 i(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t("mouse-event-offset"),o=t("has-hover"),s=t("../../plotly"),l=t("../../lib"),c=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),f=e.exports={};f.align=t("./align"),f.getCursor=t("./cursor");var h=t("./unhover");f.unhover=h.wrapped,f.unhoverRaw=h.raw;var d=l.eventListenerOptionsSupported();f.init=function(t){function e(e){_._dragged=!1,_._dragging=!0;var s=i(e);return h=s[0],p=s[1],x=e.target,y=e,b=e.buttons&&2===e.buttons||e.ctrlKey,(m=(new Date).getTime())-_._mouseDownTimeM&&(w=Math.max(w-1,1)),_._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(w,y),!b){var n;try{n=new MouseEvent("click",e)}catch(t){var c=i(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,c[0],c[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}x.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&s.plot(t)}(_),_._dragged=!1,l.pauseEvent(e)}_._dragged=!1}var h,p,m,g,v,y,x,b,_=t.gd,w=1,M=u.DBLCLICKDELAY,k=t.element;_._mouseDownTime||(_._mouseDownTime=0),k.style.pointerEvents="all",k.onmousedown=e,d?(k._ontouchstart&&k.removeEventListener("touchstart",k._ontouchstart),k._ontouchstart=e,k.addEventListener("touchstart",e,{passive:!1})):k.ontouchstart=e;var A=t.clampFn||function(t,e,r){return Math.abs(t)=200?k:"")}function i(t,e,r,n){var i=l.select(t.node().parentNode),a=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",o=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=n?n/.8+1:0,c=(m.lineCount(t)-1)*v+1,u=S[o]*s,f=.75*r+S[a]*s+(S[a]-1)*c*r/2;t.attr("text-anchor",o),i.attr("transform","translate("+u+","+f+")")}function a(t,e){var r=t.ts||e.textfont.size;return c(r)&&r>0?r:0}function o(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],c=Math.pow(i*i+a*a,E/2),u=Math.pow(o*o+s*s,E/2),f=(u*u*i-c*c*o)*n,h=(u*u*a-c*c*s)*n,d=3*u*(c+u),p=3*c*(c+u);return[[l.round(e[0]+(d&&f/d),2),l.round(e[1]+(d&&h/d),2)],[l.round(e[0]-(p&&f/p),2),l.round(e[1]-(p&&h/p),2)]]}function s(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var l=t("d3"),c=t("fast-isnumeric"),u=t("tinycolor2"),f=t("../../registry"),h=t("../color"),d=t("../colorscale"),p=t("../../lib"),m=t("../../lib/svg_text_utils"),g=t("../../constants/xmlns_namespaces"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../constants/interactions").DESELECTDIM,x=t("../../traces/scatter/subtypes"),b=t("../../traces/scatter/make_bubble_size_func"),_=e.exports={};_.font=function(t,e,r,n){p.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(h.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,i){t.call(_.setPosition,e,r).call(_.setSize,n,i)},_.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(c(i)&&c(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},_.translatePoints=function(t,e,r){t.each(function(t){var n=l.select(this);_.translatePoint(t,n,e,r)})},_.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(e){var i=e[0].trace,a=i.xcalendar,o=i.ycalendar;t.selectAll(".point,.textpoint").each(function(t){_.hideOutsideRangePoint(t,l.select(this),r,n,a,o)})})}},_.crispRound=function(t,e,r){return e&&c(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";h.stroke(e,n||a.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,o=n||i.dash||"";l.select(this).call(h.stroke,r||i.color).call(_.dashLine,o,a)})},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.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},_.singleFillStyle=function(t){var e=(((l.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(h.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=l.select(this);try{r.call(h.fill,e[0].trace.fillcolor)}catch(e){p.error(e,t),r.remove()}})};var w=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(w).forEach(function(t){var e=w[t];_.symbolList=_.symbolList.concat([e.n,t,e.n+100,t+"-open"]),_.symbolNames[e.n]=t,_.symbolFuncs[e.n]=e.f,e.needLine&&(_.symbolNeedLines[e.n]=!0),e.noDot?_.symbolNoDot[e.n]=!0:_.symbolList=_.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(_.symbolNoFill[e.n]=!0)});var M=_.symbolNames.length,k="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";_.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=M||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0};_.gradient=function(t,e,r,n,i,a){var o=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],p.identity);o.exit().remove(),o.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=l.select(this);"horizontal"===n?t.attr(A):"vertical"===n&&t.attr(T),t.attr("id",r);var e=u(i),o=u(a);t.append("stop").attr({offset:"0%","stop-color":h.tinyRGB(o),"stop-opacity":o.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":h.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},_.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},_.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;!function(t,e,r,i,a,o,s,l){if(f.traceIs(r,"symbols")){var c=b(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:x.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var i=_.symbolNumber(t.mx||o.symbol)||0;return t.om=i%200>=100,n(i,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var u,d,p,m=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,u=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?h.defaultLine:s.color,Array.isArray(o.color)&&(u=h.defaultLine,m=!0),u="mc"in t?t.mcc=i(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(h.stroke,u).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=o.gradient,v=t.mgt;if(v?m=!0:v=g&&g.type,v&&"none"!==v){var y=t.mgc;y?m=!0:y=g.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(_.gradient,l,w,v,u,y)}else e.call(h.fill,u);p&&e.call(h.stroke,d)}}(t,e,r,i,a,s,s.line,o)},_.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=_.tryColorscale(n,""),a=_.tryColorscale(n,"line");t.each(function(t){_.singlePointStyle(t,l.select(this),e,i,a,r)})}},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},s=i.marker||{},c=a.opacity,u=o.opacity,d=s.opacity,p=void 0!==u,m=void 0!==d;t.each(function(t){var e,r=l.select(this),n=t.mo,i=void 0!==n;(i||p||m)&&(t.selected?p&&(e=u):e=m?d:y*(i?n:c)),void 0!==e&&r.style("opacity",e)});var g=o.color,v=s.color;(g||v)&&t.each(function(t){var e,r=l.select(this);t.selected?g&&(e=g):v&&(e=v),e&&h.fill(r,e)});var x=o.size,b=s.size,w=void 0!==x,M=void 0!==b;f.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=l.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?x/2:i:M?b/2:i,r.attr("d",n(_.symbolNumber(o),e)),t.mrc2=e})}},_.tryColorscale=function(t,e){var r=e?p.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?d.makeColorScaleFunc(d.extractScale(n,r.cmin,r.cmax)):p.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};_.textPointStyle=function(t,e,r){t.each(function(t){var n=l.select(this),o=p.extractOption(t,e,"tx","text");if(o){var s=t.tp||e.textposition,c=a(t,e);n.call(_.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).text(o).call(m.convertToTspans,r).call(i,s,c,t.mrc)}else n.remove()})},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},n=e.unselected||{};t.each(function(t){var o,s=l.select(this),c=t.tc||e.textfont.color,u=t.tp||e.textposition,f=a(t,e),d=(r.textfont||{}).color,p=(n.textfont||{}).color;t.selected?d&&(o=d):p?o=p:d||(o=h.addOpacity(c,y)),o&&h.fill(s,o),i(s,u,f,t.mrc2||t.mrc)})}};var E=.5;_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(_.savedBBoxes={},C=0),r&&(_.savedBBoxes[r]=v),C++,p.extendFlat({},v)},_.setClipUrl=function(t,e){if(e){var r="#"+e,n=l.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},_.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}},_.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+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.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}},_.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+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var z=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=l.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),o=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(z);t=1===e&&1===r?[]:["translate("+a+","+o+")","scale("+e+","+r+")","translate("+-a+","+-o+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../constants/xmlns_namespaces":723,"../../lib":743,"../../lib/svg_text_utils":766,"../../registry":873,"../../traces/scatter/make_bubble_size_func":1083,"../../traces/scatter/subtypes":1088,"../color":618,"../colorscale":633,"./symbol_defs":644,d3:128,"fast-isnumeric":140,tinycolor2:546}],644:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:128}],645:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],646:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=[];if(a.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(a),u=0;u0;t.each(function(t){var u,f=t[0].trace,h=f.error_x||{},d=f.error_y||{};f.ids&&(u=function(t){return t.id});var p=o.hasMarkers(f)&&f.marker.maxdisplayed>0;d.visible||h.visible||(t=[]);var m=n.select(this).selectAll("g.errorbar").data(t,u);if(m.exit().remove(),t.length){h.visible||m.selectAll("path.xerror").remove(),d.visible||m.selectAll("path.yerror").remove(),m.style("opacity",1);var g=m.enter().append("g").classed("errorbar",!0);c&&g.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(m,e.layerClipId),m.each(function(t){var e=n.select(this),a=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,s,l);if(!p||t.vis){var o;if(d.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var u=d.width;o="M"+(a.x-u)+","+a.yh+"h"+2*u+"m-"+u+",0V"+a.ys,a.noYS||(o+="m-"+u+",0h"+2*u);var f=e.select("path.yerror");!f.size()?f=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):c&&(f=f.transition().duration(r.duration).ease(r.easing)),f.attr("d",o)}if(h.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var m=(h.copy_ystyle?d:h).width;o="M"+a.xh+","+(a.y-m)+"v"+2*m+"m0,-"+m+"H"+a.xs,a.noXS||(o+="m0,-"+m+"v"+2*m);var g=e.select("path.xerror");!g.size()?g=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):c&&(g=g.transition().duration(r.duration).ease(r.easing)),g.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1088,"../drawing":643,d3:128,"fast-isnumeric":140}],651:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.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)})}},{"../color":618,d3:128}],652:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":816}],653:[function(t,e,r){"use strict";function n(t,e,r,n){n=n||i.identity,Array.isArray(t)&&(e[0][r]=n(t))}var i=t("../../lib"),a=t("../../registry");e.exports=function(t){function e(t){return function(e){return i.coerceHoverinfo({hoverinfo:e},{_module:t._module},o)}}for(var r=t.calcdata,o=t._fullLayout,s=0;s=0&&r.indextt.width||$<0||$>tt.height)return v.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(P="xval"in e?b.flat(m,e.xval):b.p2c(S,Q),O="yval"in e?b.flat(m,e.yval):b.p2c(E,$),!c(P[0])||!c(O[0]))return f.warn("Fx.hover failed",e,t),v.unhoverRaw(t,e)}var et=1/0;for(R=0;RY&&(Z.splice(0,Y),et=Z[0].distance),_._has("cartesian")&&0!==X&&0===Z.length){G.distance=X,G.index=!1;var ot=j._module.hoverPoints(G,q,H,"closest",_._hoverlayer);if(ot){var st,lt=ot.filter(function(t){return t.xa.showspikes});if(lt.length){var ct=lt[0];c(ct.x0)&&c(ct.y0)&&(st=d(ct),(!K.vLinePoint||K.vLinePoint.distance>st.distance)&&(K.vLinePoint=st))}var ut=ot.filter(function(t){return t.ya.showspikes});if(ut.length){var ft=ut[0];c(ft.x0)&&c(ft.y0)&&(st=d(ft),(!K.hLinePoint||K.hLinePoint.distance>st.distance)&&(K.hLinePoint=st))}}}}var ht={fullLayout:_,container:_._hoverlayer,outerContainer:_._paperdiv,event:e},dt=t._spikepoints,pt={vLinePoint:K.vLinePoint,hLinePoint:K.hLinePoint};if(t._spikepoints=pt,_._has("cartesian")&&0!==X&&0!==Z.length){var mt=u(Z.filter(function(t){return t.ya.showspikes}),X);K.hLinePoint=d(mt);var gt=u(Z.filter(function(t){return t.xa.showspikes}),X);K.vLinePoint=d(gt)}if(0===Z.length){var vt=v.unhoverRaw(t,e);return!_._has("cartesian")||null===K.hLinePoint&&null===K.vLinePoint||s(dt)&&o(K,ht),vt}_._has("cartesian")&&s(dt)&&o(K,ht),Z.sort(function(t,e){return t.distance-e.distance});var yt=t._hoverdata,xt=[];for(F=0;F1,wt=i(Z,{hovermode:I,rotateLabels:_t,bgColor:g.combine(_.plot_bgcolor||g.background,_.paper_bgcolor),container:_._hoverlayer,outerContainer:_._paperdiv,commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance},t);if(function(t,e,r){function n(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--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}var i,a,o,s,l,c,u,f=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?k:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});for(;!i&&f<=t.length;){for(f++,i=!0,s=0;s.01&&m.pmin===g.pmin&&m.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),h.splice(s+1,1),u=0,l=d.length-1;l>=0;l--)u+=d[l].dp;for(o=u/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;i=!1}else s++}h.forEach(n)}for(s=h.length-1;s>=0;s--){var v=h[s];for(l=v.length-1;l>=0;l--){var y=v[l],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(Z,_t?"xa":"ya",_),a(wt,_t),e.target&&e.target.tagName){var Mt=x.getComponentMethod("annotations","hasClickToShow")(t,xt);p(l.select(e.target),Mt?"pointer":"")}e.target&&!n&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,yt)&&(yt&&t.emit("plotly_unhover",{event:e,points:yt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,c=e.container,u=e.outerContainer,f=e.commonLabelOpts||{},h=e.fontFamily||_.HOVERFONT,p=e.fontSize||_.HOVERFONTSIZE,v=t[0],y=v.xa,x=v.ya,b="y"===a?"yLabel":"xLabel",M=v[b],k=(String(M)||"").split(" ")[0],A=u.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,z=v.distance<=e.hoverdistance&&("x"===a||"y"===a);for(n=0;n-1&&n.length>v&&(n=v>3?n.substr(0,v-3)+"...":n.substr(0,v))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):z&&t[a+"Label"]===M?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var y=e.select("text.nums").call(m.font,t.fontFamily||h,t.fontSize||p,t.fontColor||f).text(i).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==i?(x.call(m.font,t.fontFamily||h,t.fontSize||p,u).text(n).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*E):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:f});var _,k,A=y.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,I=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),F=A.width+S+E+b;t.ty0=T-A.top,t.bx=A.width+2*E,t.by=A.height+2*E,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,_=I+O/2+F<=C,k=I-O/2-F>=0,"top"!==t.idealAlign&&_||!k?_?(I+=O/2,t.anchor="start"):t.anchor="middle":(I-=O/2,t.anchor="end")):(t.pos=I,_=D+P/2+F<=L,k=D-P/2-F>=0,"left"!==t.idealAlign&&_||!k?_?(D+=P/2,t.anchor="start"):t.anchor="middle":(D-=P/2,t.anchor="end")),y.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+I+")"+(o?"rotate("+w+")":""))}),P}function a(t,e){t.each(function(t){var r=l.select(this);if(t.del)r.remove();else{var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(S+E),s=o+a*(t.txwidth+E),c=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-T,c=t.offset*A),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+c)+","+(S+u)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+c)+"V"+(u-S)+"Z"),i.call(d.positionText,o+c,u+t.ty0-t.by/2+E),t.tx2width&&(r.select("text.name").call(d.positionText,s+a*E+c,u+t.ty0-t.by/2+E),r.select("rect").call(m.setRect,s+(a-1)*t.tx2width/2+c,u-t.by/2-1,t.tx2width,t.by+2))}})}function o(t,e){var r,n,i=e.container,a=e.fullLayout,o=e.event,s=!!t.hLinePoint,l=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),l||s){var c=g.combine(a.plot_bgcolor,a.paper_bgcolor);if(s){var f,h,d=t.hLinePoint;r=d&&d.xa;"cursor"===(n=d&&d.ya).spikesnap?(f=o.pointerX,h=o.pointerY):(f=r._offset+(d.x0+d.x1)/2,h=n._offset+(d.y0+d.y1)/2);var p,v,y=u.readability(d.color,c)<1.5?g.contrast(c):d.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,M=(w.left+w.right)/2=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],670:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":816,"../color/attributes":617}],671:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],672:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,f,h,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,h="bottom"):(c=0,f="left",u=-.1,h="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",f),l("y",u),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":743,"../../plots/layout_attributes":843,"../../registry":873,"./attributes":670,"./helpers":676}],673:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*x;if(o){var l=d.bBox(o);n=l.height,i=l.width,d.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),u=m.lineCount(c),f=c.node();n=s*u,i=f?d.bBox(f).width:0;var h=s*(.3+(1-u)/2);m.positionText(c,40,h)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,o=f.traceIs(a,"pie"),s=a.index,u=o?n.label:a.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.edits.legendText&&!o?h.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(o.type))u[(a=n.trace.transforms)[a.length-1].direction+".name"]=t;else if(f.hasTransform(o,"groupby")){var h=f.getTransformIndices(o,"groupby"),d=h[h.length-1],p=c.keyedContainer(o,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),u=p.constructUpdate()}else u.name=t;return l.restyle(e,u,s)}):h.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(p.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){g(t,e,n)},k):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,g(t,e,n))}})}function a(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=w.isGrouped(i),l=0;if(i.width=0,i.height=0,w.isVertical(i))o&&e.each(function(t,e){d.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;d.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),l=40;else if(o){for(var c=[i.width],u=e.data(),f=0,h=u.length;fa+_-M,r.each(function(t){var e=t[0],r=g?40+t[0].width:x;a+b+M+r>n.width-(n.margin.r+n.margin.l)&&(b=0,v+=y,i.height=i.height+y,y=0),d.setTranslate(this,a+b,5+a+e.height/2+v),i.width+=M+r,i.height=Math.max(i.height,e.height),b+=M+r,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];s.select(this).select(".legendtoggle").call(d.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+l,r.height)})}function o(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center");var n="top";M.isBottomAnchor(e)?n="bottom":M.isMiddleAnchor(e)&&(n="middle"),u.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../../registry"),h=t("../dragelement"),d=t("../drawing"),p=t("../color"),m=t("../../lib/svg_text_utils"),g=t("./handle_click"),v=t("./constants"),y=t("../../constants/interactions"),x=t("../../constants/alignment").LINE_SPACING,b=t("./get_legend_data"),_=t("./style"),w=t("./helpers"),M=t("./anchor_utils"),k=y.DBLCLICKDELAY;e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(d.setTranslate,0,e),L.call(d.setRect,N,t,v.scrollBarWidth,v.scrollBarHeight),T.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,m="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&b(t.calcdata,y),w=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+m).remove(),void u.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=r._topdefs.selectAll("#"+m).data([0]);T.enter().append("clipPath").attr("id",m).append("rect");var S=A.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(p.stroke,y.bordercolor),S.call(p.fill,y.bgcolor),S.style("stroke-width",y.borderwidth+"px");var E=A.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var L=A.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(p.fill,"#808BA4");var C=E.selectAll("g.groups").data(x);C.enter().append("g").attr("class","groups"),C.exit().remove();var z=C.selectAll("g.traces").data(c.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(_,t).style("opacity",function(t){var e=t[0].trace;return f.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){s.select(this).call(n,t).call(i,t)});var D=0!==A.enter().size();D&&(a(t,C,z),o(t));var I=r.width,P=r.height;a(t,C,z),y.height>P?function(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center"),u.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}(t):o(t);var O=r._size,F=O.l+O.w*y.x,R=O.t+O.h*(1-y.y);M.isRightAnchor(y)?F-=y.width:M.isCenterAnchor(y)&&(F-=y.width/2),M.isBottomAnchor(y)?R-=y.height:M.isMiddleAnchor(y)&&(R-=y.height/2);var N=y.width,j=O.w;N>j?(F=O.l,N=j):(F+N>I&&(F=I-N),F<0&&(F=0),N=Math.min(I-F,y.width));var B=y.height,U=O.h;B>U?(R=O.t,B=U):(R+B>P&&(R=P-B),R<0&&(R=0),B=Math.min(P-R,y.height)),d.setTranslate(A,F,R);var V,q,H=B-v.scrollBarHeight-2*v.scrollBarMargin,G=y.height-B;if(y.height<=B||t._context.staticPlot)S.attr({width:N-y.borderwidth,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),d.setTranslate(E,0,0),T.select("rect").attr({width:N-2*y.borderwidth,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),E.call(d.setClipUrl,m);else{V=v.scrollBarMargin,q=E.attr("data-scroll")||0,S.attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),T.select("rect").attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-q}),E.call(d.setClipUrl,m),D&&e(V,q),A.on("wheel",null),A.on("wheel",function(){q=c.constrain(E.attr("data-scroll")-s.event.deltaY/H*G,-G,0),e(V=v.scrollBarMargin-q/G*H,q),0!==q&&q!==-G&&s.event.preventDefault()}),L.on(".drag",null),E.on(".drag",null);var Y=s.behavior.drag().on("drag",function(){V=c.constrain(s.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+H),q=-(V-v.scrollBarMargin)/H*G,e(V,q)});L.call(Y),E.call(Y)}if(t._context.edits.legendPosition){var W,X,Z,J;A.classed("cursor-move",!0),h.init({element:A.node(),gd:t,prepFn:function(){var t=d.getTranslate(A);Z=t.x,J=t.y},moveFn:function(t,e){var r=Z+t,n=J+e;d.setTranslate(A,r,n),W=h.align(r,0,O.l,O.l+O.w,y.xanchor),X=h.align(n,0,O.t+O.h,O.t,y.yanchor)},doneFn:function(){void 0!==W&&void 0!==X&&l.relayout(t,{"legend.x":W,"legend.y":X})},clickFn:function(e,n){var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===e?A._clickTimeout=setTimeout(function(){g(i,t,e)},k):2===e&&(A._clickTimeout&&clearTimeout(A._clickTimeout),g(i,t,e)))}})}}}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../../registry":873,"../color":618,"../dragelement":640,"../drawing":643,"./anchor_utils":669,"./constants":671,"./get_legend_data":674,"./handle_click":675,"./helpers":676,"./style":678,d3:128}],674:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var a,o,s={},l=[],c=!1,u={},f=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],f=u.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var m={},g={};h&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(f,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),h&&(s[0].mrc=3);var x=v.selectAll("g.pointtext").data(d?s:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)})}},{"../../lib":743,"../../registry":873,"../../traces/pie/style_one":1052,"../../traces/scatter/subtypes":1088,"../color":618,"../drawing":643,d3:128}],679:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=h.list(t,null,!0),f="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),i(x,r);h&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var b=function(t){for(var e=a.list({_fullLayout:t},null,!0),r=0;r0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;ad&&(d=f)));return d>=h?[h,d]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sH&&n>G&&!t.shiftKey?f.getCursor(i/r,1-a/n):"move";h(e,o),q=o.split("-")[0]}function c(n,o){if("path"===r.type){var s=function(t){return U(j(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};N&&"date"===N.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else d[x]=r.x0=U(m+n),d[b]=r.y0=V(g+o),d[_]=r.x1=U(v+n),d[w]=r.y1=V(y+o);e.attr("d",i(t,r))}function u(n,o){if("path"===r.type){var s=function(t){return U(j(t)+n)};R&&"date"===R.type&&(s=p.encodeDate(s));var l=function(t){return V(B(t)+o)};N&&"date"===N.type&&(l=p.encodeDate(l)),r.path=a(O,s,l),d[F]=r.path}else{var c=~q.indexOf("n")?M+o:M,u=~q.indexOf("s")?k+o:k,f=~q.indexOf("w")?A+n:A,h=~q.indexOf("e")?T+n:T;u-c>G&&(d[S]=r[z]=V(c),d[E]=r[D]=V(u)),h-f>H&&(d[L]=r[I]=U(f),d[C]=r[P]=U(h))}e.attr("d",i(t,r))}var d,m,g,v,y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P,O,F,R,N,j,B,U,V,q,H=10,G=10,Y={element:e.node(),gd:t,prepFn:function(e){R=l.getFromId(t,r.xref),N=l.getFromId(t,r.yref),j=p.getDataToPixel(t,R),B=p.getDataToPixel(t,N,!0),U=p.getPixelToData(t,R),V=p.getPixelToData(t,N,!0);var i="shapes["+n+"]";"path"===r.type?(O=r.path,F=i+".path"):(m=j(r.x0),g=B(r.y0),v=j(r.x1),y=B(r.y1),x=i+".x0",b=i+".y0",_=i+".x1",w=i+".y1");ml&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),s.log("Ignoring extra params in segment "+t)),i+c})}(e.path,n,a);var h=n(e.x0),m=n(e.x1),g=a(e.y0),v=a(e.y1);if("line"===o)return"M"+h+","+g+"L"+m+","+v;if("rect"===o)return"M"+h+","+g+"H"+m+"V"+v+"H"+h+"Z";var y=(h+m)/2,x=(g+v)/2,b=Math.abs(y-h),_=Math.abs(x-g),w="A"+b+","+_,M=y+b+","+x;return"M"+M+w+" 0 1,1 "+(y+","+(x-_))+w+" 0 0,1 "+M+"Z"}function a(t,e,r){return t.replace(d.segmentRE,function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),f=t("../dragelement"),h=t("../../lib/setcursor"),d=t("./constants"),p=t("./helpers");e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r0)){n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font);n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.steps;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":704,"./constants":705}],707:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-M.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=M.currentValueInset,i="left"}a.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(b.font,e.currentvalue.font).text(o).call(_.convertToTspans,e.gd);var s=_.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*k;return _.positionText(a,n,l),a}}function a(t,e,r){var n=t.selectAll("rect."+M.gripRectClass).data([0]);n.enter().append("rect").classed(M.gripRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:M.gripWidth,height:M.gripHeight,rx:M.gripRadius,ry:M.gripRadius}).call(x.stroke,r.bordercolor).call(x.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function o(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(b.font,r.font).text(e.step.label).call(_.convertToTspans,r.gd),n}function s(t,e){var r=t.selectAll("g."+M.labelsClass).data([0]);r.enter().append("g").classed(M.labelsClass,!0);var n=r.selectAll("g."+M.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(M.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=v.select(this);r.call(o,t,e),b.setTranslate(r,d(e,t.fraction),M.tickOffset+e.ticklen+e.font.size*k+M.labelOffset+e.currentValueTotalHeight)})}function l(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&c(t,e,r,a,!0,i)}function c(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(h,r,r.active/(r.steps.length-1),o),e.call(i,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&y.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function u(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=v.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+M.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),o.call(x.fill,t.activebgcolor);var s=p(t,v.mouse(i)[0]);l(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=p(t,v.mouse(i)[0]);l(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(x.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function f(t,e){var r=t.selectAll("rect."+M.tickRectClass).data(e.steps);r.enter().append("rect").classed(M.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=v.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(x.fill,e.tickcolor),b.setTranslate(i,d(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?M.tickOffset:M.minorTickOffset)+e.currentValueTotalHeight)})}function h(t,e,r,n){var i=t.select("rect."+M.gripRectClass),a=d(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*M.gripWidth)+","+e.currentValueTotalHeight+")")}}function d(t,e){return t.inputAreaStart+M.stepInset+(t.inputAreaLength-2*M.stepInset)*Math.min(1,Math.max(0,e))}function p(t,e){return Math.min(1,Math.max(0,(e-M.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*M.stepInset-2*t.inputAreaStart)))}function m(t,e,r){var n=t.selectAll("rect."+M.railTouchRectClass).data([0]);n.enter().append("rect").classed(M.railTouchRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,M.tickOffset+r.ticklen+r.labelHeight)}).call(x.fill,r.bgcolor).attr("opacity",0),b.setTranslate(n,0,r.currentValueTotalHeight)}function g(t,e){var r=t.selectAll("rect."+M.railRectClass).data([0]);r.enter().append("rect").classed(M.railRectClass,!0);var n=e.inputAreaLength-2*M.railInset;r.attr({width:n,height:M.railWidth,rx:M.railRadius,ry:M.railRadius,"shape-rendering":"crispEdges"}).call(x.stroke,e.bordercolor).call(x.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),b.setTranslate(r,M.railInset,.5*(e.inputAreaWidth-M.railWidth)+e.currentValueTotalHeight)}var v=t("d3"),y=t("../../plots/plots"),x=t("../color"),b=t("../drawing"),_=t("../../lib/svg_text_utils"),w=t("../legend/anchor_utils"),M=t("./constants"),k=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[M.name],n=[],i=0;i0?[0]:[]);if(l.enter().append("g").classed(M.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0),e.call(i,r).call(g,r).call(s,r).call(f,r).call(m,t,r).call(a,t,r),b.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(h,r,r.active/(r.steps.length-1),!1),e.call(i,r)}(t,v.select(this),e)}})}}},{"../../constants/alignment":716,"../../lib/svg_text_utils":766,"../../plots/plots":852,"../color":618,"../drawing":643,"../legend/anchor_utils":669,"./constants":705,d3:128}],708:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":704,"./constants":705,"./defaults":706,"./draw":707}],709:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),h=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){function d(t){s.syncOrAsync([p,m],t)}function p(e){var r;return M?(r="",M.rotate&&(r+="rotate("+[M.rotate,w.x,w.y]+")"),M.offset&&(r+="translate(0, "+M.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":S,"font-size":n.round(E,2)+"px",fill:c.rgb(L),opacity:C*c.opacity(L),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&D){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=i(_.pad)?_.pad:2,u=l.bBox(e.node()),f={left:0,top:0,right:A.width,bottom:A.height},h=_.maxShift||(f[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(h<0)r=h;else{var d=_.offsetLeft||0,p=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[a])+c))}),r=Math.min(h,r)}if(r>0||h<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,x=r.placeholder,b=r.traceIndex,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont||{},S=T.family,E=T.size,L=T.color,C=1,z=!1,D=(v.title||"").trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var I=t._context.edits[g];""===D?C=0:D.replace(h," % ")===x.replace(h," % ")&&(C=.2,z=!0,I||(D=""));var P=D||I;k||(k=A._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var O=k.selectAll("text").data(P?[0]:[]);return O.enter().append("text"),O.text(D).attr("class",e),O.exit().remove(),P?(O.call(d),I&&(D?O.on(".opacity",null):(C=0,z=!0,O.text(x).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),O.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),O.classed("js-placeholder",z),k):k}},{"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../color":618,"../drawing":643,d3:128,"fast-isnumeric":140}],710:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"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:{_isLinkedToArray:"button",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",dflt:""},execute:{valType:"boolean",dflt:!0}},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,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/font_attributes":816,"../../plots/pad_attributes":851,"../color/attributes":617}],711:[function(t,e,r){"use strict";e.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:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],712:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,o,r,n)}n("visible",function(t,e){function r(t,e){return i.coerce(n,a,l,t,e)}var n,a,o=t.buttons||[],s=e.buttons=[];for(var c=0;c0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.buttons;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":710,"./constants":711}],713:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e){return+t.attr(M.menuIndexAttrName)===e._index}function a(t,e,r,n,i,a,l,c){e._input.active=e.active=l,"buttons"===e.type?s(t,n,null,null,e):"dropdown"===e.type&&(i.attr(M.menuIndexAttrName,"-1"),o(t,n,i,a,e),c||s(t,n,i,a,e))}function o(t,e,r,n,a){var o=e.selectAll("g."+M.headerClassName).data([0]);o.enter().append("g").classed(M.headerClassName,!0).style("pointer-events","all");var c=a.active,u=a.buttons[c]||M.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},g={width:a.headerWidth,height:a.headerHeight};o.call(l,a,u,t).call(p,a,f,g);var v=e.selectAll("text."+M.headerArrowClassName).data([0]);v.enter().append("text").classed(M.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(x.font,a.font).text(M.arrowSymbol[a.direction]),v.attr({x:a.headerWidth-M.arrowOffsetX+a.pad.l,y:a.headerHeight/2+M.textOffsetY+a.pad.t}),o.on("click",function(){r.call(m),r.attr(M.menuIndexAttrName,i(r,a)?-1:String(a._index)),s(t,e,r,n,a)}),o.on("mouseover",function(){o.call(h)}),o.on("mouseout",function(){o.call(d,a)}),x.setTranslate(e,a.lx,a.ly)}function s(t,e,r,n,i){r||(r=e).attr("pointer-events","all");var o=function(t){return-1==+t.attr(M.menuIndexAttrName)}(r)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?M.dropdownButtonClassName:M.buttonClassName,c=r.selectAll("g."+s).data(o),u=c.enter().append("g").classed(s,!0),m=c.exit();"dropdown"===i.type?(u.attr("opacity","0").transition().attr("opacity","1"),m.transition().attr("opacity","0").remove()):m.remove();var y=0,x=0,b=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(b?x=i.headerHeight+M.gapButtonHeader:y=i.headerWidth+M.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(x=-M.gapButtonHeader+M.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-M.gapButtonHeader+M.gapButton-i.openWidth);var _={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:M.gapButton,xPad:M.gapButton,index:0},w={l:_.x+i.borderwidth,t:_.y+i.borderwidth};c.each(function(o,s){var u=g.select(this);u.call(l,i,o,t).call(p,i,_),u.on("click",function(){g.event.defaultPrevented||(a(t,i,0,e,r,n,s),o.execute&&v.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:i,button:o,active:i.active}))}),u.on("mouseover",function(){u.call(h)}),u.on("mouseout",function(){u.call(d,i),c.call(f,i)})}),c.call(f,i),b?(w.w=Math.max(i.openWidth,i.headerWidth),w.h=_.y-w.t):(w.w=_.x-w.l,w.h=Math.max(i.openHeight,i.headerHeight)),w.direction=i.direction,n&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,f=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(c.enter().append("g").classed(M.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,A=n.barLength+2*n.barPad,T=n.barWidth+2*n.barPad,S=p,E=g+v;E+T>c&&(E=c-T);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=L.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:E,width:A,height:T}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>M,z=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,I=p+m,P=g;I+z>l&&(I=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),C?(this.vbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:I,y:P,width:z,height:D}),this._vbarYMin=P+D/2,this._vbarTranslateMax=M-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=u-.5,N=C?f+z+.5:f+.5,j=h-.5,B=k?d+T+.5:d+.5,U=s._topdefs.selectAll("#"+F).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(R),y:Math.floor(j),width:Math.ceil(N)-Math.floor(R),height:Math.ceil(B)-Math.floor(j)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||C){var V=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":743,"../color":618,"../drawing":643,d3:128}],716:[function(t,e,r){"use strict";e.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},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],717:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],718:[function(t,e,r){"use strict";e.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]}},{}],719:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],720:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],721:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],722:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],723:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],724:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.33.0",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":609,"./components/annotations3d":614,"./components/fx":660,"./components/images":668,"./components/legend":677,"./components/rangeselector":689,"./components/rangeslider":695,"./components/shapes":702,"./components/sliders":708,"./components/updatemenus":714,"./fonts/mathjax_config":725,"./lib/queue":757,"./locale-en":771,"./locale-en-us":770,"./plot_api/plot_schema":778,"./plot_api/register":779,"./plot_api/set_plot_config":780,"./plot_api/to_image":782,"./plot_api/validate":783,"./plotly":784,"./snapshot":878,"./snapshot/download":875,"./traces/scatter":1078,d3:128,"es6-promise":137}],725:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],726:[function(t,e,r){"use strict";var n=Math.PI;r.deg2rad=function(t){return t/180*n},r.rad2deg=function(t){return t/n*180},r.wrap360=function(t){var e=t%360;return e<0?e+360:e},r.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],727:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":721,"fast-isnumeric":140}],728:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):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){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(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}function s(t){return t.formatDate("yyyy")}var l=t("d3"),c=t("fast-isnumeric"),u=t("./loggers"),f=t("./mod"),h=t("../constants/numerical"),d=h.BADNUM,p=h.ONEDAY,m=h.ONEHOUR,g=h.ONEMIN,v=h.ONESEC,y=h.EPOCHJD,x=t("../registry"),b=l.time.format.utc,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,w=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,M=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?x.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:x.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?x.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var k,A;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*g)>=k&&t<=A?t:d;if("string"!=typeof t&&"number"!=typeof t)return d;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?w:_);if(!s)return d;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),b=Number(s[11]||0);if(i){if(2===l.length)return d;l=Number(l);var T;try{var S=x.getComponentMethod("calendars","getCal")(e);if(o){var E="i"===c.charAt(c.length-1);c=parseInt(c,10),T=S.newDate(l,S.toMonthIndex(l,c,E),u)}else T=S.newDate(l,Number(c),u)}catch(t){return d}return T?(T.toJD()-y)*p+f*m+h*g+b*v:d}l=2===l.length?(Number(l)+2e3-M)%100+M:Number(l),c-=1;var L=new Date(Date.UTC(2e3,c,u,f,h));return L.setUTCFullYear(l),L.getUTCMonth()!==c?d:L.getUTCDate()!==u?d:L.getTime()+b*v},k=r.MIN_MS=r.dateTime2ms("-9999"),A=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==d};var T=90*p,S=3*m,E=5*g;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=k&&t<=A))return d;e||(e=0);var i,o,s,l,c,u,h=Math.floor(10*f(t+.05,1)),_=Math.round(t-h/10);if(n(r)){var w=Math.floor(_/p)+y,M=Math.floor(f(t,p));try{i=x.getComponentMethod("calendars","getCal")(r).fromJD(w).formatDate("yyyy-mm-dd")}catch(t){i=b("G%Y-%m-%d")(new Date(_))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=k+p&&t<=A-p))return d;var e=Math.floor(10*f(t+.05,1)),r=new Date(Math.round(t-e/10));return a(l.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return u.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return u.error("unrecognized date",t),e;return t};var L=/%\d?f/g,C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,i,a){var l,c;if(a=n(a)&&a,e)return function(t,e,r,i){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 a=new Date(Math.floor(e+.05));if(n(i))try{t=x.getComponentMethod("calendars","worldCalFmt")(t,e,i)}catch(t){return"Invalid"}return r(t)(a)}(e,t,i,a);if(a)try{var u=Math.floor((t+.05)/p)+y,f=x.getComponentMethod("calendars","getCal")(a).fromJD(u);"y"===r?c=s(f):"m"===r?c=function(t){return t.formatDate("M yyyy")}(f):"d"===r?(l=s(f),c=function(t){return t.formatDate("M d")}(f)):(l=function(t){return t.formatDate("M d, yyyy")}(f),c=o(t,r))}catch(t){return"Invalid"}else{var h=new Date(Math.floor(t+.05));"y"===r?c=i("%Y")(h):"m"===r?c=i("%b %Y")(h):"d"===r?(l=i("%Y")(h),c=i("%b %-d")(h)):(l=i("%b %-d, %Y")(h),c=o(t,r))}return c+(l?"\n"+l:"")};var z=3*p;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=f(t,p);if(t=Math.round(t-i),r)try{var a=Math.round(t/p)+y,o=x.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-y)*p+i}catch(e){u.error("invalid ms "+t+" in calendar "+r)}var l=new Date(t+z);return l.setUTCMonth(l.getUTCMonth()+e)+i-z},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&x.getComponentMethod("calendars","getCal")(e),f=0;f0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function i(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}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,f=a-e,h=l-o,d=c-s,p=u*u+f*f,m=h*h+d*d,g=Math.min(i(u,f,p,o-t,s-e),i(u,f,p,l-t,c-e),i(h,d,m,t-o,e-s),i(h,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),f=t.getPointAtLength(a(r,e)),h={x:(4*f.x+i.x+c.x)/6,y:(4*f.y+i.y+c.y)/6,theta:u};return o[r]=h,h},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,f=t.getTotalLength(),h=f,d=n(u);d;){if((u+=d+r)>h)return;d=n(u)}for(d=n(h);d;){if(h-=d+r,u>h)return;d=n(h)}return{min:u,max:h,len:h-u,total:f,isClosed:0===u&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":750}],738:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],739:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(o(t))return u;var e=s(t);return e.length?e:u}function a(t){return o(t)?t:f}var o=t("fast-isnumeric"),s=t("color-normalize"),l=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,u=s(c),f=1;e.exports=function(t,e,r){var o,c,h,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,c=g?function(t,e){return void 0===t[e]?u:s(o(t[e]))}:i,h=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var x=0;x=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}(t))))}},{"../constants/string_mappings":722,"superscript-text":539}],742:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],743:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./angles");l.deg2rad=p.deg2rad,l.rad2deg=p.rad2deg,l.wrap360=p.wrap360,l.wrap180=p.wrap180;var m=t("./geometry2d");l.segmentsIntersect=m.segmentsIntersect,l.segmentDistance=m.segmentDistance,l.getTextLocation=m.getTextLocation,l.clearLocationCache=m.clearLocationCache,l.getVisibleSegment=m.getVisibleSegment,l.findPointOnPath=m.findPointOnPath;var g=t("./extend");l.extendFlat=g.extendFlat,l.extendDeep=g.extendDeep,l.extendDeepAll=g.extendDeepAll,l.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");l.log=v.log,l.warn=v.warn,l.error=v.error;var y=t("./regex");l.counterRegex=y.counter;var x=t("./throttle");l.throttle=x.throttle,l.throttleDone=x.done,l.clearThrottle=x.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.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,c=new Array(l),u=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]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n=0&&t%1==0}function a(e){return void 0!==e&&e1?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};var w=/%{([^\s%{}]*)}/g,M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(w,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n},l.eventListenerOptionsSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}},{"../constants/numerical":721,"./angles":726,"./clean_number":727,"./coerce":728,"./dates":729,"./ensure_array":730,"./extend":732,"./filter_unique":733,"./filter_visible":734,"./geometry2d":737,"./get_graph_div":738,"./identity":742,"./is_array":744,"./is_plain_object":745,"./keyed_container":746,"./localize":747,"./loggers":748,"./matrix":749,"./mod":750,"./nested_property":751,"./noop":752,"./notifier":753,"./push_unique":756,"./regex":758,"./relative_attr":759,"./relink_private":760,"./search":761,"./stats":764,"./throttle":767,"./to_log_range":768,d3:128,"fast-isnumeric":140}],744:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],745:[function(t,e,r){"use strict";e.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)===Object.prototype}},{}],746:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,c(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}(d)):f[e[u]]=n}}function o(t,e){var r=e;return l(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}var l=t("fast-isnumeric"),c=t("./is_array"),u=t("./is_plain_object"),f=t("../plot_api/container_array_match");e.exports=function(t,e){if(l(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),s=0;so||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,f,h,d,p,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":721,"./matrix":749}],756:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else 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 o(t,e){return t>=e}var s=t("fast-isnumeric"),l=t("./loggers");r.findBin=function(t,e,r){if(s(e.start))return r?Math.ceil((t-e.start)/e.size-1e-9)-1:Math.floor((t-e.start)/e.size+1e-9);var c,u,f=0,h=e.length,d=0,p=h>1?(e[h-1]-e[0])/(h-1):1;for(u=p>=0?r?n:i:r?o:a,t+=1e-9*p*(r?-1:1)*(p>=0?1:-1);f90&&l.log("Long binary search..."),f-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":140}],765:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":99}],766:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t,e,r){var n="math-output-"+c.randstr([],64),i=l.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(function(t){return t.replace(p,"\\lt ").replace(m,"\\gt ")}(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=l.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function a(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function o(t,e){function r(){p++;var e=document.createElementNS(u.svg,"tspan");l.select(e).attr({class:"line",dy:p*h+"em"}),t.appendChild(e),s=e;var r=d;if(d=[{node:e}],r.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),s=d[d.length-1].node}else c.log("Ignoring unexpected end tag .",e)}e=function(t){return function(t,e){if(!t)return"";for(var r=0;r|>|>)/g,g={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},v={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},x="\u200b",b=["http:","https:","mailto:","",void 0,":"],_=new RegExp("]*)?/?>","g"),w=Object.keys(f.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:f.entityToUnicode[t]}}),M=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,A=/<(\/?)([^ >]*)(\s+(.*))?>/i,T=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,E=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,z=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(_," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=l.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){!function(){var r=l.select(i).select(".svg-container"),a=r.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12);a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(s(t,r,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=l.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;l.select(this).transition().duration(0).remove(),l.select(document).on("mouseup",null),o.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,l.select(document).on("mouseup",function(){if(l.event.target===t)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===l.event.which?(i._editing=!1,t.style({opacity:1}),l.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),l.select(this).call(s(t,r,e)))}).on("keydown",function(){13===l.event.which&&this.blur()}).call(n)}(),t.style({opacity:0});var r,a=c.attr("class");(r=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(r).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}var i=e.gd,a=e.delegate,o=l.dispatch("edit","input","cancel"),c=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():c.on("click",r),l.rebind(t,o,"on")}},{"../constants/alignment":716,"../constants/string_mappings":722,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],767:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e?a():o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],768:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.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}},{"fast-isnumeric":140}],769:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":818,"topojson-client":549}],770:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],771:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],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:["$",""]}}},{}],772:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axis_ids"),d=h.cleanId,p=h.getFromTrace,m=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;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 i=(f.subplotsRegistry.cartesian||{}).attrRegex,o=(f.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),m.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s1&&o.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 o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),d(t),!0)}var x,b,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,f).get(),C=[],z=-1,D=E.length;for(x=0;xE.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,k),-1===z&&(z=_);else for(b=0;b=0;x--)E.splice(C[x],1),L&&L.splice(C[x],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(h(g,v),p!==a){var I;if(-1===z)I=T;else{for(D=Math.max(E.length,D),I=[],x=0;x=z);x++)I.push(_);for(x=z;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 s(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]),o(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&o(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function l(t,e,r,n,i,s){!function(t,e,r,n){var i=v.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!v.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");o(t,r,"indices");for(var a in 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,c,u,f=function(t,e,r,n){var i,o,s,l,c,u=v.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=a(r,t.data.length-1);for(var h in e)for(var d=0;d=0&&uY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(j+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(j+".range[0]",Math.log(Z)/Math.LN10),r(j+".range[1]",Math.log(J)/Math.LN10)):(r(j+".range[0]",Math.pow(10,Z)),r(j+".range[1]",Math.pow(10,J)))}else r(j+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[E.parts[0]]&&"radialaxis"===E.parts[1]&&delete u[E.parts[0]]._subplot.viewInitial["radialaxis.range"],b.getComponentMethod("annotations","convertCoords")(t,U,L,r),b.getComponentMethod("images","convertCoords")(t,U,L,r)}else r(j+".autorange",!0),r(j+".range",null);v.nestedProperty(u,j+"._inputRange").set(null)}else if(F.match(P.AX_NAME_PATTERN)){var K=v.nestedProperty(u,S).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),b.getComponentMethod("annotations","convertCoords")(t,K,Q,r),b.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=C.containerArrayMatch(S);if($){a=$.array,o=$.index;var tt=$.property,et=(v.nestedProperty(l,a)||[])[o]||{},rt=et,nt=q||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===o?(it?M.calc=!0:I.update(M,nt),it=!1):""===tt&&(rt=L,C.isAddVal(L)?A[S]=null:C.isRemoveVal(L)?(A[S]=et,rt=et):v.warn("unrecognized full object value",e)),it&&(n(rt,"x")||n(rt,"y"))?M.calc=!0:I.update(M,nt),d[a]||(d[a]={});var at=d[a][o];at||(at=d[a][o]={}),at[tt]=L,delete e[S]}else"reverse"===F?(B.range?B.range.reverse():(r(j+".autorange",!0),B.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):((!u._has("gl2d")&&!u._has("regl")||"dragmode"!==S||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&q?I.update(M,q):M.calc=!0,E.set(L))}}for(a in d){C.applyContainerArrayChanges(t,v.nestedProperty(l,a),d[a],M)||(M.plot=!0)}var ot=u._axisConstraintGroups||[];for(x in T)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=v.getGraphDiv(t),!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=w.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(e){if(0!==e.length){for(var s=0;so._timeToNext&&function(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,w.transition(t,e.frame.data,e.frame.layout,z.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(o._animationRaf),o._animationRaf=null}()};e()}()}}function f(t){return Array.isArray(s)?p>=s.length?t.transitionOpts=s[p]:t.transitionOpts=s[0]:t.transitionOpts=s,p++,t}var h,d,p=0,m=[],g=void 0===e||null===e,y=Array.isArray(e);if(!g&&!y&&v.isPlainObject(e))m.push({type:"object",data:f(v.extendFlat({},e))});else if(g||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&__)&&M.push(d);m=M}}m.length>0?u(m):(t.emit("plotly_animated"),l())})},g.addFrames=function(t,e,r){t=v.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=l.length+2*e.length,f=[];for(i=e.length-1;i>=0;i--)if(v.isPlainObject(e[i])){var h=(c[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&c[h]&&(n++,v.warn('addFrames: overwriting frame "'+c[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&v.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:w.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(a=f[i].frame).name&&v.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=w.modifyFrames,l=w.modifyFrames,c=[t,o],u=[t,a];return x&&x.add(t,s,c,l,u),w.modifyFrames(t,a)},g.purge=function(t){var e=(t=v.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return w.cleanPlot([],{},r,e),w.purge(t),y.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":618,"../components/drawing":643,"../components/errorbars":649,"../constants/xmlns_namespaces":723,"../lib":743,"../lib/events":731,"../lib/queue":757,"../lib/svg_text_utils":766,"../plotly":784,"../plots/cartesian/axis_ids":792,"../plots/cartesian/constants":794,"../plots/cartesian/constraints":796,"../plots/cartesian/graph_interact":798,"../plots/plots":852,"../plots/polar/legacy":860,"../registry":873,"./edit_types":773,"./helpers":774,"./manage_arrays":775,"./plot_schema":778,"./subroutines":781,d3:128,"fast-isnumeric":140,"has-hover":276}],777:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],778:[function(t,e,r){"use strict";function n(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function a(){var t,e,r={};x(r,h);for(t in c.subplotsRegistry)if((e=c.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)s(r,e,"xaxis"),s(r,e,"yaxis");else{s(r,e,"subplot"===e.attr?e.name:e.attr)}r=function(t){return y(t,{radialaxis:g.radialaxis,angularaxis:g.angularaxis}),y(t,g.layout),t}(r);for(t in c.componentsRegistry){var n=(e=c.componentsRegistry[t]).schema;if(n&&(n.subplots||n.layout)){var i=n.subplots;if(i&&i.xaxis&&!i.yaxis)for(var a in i.xaxis)delete r.yaxis[a]}else e.layoutAttributes&&l(r,e.layoutAttributes,e.name)}return{layoutAttributes:o(r)}}function o(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):u.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[_];if(!n)return;delete t[_],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function s(t,e,r){var n=u.nestedProperty(t,r),i=x({},e.layoutAttributes);i[b]=!0,n.set(i)}function l(t,e,r){var n=u.nestedProperty(t,r);n.set(x(n.get()||{},e))}var c=t("../registry"),u=t("../lib"),f=t("../plots/attributes"),h=t("../plots/layout_attributes"),d=t("../plots/frame_attributes"),p=t("../plots/animation_attributes"),m=t("../plots/polar/legacy/area_attributes"),g=t("../plots/polar/legacy/axis_attributes"),v=t("./edit_types"),y=u.extendFlat,x=u.extendDeepAll,b="_isSubplotObj",_="_isLinkedToArray",w=[b,_,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=b,r.IS_LINKED_TO_ARRAY=_,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=w,r.get=function(){var t={};c.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:m},r={}):r=(e=c.modules[t]._module).basePlotModule;var n={};n.type=null,x(n,f),x(n,e.attributes),r.attributes&&x(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:o(n)};if(e.layoutAttributes){var a={};x(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}(e)});var e={};return Object.keys(c.transformsRegistry).forEach(function(t){e[t]=function(t){var e=c.transformsRegistry[t],r=x({},e.attributes);return Object.keys(c.componentsRegistry).forEach(function(e){var n=c.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){l(r,n.schema.transforms[t][e],e)})}),{attributes:o(r)}}(t)}),{defs:{valObjects:u.valObjectMeta,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:v.traces,layout:v.layout},impliedEdits:{}},traces:t,layout:a(),transforms:e,frames:function(){var t={frames:u.extendDeepAll({},d)};return o(t),t.frames}(),animation:o(p)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===w.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||u.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,a,o){i=i.slice(0,o).concat([r]);if(e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[o-1]&&("ticktext"===r||"tickvals"===r))){var s=function(t){return t.join(".")}(i),l=u.nestedProperty(t,s).get();Array.isArray(l)&&n.push(s)}}var n=[],i=[];if(r.crawl(f,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,o=0;o=t.transforms.length)return!1;a=(r=(c.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=m[o];else{var u=t._module;if(u||(u=(c.modules[t.type||f.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(a=r&&r[o])){var h=u.basePlotModule;h&&h.attributes&&(a=h.attributes[o])}a||(a=f[o])}return n(a,e,s)},r.getLayoutValObject=function(t,e){return n(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var a=e.plotgroup.selectAll(".bg").data(i);a.enter().append("rect").classed("bg",!0),a.exit().remove(),a.each(function(){e.bg=a;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=l._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){l._plots[t].bg=o.select(this)}),b.each(function(t){function r(t){return"M"+k+","+t+"H"+A}function o(t){return"M"+y._offset+","+t+"h"+y._length}function s(t){return"M"+t+","+z+"V"+C}function c(t){return"M"+t+","+x._offset+"v"+x._length}function p(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}var v=l._plots[t],y=v.xaxis,x=v.yaxis;v.bg&&m&&v.bg.call(h.setRect,y._offset-u,x._offset-u,y._length+2*u,x._length+2*u).call(f.fill,l.plot_bgcolor).style("stroke-width",0),v.clipId="clip"+l._uid+t+"plot";var b=l._clips.selectAll("#"+v.clipId).data([0]);b.enter().append("clipPath").attr({class:"plotclip",id:v.clipId}).append("rect"),b.selectAll("rect").attr({width:y._length,height:x._length}),h.setTranslate(v.plot,y._offset,x._offset);var _,w;for(v._hasClipOnAxisFalse?(_=null,w=v.clipId):(_=v.clipId,w=null),h.setClipUrl(v.plot,_),i=0;i1&&d.push(a("object","layout"))),l.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&i<=10||e>=15*T)t._tickround="d";else if(e>=E&&i<=16||e>=S)t._tickround="M";else if(e>=L&&i<=19||e>=E)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(m(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);m(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(c(t.exponentformat)&&!u(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function s(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=f(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}function r(t,n){return e(n,0)?t:r(n,t%n)}var n=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),i=t*n,a=Math.abs(r(i,n));return[Math.round(i/a),Math.round(n/a)]}(a);if(o[1]>=100)e.text=f(v.deg2rad(e.x),t,i,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(e.text=C+e.text)}}}}function c(t){return"SI"===t||"B"===t}function u(t){return t>14||t<-15}function f(t,e,r,n){var i=t<0,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,f=I.getTickFormat(e),h=e.separatethousands;if(n){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:m(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(d),a=(Number(d._tickround)||0)+4,l=d._tickexponent,e.hoverformat&&(f=e.hoverformat)}if(f)return e._numFormat(f)(t).replace(/-/g,C);var p=Math.pow(10,-a)/2;if("none"===s&&(l=0),(t=Math.abs(t))"+x+"":"B"===s&&9===l?t+="B":c(s)&&(t+=H[l/3+5])}return i?C+t:t}function h(t,e){for(var r=0;r2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},I.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);if(n===i){var m=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),v.simpleMap(r,t.l2r||Number)},I.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=I.getAutoRange(t),t._r=t.range.slice(),t._rl=v.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},I.saveRangeInitial=function(t,e){for(var r=I.list(t,"",!0),n=!1,i=0;i=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:b&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:b&&0===u?0:f})}}}if((t.autorange||!!v.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,g,y=e.length,x=r.padded?.05*t._length:0,b=r.tozero&&("linear"===t.type||"-"===t.type);x&&"domain"===t.constrain&&t._inputDomain&&(x*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var _=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),A=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=y-1;a>5;a--)i(a)}},I.autoBin=function(t,e,r,n,i){var a=v.aggNums(Math.min,null,t),o=v.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:a-.5,end:o+.5,size:1,_count:o-a+1};var s;if(r)s=(o-a)/r;else{var l=v.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*v.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*v.stdev(t)/Math.pow(t.length,n?.25:.4)),m(s)||(s=1)}var f;f="log"===e.type?{type:"linear",range:[a,o]}:{type:e.type,range:v.simpleMap([a,o],e.c2r,0,i),calendar:i},I.setConvert(f),I.autoTicks(f,s);var h,d,p=I.tickIncrement(I.tickFirst(f),f.dtick,"reverse",i);if("number"==typeof f.dtick)h=(p=function(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,c=0,u=0;u.3*f||a(n)||a(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=I.tickIncrement(t,"M6","reverse")+1.5*T:a.exactMonths>.8?t=I.tickIncrement(t,"M1","reverse")+15.5*T:t-=T/2;var s=I.tickIncrement(t,r);if(s<=n)return s}return t}(p,t,f.dtick,a,i)),h=p,d=0;h<=o;)h=I.tickIncrement(h,f.dtick,!1,i),d++;return{start:e.c2r(p,0,i),end:e.c2r(h,0,i),size:f.dtick,_count:d}},I.calcTicks=function(t){var e=v.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=v.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),I.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),o(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=v.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),f=Math.max(l,c),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e=l:f<=l)&&!(a.length>u||f===c);f=I.tickIncrement(f,t.dtick,i,t.calendar))c=f,a.push(f);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dk?(e/=k,n=r(10),t.dtick="M"+12*a(e,n,R)):i>A?(e/=A,t.dtick="M"+a(e,1,N)):i>T?(t.dtick=a(e,T,B),t.tick0=v.dateTick0(t.calendar,!0)):i>S?t.dtick=a(e,S,N):i>E?t.dtick=a(e,E,j):i>L?t.dtick=a(e,L,j):(n=r(10),t.dtick=a(e,n,R))}else if("log"===t.type){t.tick0=0;var o=v.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,n=r(10),t.dtick="L"+a(e,n,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=a(e,n,q)):(t.tick0=0,n=r(10),t.dtick=a(e,n,R));if(0===t.dtick&&(t.dtick=1),!m(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},I.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(m(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return v.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?V:U,l=t+.01*i,c=v.roundUp(v.mod(l,1),s,r);return Math.floor(l)+Math.log(p.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},I.tickFirst=function(t){var e=t.r2l||Number,r=v.simpleMap(t.range,e),n=r[1]"+o,t._prevDateHead=o)),e.text=s}(t,o,r,d):"log"===t.type?function(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=f(Math.pow(10,o),t,i,n);else if(m(a)||"D"===a.charAt(0)&&v.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||c(t.exponentformat)&&u(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+C+-l+"",e.fontSize*=1.25):(e.text=f(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,v.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("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*(o<0?.5:.25)))}}(t,o,0,d,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"angular"===t._id?l(t,o,r,d,i):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=f(e.x,t,i,n)}(t,o,0,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o},I.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return I.hoverLabelText(t,e)+" - "+I.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=I.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":C+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];I.getTickFormat=function(t){function e(t){return"string"!=typeof t?t:Number(t.replace("M",""))*A}function r(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function n(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function i(t,e){var n=null===e[0],i=null===e[1],a=r(t,e[0])>=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}var a,o;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(a=0;a1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":873,"./constants":794}],793:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],794:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":743}],795:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;oo*v)||_)for(r=0;rz&&IL&&(L=I);f/=(L-E)/(2*C),E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=A.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function c(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:k.background,stroke:k.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function u(t){t.selectAll(".select-outline").remove()}function f(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 d(t){y.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function p(t){j&&t.data&&t._context.showTips&&(w.notifier(w._(t,"Double-click to zoom back out"),"long"),j=!1)}function m(t){return"lasso"===t||"select"===t}function g(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,R)/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 v(t,e){if(N){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}var y=t("d3"),x=t("tinycolor2"),b=t("../../plotly"),_=t("../../registry"),w=t("../../lib"),M=t("../../lib/svg_text_utils"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("../../components/fx"),S=t("../../lib/setcursor"),E=t("../../components/dragelement"),L=t("../../constants/alignment").FROM_TL,C=t("../plots"),z=t("./axes").doTicks,D=t("./axis_ids").getFromId,I=t("./select"),P=t("./scale_zoom"),O=t("./constants"),F=O.MINDRAG,R=O.MINZOOM,N=w.eventListenerOptionsSupported(),j=!0;e.exports={makeDragBox:function(t,e,r,n,h,k,S,N){function j(){X=[e.xaxis],Z=[e.yaxis];var r=X[0],n=Z[0];Q=r._length,$=n._length;var i=ot._axisConstraintGroups,o=[r._id],s=[n._id];W=[e].concat(S&&N?e.overlays:[]);for(var l=1;lR||s>R?(yt="xy",o/Q>s/$?(s=o*$/Q,dt>a?pt.t=dt-s:pt.b=dt+s):(o=s*Q/$,ht>i?pt.l=ht-o:pt.r=ht+o),bt.attr("d",g(pt))):n():!et||s10||n.scrollWidth-n.clientWidth>10)){clearTimeout(Mt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=At.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(N||nt){for(N||(l=.5),a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(j(),"ew"===tt||"ns"===et)return tt&&s(X,e),et&&s(Z,r),Y([tt?-e:0,et?-r:0,Q,$]),void H(et,tt);if(nt&&tt&&et){var i="w"===tt==("n"===et)?1:-1,a=(e/Q+i*r/$)/2;e=a*Q,r=i*a*$}"w"===tt?e=n(X,0,e):"e"===tt?e=n(X,1,-e):tt||(e=0),"n"===et?r=n(Z,1,r):"s"===et?r=n(Z,0,-r):et||(r=0);var o="w"===tt?e:0,l="n"===et?r:0;if(nt){var c;if(!tt&&1===et.length){for(c=0;c rect").call(A.setTranslate,s,l).call(A.setScale,a,o);var T=m.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");m.plot.call(A.setTranslate,M,k).call(A.setScale,1/a,1/o),T.selectAll(".point").call(A.setPointGroupScale,a,o),T.selectAll(".textpoint").call(A.setTextPointsScale,a,o),T.call(A.hideOutsideRangePoints,m)}}}var W,X,Z,J,K,Q,$,tt,et,rt,nt,it,at,ot=t._fullLayout,st=t._fullLayout._zoomlayer,lt=S+N==="nsew",ct=1===(S+N).length;j();var ut=i(e,S+N+"drag",rt,r,n,h,k);if(!et&&!tt&&!m(ot.dragmode))return ut.onmousedown=null,ut.style.pointerEvents=lt?"all":"none",ut;var ft={element:ut,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;lt?e.shiftKey?"pan"===i?i="zoom":m(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan",ft.minDrag="lasso"===i?1:void 0,"zoom"===i?(ft.moveFn=B,ft.doneFn=U,ft.minDrag=1,function(e,r,n){var i=ut.getBoundingClientRect();ht=r-i.left,dt=n-i.top,pt={l:ht,r:ht,w:0,t:dt,b:dt,h:0},mt=t._hmpixcount?t._hmlumcount/t._hmpixcount:x(t._fullLayout.plot_bgcolor).getLuminance(),vt=!1,yt="xy",xt=l(st,mt,J,K,gt="M0,0H"+Q+"V"+$+"H0V0"),bt=c(st,J,K),u(st)}(0,r,n)):"pan"===i?(ft.moveFn=q,ft.doneFn=G,u(st)):m(i)&&(ft.xaxes=X,ft.yaxes=Z,I(e,r,n,ft,i))},clickFn:function(r,n){if(d(t),2!==r||ct||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(tt?X:[]).concat(et?Z:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;ru[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":743,"fast-isnumeric":140}],806:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.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)]}},{"../../constants/alignment":716}],807:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function b(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,s=o.nestedProperty(t,e).get();if(i="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:r.dfltRange||p.DFLTRANGEX,i=i.slice(),s&&2===s.length)for("date"===t.type&&(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(s[n],t.calendar)){t[e]=i;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!a(s[n])){if(!a(s[1-n])){t[e]=i;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-h?s[n]=-h:s[n]>h&&(s[n]=h),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else o.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:i.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:i.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":721,"../../lib":743,"./axis_ids":792,"./constants":794,d3:128,"fast-isnumeric":140}],809:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);r("tickprefix")&&r("showtickprefix",s);r("ticksuffix",o.tickSuffixDflt)&&r("showticksuffix",s);if(r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){function r(t,e){return n.coerce(s,l,i.tickformatstops,t,e)}var a=t.tickformatstops,o=e.tickformatstops=[];if(Array.isArray(a))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),h=u.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],812:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(t){var e=t.xaxis,r=t.yaxis;d._defs.select("#"+t.clipId+"> 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 f(e,r){var n,i,l,c=m[e.xaxis._id],u=m[e.yaxis._id],f=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,f[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[2]=e.xaxis._length*(1-r+r*p/h)}else f[0]=0,f[2]=e.xaxis._length;if(u){i=(n=t._fullLayout[u.axisName])._r,l=u.to,f[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var g=i[1]-i[0],v=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[3]=e.yaxis._length*(1-r+r*v/g)}else f[1]=0,f[3]=e.yaxis._length;!function(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,k,A).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,E,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}function h(){b=Date.now();for(var e=Math.min(1,(b-x)/r.duration),n=w(e),a=0;ar.duration?(!function(){for(var e={},r=0;r0?".":"")+i;l.isPlainObject(a)?o(a,e,s,n+1):e(s,i,a)}})}var s=t("../plotly"),l=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(c)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(c){n(t,c,o.cache),o.check=function(){if(s){var e=n(t,c,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fn*Math.PI/180}return!1},r.getPath=function(){return i.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(m.precision),n&&r.clipAngle(n-m.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],h=e.lonaxis,d=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(h.range,d.range);u.fitExtent(f,p);var g=this.bounds=u.getBounds(p),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!c){var A=u?o.projRotate:[k,0,0];M=r("projection.rotation.lon",A[0]),r("projection.rotation.lat",A[1]),r("projection.rotation.roll",A[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}var T,S;if(c?(T=-96.6,S=38.7):(T=u?k:M,S=(b[0]+b[1])/2),r("center.lon",T),r("center.lat",S),f){r("projection.parallels",o.projParallels||[0,60])}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":865,"../constants":818,"./layout_attributes":823}],823:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,s={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({domain:i({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:s,lataxis:s},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"../constants":818}],824:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!M.hasOwnProperty(e.type))return null;var i=M[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){return t>1?S:t<-1?-S:Math.asin(t)}function a(t){return t>1?0:t<-1?T:Math.acos(t)}function o(t,e){var r=(2+S)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>k;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function s(t,e){function r(r,n){var i=D(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?D:e===1/0?l:(r.invert=function(r,n){var i=D.invert(r/t,n);return i[0]*=e,i},r)}function l(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function c(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function u(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function f(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>k&&--i>0);return e/2}}function h(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function d(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=P[i])[0],s=r[1],l=(r=P[++i])[0],c=r[1],u=(r=P[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?S:-S)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function p(t,e){return[t*Math.cos(e),e]}function m(t,e){var r=Math.cos(e),n=function(t){return t?t/Math.sin(t):1}(a(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function g(t,e){var r=m(t,e);return[(r[0]+t/S)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&v.hasOwnProperty(t.type)?v[t.type]:r)(t,n)};var v={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},y=[],x=[],b={point:function(t,e){y.push([t,e])},result:function(){var t=y.length?y.length<2?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y}:null;return y=[],t}},_={lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){y.length&&(x.push(y),y=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},w={polygonStart:n,lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){var t=y.length;if(t){do{y.push(y[0].slice())}while(++t<4);x.push(y),y=[]}},polygonEnd:n,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(h-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},M={Point:b,MultiPoint:b,LineString:_,MultiLineString:_,Polygon:w,MultiPolygon:w,Sphere:w},k=1e-6,A=k*k,T=Math.PI,S=T/2,E=(Math.sqrt(T),T/180),L=180/T,C=t.geo.projection,z=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=a[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],l}function n(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a=0;--r){var f;o=180*(f=a[1][r])[0][0]/T,s=180*f[0][1]/T,l=180*f[1][1]/T,c=180*f[2][0]/T,u=180*f[2][1]/T,e.push(n([[c-1e-6,u-1e-6],[c-1e-6,l+1e-6],[o+1e-6,l+1e-6],[o+1e-6,s-1e-6]],30))}return{type:"Polygon",coordinates:[t.merge(e)]}}(),l)},i},o.lobes=function(t){return arguments.length?(a=t.map(function(t){return t.map(function(t){return[[t[0][0]*T/180,t[0][1]*T/180],[t[1][0]*T/180,t[1][1]*T/180],[t[2][0]*T/180,t[2][1]*T/180]]})}),i=a.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),o):a.map(function(t){return t.map(function(t){return[[180*t[0][0]/T,180*t[0][1]/T],[180*t[1][0]/T,180*t[1][1]/T],[180*t[2][0]/T,180*t[2][1]/T]]})})},o},o.invert=function(t,e){var r=.5*e*Math.sqrt((4+T)/T),n=i(r),a=Math.cos(n);return[t/(2/Math.sqrt(T*(4+T))*(1+a)),i((n+r*(a+2))/(2+S))]},(t.geo.eckert4=function(){return C(o)}).raw=o;var D=t.geo.azimuthalEqualArea.raw;l.invert=function(t,e){var r=2*i(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=z(s),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=s,c.invert=function(t,e){return[2/3*T*t/Math.sqrt(T*T/3-e*e),e]},(t.geo.kavrayskiy7=function(){return C(c)}).raw=c,u.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*T]},(t.geo.miller=function(){return C(u)}).raw=u,f(T);var I=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=a(n)),e*Math.sin(n)]}var a=f(r);return n.invert=function(n,a){var o=i(a/e);return[n/(t*Math.cos(o)),i((2*o+Math.sin(2*o))/r)]},n}(Math.SQRT2/S,Math.SQRT2,T);(t.geo.mollweide=function(){return C(I)}).raw=I,h.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>k&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return C(h)}).raw=h;var P=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];P.forEach(function(t){t[1]*=1.0144}),d.invert=function(t,e){var r=e/S,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],n-=(p=(e>=0?S:-S)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*L}while(Math.abs(p)>A&&--m>0);break}}while(--a>=0);var g=P[a][0],v=P[a+1][0],y=P[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*E]},(t.geo.robinson=function(){return C(d)}).raw=d,p.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return C(p)}).raw=p,m.invert=function(t,e){if(!(t*t+4*e*e>T*T+k)){var r=t,n=e,i=25;do{var o,s=Math.sin(r),l=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,m=l*l,g=1-p*c*c,v=g?a(f*c)*Math.sqrt(o=1/g):o=0,y=2*v*f*l-t,x=v*u-e,b=o*(p*m+v*f*c*d),_=o*(.5*s*h-2*v*u*l),w=.25*o*(h*l-v*u*p*s),M=o*(d*c+v*m*f),A=_*w-M*b;if(!A)break;var S=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=S,n-=E}while((Math.abs(S)>k||Math.abs(E)>k)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return C(m)}).raw=m,g.invert=function(t,e){var r=t,n=e,i=25;do{var o,s=Math.cos(n),l=Math.sin(n),c=Math.sin(2*n),u=l*l,f=s*s,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-f*d*d,v=g?a(s*d)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*s*p+r/S)-t,x=.5*(v*l+n)-e,b=.5*o*(f*m+v*s*d*u)+.5/S,_=o*(h*c/4-v*l*p),w=.125*o*(c*p-v*l*f*h),M=.5*o*(u*d+v*m*s)+.5,A=_*w-M*b,T=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=T,n-=E}while((Math.abs(T)>k||Math.abs(E)>k)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return C(g)}).raw=g}},{}],825:[function(t,e,r){"use strict";function n(t,e){return d.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,r){function n(t,e){var r=p.nestedProperty(s,t);r.get()!==e&&(r.set(e),p.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function a(t,e){function r(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}var a=n(0,e);return a.on("zoomstart",function(){d.select(this).style(v)}).on("zoom",function(){e.scale(d.event.scale).translate(d.event.translate),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,r)}),a}function o(t,e){function r(t){return e.invert(t)}function a(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var o,s,l,c,u,f,h,p,m=n(0,e),g=2;return m.on("zoomstart",function(){d.select(this).style(v),o=d.mouse(this),s=e.rotate(),l=e.translate(),c=s,u=r(o)}).on("zoom",function(){if(f=d.mouse(this),function(t){var n=e(r(t));return Math.abs(n[0]-t[0])>g||Math.abs(n[1]-t[1])>g}(o))return m.scale(e.scale()),void m.translate(e.translate());e.scale(d.event.scale),e.translate([l[0],d.event.translate[1]]),u?r(f)&&(p=r(f),h=[c[0]+(p[0]-u[0]),s[1],s[2]],e.rotate(h),c=h):u=r(o=f),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,a)}),m}function s(t,e){function r(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var a,o={r:e.rotate(),k:e.scale()},s=n(0,e),u=function(t){var e=0,r=arguments.length,n=[];for(;++em?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/m)*g-p,i=Math.sqrt(m*m-h*h));var v=180-a-2*p,y=(Math.atan2(d,u)-Math.atan2(l,i))*g,x=(Math.atan2(d,u)-Math.atan2(l,-i))*g,b=c(r[0],r[1],a,y),_=c(r[0],r[1],v,x);return b<=_?[a,y,r[2]]:[v,x,r[2]]}(v,a,n);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=n),e.rotate(x),n=x}}else a=l(e,t=s);!function(t){t({type:"zoom"})}(u.of(this,arguments))}),function(t){p++||t({type:"zoomstart"})}(u.of(this,arguments))}).on("zoomend",function(){d.select(this).style(y),x.call(s,"zoom",null),function(t){--p||t({type:"zoomend"})}(u.of(this,arguments)),i(t,e,r)}).on("zoom.redraw",function(){t.render()}),d.rebind(s,u,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*m,r=t[1]*m,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function c(t,e,r,n){var i=u(r-t),a=u(n-e);return Math.sqrt(i*i+a*a)}function u(t){return(t%360+540)%360-180}function f(t,e,r){var n=r*m,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function h(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(s)*_*(u>=0?1:-1),c.boxEnd[1]f[3]&&(c.boxEnd[1]=f[3],c.boxEnd[0]=c.boxStart[0]+(f[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(u)/_*(s>=0?1:-1),c.boxEnd[0]f[2]&&(c.boxEnd[0]=f[2],c.boxEnd[1]=c.boxStart[1]+(f[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(s=c.boxStart[0]!==c.boxEnd[0],u=c.boxStart[1]!==c.boxEnd[1],s||u?(s&&(a(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,r?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)h[p+2]&&(h[p]=-1,h[p+2]=1),(d=this[b[p]])._length=o.viewBox[p+2]-o.viewBox[p],s.doAutoRange(d),d.setScale();y(l),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],832:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return i.validate(t[e],c[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":618,"../../../lib":743,"../../../registry":873,"../../subplot_defaults":865,"./axis_defaults":835,"./layout_attributes":838}],838:[function(t,e,r){"use strict";function n(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"}}var i=t("./axis_attributes"),a=t("../../domain_attributes"),o=t("../../../lib/extend").extendFlat,s=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[s("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:o(n(0,0,1),{}),center:o(n(0,0,0),{}),eye:o(n(1.25,1.25,1.25),{}),editType:"camera"},domain:a({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:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":743,"../../../lib/extend":732,"../../domain_attributes":815,"./axis_attributes":834}],839:[function(t,e,r){"use strict";function n(){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]}var i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=i(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new n;return e.merge(t),e}},{"../../../lib/str2rgbarray":765}],840:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var f=l[o[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||i.constrain(f._length/40,4,9);n.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=n.calcTicks(f),m=0;mh[1][s]?d[s]=1:h[1][s]===h[0][s]?d[s]=1:d[s]=1/(h[1][s]-h[0][s]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var T=m[1][a]-m[0][a];m[0][a]-=T/32,m[1][a]+=T/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){var L=y[c=(l=u[k[a]]).type];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=E;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=u.aspectratio;C=[z.x,z.y,z.z]}u.aspectratio.x=f.aspectratio.x=C[0],u.aspectratio.y=f.aspectratio.y=C[1],u.aspectratio.z=f.aspectratio.z=C[2],this.glplot.aspect=C;var D=u.domain||null,I=e._size||null;if(D&&I){var P=this.container.style;P.position="absolute",P.left=I.l+D.x[0]*I.w+"px",P.top=I.t+(1-D.y[1])*I.h+"px",P.width=I.w*(D.x[1]-D.x[0])+"px",P.height=I.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),s(this.glplot.camera)},M.setCamera=function(t){this.glplot.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(t))},M.saveCamera=function(t){function e(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 r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}var a=t("../../lib"),o=t("./convert_text_opts"),s=n.prototype;s.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},s.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},s.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":a.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":a.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":a.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=o(n.textposition,n.iconsize);a.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),a.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},s.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":743,"./convert_text_opts":845}],848:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain_attributes"),o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:c,textposition:n.extendFlat({},s,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":618,"../../lib":743,"../../plot_api/edit_types":773,"../../traces/scatter/attributes":1066,"../domain_attributes":815,"../font_attributes":816}],849:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){function r(t,e){return i.coerce(n,a,o.layers,t,e)}var n,a,s=t.layers||[],l=e.layers=[];for(var c=0;c=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(){p.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()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=i.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],h=t.data||[];t._transitionData||p.createTransitionData(t),n._dfltTitle={plot:f(t,"Click to enter Plot title"),x:f(t,"Click to enter X axis title"),y:f(t,"Click to enter Y axis title"),colorbar:f(t,"Click to enter Colorscale title"),annotation:f(t,"new text")},n._traceWord=f(t,"trace");var d=function(t){function e(t){for(var e=!0,r=0;r=0)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,d=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(m.width-f)),i=Math.round(d*(m.height-h))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var v=p.layoutAttributes.width.min,y=p.layoutAttributes.height.min;n1,b=!e.height&&Math.abs(r.height-i)>1;(b||x)&&(x&&(r.width=n),b&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand){u.base={l:{val:0,size:i},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}};for(var f in u){var h=u[f].l||{},d=u[f].b||{},p=h.val,m=h.size,g=d.val,v=d.size;for(var y in u){if(a(m)&&u[y].r){var x=u[y].r.val,b=u[y].r.size;if(x>p){var _=(m*x+(b-e.width)*p)/(x-p),w=(b*(1-p)+(m-e.width)*(1-x))/(x-p);_>=0&&w>=0&&_+w>i+s&&(i=_,s=w)}}if(a(v)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>g){var A=(v*M+(k-e.height)*g)/(M-g),T=(k*(1-g)+(v-e.height)*(1-M))/(M-g);A>=0&&T>=0&&A+T>c+l&&(c=A,l=T)}}}}}if(r.l=Math.round(i),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(u.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var s,l,c=0,f=0,p=t._fullLayout._basePlotModules,m=!1;if(r)for(l=0;l=0;o--)if(_[o].enabled){r._indexToPoints=_[o]._indexToPoints;break}i&&i.calc&&(b=i.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:d,y:d}]),b[0].t||(b[0].t={}),b[0].trace=r,p[a]=b}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i=0?h.angularAxis.domain:n.extent(M),E=Math.abs(M[1]-M[0]);A&&!k&&(E=0);var L=S.slice();T&&k&&(L[1]+=E);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var z=h.angularAxis.ticksStep||(L[1]-L[0])/(C*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),L[2]||(L[2]=z);var D=n.range.apply(this,L);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=T?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),P=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(P)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,F=t.select(".chart-group"),R={fill:"none",stroke:h.tickColor},N={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=O.node().getBBox();x=Math.min(h.width-B.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*x+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title){var V=t.select("g.title-group text").style(N).text(h.title),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(R),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(R);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),H.selectAll(".domain").style(R),H.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+c(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(R),Z.selectAll(".minor").style({stroke:h.minorTickColor}),X.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(N);var J=X.select("text.axis-text").attr({x:x+h.labelOffset,dy:a+"em",transform:function(t,e){var r=c(t),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(N);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[x+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(p);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),p[0]||Q){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!k){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ct.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ot.text(o.util.round(rt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(Y).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=t.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(e){return t.radialScale(l+(e[2]||0))}).outerRadius(function(e){return t.radialScale(l+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(e,r){return"rotate("+(t.orientation+s(e[0])+90)+")"}})};var p={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(p).each(c[t.geometryType]),g.exit().remove(),m.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],o.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),g=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,f]);if(u){var v=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){return function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()}(t.symbol,c)},fill:function(t,e){return m(e)}}),y.exit().remove()}var x=n.svg.axis().scale(g).orient("right"),b=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),b.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*h+l,g=d.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../../constants/alignment":716,"../../../lib":743,d3:128}],862:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(f=i),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":618,"../../../lib":743,"./micropolar":861,"./undo_manager":863,d3:128}],863:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n0?1:-1}function d(t){return h(Math.cos(t))}function p(t){return h(Math.sin(t))}var m=t("d3"),g=t("tinycolor2"),v=t("../../plotly"),y=t("../../registry"),x=t("../../lib"),b=t("../../components/color"),_=t("../../components/drawing"),w=t("../plots"),M=t("../cartesian/axes"),k=t("../../components/dragelement"),A=t("../cartesian/dragbox"),T=t("../../components/fx"),S=t("../../components/titles"),E=t("../cartesian/select"),L=t("../../lib/setcursor"),C=t("../../constants/alignment").MID_SHIFT,z=x._,D=x.deg2rad,I=x.rad2deg,P=x.wrap360,O=x.wrap180,F=t("./helpers").setConvertAngular,R=t("./constants"),N=n.prototype;e.exports=function(t,e){return new n(t,e)},N.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h),e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f),r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h),n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f),[e,r,n,i]}(g),y=v[2]-v[0],x=v[3]-v[1],w=m/p,k=Math.abs(x/y);w>k?(l=p,d=(m-(c=p*k))/i.h/2,f=[a[0],a[1]],h=[o[0]+d,o[1]-d]):(c=m,d=(p-(l=m/k))/i.w/2,f=[a[0]+d,a[1]-d],h=[o[0],o[1]]),r.xLength2=l,r.yLength2=c,r.xDomain2=f,r.yDomain2=h;var A=r.xOffset2=i.l+i.w*f[0],T=r.yOffset2=i.t+i.h*(1-h[1]),S=r.radius=l/y,E=r.cx=A-S*v[0],L=r.cy=T+S*v[3],C=r.cxx=E-A,z=r.cyy=L-T;r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.updateAngularAxis(t,e);var I=r.radialAxis.range,O=I[1]-I[0],F=r.xaxis={type:"linear",_id:"x",range:[v[0]*O,v[2]*O],domain:f};M.setConvert(F,t),F.setScale();var R=r.yaxis={type:"linear",_id:"y",range:[v[1]*O,v[3]*O],domain:h};M.setConvert(R,t),R.setScale(),F.isPtWithinRange=function(t){return r.isPtWithinSector(t)},R.isPtWithinRange=function(){return!0},n.frontplot.attr("transform",u(A,T)).call(_.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.circle),n.bgcircle.attr({d:s(S,g),transform:u(E,L)}).call(b.fill,e.bgcolor),r.clipPaths.circle.select("path").attr("d",s(S,g)).attr("transform",u(C,z)),r.framework.selectAll(".crisp").classed("crisp",0)},N.updateRadialAxis=function(t,e){var r=this.gd,n=this.layers,s=this.radius,l=this.cx,h=this.cy,d=t._size,p=e.radialaxis,m=e.sector,g=P(m[0]);this.fillViewInitialKey("radialaxis.angle",p.angle);var v=this.radialAxis=x.extendFlat({},p,{_axislayer:n["radial-axis"],_gridlayer:n["radial-grid"],_id:"x",_pos:0,side:{counterclockwise:"top",clockwise:"bottom"}[p.side],domain:[0,s/d.w],anchor:"free",position:0,_counteraxis:!0});i(v,p,t),M.doAutoRange(v),p.range=v.range.slice(),p._input.range=v.range.slice(),this.fillViewInitialKey("radialaxis.range",v.range.slice()),"auto"===v.tickangle&&g>90&&g<=270&&(v.tickangle=180),v._transfn=function(t){return"translate("+v.l2p(t.x)+",0)"},v._gridpath=function(t){return o(v.r2p(t.x),m)};var y=a(p);this.radialTickLayout!==y&&(n["radial-axis"].selectAll(".xtick").remove(),this.radialTickLayout=y),M.doTicks(r,v,!0),c(n["radial-axis"],p.showticklabels||p.ticks,{transform:u(l,h)+f(-p.angle)}),c(n["radial-grid"],p.showgrid,{transform:u(l,h)}).selectAll("path").attr("transform",null),c(n["radial-line"].select("line"),p.showline,{x1:0,y1:0,x2:s,y2:0,transform:u(l,h)+f(-p.angle)}).attr("stroke-width",p.linewidth).call(b.stroke,p.linecolor)},N.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:s.angle,u=D(c),f=Math.cos(u),h=Math.sin(u),d=0;if(s.title){var p=_.bBox(this.layers["radial-axis"].node()).height,m=s.titlefont.size;d="counterclockwise"===s.side?-p-.4*m:p+.8*m}this.layers["radial-axis-title"]=S.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:a+i/2*f+d*h,y:o-i/2*h+d*f,"text-anchor":"middle"},transform:{rotate:-c}})},N.updateAngularAxis=function(t,e){function r(t){return T.c2rad(t.x,"degrees")}function n(t){return[v*Math.cos(t),v*Math.sin(t)]}var o=this,h=o.gd,g=o.layers,v=o.radius,y=o.cx,_=o.cy,w=e.angularaxis,k=e.sector,A=k.map(D);o.fillViewInitialKey("angularaxis.rotation",w.rotation);var T=o.angularAxis=x.extendFlat({},w,{_axislayer:g["angular-axis"],_gridlayer:g["angular-grid"],_id:"angular",_pos:0,side:"right",domain:[0,Math.PI],anchor:"free",position:0,_counteraxis:!0});"linear"===T.type?(T.autorange=!1,l(k)?T.range=k.slice():T.range=A.map(T.unTransformRad).map(I),"radians"===T.thetaunit&&(T.tick0=I(T.tick0),T.dtick=I(T.dtick))):"category"===T.type&&(T._tickFilter=function(t){return o.isPtWithinSector({r:o.radialAxis.range[1],rad:T.c2rad(t.x)})}),i(T,w,t),M.doAutoRange(T),T._transfn=function(t){var e=r(t),i=n(e),a=u(y+i[0],_-i[1]),o=m.select(this);return o&&o.node()&&o.classed("ticks")&&(a+=f(-I(e))),a},T._gridpath=function(t){var e=n(r(t));return"M0,0L"+-e[0]+","+e[1]};var S="outside"!==w.ticks?.7:.5;T._labelx=function(t){var e=r(t),n=T._labelStandoff,i=T._pad;return(0===p(e)?0:Math.cos(e)*(n+i+S*t.fontSize))+d(e)*(t.dx+n+i)},T._labely=function(t){var e=r(t),n=T._labelStandoff,i=T._labelShift,a=T._pad;return t.dy+t.fontSize*C-i+-Math.sin(e)*(n+a+S*t.fontSize)},T._labelanchor=function(t,e){var n=r(e);return 0===p(n)?d(n)>0?"start":"end":"middle"};var E=a(w);o.angularTickLayout!==E&&(g["angular-axis"].selectAll(".angulartick").remove(),o.angularTickLayout=E),M.doTicks(h,T,!0),c(g["angular-line"].select("path"),w.showline,{d:s(v,k),transform:u(y,_)}).attr("stroke-width",w.linewidth).call(b.stroke,w.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t,e),this.updateRadialDrag(t,e),this.updateMainDrag(t,e))},N.updateMainDrag=function(t,e){function r(t,e){var r=t-w,n=e-M;return Math.sqrt(r*r+n*n)}function n(t,e){return Math.atan2(M-e,t-w)}function i(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function a(t,e){var r=R.cornerLen,n=R.cornerHalfWidth;if(0===t)return s(2*n,S);var a=r/t/2,o=e-a,l=e+a,c=Math.max(0,Math.min(t,x)),u=c-n,f=c+n;return"M"+i(u,o)+"A"+[u,u]+" 0,0,0 "+i(u,l)+"L"+i(f,l)+"A"+[f,f]+" 0,0,1 "+i(f,o)+"Z"}function o(t,e){var i=C+t,o=z+e,l=r(C,z),c=Math.min(r(i,o),x),u=n(C,z),f=n(i,o);lp?(l0==n>_[0]){F=p.range[1]=n,M.doTicks(s,o.radialAxis,!0),l["radial-grid"].attr("transform",u(h,d)).selectAll("path").attr("transform",null);var i=F-_[0],a=o.sectorBBox;o.xaxis.range=[a[0]*i,a[2]*i],o.yaxis.range=[a[1]*i,a[3]*i],o.xaxis.setScale(),o.yaxis.setScale();for(var f in o.traceHash){var m=o.traceHash[f],g=x.filterVisible(m),v=m[0][0].trace._module,k=s._fullLayout[o.id];if(v.plot(s,o,g,k),!y.traceIs(f,"gl"))for(var A=0;Ao&&(o+=360);var s,c,u=P(I(t.rad)),f=u+360;return n[1]>=n[0]?(s=n[0],c=n[1]):(s=n[1],c=n[0]),i>=s&&i<=c&&(l(e)||u>=a&&u<=o||f>=a&&f<=o)},N.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../constants/alignment":716,"../../lib":743,"../../lib/setcursor":762,"../../plotly":784,"../../registry":873,"../cartesian/axes":789,"../cartesian/dragbox":797,"../cartesian/select":807,"../plots":852,"./constants":853,"./helpers":854,d3:128,tinycolor2:546}],865:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r,i){function a(t,e){return n.coerce(o,s,c,t,e)}for(var o,s,l=i.type,c=i.attributes,u=i.handleDefaults,f=i.partition||"x",h=e._subplots[l],d=h.length,p=0;p=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":618,"../../subplot_defaults":865,"./axis_defaults":869,"./layout_attributes":871}],871:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("./axis_attributes"),o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"./axis_attributes":868}],872:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=l._,u=t("../../components/color"),f=t("../../components/drawing"),h=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),m=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),x=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var _=n.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*x?i=(a=x)*w:a=(i=y)/w,o=g*i/y,s=v*a/x,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[_+2*k-b,b-_-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[_,b-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=d({},t.aaxis,{visible:!0,range:[_,b-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*w],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=d({},t.baxis,{visible:!0,range:[b-_-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=d({},t.caxis,{visible:!0,range:[b-_-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*w],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var z="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),l.clipDefRelative.select("path").attr("transform",null);var D="translate("+(r-S._offset)+","+(n+a)+")";l.layers.baxis.attr("transform",D),l.layers.bgrid.attr("transform",D);var I="translate("+(r+i/2)+","+n+")rotate(30)translate(0,-"+T._offset+")";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,-"+E._offset+")";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),f.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(m.doTicks(e,n,!0),m.doTicks(e,i,!0),m.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));this.layers["a-title"]=y.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:c(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var s=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;this.layers["b-title"]=y.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:c(e,"Click to enter Component B title"),attributes:{x:this.x0-s,y:this.y0+this.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),this.layers["c-title"]=y.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:c(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+s,y:this.y0+this.h+.83*a.titlefont.size+s,"text-anchor":"middle"}})}};var M=b.MINZOOM/2+.87,k="m-0.87,.5h"+M+"v3h-"+(M+5.2)+"l"+(M/2+2.6)+",-"+(.87*M+4.5)+"l2.6,1.5l-"+M/2+","+.87*M+"Z",A="m0.87,.5h-"+M+"v3h"+(M+5.2)+"l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-2.6,1.5l"+M/2+","+.87*M+"Z",T="m0,1l"+M/2+","+.87*M+"l2.6,-1.5l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-"+(M/2+2.6)+","+(.87*M+4.5)+"l2.6,1.5l"+M/2+",-"+.87*M+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;_.initInteractions=function(){function t(t,e){return 1-e/O.h}function e(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function r(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function n(n,i){var a=m+n,o=y+i,s=Math.max(0,Math.min(1,t(0,y),t(0,o))),l=Math.max(0,Math.min(1,e(m,y),e(a,o))),c=Math.max(0,Math.min(1,r(m,y),r(a,o))),u=(s/2+c)*O.w,f=(1-s/2-l)*O.w,h=(u+f)/2,d=f-u,p=(1-s)*O.h,g=p-d/w;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),P.transition().style("opacity",1).duration(200),D=!0)}function a(){if(i(R),L!==_){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t),E&&R.data&&R._context.showTips&&(l.notifier(c(R,"Double-click to zoom back out"),"long"),E=!1)}}function h(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m,i=[(L={a:_.a-n,b:_.b+(r+n)/2,c:_.c-(r-n)/2}).a,L.b,L.c].sort(),a=i.indexOf(L.a),o=i.indexOf(L.b),s=i.indexOf(L.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),L={a:i[a],b:i[o],c:i[s]},e=(_.a-L.a)*O.yaxis._m,t=(_.c-L.c-_.b+L.b)*O.xaxis._m);var l="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",l);var c="translate("+-t+","+-e+")";O.clipDefRelative.select("path").attr("transform",c),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(f.hideOutsideRangePoints,O)}function d(){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t)}function p(){N.selectAll(".select-outline").remove()}var m,y,_,M,L,C,z,D,I,P,O=this,F=O.layers.plotbg.select("path").node(),R=O.graphDiv,N=R._fullLayout._zoomlayer,j={element:F,gd:R,plotinfo:{xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(t,e,r){j.xaxes=[O.xaxis],j.yaxes=[O.yaxis];var i=R._fullLayout.dragmode;t.shiftKey&&(i="pan"===i?"zoom":"pan"),j.minDrag="lasso"===i?1:void 0,"zoom"===i?(j.moveFn=n,j.doneFn=a,function(t,e,r){var n=F.getBoundingClientRect();m=e-n.left,y=r-n.top,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,M=O.aaxis.range[1]-_.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),z="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",D=!1,I=N.append("path").attr("class","zoombox").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),P=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}(0,e,r)):"pan"===i?(j.moveFn=h,j.doneFn=d,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,p()):"select"!==i&&"lasso"!==i||x(t,e,r,j,i)},clickFn:function(t,e){if(i(R),2===t){var r={};r[O.id+".aaxis.min"]=0,r[O.id+".baxis.min"]=0,r[O.id+".caxis.min"]=0,R.emit("plotly_doubleclick",null),s.relayout(R,r)}v.click(R,e,O.id)}};F.onmousemove=function(t){v.hover(R,t,O.id),R._fullLayout._lasthover=F,R._fullLayout._hoversubplot=O.id},F.onmouseout=function(t){R._dragging||g.unhover(R,t)},g.init(j)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../lib":743,"../../lib/extend":732,"../../plotly":784,"../cartesian/axes":789,"../cartesian/constants":794,"../cartesian/select":807,"../cartesian/set_convert":808,"../plots":852,d3:128,tinycolor2:546}],873:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=a.extendFlat,s=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,l=t.layout,c=s([],a),u=s({},l,n(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var h=Object.keys(u);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(w),w=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}(w),w=w.replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},{"../components/color":618,"../components/drawing":643,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],882:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&E>0&&(S<=F&&E<=R||S<=R&&E<=F||("h"===M?F>=S*(R/E):R>=E*(F/S)))?m="inside":(m="outside",A.remove(),A=null)}else m="inside";if(!A&&(A=d(e,k,"outside"===m?z:C),T=p.bBox(A.node()),S=T.width,E=T.height,S<=0||E<=0))A.remove();else{var N;N="outside"===m?function(t,e,r,n,a,o,s){var l,c="h"===o?Math.abs(n-r):Math.abs(e-t);c>2*w&&(l=w);var u=1;s&&(u="h"===o?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,h,d,p,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2;f=u*a.width,h=u*a.height,"h"===o?er?(d=(t+e)/2,p=n+l+h/2):(d=(t+e)/2,p=n-l-h/2);return i(m,g,d,p,u,!1)}(l,c,u,f,T,M,"both"===g.constraintext||"outside"===g.constraintext):function(t,e,r,n,a,o,s){var l,c,u,f,h,d=a.width,p=a.height,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*w&&y>2*w?(v-=2*(h=w),y-=2*h):h=0;var x,b;d<=v&&p<=y?(x=!1,b=1):d<=y&&p<=v?(x=!0,b=1):dr?(u=(t+e)/2,f=n-h-c/2):(u=(t+e)/2,f=n+h+c/2);return i(m,g,u,f,b,x)}(l,c,u,f,T,M,"both"===g.constraintext||"inside"===g.constraintext),A.attr("transform",N)}}}function i(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");return"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function a(t,e,r,n){var i=o((e=e||{}).family,r),a=o(e.size,r),l=o(e.color,r);return{family:s(t.family,i,n.family),size:function(t,e,r){if(c(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&ei;if(!a)return e}return void 0!==r?r:t.dflt}(t.size,a,n.size),color:function(t,e,r){return u(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function o(t,e){var r;return Array.isArray(t)?e=2?f(t):t>e?Math.ceil(t):Math.floor(t)}var g,v,y,x,b=r.p+(p?h[s]:h),_=b+r.w,w=r.b,M=w+r.s;if("h"===u.orientation?(y=a.c2p(b,!0),x=a.c2p(_,!0),g=i.c2p(w,!0),v=i.c2p(M,!0),r.ct=[v,(y+x)/2]):(g=i.c2p(b,!0),v=i.c2p(_,!0),y=a.c2p(w,!0),x=a.c2p(M,!0),r.ct=[(g+v)/2,x]),c(g)&&c(v)&&c(y)&&c(x)&&g!==v&&y!==x){var k=(r.mlw+1||u.marker.line.width+1||(r.trace?r.trace.marker.line.width:0)+1)-1,A=l.round(k/2%1,2);if(!t._context.staticPlot){var T=d.opacity(r.mc||u.marker.color)<1||k>.01?f:m;v=T(v,g=T(g,v)),x=T(x,y=T(y,x))}var S=l.select(this);S.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+g+","+y+"V"+x+"H"+v+"V"+y+"Z"),n(t,S,e,s,g,v,y,x)}else l.select(this).remove()})}),s.call(m.plot,e)}},{"../../components/color":618,"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/svg_text_utils":766,"./attributes":883,d3:128,"fast-isnumeric":140,tinycolor2:546}],891:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;ru+s||!p(l))&&(h=!0,c(f,t))}for(var i=r.traces,a=d(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,f=[l,u],h=!1,g=0;g1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){function e(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}var r,a=n.select(this);a.classed("bartext-inside")?r=s.insidetextfont:a.classed("bartext-outside")&&(r=s.outsidetextfont),r||(r=s.textfont),i.font(a,e("family"),e("size"),e("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":643,"../../components/errorbars":649,d3:128}],895:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],896:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../scatter/attributes":1066}],897:[function(t,e,r){"use strict";function n(t,e){return t.v-e.v}function i(t){return t.v}var a=t("fast-isnumeric"),o=t("../../lib"),s=o._,l=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,c,u,f,h,d=t._fullLayout,p=l.getFromId(t,e.xaxis||"x"),m=l.getFromId(t,e.yaxis||"y"),g=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=p,u="x",f=m,h="y"):(c=m,u="y",f=p,h="x");var y=c.makeCalcdata(e,u),x=function(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||a(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;var l=r.d2c(s,0,t[e+"calendar"]);return n.map(function(){return l})}(e,h,f,y,d[v]),b=o.distinctVals(x),_=b.vals,w=b.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var C=T[r].sort(n),z=C.map(i),D=z.length,I={pos:_[r],pts:C};I.min=z[0],I.max=z[D-1],I.mean=o.mean(z,D),I.sd=o.stdev(z,D,I.mean),I.q1=o.interp(z,.25),I.med=o.interp(z,.5),I.q3=o.interp(z,.75),I.lf=Math.min(I.q1,z[Math.min(o.findBin(2.5*I.q1-1.5*I.q3,z,!0)+1,D-1)]),I.uf=Math.max(I.q3,z[Math.max(o.findBin(2.5*I.q3-1.5*I.q1,z),0)]),I.lo=4*I.q1-3*I.q3,I.uo=4*I.q3-3*I.q1,g.push(I)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r0?(g[0].t={num:d[v],dPos:w,posLetter:h,valLetter:u,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete g[0].t.labels,d[v]++,g):[{t:{empty:!0}}]}},{"../../lib":743,"../../plots/cartesian/axes":789,"fast-isnumeric":140}],898:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a=r("y"),s=r("x");if(a&&a.length)i="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",r("y0")}o.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function i(t,e,r,n){var i=n.prefix,o=a.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",o||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),a.coerceSelectionMarkerOpacity(e,r)}var a=t("../../lib"),o=t("../../registry"),s=t("../../components/color"),l=t("./attributes");e.exports={supplyDefaults:function(t,e,r,o){function c(r,n){return a.coerce(t,e,l,r,n)}n(t,e,c,o),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",s.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),i(t,e,c,{prefix:"box"}))},handleSampleDefaults:n,handlePointsDefaults:i}},{"../../components/color":618,"../../lib":743,"../../registry":873,"./attributes":896}],899:[function(t,e,r){"use strict";function n(t,e,r,n){var i,c,u,f,h,d,p,m,g,v=t.cd,y=t.xa,x=t.ya,b=v[0].trace,_=v[0].t,w="violin"===b.type,M=[],k="closest"!==n||w?_.bdPos:2.5*_.bdPos,A=function(t){return t.pos+_.bPos-d};w&&"both"!==b.side?("positive"===b.side&&(g=function(t){var e=A(t);return s.inbox(e,e+k)}),"negative"===b.side&&(g=function(t){var e=A(t);return s.inbox(e-k,e)})):g=function(t){var e=A(t);return s.inbox(e-k,e+k)};var T;T=w?function(t){return s.inbox(t.span[0]-h,t.span[1]-h)}:function(t){return s.inbox(t.min-h,t.max-h)},"h"===b.orientation?(h=e,d=r,p=T,m=g,i="y",u=x,c="x",f=y):(h=r,d=e,p=g,m=T,i="x",u=y,c="y",f=x);var S=s.getDistanceFunction(n,p,m);if(s.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],L=b.line.color,C=(b.marker||{}).color;l.opacity(L)&&b.line.width?t.color=L:l.opacity(C)&&b.boxpoints?t.color=C:t.color=b.fillcolor,t[i+"0"]=u.c2p(E.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(E.pos+_.bPos+_.bdPos,!0),a.tickText(u,u.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var z={},D=["med","min","q1","q3","max"];(b.boxmean||(b.meanline||{}).visible)&&D.push("mean"),(b.boxpoints||b.points)&&D.push("lf","uf");for(var I=0;It.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*o,u=o*h,m=[],g=0;if(r.jitter){if(0===o)for(g=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(c.translatePoints,a,o)}function o(t,e,r,n){var i,a,o=e.pos,c=e.val,u=n.bPos,f=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(l.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+u,!0)+f,n=o.c2p(t.pos+u-i,!0)+f,l=o.c2p(t.pos+u+a,!0)+f,h=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?s.select(this).attr("d","M"+h+","+n+"V"+l+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+h+","+n+"L"+p+","+e+"Z":"")):s.select(this).attr("d","M"+n+","+h+"H"+l+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+h+"L"+e+","+p+"Z":""))})}var s=t("d3"),l=t("../../lib"),c=t("../../components/drawing"),u=2e9,f=5,h=.01;e.exports={plot:function(t,e,r){var n=t._fullLayout,l=e.xaxis,c=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e=t[0],r=e.t,u=e.trace,f=e.node3=s.select(this),h=n._numBoxes,d="group"===n.boxmode&&h>1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?h:1),m=d?2*r.dPos*((r.num+.5)/h-.5)*(1-n.boxgap):0,g=p*u.whiskerwidth;if(!0!==u.visible||r.empty)s.select(this).remove();else{var v,y;"h"===u.orientation?(v=c,y=l):(v=l,y=c),r.bPos=m,r.bdPos=p,r.wdPos=g,i(f,{pos:v,val:y},u,r),u.boxpoints&&a(f,{x:l,y:c},u,r),u.boxmean&&o(f,{pos:v,val:y},u,r)}})},plotBoxAndWhiskers:i,plotPoints:a,plotBoxMean:o}},{"../../components/drawing":643,"../../lib":743,d3:128}],904:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,z=E>0?Math.ceil:Math.floor,D=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,P=C(T+L),O=z(S-L),F=[[u=A(T)]];for(i=P;i*E=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],919:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,f,h,d,p,g,v=[],y=[],x={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,x.length=P,x.crossLength=I,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(h=t.dxydi([],n-1,o,0,s),v.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=P,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],c,i-1,u,1),v.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=r,x.axis=M,x.crossAxis=E,x.value=e,x.constvar=a,x.index=m,x.x=v,x.y=y,x.smoothing=E.smoothing,x}function s(e){var n,i,o,s,l,c=[],u=[],f={};if(f.length=w.length,f.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),f.xy=function(r){return t.evalxy([],r,e)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(x=w[u],b=w[y],l=0;lw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(f=5e-15,d=(h=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+f)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+f))].sort(function(t,e){return t-e}))[0],p=h[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":732,"../../plots/cartesian/axes":789}],920:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],936:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],l=r[0].trace,c=e.xaxis,h=e.yaxis,d=l.aaxis,p=l.baxis,m=t._fullLayout,g=e.plot.selectAll(".carpetlayer"),v=m._clips,y=n(g,"g","carpet"+l.uid).classed("trace",!0),x=n(y,"g","minorlayer"),b=n(y,"g","majorlayer"),_=n(y,"g","boundarylayer"),w=n(y,"g","labellayer");y.style("opacity",l.opacity),a(c,h,b,d,"a",d._gridlines),a(c,h,b,p,"b",p._gridlines),a(c,h,x,d,"a",d._minorgridlines),a(c,h,x,p,"b",p._minorgridlines),a(c,h,_,d,"a-boundary",d._boundarylines),a(c,h,_,p,"b-boundary",p._boundarylines);!function(t,e,r,n,i,a,o,l){var c,u,f,h;c=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],f=r.ab2xy(c,u,!0),h=r.dxyda_rough(c,u),s(t,e,r,n,f,h,r.aaxis,i,a,o,"a-title"),c=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),f=r.ab2xy(c,u,!0),h=r.dxydb_rough(c,u),s(t,e,r,n,f,h,r.baxis,i,a,l,"b-title")}(t,w,l,i,c,h,o(t,c,h,l,i,w,d._labels,"a-label"),o(t,c,h,l,i,w,p._labels,"b-label")),function(t,e,r,i,a){var o,s,l,c,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var d=n(h,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(c.font,i.font).text(i.text).call(d.convertToTspans,t),p=c.bBox(this);u.attr("transform","translate("+a.p[0]+","+a.p[1]+") rotate("+a.angle+")translate("+i.axis.labelpadding*s+","+.3*p.height+")"),f=Math.max(f,p.width+i.axis.labelpadding)}),u.exit().remove(),f}function s(t,e,r,n,i,a,o,s,u,f,p){var m=[];o.title&&m.push(o.title);var g=e.selectAll("text."+p).data(m);g.enter().append("text").classed(p,!0),g.each(function(){var e=h(r,s,u,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(f=0),f+=o.titlefont.size+o.titleoffset;l.select(this).text(o.title||"").call(d.convertToTspans,t).attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+f+")").classed("user-select-none",!0).attr("text-anchor","middle").call(c.font,o.titlefont)}),g.exit().remove()}var l=t("d3"),c=t("../../components/drawing"),u=t("./map_1d_array"),f=t("./makepath"),h=t("./orient_text"),d=t("../../lib/svg_text_utils");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},f.c2p=function(t){return t},h.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,f.smoothing,h.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t.xctrl,t.yctrl],f.smoothing,h.smoothing),t.dxydj=l([t.xctrl,t.yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,d,p,m=0,g=0,v=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(d=u-2,p=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,d,h,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,d,h,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":761,"./compute_control_points":923,"./constants":924,"./create_i_derivative_evaluator":925,"./create_j_derivative_evaluator":926,"./create_spline_evaluator":927}],938:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){function i(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&o0&&a1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":743}],939:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":981,"./has_columns":929}],940:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plots/attributes":787,"../scattergeo/attributes":1104}],941:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;cl&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":628,"../../lib":743,"./attributes":940}],943:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],944:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,f=u[0].trace,h=t.subplot;for(s=0;s")}(t,f,o,h.mockAxis),[t]}},{"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"./attributes":940}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":820,"../heatmap/colorbar":980,"./attributes":940,"./calc":941,"./defaults":942,"./event_data":943,"./hover":944,"./plot":946,"./select":947,"./style":948}],946:[function(t,e,r){"use strict";function n(t,e){for(var r=t[0].trace,n=t.length,i=s(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,s=t.geometry,l=s.coordinates,c=t.id,u=[];r="RUS"===c||"FJI"===c?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var s=o.tester(n);s.pts.pop(),u.push(s)}:function(t){u.push(o.tester(t))};switch(s.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,f=e._input.contours;if(c>u&&(s.start=f.start=u,u=s.end=f.end=c,c=s.start),!(s.size>0)){var h;h=c===u?1:n(c,u,e.ncontours).dtick,f.size=s.size=h}}return r}},{"../../lib":743,"../../plots/cartesian/axes":789,"../heatmap/calc":978}],951:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,f=c.size||1,h=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":622,"../../plots/plots":852,"./end_plus":955,"./make_color_map":959}],952:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],953:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,"contours.start"),o=n.coerce2(t,e,i,"contours.end"),s=!1===a||!1===o,l=r("contours.size");!(s?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{"../../lib":743,"./attributes":949}],954:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)):e.visible=!1}},{"../../lib":743,"../heatmap/has_columns":984,"../heatmap/xyz_defaults":993,"./attributes":949,"./contours_defaults":953,"./style_defaults":963}],955:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],956:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==l.BOTTOMSTART.indexOf(t)?i=1:-1!==l.LEFTSTART.indexOf(t)?n=1:-1!==l.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),g=[o(t,e,[-m[0],-m[1]])],v=m.join(","),y=t.z.length,x=t.z[0].length;for(f=0;f<1e4;f++){if(p>20?(p=l.CHOOSESADDLE[p][(m[0]||m[1])<0?0:1],t.crossings[d]=l.SADDLEREMAINDER[p]):delete t.crossings[d],!(m=l.NEWDELTA[p])){s.log("Found bad marching index:",p,e,t.level);break}g.push(o(t,e,m)),e[0]+=m[0],e[1]+=m[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),d=e.join(",");var b=m[0]&&(e[0]<0||e[0]>x-2)||m[1]&&(e[1]<0||e[1]>y-2);if(d===h&&m.join(",")===v||r&&b)break;p=t.crossings[d]}1e4===f&&s.log("Infinite loop in contour?");var _,w,M,k,A,T,S,E,L,C,z,D=n(g[0],g[g.length-1],a,c),I=0,P=.2*t.smoothing,O=[],F=0;for(f=1;f=F;f--)if((_=O[f])=F&&_+O[w]E&&L--,t.edgepaths[L]=z.concat(g,C));break}j||(t.edgepaths[E]=g.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r)return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208;return 15===r?0:r}((c=t[u]).level,s))&&(c.crossings[o]=l,-1!==i.indexOf(l)&&(c.starts.push([e,r]),p&&-1!==i.indexOf(l,i.indexOf(l)+1)&&c.starts.push([e,r])))}},{"./constants":952}],961:[function(t,e,r){"use strict";function n(t,e,n){var l=n[0].trace,c=n[0].x,u=n[0].y,g=l.contours,v=l.uid,y=e.xaxis,x=e.yaxis,b=t._fullLayout,_="contour"+v,w=function(t,e,r){for(var n=t.size,i=[],a=p(t),s=t.start;s1e3){o.warn("Too many contours, clipping at 1000",t);break}return i}(g,e,n[0]);if(!0!==l.visible)return b._paper.selectAll("."+_+",.hm"+v).remove(),void b._infolayer.selectAll(".cb"+v).remove();"heatmap"===g.coloring?(l.zauto&&!1===l.autocontour&&(l._input.zmin=l.zmin=g.start-g.size/2,l._input.zmax=l.zmax=l.zmin+w.length*g.size),f(t,e,[n])):(b._paper.selectAll(".hm"+v).remove(),b._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+v).remove()),h(w),d(w);var M=y.c2p(c[0],!0),k=y.c2p(c[c.length-1],!0),A=x.c2p(u[0],!0),T=x.c2p(u[u.length-1],!0),S=[[M,T],[k,T],[k,A],[M,A]],E=r.makeContourGroup(e,n,_);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(E,S,g),function(t,e,r,n){var o=t.selectAll("g.contourfill").data([0]);o.enter().append("g").classed("contourfill",!0);var s=o.selectAll("path").data("fill"===n.coloring?e:[]);s.enter().append("path"),s.exit().remove(),s.each(function(t){var e=i(t,r);e?a.select(this).attr("d",e).style("stroke","none"):a.select(this).remove()})}(E,w,S,g),function(t,e,n,i,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var f=!1!==l.showlines,h=l.showlabels,d=f&&h,p=r.createLines(u,f||h,e),g=r.createLineClip(u,d,n._fullLayout._clips,i.trace.uid),v=t.selectAll("g.contourlabels").data(h?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),h){var y=[c],x=[];o.clearLocationCache();var b=r.labelFormatter(l,i.t.cb,n._fullLayout),_=s.tester.append("text").attr("data-notex",1).call(s.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var A=Math.sqrt(w*w+M*M),T=m.LABELDISTANCE*A/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,b,_,n);a.select(this).selectAll("path").each(function(){var t=o.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/T),m.LABELMAX),i=0;i=0&&(c=x,f=h):Math.abs(l[1]-c[1])<.01?Math.abs(l[1]-x[1])<.01&&(x[0]-l[0])*(c[0]-x[0])>=0&&(c=x,f=h):o.log("endpt to newendpt is not vert. or horz.",l,c,x)}if(l=c,f>=0)break;m+="L"+c}if(f===t.edgepaths.length){o.log("unclosed perimeter path");break}g=f,(y=-1===v.indexOf(g))&&(g=v[0],m+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*a)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*a);if(h<1||d<1)return 1/0;var p=g.EDGECOST*(1/(h-1)+1/(d-1));p+=g.ANGLECOST*c*c;for(var m=s-u,v=l-f,y=s+u,x=l+f,b=0;b2*g.MAXCOST)break;d&&(s/=2),l=(a=c-s/2)+1.5*s}if(h<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=i*u,h=a*c,d=i*c,p=-a*u,m=[[o-f-h,s-d-p],[o+f-h,s+d-p],[o+f+h,s+d+p],[o-f+h,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;a.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(l.convertToTspans,r)}),i){for(var s="",c=0;cx.end&&(x.start=x.end=(x.start+x.end)/2),e._input.contours=a({},x)}else{var _=x.start,w=x.end,M=e._input.contours;if(_>w&&(x.start=M.start=w,w=x.end=M.end=_,_=x.start),!(x.size>0)){var k;k=_===w?1:n(_,w,e.ncontours).dtick,M.size=x.size=k}}return y}}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../carpet/lookup_carpetid":931,"../heatmap/clean_2d_array":979,"../heatmap/convert_column_xyz":981,"../heatmap/find_empties":983,"../heatmap/has_columns":984,"../heatmap/interp2d":987,"../heatmap/make_bound_array":988,"../heatmap/max_row_length":989,"./defaults":971}],966:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-1/0,f=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],967:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],968:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":967,"fast-isnumeric":140}],969:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":968,"fast-isnumeric":140}],970:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":743}],973:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../contour/colorbar":951,"../contour/style":962,"./attributes":964,"./calc":965,"./defaults":971,"./plot":976}],974:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function f(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,b=_):Math.abs(v[1]-y[1])=0&&(y=L,b=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(b>=0)break;M+=m(v,y),v=y}if(b===e.edgepaths.length){a.log("unclosed perimeter path");break}g=b,(A=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;U--)N=k.clipsegments[U],j=l([],N.x,L.c2p),B=l([],N.y,C.c2p),j.reverse(),B.reverse(),q.push(c(j,B,N.bicubic));var H="M"+q.join("L")+"Z";!function(t,e,r,n,i,a){var o,s,u,f,h=t.selectAll("g.contourbg").data([0]);h.enter().append("g").classed("contourbg",!0);var d=h.selectAll("path").data("fill"!==a||i?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(f=0;fx&&(n.max=x);n.len=n.max-n.min}(this,r,t,n,h,e.height),!(n.len<(e.width+e.height)*m.LABELMIN)))for(var s=Math.min(Math.ceil(n.len/D),m.LABELMAX),l=0;lz){r("x scale is not linear");break}}if(y.length&&"fast"===L){var D=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(D/100);for(w=0;wI){r("y scale is not linear");break}}}var P=u(_),O="scaled"===e.xtype?"":m,F=p(e,O,g,v,P,k),R="scaled"===e.ytype?"":y,N=p(e,R,x,b,_.length,A);E||(a.expand(k,F),a.expand(A,N));var j={x:F,y:N,z:_,text:e.text};if(S&&(j.xRanges=M.xRanges,j.yRanges=M.yRanges,j.pts=M.pts),s(e,_,"","z"),T&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=p(B,O,g,v,P,k),j.yfill=p(B,R,x,b,_.length,A)}return[j]}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../../registry":873,"../histogram2d/calc":1010,"./clean_2d_array":979,"./convert_column_xyz":981,"./find_empties":983,"./has_columns":984,"./interp2d":987,"./make_bound_array":988,"./max_row_length":989}],979:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,c;if(e){for(i=0,l=0;l=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":989}],984:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],985:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=b[0].length||d<0||d>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-x[0],r-x[x.length-1])>o)return;if(c){var T;for(k=[2*y[0]-y[1]],T=1;Tm&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":743}],988:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)b=m.c2p(T[k]),k--;for(b0;)M=g.c2p(S[k]),k--;if(M0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c){var l=a(e,i,o),u=a(r,i,o),f=t===s?0:1;return l[f]!==u[f]}return Math.floor(r/t)-Math.floor(e/t)>.1}(h,t,e,l,r,n))break;u=h}return u}function i(t,e){return e&&t>h?t>c?t>1.1*s?s:t>1.1*l?l:c:t>u?u:t>f?f:h:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r){var n=e.c2d(t,s,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var o=t("../../constants/numerical"),s=o.ONEAVGYEAR,l=o.ONEAVGMONTH,c=o.ONEDAY,u=o.ONEHOUR,f=o.ONEMIN,h=o.ONESEC,d=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,l,u=-1.1*e,f=-.1*e,h=t-f,p=r[0],m=r[1],g=Math.min(n(p+f,p+h,i,a),n(m+f,m+h,i,a)),v=Math.min(n(p+u,p+f,i,a),n(m+u,m+f,i,a));if(g>v&&vc){var y=o===s?1:6,x=o===s?"M12":"M1";return function(e,r){var n=i.c2d(e,s,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cp.size/1.9?p.size:p.size/Math.ceil(p.size/b);var T=p.start+(p.size-b)/2;_=T-b*Math.ceil((T-_)/b)}for(f=0;f=0&&w=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}(a,x.direction,x.currentbin);var Z=Math.min(i.length,a.length),J=[],K=0,Q=Z-1;for(r=0;r=K;r--)if(a[r]){Q=r;break}for(r=K;r<=Q;r++)if(o(i[r])&&o(a[r])){var $={p:i[r],s:a[r],b:0};x.enabled||($.pts=z[r],q?$.p0=$.p1=z[r].length?A[z[r][0]]:i[r]:($.p0=X(S[r]),$.p1=X(S[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=l.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),c(J,e),Array.isArray(e.selectedpoints)&&s.tagSelected(J,e,Y),J}}},{"../../constants/numerical":721,"../../lib":743,"../../plots/cartesian/axes":789,"../bar/arrays_to_calcdata":882,"./average":998,"./bin_functions":1e3,"./bin_label_vals":1001,"./clean_bins":1003,"./norm_functions":1008,"fast-isnumeric":140}],1003:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===a?o:1,h=c.size;if(n(h))c.size=h>0?Number(h):f;else if("string"!=typeof h)c.size=f;else{var d=h.charAt(0),p=h.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=f)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],1004:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return i.coerce(t,e,c,r,n)}var h=f("x"),d=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var p=f("orientation",d&&!h?"h":"v"),m=e["v"===p?"x":"y"];if(m&&m.length){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u);e["h"===p?"x":"y"]&&f("histfunc");o(t,e,f,"h"===p?["y"]:["x"]),s(t,e,f,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../components/color":618,"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../bar/style_defaults":895,"./attributes":997,"./bin_defaults":999}],1005:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;t.pointNumbers=a,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex;var o;if(r._indexToPoints){o=[];for(var s=0;sA&&g.splice(A,g.length-A),y.length>A&&y.splice(A,y.length-A),n(e,"x",g,m,_,M,x),n(e,"y",y,v,w,k,b);var T=[],S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,z=[],D=[],I=L?z:e.xbins,P=C?D:e.ybins,O=0,F=[],R=[],N=e.histnorm,j=e.histfunc,B=-1!==N.indexOf("density"),U="max"===j||"min"===j?null:0,V=c.count,q=u[N],H=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(H="avg"===j,V=c[j]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-l.tickIncrement(Z,X.size,!1,x))/1e6;for(r=Z;r=0&&d=0&&p0)o=c(t.alphahull,h);else{var d=["x","y","z"].indexOf(t.delaunayaxis);o=l(h.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:h,cells:o,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:f(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=function(t){return t.map(function(t){var e=t[0],r=s(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=i(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=i(t.facecolor)):(this.color=t.color,p.meshColor=f(t.color)),this.mesh.update(p)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=o({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":765,"alpha-shape":47,"convex-hull":109,"delaunay-triangulate":130,"gl-mesh3d":210,tinycolor2:546}],1022:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),f=c(["i","j","k"]);if(u){f&&f.forEach(function(t){for(var e=0;ei?r=!0:e1)){var f=a.simpleMap(u.x,e.d2c,0,r.xcalendar),h=a.distinctVals(f).minDiff;o=Math.min(o,h)}}for(o===1/0&&(o=1),c=0;c");S.push(o,o,o,o,o,o,null)},R=0;Rs&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),c.splice(s)),l=0;l0)&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),f=Math.min(f,o.values.length)),o._index=l,u.push(o));if(isFinite(f))for(l=0;lf&&(o.values=o.values.slice(0,f));return u}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var f={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",f),n.coerceFont(c,"tickfont",f),n.coerceFont(c,"rangefont",f)}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"../../lib":743,"./attributes":1031,"./constants":1035}],1037:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1031,"./base_plot":1032,"./calc":1033,"./colorbar":1034,"./defaults":1036,"./plot":1040}],1038:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function i(t,e,r,i,a,o){function s(c){var u;u=Math.min(i,a-c*i),o.offset=h*c*i,o.count=h*u,0===c&&(window.cancelAnimationFrame(r.currentRafs[l]),delete r.currentRafs[l],n(t,o.scissorX,o.scissorY,o.scissorWidth,o.viewBoxSize[1])),r.clearOnly||(e(o),c*i+u>>8*e)%256/255}function s(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i=f-4?o(s,f-2-l):.5);return i}(E,S,T,C),O=s(E,P),F=e.regl,R=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?p:a).concat(r))}return n}(w,M,Math.round(255*(M?z:1)))}),N=F({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:k?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:R,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),j=[0,1],B=[];return{setColorDomain:function(t){j[0]=t[0],j[1]=t[1]},render:function(t,e,a){var o,s,l,c=1/0,f=-1/0;for(o=0;of&&(f=t[o].dim2.canvasX,l=o),t[o].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t){return d.scale.linear().domain(i(t))}function s(t,e,r){var i=v(e),a=i.trace,s=i.lineColor,l=i.cscale,c=a.line,u=a.domain,p=a.dimensions,m=t.width,g=a.labelfont,y=a.tickfont,x=a.rangefont,b=h.extendDeep({},c,{color:s.map(o({values:s,range:[c.cmin,c.cmax]})),blockLineCount:f.blockLineCount,canvasOverdrag:f.overdrag*f.canvasPixelRatio}),_=Math.floor(m*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w;return{key:r,colCount:p.filter(n).length,dimensions:p,tickDistance:f.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return d.rgb(t)}),n="rgb".split("").map(function(t){return d.scale.linear().clamp(!0).domain(e).range(r.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return n.map(function(e){return e(t)})}}(l),lines:b,labelFont:g,tickFont:y,rangeFont:x,layoutWidth:m,layoutHeight:t.height,domain:u,translateX:u.x[0]*m,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*f.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:A*f.canvasPixelRatio,width:k,height:A,canvasPixelRatio:f.canvasPixelRatio}}function l(t){var e=t.width,r=t.height,a=t.dimensions,s=t.canvasPixelRatio,l=function(r){return e*r/Math.max(1,t.colCount-1)},c=f.verticalPadding/(r*s),u=1-2*c,h=function(t){return c+u*t},p={key:t.key,xScale:l,model:t},m={};return p.dimensions=a.filter(n).map(function(e,n){var a=o(e),c=m[e.label];m[e.label]=(c||0)+1;return{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:f.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(h),xScale:l,x:l(n),canvasX:l(n)*s,unitScale:function(t,e){return d.scale.linear().range([t-e,e])}(r,f.verticalPadding),domainScale:function(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?d.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(d.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):d.scale.linear().domain(n).range([t-e,e])}(r,f.verticalPadding,e),ordinalScale:function(t){var e=i(t);return t.tickvals&&d.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function c(t){t.classed(f.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var u=t("./lines"),f=t("./constants"),h=t("../../lib"),d=t("d3"),p=t("../../components/drawing"),m=t("../../lib/gup").keyFun,g=t("../../lib/gup").repeat,v=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i,o){function y(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function x(t,e){return(f.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,f={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==L&&(c?o.hover(f):o.unhover&&o.unhover(f),L=u)}}),S.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var C=e.selectAll("."+f.cn.parcoords).data(T,m);C.exit().remove(),C.enter().append("g").classed(f.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(g,m);e.enter().append("defs");var r=e.selectAll("#"+f.id.filterBarPattern).data(g,m);r.enter().append("pattern").attr("id",f.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-f.bar.width).attr("width",f.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(g,m);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",f.bar.width).attr("x",f.bar.width/2).attr("fill",f.bar.fillcolor).attr("fill-opacity",f.bar.fillopacity).attr("stroke",f.bar.strokecolor).attr("stroke-opacity",f.bar.strokeopacity).attr("stroke-width",f.bar.strokewidth)}),C.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var z=C.selectAll("."+f.cn.parcoordsControlView).data(g,m);z.enter().append("g").classed(f.cn.parcoordsControlView,!0).style("box-sizing","content-box"),z.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var D=z.selectAll("."+f.cn.yAxis).data(function(t){return t.dimensions},m);D.enter().append("g").classed(f.cn.yAxis,!0).each(function(t){E.dimensions.push(t)}),z.each(function(t){x(D,t)}),S.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=u(this,t,f.scatter),t.viewModel[t.key]=t.lineLayer,E.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),D.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),D.call(d.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;A=!1,k||(t.x=Math.max(-f.overdrag,Math.min(t.model.width+f.overdrag,d.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,D.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),x(D,e),D.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),d.select(this).attr("transform","translate("+t.x+", 0)"),D.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;k?"ending"===k&&(k=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,x(D,e),d.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),D.exit().remove();var I=D.selectAll("."+f.cn.axisOverlays).data(g,m);I.enter().append("g").classed(f.cn.axisOverlays,!0),I.selectAll("."+f.cn.axis).remove();var P=I.selectAll("."+f.cn.axis).data(g,m);P.enter().append("g").classed(f.cn.axis,!0),P.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),p.font(P.selectAll("text"),t.model.tickFont)}),P.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),P.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var O=I.selectAll("."+f.cn.axisHeading).data(g,m);O.enter().append("g").classed(f.cn.axisHeading,!0);var F=O.selectAll("."+f.cn.axisTitle).data(g,m);F.enter().append("text").classed(f.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-f.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){p.font(F,t.model.labelFont)});var R=I.selectAll("."+f.cn.axisExtent).data(g,m);R.enter().append("g").classed(f.cn.axisExtent,!0);var N=R.selectAll("."+f.cn.axisExtentTop).data(g,m);N.enter().append("g").classed(f.cn.axisExtentTop,!0),N.attr("transform","translate(0,"+-f.axisExtentOffset+")");var j=N.selectAll("."+f.cn.axisExtentTopText).data(g,m);j.enter().append("text").classed(f.cn.axisExtentTopText,!0).call(c),j.text(function(t){return b(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){p.font(j,t.model.rangeFont)});var B=R.selectAll("."+f.cn.axisExtentBottom).data(g,m);B.enter().append("g").classed(f.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+f.axisExtentOffset)+")"});var U=B.selectAll("."+f.cn.axisExtentBottomText).data(g,m);U.enter().append("text").classed(f.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(c),U.text(function(t){return b(t)(t.domainScale.domain()[0])}).each(function(t){p.font(U,t.model.rangeFont)});var V=I.selectAll("."+f.cn.axisBrush).data(g,m),q=V.enter().append("g").classed(f.cn.axisBrush,!0);V.each(function(t){t.brush||(t.brush=d.svg.brush().y(t.unitScale).on("brushstart",_).on("brush",w).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),d.select(this).call(t.brush))}),q.selectAll("rect").attr("x",-f.bar.capturewidth/2).attr("width",f.bar.capturewidth),q.selectAll("rect.extent").attr("fill","url(#"+f.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),q.selectAll(".resize rect").attr("height",f.bar.handleheight).attr("opacity",0).style("visibility","visible"),q.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",f.bar.handleoverlap-f.bar.handleheight),q.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",f.bar.handleoverlap);var H=!1,G=!1;return E}},{"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1035,"./lines":1038,d3:128}],1040:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},f=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1039,regl:506}],1041:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../plots/domain_attributes"),s=t("../../lib/extend").extendFlat,l=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},l,{}),insidetextfont:s({},l,{}),outsidetextfont:s({},l,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1042:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n")}}return y};var l},{"../../components/color":618,"./helpers":1046,"fast-isnumeric":140,tinycolor2:546}],1044:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),h=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),h&&"none"!==h){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":743,"./attributes":1041}],1045:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":657}],1046:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}var a=t("d3"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./helpers"),f=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,f=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===f.indexOf(s.scalegroup)&&f.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}(e),h.each(function(){var h=a.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove();var m=[[[],[]],[[],[]]],g=!1;h.each(function(e){function s(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)a.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var h=d.cx,v=d.cy,y=a.select(this),x=y.selectAll("path.surface").data([e]),b=!1,_=!1;if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==i.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=o.castHoverinfo({hoverinfo:[u.castOption(l,e.pts)],_module:p._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var c=n(e,d),m=h+e.pxmid[0]*(1-c),g=v+e.pxmid[1]*(1-c),y=r.separators,x=[];if(-1!==l.indexOf("label")&&x.push(e.label),-1!==l.indexOf("text")){var w=u.castOption(s.hovertext||s.text,e.pts);w&&x.push(w)}-1!==l.indexOf("value")&&x.push(u.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&x.push(u.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;o.loneHover({x0:m-c*d.r,x1:m+c*d.r,y:g,text:x.join("
"),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:u.castOption(M.bgcolor,e.pts)||e.color,borderColor:u.castOption(M.bordercolor,e.pts),fontFamily:u.castOption(k.family,e.pts),fontSize:u.castOption(k.size,e.pts),fontColor:u.castOption(k.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[f(e,s)],event:a.event}),_=!0}}).on("mouseout",function(r){var n=t._fullLayout,i=t._fullData[p.index];_&&(r.originalEvent=a.event,t.emit("plotly_unhover",{points:[f(e,i)],event:a.event}),_=!1),b&&(o.loneUnhover(n._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,n=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[f(e,n)],o.click(t,a.event))}),p.pull){var w=+u.castOption(p.pull,e.pts)||0;w>0&&(h+=w*e.pxmid[0],v+=w*e.pxmid[1])}e.cxFinal=h,e.cyFinal=v;var M=p.hole;if(e.v===d.vTotal){var k="M"+(h+e.px0[0])+","+(v+e.px0[1])+s(e.px0,e.pxmid,!0,1)+s(e.pxmid,e.px0,!0,1)+"Z";M?x.attr("d","M"+(h+M*e.px0[0])+","+(v+M*e.px0[1])+s(e.px0,e.pxmid,!1,M)+s(e.pxmid,e.px0,!1,M)+"Z"+k):x.attr("d",k)}else{var A=s(e.px0,e.px1,!0,1);if(M){var T=1-M;x.attr("d","M"+(h+M*e.px1[0])+","+(v+M*e.px1[1])+s(e.px1,e.px0,!1,M)+"l"+T*e.px0[0]+","+T*e.px0[1]+A+"Z")}else x.attr("d","M"+h+","+v+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var S=u.castOption(p.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=a.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,"outside"===S?p.outsidetextfont:p.insidetextfont).call(c.convertToTspans,t);var o,s=l.bBox(r.node());"outside"===S?o=i(s,e):(o=function(t,e,r){var i=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=n(e,r),c={scale:l*r.r*2/i,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>h.scale?g:h;return c.scale<1&&v.scale>c.scale?v:c}(s,e,d),"auto"===S&&o.scale<1&&(r.call(l.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(s=l.bBox(r.node())),o=i(s,e)));var u=h+e.pxmid[0]*o.rCenter+(o.x||0),f=v+e.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(e.yLabelMin=f-s.height/2,e.yLabelMid=f,e.yLabelMax=f+s.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+u+","+f+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}}),g&&function(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,d=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),p=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,v=t.cyFinal+c(t.px0[1],t.px1[1]),y=d-p;if(y*h>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(i=0;i=(u.castOption(e.pull,a.pts)||0)||((t.pxmid[1]-a.pxmid[1])*h>0?(y=a.cyFinal+c(a.px0[1],a.px1[1])-p-t.labelExtraY)*h>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*h>0&&(n=3*f*Math.abs(i-m.indexOf(t)),(s=a.cxFinal+l(a.px0[0],a.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*f>0&&(t.labelExtraX+=s)))}var a,o,s,l,c,f,h,d,p,m,g,v,y;for(o=0;o<2;o++)for(s=o?r:n,c=o?Math.max:Math.min,h=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,f=a?1:-1,(d=t[o][a]).sort(s),p=t[1-o][a],m=p.concat(d),v=[],g=0;gMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(s.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){h.selectAll("tspan").each(function(){var t=a.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":618,"../../components/drawing":643,"../../components/fx":660,"../../lib/svg_text_utils":766,"./event_data":1045,"./helpers":1046,d3:128}],1051:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1052,d3:128}],1052:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":618,"./helpers":1046}],1053:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scatter/attributes":1066}],1054:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),o=t("../scatter/get_trace_color"),s=["xaxis","yaxis"],l=n.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,i,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);if(h)r=h;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=a(t.marker.color),m=a(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,x/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[s[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new n(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":765,"../scatter/get_trace_color":1076,"gl-pointcloud2d":235}],1055:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":743,"./attributes":1053}],1056:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":829,"../scatter3d/calc":1092,"./attributes":1053,"./convert":1054,"./defaults":1055}],1057:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain_attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;e.exports=c({hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":617,"../../components/fx/attributes":652,"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1058:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":661,"../../plot_api/edit_types":773,"../../plots/get_data":826,"./plot":1063}],1059:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":743,"../../lib/gup":740,"strongly-connected-components":537}],1060:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1061:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color/attributes").defaults,o=t("../../components/color"),s=t("tinycolor2");e.exports=function(t,e,r,l){function c(r,a){return n.coerce(t,e,i,r,a)}c("node.label"),c("node.pad"),c("node.thickness"),c("node.line.color"),c("node.line.width");c("node.color",e.node.label.map(function(t,e){return o.addOpacity(function(t){return a[t%a.length]}(e),.8)})),c("link.label"),c("link.source"),c("link.target"),c("link.value"),c("link.line.color"),c("link.line.width"),c("link.color",e.link.value.map(function(){return s(l.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),c("domain.x"),c("domain.y"),c("orientation"),c("valueformat"),c("valuesuffix"),c("arrangement"),n.coerceFont(c,"textfont",n.extendFlat({},l.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":618,"../../components/color/attributes":617,"../../lib":743,"./attributes":1057,tinycolor2:546}],1062:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1057,"./base_plot":1058,"./calc":1059,"./defaults":1061,"./plot":1063}],1063:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+x.sankeyNode).filter(l(t)).call(c)}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(x.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),x=t("./constants").cn,b=y._;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=b(t,"source:")+" ",y=b(t,"target:")+" ",_=b(t,"incoming flow count:")+" ",w=b(t,"outgoing flow count:")+" ";m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,r,n){p.select(e).call(f.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,c=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left+u.width/2,h=u.top+u.height/2,m=g.loneHover({x:f-c.left,y:h-c.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",l+i.link.source.label,y+i.link.target.label].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},unhover:function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())},select:function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(u,r,n),g.click(t,{target:!0})}}})}},{"../../components/color":618,"../../components/fx":660,"../../lib":743,"./constants":1060,"./render":1064,d3:128}],1064:[function(t,e,r){"use strict";function n(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function i(t){return function(e){return e.node.originalX===t.node.originalX}}function a(t){for(var e=0;e1||t.linkLineWidth>0}function h(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function d(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function p(t){return w.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+_.nodeTextOffsetHorizontal:_.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-_.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-_.nodeTextOffsetHorizontal,0]])}function m(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function g(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function v(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function y(t){return t.horizontal&&t.left?"100%":"0%"}function x(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function b(t,e,r){var a=w.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(E.raiseToTop(this),a.interactionState.dragInProgress=a.node,n(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+Math.floor(a.node.originalX);a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=S.forceSimulation(n).alphaDecay(0).force("collide",S.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(_.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}(0,e,n,r)).stop()}(0,o,a),function(t,e,r,n){window.requestAnimationFrame(function a(){for(var o=0;o<_.forceTicksPerFrame;o++)r.forceLayouts[n].tick();r.sankey.relayout(),c(t.filter(i(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,a,o)}}).on("drag",function(r){if("fixed"!==r.arrangement){var a=w.event.x,o=w.event.y;"snap"===r.arrangement?(r.node.x=a,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=a),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),n(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),c(t.filter(i(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}var _=t("./constants"),w=t("d3"),M=t("tinycolor2"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("@plotly/d3-sankey").sankey,S=t("d3-force"),E=t("../../lib"),L=t("../../lib/gup").keyFun,C=t("../../lib/gup").repeat,z=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n){var i=t.selectAll("."+_.cn.sankey).data(e.filter(function(t){return z(t).trace.visible}).map(function(t,e,r){for(var n,i=z(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,u="h"===i.orientation,f=i.node.pad,h=i.node.thickness,d=i.node.line.color,p=i.node.line.width,m=i.link.line.color,g=i.link.line.width,v=i.valueformat,y=i.valuesuffix,x=i.textfont,b=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{pointNumber:e,label:t,color:E.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{pointNumber:e,label:l.label[e],color:E.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),A=T().size(u?[b,w]:[w,b]).nodeWidth(h).nodePadding(f).nodes(M).links(k).layout(_.sankeyIterations),S=A.nodes(),L=0;L5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),R.transition().ease(_.ease).duration(_.duration).attr("startOffset",y).style("fill",v)}},{"../../components/color":618,"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1060,"@plotly/d3-sankey":41,d3:128,"d3-force":124,tinycolor2:546}],1065:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;re&&l.splice(e,l.length-e),l.map(r)}return r(n.size)}}var i=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("./subtypes"),l=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),h=r.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=Math.min(h.length,d.length);r._minDtick=0,f._minDtick=0,h.length>p&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0},v=n(e,p);v&&(m.ppad=g.ppad=v),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(s.hasMarkers(e)||s.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,a.expand(r,h,m),a.expand(f,d,g);for(var y=new Array(p),x=0;x=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1070:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1071:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":625,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1072:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1073:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=(F=z[L][1])>=H&&(I=z[L-1][0],P=z[L][0],F-O&&(D=I+(P-I)*(H-O)/(F-O),B=Math.min(B,D),U=Math.max(U,D)));B=Math.max(B,0),U=Math.min(U,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),n.extendFlat(t,{distance:c+10,x0:B,x1:U,y0:H,y1:H,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":618,"../../components/errorbars":649,"../../components/fx":660,"../../lib":743,"./fill_hover_text":1074,"./get_trace_color":1076}],1078:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"./arrays_to_calcdata":1065,"./attributes":1066,"./calc":1067,"./clean_data":1069,"./colorbar":1070,"./defaults":1073,"./hover":1077,"./plot":1085,"./select":1086,"./style":1087,"./subtypes":1088}],1079:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],1080:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=t[e],i=P.c2p(r.x),a=O.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function l(t){var e=t[0]/P._length,r=t[1]/O._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=nt[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)tt||t[1]rt)return[o(t[0],$,tt),o(t[1],et,rt)]}function h(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function d(t,e){var r=[],n=f(t),i=f(e);return n&&i&&h(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=f(n),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){(o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c}return l}}function m(t){var e=t[0],r=t[1],n=e===q[H-1][0],i=r===q[H-1][1];if(!n||!i)if(H>1){var a=e===q[H-2][0],o=r===q[H-2][1];n&&(e===$||e===tt)&&a?o?H--:q[H-1]=t:i&&(r===et||r===rt)&&o?a?H--:q[H-1]=t:q[H++]=t}else q[H++]=t}function g(t){q[H-1][0]!==t[0]&&q[H-1][1]!==t[1]&&m([W,X]),m(t),Z=null,W=X=0}function v(t){if(G=t[0]<$?$:t[0]>tt?tt:0,Y=t[1]rt?rt:0,G||Y){if(H)if(Z){var e=K(Z,t);e.length>1&&(g(e[0]),q[H++]=e[1])}else J=K(q[H-1],t)[0],q[H++]=J;else q[H++]=[G||t[0],Y||t[1]];var r=q[H-1];G&&Y&&(r[0]!==G||r[1]!==Y)?(Z&&(W!==G&&X!==Y?m(W&&X?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?$:tt,rt]:[n>0?tt:$,et]}(Z,t):[W||G,X||Y]):W&&X&&m([W,X])),m([G,Y])):W-G&&X-Y&&m([G||W,Y||X]),Z=t,W=G,X=Y}else Z&&g(K(Z,t)[0]),q[H++]=t}var y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P=e.xaxis,O=e.yaxis,F=e.simplify,R=e.connectGaps,N=e.baseTolerance,j=e.shape,B="linear"===j,U=[],V=s.minTolerance,q=new Array(t.length),H=0;F||(N=V=-1);var G,Y,W,X,Z,J,K,Q=s.maxScreensAway,$=-P._length*Q,tt=P._length*(1+Q),et=-O._length*Q,rt=O._length*(1+Q),nt=[[$,et,tt,et],[tt,et,tt,rt],[tt,rt,$,rt],[$,rt,$,et]];for("linear"===j||"spline"===j?K=u:"hv"===j||"vh"===j?K=d:"hvh"===j?K=p(0,$,tt):"vhv"===j&&(K=p(1,et,rt)),y=0;yl(M))break;b=M,(C=T[0]*A[0]+T[1]*A[1])>E?(E=C,_=M,k=!1):C=t.length||!M)break;v(M),x=M}}else v(_)}Z&&m([W||Z[0],X||Z[1]]),U.push(q.slice(0,H))}return U}},{"../../constants/numerical":721,"../../lib":743,"./constants":1072}],1081:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1082:[function(t,e,r){"use strict";e.exports=function(t,e,r){for(var n,i=null,a=0;a0?Math.max(e,i):0}}},{"fast-isnumeric":140}],1084:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;if(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1085:[function(t,e,r){"use strict";function n(t,e,r,n,u,h,d){function p(t){return _?t.transition():t}function m(t){return t.filter(function(t){return t.vis})}function g(t){return t.id}function v(){return!1}function y(e){var n,s=e[0].trace,c=i.select(this),u=l.hasMarkers(s),f=l.hasText(s),h=function(t){if(t.ids)return g}(s),d=v,y=v;u&&(d=s.marker.maxdisplayed||s._needsCull?m:a.identity),f&&(y=s.marker.maxdisplayed||s._needsCull?m:a.identity);var x=(n=c.selectAll("path.point").data(d,h)).enter().append("path").classed("point",!0);_&&x.call(o.pointStyle,s,t).call(o.translatePoints,w,M).style("opacity",0).transition().style("opacity",1);var b=u&&o.tryColorscale(s.marker,""),k=u&&o.tryColorscale(s.marker,"line");n.order(),n.each(function(e){var n=i.select(this),a=p(n);o.translatePoint(e,a,w,M)?(o.singlePointStyle(e,a,s,b,k,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,w,M,s.xcalendar,s.ycalendar),s.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),_?n.exit().transition().style("opacity",0).remove():n.exit().remove(),(n=c.selectAll("g").data(y,h)).enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=i.select(this),n=p(e.select("text"));o.translatePoint(t,n,w,M)?r.layerClipId&&o.hideOutsideRangePoint(t,e,w,M,s.xcalendar,s.ycalendar):e.remove()}),n.selectAll("text").call(o.textPointStyle,s,t).each(function(t){var e=w.c2p(t.x),r=M.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){p(i.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var x,b;!function(t,e,r,n,o){var s=r.xaxis,c=r.yaxis,u=i.extent(a.simpleMap(s.range,s.r2c)),f=i.extent(a.simpleMap(c.range,c.r2c)),h=n[0].trace;if(!l.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0,w=r.xaxis,M=r.yaxis,k=n[0].trace,A=k.line,T=i.select(h);if(T.call(s.plot,r,d),!0===k.visible){p(T).style("opacity",k.opacity);var S,E,L=k.fill.charAt(k.fill.length-1);"x"!==L&&"y"!==L&&(L=""),n[0].node3=T;var C="",z=[],D=k._prevtrace;D&&(C=D._prevRevpath||"",E=D._nextFill,z=D._polygons);var I,P,O,F,R,N,j,B,U,V="",q="",H=[],G=a.noop;if(S=k._ownFill,l.hasLines(k)||"none"!==k.fill){for(E&&E.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(A.shape)?(O=o.steps(A.shape),F=o.steps(A.shape.split("").reverse().join(""))):O=F="spline"===A.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),A.smoothing):o.smoothopen(t,A.smoothing)}:function(t){return"M"+t.join("L")},R=function(t){return F(t.reverse())},H=c(n,{xaxis:w,yaxis:M,connectGaps:k.connectgaps,baseTolerance:Math.max(A.width||1,3)/4,shape:A.shape,simplify:A.simplify}),U=k._polygons=new Array(H.length),b=0;b1){var r=i.select(this);if(r.datum(n),t)p(r.style("opacity",0).attr("d",I).call(o.lineGroupStyle)).style("opacity",1);else{var a=p(r);a.attr("d",I),o.singleLineStyle(n,a)}}}}}var Y=T.selectAll(".js-line").data(H);p(Y.exit()).style("opacity",0).remove(),Y.each(G(!1)),Y.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(G(!0)),o.setClipUrl(Y,r.layerClipId),H.length&&(S?N&&B&&(L?("y"===L?N[1]=B[1]=M.c2p(0,!0):"x"===L&&(N[0]=B[0]=w.c2p(0,!0)),p(S).attr("d","M"+B+"L"+N+"L"+V.substr(1)).call(o.singleFillStyle)):p(S).attr("d",V+"Z").call(o.singleFillStyle)):"tonext"===k.fill.substr(0,6)&&V&&C&&("tonext"===k.fill?p(E).attr("d",V+"Z"+C+"Z").call(o.singleFillStyle):p(E).attr("d",V+"L"+C.substr(1)+"Z").call(o.singleFillStyle),k._polygons=k._polygons.concat(z)),k._prevRevpath=q,k._prevPolygons=U);var W=T.selectAll(".points");x=W.data([n]),W.each(y),x.enter().append("g").classed("points",!0).each(y),x.exit().remove(),x.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(i.select(this),e?null:r.layerClipId)})}}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./line_points"),u=t("./link_traces"),f=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,c,f,h,d=e.plot.select("g.scatterlayer"),p=!a,m=!!a&&a.duration>0;for((f=d.selectAll("g.trace").data(r,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),u(t,e,r),function(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=i.select(this);if((n=t[0].trace)._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,d,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),m){s&&(h=s());i.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)})})}else d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)});p&&f.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/polygon":755,"./line_points":1080,"./link_traces":1082,"./subtypes":1088,d3:128}],1086:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}(e.textposition),r.textColor=g(e.textfont,1,S),r.textSize=o(e.textfont.size,S,p.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var D=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var I=e.projection[D[n]];(r.project[n]=I.show)&&(r.projectOpacity[n]=I.opacity,r.projectScale[n]=I.scale)}r.errorBounds=b(e,d);var P=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=m(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=P.color,r.errorLineWidth=P.lineWidth,r.errorCapSize=P.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=m(e.surfacecolor),r}function l(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}var c=t("gl-line3d"),u=t("gl-scatter3d"),f=t("gl-error3d"),h=t("gl-mesh3d"),d=t("delaunay-triangulate"),p=t("../../lib"),m=t("../../lib/str2rgbarray"),g=t("../../lib/gl_format_color"),v=t("../scatter/make_bubble_size_func"),y=t("../../constants/gl3d_dashes"),x=t("../../constants/gl3d_markers"),b=t("./calc_errors"),_=n.prototype;_.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},_.update=function(t){var e,r,n,i,a=this.scene.glplot.gl,o=y.solid;this.data=t;var p=s(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in y&&(o=y[p.lineDashes]),this.color=l(p.scatterColor)||l(p.lineColor),this.dataPoints=p.position,e={gl:a,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:o[0],dashScale:o[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=c(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var m=t.opacity;if(t.marker&&t.marker.opacity&&(m*=t.marker.opacity),r={gl:a,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:m,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=u(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),i={gl:a,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(i):(this.textMarkers=u(i),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=f(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n=0&&h("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];h(v+".show")&&(h(v+".opacity"),h(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../scatter/line_defaults":1079,"../scatter/marker_defaults":1084,"../scatter/subtypes":1088,"../scatter/text_defaults":1089,"./attributes":1091}],1096:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":719,"../../plots/gl3d":832,"../scatter/colorbar":1070,"./attributes":1091,"./calc":1092,"./convert":1094,"./defaults":1095}],1097:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1098:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e.a.length,d=new Array(h),p=!1;for(c=0;c0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(h.hi||d.hoverinfo).split("+"),g=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,h.a),-1!==m.indexOf("b")&&a(p.baxis,h.b);var v=p.ab2ij([h.a,h.b]),y=Math.floor(v[0]),x=v[0]-y,b=Math.floor(v[1]),_=v[1]-b,w=p.evalxy([],y,b,x,_);return g.push("y: "+w[1].toFixed(3)),s.extraText=g.join("
"),o}}},{"../scatter/hover":1077}],1102:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1097,"./calc":1098,"./defaults":1099,"./event_data":1100,"./hover":1101,"./plot":1103}],1103:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}(u,g,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076,"./attributes":1104}],1109:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":820,"../scatter/colorbar":1070,"./attributes":1104,"./calc":1105,"./defaults":1106,"./event_data":1107,"./hover":1108,"./plot":1110,"./select":1111,"./style":1112}],1110:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");e.exports=function(t,e,r){function f(t,e){t.lonlat[0]===a&&n.select(e).remove()}for(var h=0;h1,f=r.error_x&&!0===r.error_x.visible,h=r.error_y&&!0===r.error_y.visible,p=f||h,m=d.hasMarkers(r),x=!!r.fill&&"none"!==r.fill);var E,L,C,z,D,I,O,F,R=p?l.calcFromTrace(r,b):null;if(f){(C={}).positions=n;var N=new Float64Array(4*_);if("log"===T.type)for(o=0;o<_;++o)N[k++]=n[2*o]-T.d2l(R[o].xs)||0,N[k++]=T.d2l(R[o].xh)-n[2*o]||0,N[k++]=0,N[k++]=0;else for(o=0;o<_;++o)N[k++]=n[2*o]-R[o].xs||0,N[k++]=R[o].xh-n[2*o]||0,N[k++]=0,N[k++]=0;r.error_x.copy_ystyle&&(r.error_x=r.error_y),C.errors=N,C.capSize=2*r.error_x.width,C.lineWidth=r.error_x.thickness,C.color=r.error_x.color}if(h){(z={}).positions=n;var j=new Float64Array(4*_);if("log"===S.type)for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-S.d2l(R[o].ys)||0,j[A++]=S.d2l(R[o].yh)-n[2*o+1]||0;else for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-R[o].ys||0,j[A++]=R[o].yh-n[2*o+1]||0;z.errors=j,z.capSize=2*r.error_y.width,z.lineWidth=r.error_y.thickness,z.color=r.error_y.color}if(s){(E={}).thickness=r.line.width,E.color=r.line.color,E.opacity=r.opacity,E.overlay=!0;var B=(v[r.line.dash]||[1]).slice();for(o=0;oP?"rect":m?"rect":"round",U&&r.connectgaps){var V=F[0],q=F[1];for(o=0;os&&(A[0]=s),A[1]l&&(T[0]=l),T[1]=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),h=e-f;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([h,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+f,p[1]],g=c.c2p(m),v=u.c2p(m),y=d.mrc||1;return t.x0=g-y,t.x1=g+y,t.y0=v-y,t.y1=v+y,t.color=i(l,d),t.extraText=function(t,e,r){function n(t){return t+"\xb0"}var i=(e.hi||t.hoverinfo).split("+"),o=-1!==i.indexOf("all"),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),c=e.lonlat,u=[];return o||s&&l?u.push("("+n(c[0])+", "+n(c[1])+")"):s?u.push(r.lon+n(c[0])):l&&u.push(r.lat+n(c[1])),(o||-1!==i.indexOf("text"))&&a(e,t,u),u.join("
")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076}],1121:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){if(e){e[0].trace._glTrace.update(e)}},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":846,"../scatter/colorbar":1070,"../scattergeo/calc":1105,"./attributes":1116,"./defaults":1118,"./event_data":1119,"./hover":1120,"./plot":1122,"./select":1123}],1122:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1117}],1123:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(!n.hasMarkers(h))return[];if(!1===e)for(s=0;s")}var i=t("../scatter/hover"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports={hoverPoints:function(t,e,r,a){var o=i(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtWithinSector(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,s.extraText=n(c,u,l),o}},makeHoverPointText:n}},{"../../lib":743,"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1128:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":855,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1124,"./calc":1125,"./defaults":1126,"./hover":1127,"./plot":1129}],1129:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var a,o,s,l={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.circle:null},c=e.radialAxis,u=c.range;for(s=u[0]>u[1]?function(t){return t<=0}:function(t){return t>=0},a=0;a=0?(g=o.c2r(m)-l[0],y=d(v),E[p]=S[2*p]=g*Math.cos(y),L[p]=S[2*p+1]=g*Math.sin(y)):E[p]=L[p]=S[2*p]=S[2*p+1]=NaN;var C=a.sceneOptions(t,e,b,S);C.fill&&!u.fill2d&&(u.fill2d=!0),C.marker&&!u.scatter2d&&(u.scatter2d=!0),C.line&&!u.line2d&&(u.line2d=!0),!C.errorX&&!C.errorY||u.error2d||(u.error2d=!0),c.hasMarkers(b)&&(C.selected.positions=C.unselected.positions=C.marker.positions),u.lineOptions.push(C.line),u.errorXOptions.push(C.errorX),u.errorYOptions.push(C.errorY),u.fillOptions.push(C.fill),u.markerOptions.push(C.marker),u.selectedOptions.push(C.selected),u.unselectedOptions.push(C.unselected),u.count=r.length,_.scene=u,_.index=h,_.x=E,_.y=L,_.rawx=E,_.rawy=L,_.r=w,_.theta=M,_.positions=S,_.count=T,_.tree=n(S,512)}}),a.plot(t,e,r)},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,c=a.hoverPoints(t,e,r,n);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var f=t.subplot,h=f.angularAxis,d=u.cd[u.index],p=u.trace;if(d.r=o[u.index],d.theta=s[u.index],d.rad=h.c2rad(d.theta,p.thetaunit),f.isPtWithinSector(d))return u.xLabelVal=void 0,u.yLabelVal=void 0,u.extraText=l(d,p,f),c}},style:a.style,selectPoints:a.selectPoints,meta:{}}},{"../../plots/cartesian/axes":789,"../../plots/polar":855,"../scatter/colorscale_calc":1071,"../scatter/subtypes":1088,"../scattergl":1115,"../scatterpolar/hover":1127,"./attributes":1130,"./defaults":1131,"fast-isnumeric":140,kdgrass:292}],1133:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:s,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker"),{showscale:c.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../components/drawing/attributes":642,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1134:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,d,p,m=t._fullLayout[e.subplot].sum,g=e.sum||m;for(r=0;r"),s}}},{"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1138:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":866,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1133,"./calc":1134,"./defaults":1135,"./event_data":1136,"./hover":1137,"./plot":1139}],1139:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null};n(t,a,r)}},{"../scatter/plot":1085}],1140:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:i.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:i.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var i=t("../../components/color"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=e.exports=l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:a.zauto,cmin:a.zmin,cmax:a.zmax,colorscale:a.colorscale,autocolorscale:s({},a.autocolorscale,{dflt:!1}),reversescale:a.reversescale,showscale:a.showscale,colorbar:o,contours:{x:n(),y:n(),z:n()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":618,"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plot_api/edit_types":773}],1141:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":625}],1142:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,c=r.cmin,u=r.cmax,f=r.surfacecolor||r.z;if(n(c)||(c=i.aggNums(Math.min,null,f)),n(u)||(u=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1143:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=o(new Float32Array(r[0]*r[1]),r);return c.assign(n.lo(1,1).hi(e[0],e[1]),t),c.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),c.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),c.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),c.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}var a=t("gl-surface3d"),o=t("ndarray"),s=t("ndarray-homography"),l=t("ndarray-fill"),c=t("ndarray-ops"),u=t("tinycolor2"),f=t("../../lib/str2rgbarray"),h=128,d=n.prototype;d.handlePick=function(t){if(t.object===this.surface){var e=t.index=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},d.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},d.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,c=t.opacity,d=function(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=u(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}})}(t.colorscale,c),p=t.z,m=t.x,g=t.y,v=n.xaxis,y=n.yaxis,x=n.zaxis,b=r.dataScale,_=p[0].length,w=p.length,M=[o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w])],k=M[0],A=M[1],T=r.contourLevels;this.data=t;var S=t.xcalendar,E=t.ycalendar,L=t.zcalendar;l(M[2],function(t,e){return x.d2l(p[e][t],0,L)*b[2]}),Array.isArray(m[0])?l(k,function(t,e){return v.d2l(m[e][t],0,S)*b[0]}):l(k,function(t){return v.d2l(m[t],0,S)*b[0]}),Array.isArray(g[0])?l(A,function(t,e){return y.d2l(g[e][t],0,E)*b[1]}):l(A,function(t,e){return y.d2l(g[e],0,E)*b[1]});var C={colormap:d,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(C.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var z=o(new Float32Array(_*w),[_,w]);l(z,function(e,r){return t.surfacecolor[r][e]}),M.push(z)}else C.intensityBounds[0]*=b[2],C.intensityBounds[1]*=b[2];this.dataScale=function(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1150:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}var o=t("./constants"),s=t("../../lib/extend").extendFlat,l=t("fast-isnumeric");e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),c=e.cells.values,u=e.domain,f=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),h=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),d=r.length?r[0].map(function(){return e.header.height}):[],p=c.length?c[0].map(function(){return e.cells.height}):[],m=d.reduce(function(t,e){return t+e},0),g=a(p,h-m+o.uplift),v=i(a(d,m),[]),y=i(g,v),x={},b=e._fullInput.columnorder,_=r.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return l(n)?Number(n):1}),w=_.reduce(function(t,e){return t+e},0);_=_.map(function(t){return t/w*f});var M={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:f,height:h,columnOrder:b,groupHeight:h,rowBlocks:y,headerRowBlocks:v,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=x[t];x[t]=(r||0)+1;return{key:t+"__"+x[t],label:t,specIndex:e,xIndex:b[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:_[e]}})};return M.columns.forEach(function(t){t.calcdata=M,t.x=n(t)}),M}},{"../../lib/extend":732,"./constants":1149,"fast-isnumeric":140}],1151:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":732}],1152:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=function(t){return"string"==typeof t&&t.match(A.latexCheck)}(n);t.latex=s;var l,f=s?"":u(t.calcdata.cells.prefix,e,r)||"",h=s?"":u(t.calcdata.cells.suffix,e,r)||"",d=s?null:u(t.calcdata.cells.format,e,r)||null,p=f+(d?T.format(d)(t.value):t.value)+h;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=c(p)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?c(p):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var m;if(t.wrappingNeeded){var g=(" "===A.wrapSplitCharacter?p.replace(/
i&&n.push(a),i+=l}return n}(i,u,c);1===f.length&&(f[0]===i.length-1?f.unshift(f[0]-1):f.push(f[0]+1)),f[0]%2&&f.reverse(),e.each(function(t,e){t.page=f[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(w(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(v(t,r,e,f,n.prevPages,n,0),v(t,r,e,f,n.prevPages,n,1),o(r,t))}}function g(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*T.event.dy:n;var l=o.selectAll("."+A.cn.yColumn).selectAll("."+A.cn.columnBlock).filter(h);m(t,l,o)}}function v(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function y(t,e,r){return function(){var n=T.select(e.parentNode);n.each(function(t){var e=t.fragments;n.selectAll("tspan.line").each(function(t,r){e[r].width=this.getComputedTextLength()});var r,i,a=e[e.length-1].width,o=e.slice(0,-1),s=[],l=0,c=t.column.columnWidth-2*A.cellPad;for(t.value="";o.length;)l+(i=(r=o.shift()).width+a)>c&&(t.value+=s.join(A.wrapSpacer)+A.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(A.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),l(n.select("."+A.cn.cellText),r,t),T.select(e.parentNode.parentNode).call(_)}}function x(t,e,r,n,i){return function(){if(!i.settledY){var a=T.select(e.parentNode),s=k(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*A.cellPad:c,f=Math.max(u,c);f-s.rows[l].rowHeight&&(s.rows[l].rowHeight=f,t.selectAll("."+A.cn.columnCell).call(_),m(null,t.filter(h),0),o(r,n,!0)),a.attr("transform",function(){var t=this.parentNode.getBoundingClientRect(),e=T.select(this.parentNode).select("."+A.cn.cellRect).node().getBoundingClientRect(),r=this.transform.baseVal.consolidate(),n=e.top-t.top+(r?r.matrix.f:A.cellPad);return"translate("+b(i,T.select(this.parentNode).select("."+A.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+n+")"}),i.settledY=!0}}}function b(t,e){switch(t.align){case"left":return A.cellPad;case"right":return t.column.columnWidth-(e||0)-A.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return A.cellPad}}function _(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+M(e,1/0)},0);return"translate(0 "+(M(k(t),t.key)+e)+")"}).selectAll("."+A.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(k(t),t.key).rowHeight})}function w(t,e){for(var r=0,n=e-1;n>=0;n--)r+=function(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n0){var y,x,b,_,w,M=t.xa,k=t.ya;"h"===h.orientation?(w=e,y="y",b=k,x="x",_=M):(w=r,y="x",b=M,x="y",_=k);var A=f[t.index];if(w>=A.span[0]&&w<=A.span[1]){var T=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,h,w),L=o.getPositionOnKdePath(A,h,S),C=b._offset,z=b._length;T[y+"0"]=L[0],T[y+"1"]=L[1],T[x+"0"]=T[x+"1"]=S,T[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+E.toFixed(3),g.push(T),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+z),u[y+"2"]=n.constrain(C+L[1],C,C+z),u[x+"1"]=u[x+"2"]=_._offset+S}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var D=l.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":743,"../../plots/cartesian/axes":789,"../box/hover":899,"./helpers":1158}],1160:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":800,"../box/select":904,"./attributes":1155,"./calc":1156,"./defaults":1157,"./hover":1159,"./layout_attributes":1161,"./layout_defaults":1162,"./plot":1163,"./set_positions":1164,"./style":1165}],1161:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":743,"../box/layout_attributes":901}],1162:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":743,"../box/layout_defaults":902,"./layout_attributes":1161}],1163:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,f=e.xaxis,h=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,g=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),v=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-u.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],x=e[a.posLetter+"axis"],b="both"===s.side,_=b||"positive"===s.side,w=b||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,A=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+v,u=x.c2p(l);switch(s.scalemode){case"width":e=A.maxWidth/g;break;case"count":e=A.maxWidth/g*(A.maxCount/t.pts.length)}var f,h,d,p,m,M,k;if(_){for(M=new Array(o),p=0;pi&&(i=c,a=l)}}return i?s(a):f};case"rms":return function(t,e){for(var r=0,i=0,a=0;a=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,i){return n.coerce(t,a,r.attributes,e,i)}var a={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,a,"valuecalendar",null),o(t,a,"targetcalendar",null)}return a},r.calcTransform=function(t,e,r){function i(t,r){for(var i=0;i":return function(t){return h(t)>i};case">=":return function(t){return h(t)>=i};case"[]":return function(t){var e=h(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=h(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=h(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=h(t);return ei[1]};case"](":return function(t){var e=h(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=h(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(h(t))};case"}{":return function(t){return-1===i.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,f,u),d),x={},b={},_=0;r.preservegaps?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=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([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),i(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;oMath.abs(e))c.rotate(o,0,0,-t*i*Math.PI*p.rotateSpeed/window.innerWidth);else{var s=p.zoomSpeed*a*e/window.innerHeight*(o-c.lastT())/100;c.pan(o,0,0,f*(Math.exp(s)-1))}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],40:[function(t,e,r){"use strict";function n(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}e.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],c=t.mode||"turntable",u=i(),f=a(),h=o();return u.setDistanceLimits(l[0],l[1]),u.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 n({turntable:u,orbit:f,matrix:h},c)};var i=t("turntable-camera-controller"),a=t("orbit-camera-controller"),o=t("matrix-camera-controller"),s=n.prototype;[["flush",1],["idle",1],["lookAt",4],["rotate",4],["pan",4],["translate",4],["setMatrix",2],["setDistanceLimits",2],["setDistance",2]].forEach(function(t){for(var e=t[0],r=[],n=0;n0&&(e.y+=r),a=e.y+e.dy+u;if((r=a-u-f[1])>0)for(a=e.y-=r,n=o-2;n>=0;--n)(r=(e=t[n]).y+e.dy+u-a)>0&&(e.y-=r),a=e.y})}function i(t,e){return t.y-e.y}var a=r.nest().key(function(t){return t.x}).sortKeys(e.ascending).entries(h).map(function(t){return t.values});!function(){var t=e.min(a,function(t){return(f[1]-(t.length-1)*u)/e.sum(t,s)});a.forEach(function(e){e.forEach(function(e,r){e.y=r,e.dy=e.value*t})}),d.forEach(function(e){e.dy=e.value*t})}(),n();for(var l=1;t>0;--t)!function(t){function r(t){return o(t.target)*t.value}a.slice().reverse().forEach(function(n){n.forEach(function(n){if(n.sourceLinks.length){var i=e.sum(n.sourceLinks,r)/e.sum(n.sourceLinks,s);n.y+=(i-o(n))*t}})})}(l*=.99),n(),function(t){function r(t){return o(t.source)*t.value}a.forEach(function(n){n.forEach(function(n){if(n.targetLinks.length){var i=e.sum(n.targetLinks,r)/e.sum(n.targetLinks,s);n.y+=(i-o(n))*t}})})}(l),n()}function a(){function t(t,e){return t.source.y-e.source.y||t.originalIndex-e.originalIndex}function e(t,e){return t.target.y-e.target.y||t.originalIndex-e.originalIndex}h.forEach(function(r){r.sourceLinks.sort(e),r.targetLinks.sort(t)}),h.forEach(function(t){var e=0,r=0;t.sourceLinks.forEach(function(t){t.sy=e,e+=t.dy}),t.targetLinks.forEach(function(t){t.ty=r,r+=t.dy})})}function o(t){return t.y+t.dy/2}function s(t){return t.value}var l={},c=24,u=8,f=[1,1],h=[],d=[];return l.nodeWidth=function(t){return arguments.length?(c=+t,l):c},l.nodePadding=function(t){return arguments.length?(u=+t,l):u},l.nodes=function(t){return arguments.length?(h=t,l):h},l.links=function(t){return arguments.length?(d=t,l):d},l.size=function(t){return arguments.length?(f=t,l):f},l.layout=function(r){return h.forEach(function(t){t.sourceLinks=[],t.targetLinks=[]}),d.forEach(function(t,e){var r=t.source,n=t.target;"number"==typeof r&&(r=t.source=h[t.source]),"number"==typeof n&&(n=t.target=h[t.target]),t.originalIndex=e,r.sourceLinks.push(t),n.targetLinks.push(t)}),h.forEach(function(t){t.value=Math.max(e.sum(t.sourceLinks,s),e.sum(t.targetLinks,s))}),t(),i(r),a(),l},l.relayout=function(){return a(),l},l.link=function(){function t(t){var r=t.source.x+t.source.dx,i=t.target.x,a=n.interpolateNumber(r,i),o=a(e),s=a(1-e),l=t.source.y+t.sy,c=l+t.dy,u=t.target.y+t.ty,f=u+t.dy;return"M"+r+","+l+"C"+o+","+l+" "+s+","+u+" "+i+","+u+"L"+i+","+f+"C"+s+","+f+" "+o+","+c+" "+r+","+c+"Z"}var e=.5;return t.curvature=function(r){return arguments.length?(e=+r,t):e},t},l},Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":120,"d3-collection":121,"d3-interpolate":125}],42:[function(t,e,r){"use strict";var n="undefined"==typeof WeakMap?t("weak-map"):WeakMap,i=t("gl-buffer"),a=t("gl-vao"),o=new n;e.exports=function(t){var e=o.get(t),r=e&&(e._triangleBuffer.handle||e._triangleBuffer.buffer);if(!r||!t.isBuffer(r)){var n=i(t,new Float32Array([-1,-1,-1,4,4,-1]));(e=a(t,[{buffer:n,type:t.FLOAT,size:2}]))._triangleBuffer=n,o.set(t,e)}e.bind(),t.drawArrays(t.TRIANGLES,0,3),e.unbind()}},{"gl-buffer":165,"gl-vao":259,"weak-map":573}],43:[function(t,e,r){e.exports=function(t){var e=0,r=0,n=0,i=0;return t.map(function(t){var a=(t=t.slice())[0],o=a.toUpperCase();if(a!=o)switch(t[0]=o,a){case"a":t[6]+=n,t[7]+=i;break;case"v":t[1]+=i;break;case"h":t[1]+=n;break;default:for(var s=1;si&&(i=t[o]),t[o]>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3])),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t.str2RgbaArray=function(t,n){var i,a;if("string"!=typeof t)return t;if(i=[],"#"===t[0]?(3===(t=t.substr(1)).length&&(t+=t),a=parseInt(t,16),i[0]=a>>16&255,i[1]=a>>8&255,i[2]=255&a):e.test(t)&&(a=t.match(r),i[0]=parseInt(a[1]),i[1]=parseInt(a[2]),i[2]=parseInt(a[3]),a[4]?i[3]=parseFloat(a[4]):i[3]=1),!n)for(var o=0;o<3;++o)i[o]=i[o]/255;return i},t}()},{}],51:[function(t,e,r){(function(r){"use strict";function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(o=l[s],!h(t[o],e[o],r,n))return!1;return!0}(t,e,r,s))}return r?t===e:t==e}function d(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function p(t,e,r){h(t,e,!0)&&u(t,e,r,"notDeepStrictEqual",p)}function m(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function g(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&u(i,r,"Missing expected exception"+n);var a="string"==typeof n,o=!t&&v.isError(i),s=!t&&i&&!r;if((o&&a&&m(i,r)||s)&&u(i,r,"Got unwanted exception"+n),t&&i&&r&&!m(i,r)||!t&&i)throw i}var v=t("util/"),y=Object.prototype.hasOwnProperty,x=Array.prototype.slice,b="foo"===function(){}.name,_=e.exports=f,w=/\s*function\s+([^\(\s]*)\s*/;_.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return l(c(t.actual),128)+" "+t.operator+" "+l(c(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||u;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=s(e),a=n.indexOf("\n"+i);if(a>=0){var o=n.indexOf("\n",a+1);n=n.substring(o+1)}this.stack=n}}},v.inherits(_.AssertionError,Error),_.fail=u,_.ok=f,_.equal=function(t,e,r){t!=e&&u(t,e,r,"==",_.equal)},_.notEqual=function(t,e,r){t==e&&u(t,e,r,"!=",_.notEqual)},_.deepEqual=function(t,e,r){h(t,e,!1)||u(t,e,r,"deepEqual",_.deepEqual)},_.deepStrictEqual=function(t,e,r){h(t,e,!0)||u(t,e,r,"deepStrictEqual",_.deepStrictEqual)},_.notDeepEqual=function(t,e,r){h(t,e,!1)&&u(t,e,r,"notDeepEqual",_.notDeepEqual)},_.notDeepStrictEqual=p,_.strictEqual=function(t,e,r){t!==e&&u(t,e,r,"===",_.strictEqual)},_.notStrictEqual=function(t,e,r){t===e&&u(t,e,r,"!==",_.notStrictEqual)},_.throws=function(t,e,r){g(!0,t,e,r)},_.doesNotThrow=function(t,e,r){g(!1,t,e,r)},_.ifError=function(t){if(t)throw t};var M=Object.keys||function(t){var e=[];for(var r in t)y.call(t,r)&&e.push(r);return e}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"util/":563}],52:[function(t,e,r){e.exports=function(t){return atob(t)}},{}],53:[function(t,e,r){"use strict";function n(t){for(var e=0,r=0;r0?r=r.ushln(f):f<0&&(u=u.ushln(-f)),l(r,u)}var i=t("./is-rat"),a=t("./lib/is-bn"),o=t("./lib/num-to-bn"),s=t("./lib/str-to-bn"),l=t("./lib/rationalize"),c=t("./div");e.exports=n},{"./div":56,"./is-rat":58,"./lib/is-bn":62,"./lib/num-to-bn":63,"./lib/rationalize":64,"./lib/str-to-bn":65}],58:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":62}],59:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":73}],60:[function(t,e,r){"use strict";var n=t("./bn-sign");e.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}},{"bit-twiddle":71,"double-bits":131}],62:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":73}],63:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.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)}},{"bn.js":73,"double-bits":131}],64:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.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]}},{"./bn-sign":59,"./num-to-bn":63}],65:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":73}],66:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":64}],67:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":59}],68:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":64}],69:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.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,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4;return c*(s+(h=n(l.ushln(u).divRound(r)))*Math.pow(2,-u))}var f=r.bitLength()-l.bitLength()+53,h=n(l.ushln(f).divRound(r));return f<1023?c*h*Math.pow(2,-f):(h*=Math.pow(2,-1023),c*h*Math.pow(2,1023-f))}},{"./lib/bn-to-num":60,"./lib/ctz":61}],70:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){var o=["function ",t,"(a,l,h,",n.join(","),"){",a?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a",i?".get(m)":"[m]"];return a?e.indexOf("c")<0?o.push(";if(x===y){return m}else if(x<=y){"):o.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):o.push(";if(",e,"){i=m;"),r?o.push("l=m+1}else{h=m-1}"):o.push("h=m-1}else{l=m+1}"),o.push("}"),a?o.push("return -1};"):o.push("return i};"),o.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],!1,i),n("B","x"+t+"y",e,["y"],!0,i),n("P","c(x,y)"+t+"0",e,["y","c"],!1,i),n("Q","c(x,y)"+t+"0",e,["y","c"],!0,i),"function dispatchBsearch",r,"(a,y,c,l,h){if(a.shape){if(typeof(c)==='function'){return Q(a,(l===undefined)?0:l|0,(h===undefined)?a.shape[0]-1:h|0,y,c)}else{return B(a,(c===undefined)?0:c|0,(l===undefined)?a.shape[0]-1:l|0,y)}}else{if(typeof(c)==='function'){return P(a,(l===undefined)?0:l|0,(h===undefined)?a.length-1:h|0,y,c)}else{return A(a,(c===undefined)?0:c|0,(l===undefined)?a.length-1:l|0,y)}}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],71:[function(t,e,r){"use strict";"use restrict";function n(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}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,t>>>=e,r=(t>255)<<3,t>>>=r,e|=r,r=(t>15)<<2,t>>>=r,e|=r,r=(t>3)<<1,t>>>=r,(e|=r)|t>>1},r.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},r.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=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|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return t&=65535,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e&=65535,e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1},r.deinterleave2=function(t,e){return t=t>>>e&1431655765,t=858993459&(t|t>>>1),t=252645135&(t|t>>>2),t=16711935&(t|t>>>4),(t=65535&(t|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t&=1023,t=4278190335&(t|t<<16),t=251719695&(t|t<<8),t=3272356035&(t|t<<4),t=1227133513&(t|t<<2),e&=1023,e=4278190335&(e|e<<16),e=251719695&(e|e<<8),e=3272356035&(e|e<<4),e=1227133513&(e|e<<2),t|=e<<1,r&=1023,r=4278190335&(r|r<<16),r=251719695&(r|r<<8),r=3272356035&(r|r<<4),r=1227133513&(r|r<<2),t|r<<2},r.deinterleave3=function(t,e){return t=t>>>e&1227133513,t=3272356035&(t|t>>>2),t=251719695&(t|t>>>4),t=4278190335&(t|t>>>8),(t=1023&(t|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],72:[function(t,e,r){"use strict";function n(t,e,r,n,a,o,s){for(var l=0;l=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function s(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}function l(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 c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;u+=(o=(i=0|t.words[p])*(a=0|e.words[d])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}function c(t,e,r){return(new u).mulp(t,e,r)}function u(t,e){this.x=t,this.y=e}function f(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 h(){f.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function d(){f.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function p(){f.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function m(){f.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function g(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 v(t){g.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)}"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var y;try{y=t("buffer").Buffer}catch(t){}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++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},a.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;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){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=o(t,r,r+6),this.words[n]|=i<>>26-a&4194303,(a+=24)>=26&&(a-=26,n++);r+6!==e&&(i=o(t,e,r+6),this.words[n]|=i<>>26-a&4194303),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,l=Math.min(a,a-o)+r,c=0,u=r;u1&&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 x=["","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"],b=[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],_=[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];a.prototype.toString=function(t,e){t=t||10,e=0|e||1;var r;if(16===t||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?x[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 c=b[t],u=_[t];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var h=f.modn(u).toString(t);r=(f=f.idivn(u)).isZero()?h+r:x[c-h.length]+h+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!==y),this.toArrayLike(y,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,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[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=this.cmp(t);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;var n,i;r>0?(n=this,i=t):(n=t,i=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,m=d>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],M=8191&w,k=w>>>13,A=0|o[5],T=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,z=0|o[7],D=8191&z,I=z>>>13,P=0|o[8],O=8191&P,F=P>>>13,R=0|o[9],N=8191&R,j=R>>>13,B=0|s[0],U=8191&B,V=B>>>13,q=0|s[1],H=8191&q,G=q>>>13,Y=0|s[2],W=8191&Y,X=Y>>>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,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,H)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((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,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,H)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((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,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,H)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|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(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,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(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(S,H)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,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(v,$)|0,i=(i=i+Math.imul(v,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(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(I,U)|0,a=Math.imul(I,V),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,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(v,rt)|0,i=(i=i+Math.imul(v,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(m,at)|0,a=a+Math.imul(m,ot)|0;var Mt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(O,U),i=(i=Math.imul(O,V))+Math.imul(F,U)|0,a=Math.imul(F,V),n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(I,H)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,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(v,at)|0,i=(i=i+Math.imul(v,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,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,V))+Math.imul(j,U)|0,a=Math.imul(j,V),n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,G)|0)+Math.imul(F,H)|0,a=a+Math.imul(F,G)|0,n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(I,W)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,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(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(p,ft)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,pt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(N,H),i=(i=Math.imul(N,G))+Math.imul(j,H)|0,a=Math.imul(j,G),n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(F,W)|0,a=a+Math.imul(F,X)|0,n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Tt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(N,W),i=(i=Math.imul(N,X))+Math.imul(j,W)|0,a=Math.imul(j,X),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(F,J)|0,a=a+Math.imul(F,K)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(I,$)|0,a=a+Math.imul(I,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|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 St=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(N,J),i=(i=Math.imul(N,K))+Math.imul(j,J)|0,a=Math.imul(j,K),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(F,$)|0,a=a+Math.imul(F,tt)|0,n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(I,rt)|0,a=a+Math.imul(I,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,pt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(N,$),i=(i=Math.imul(N,tt))+Math.imul(j,$)|0,a=Math.imul(j,tt),n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(F,rt)|0,a=a+Math.imul(F,nt)|0,n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(I,at)|0,a=a+Math.imul(I,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(N,rt),i=(i=Math.imul(N,nt))+Math.imul(j,rt)|0,a=Math.imul(j,nt),n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ot)|0)+Math.imul(F,at)|0,a=a+Math.imul(F,ot)|0,n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(I,lt)|0,a=a+Math.imul(I,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(S,pt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(N,at),i=(i=Math.imul(N,ot))+Math.imul(j,at)|0,a=Math.imul(j,ot),n=n+Math.imul(O,lt)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(F,lt)|0,a=a+Math.imul(F,ct)|0,n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(I,ft)|0,a=a+Math.imul(I,ht)|0;var zt=(c+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,n=Math.imul(N,lt),i=(i=Math.imul(N,ct))+Math.imul(j,lt)|0,a=Math.imul(j,ct),n=n+Math.imul(O,ft)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(F,ft)|0,a=a+Math.imul(F,ht)|0;var Dt=(c+(n=n+Math.imul(D,pt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((a=a+Math.imul(I,mt)|0)+(i>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,n=Math.imul(N,ft),i=(i=Math.imul(N,ht))+Math.imul(j,ft)|0,a=Math.imul(j,ht);var It=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(F,pt)|0))<<13)|0;c=((a=a+Math.imul(F,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863;var Pt=(c+(n=Math.imul(N,pt))|0)+((8191&(i=(i=Math.imul(N,mt))+Math.imul(j,pt)|0))<<13)|0;return c=((a=Math.imul(j,mt))+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Mt,l[8]=kt,l[9]=At,l[10]=Tt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=zt,l[16]=Dt,l[17]=It,l[18]=Pt,0!==c&&(l[19]=c,r.length++),r};Math.imul||(w=l),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?w(this,t,e):r<63?l(this,t,e):r<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):c(this,t,e)},u.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},u.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);var i;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,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),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&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;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 c=0;c=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){if(n(!t.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var i,o,s;return 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)},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),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=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(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),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(c)}},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=new a(1),o=new a(0),s=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(e.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(e.iushrn(l);l-- >0;)i.isOdd()&&i.iadd(s),i.iushrn(1);for(var u=0,f=1;0==(r.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(s),o.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(o)):(r.isub(e),o.isub(i))}var h;return(h=0===e.cmpn(1)?i:o).cmpn(0)<0&&h.iadd(t),h},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=t<0;if(0!==this.negative&&!e)return-1;if(0===this.negative&&e)return 1;this.strip();var r;if(this.length>1)r=1;else{e&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];r=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 g(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};f.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},f.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):r.strip(),r},f.prototype.split=function(t,e){t.iushrn(this.n,0,e)},f.prototype.imulK=function(t){return t.imul(this.k)},i(h,f),h.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},h.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 h;else if("p224"===t)e=new d;else if("p192"===t)e=new p;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new m}return M[t]=e,e},g.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},g.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")},g.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},g.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},g.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)},g.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},g.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)},g.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},g.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},g.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},g.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},g.prototype.isqr=function(t){return this.imul(t,t.clone())},g.prototype.sqr=function(t){return this.mul(t,t)},g.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(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=o;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},g.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},g.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new v(t)},i(v,g),v.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},v.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},v.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)},v.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)},v.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{}],74:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(s<=0)){var f,h=l.mallocDouble(2*s*a),d=l.mallocInt32(a);if((a=i(t,s,h,d))>0){if(1===s&&n)c.init(a),f=c.sweepComplete(s,r,0,a,h,d,0,a,h,d);else{var p=l.mallocDouble(2*s*o),m=l.mallocInt32(o);(o=i(e,s,p,m))>0&&(c.init(a+o),f=1===s?c.sweepBipartite(s,r,0,a,h,d,0,o,p,m):u(s,r,n,a,h,d,o,p,m),l.free(p),l.free(m))}l.free(h),l.free(d)}return f}}}function o(t,e){s.push([t,e])}e.exports=function(t,e,r){switch(arguments.length){case 1:return function(t){return s=[],a(t,t,o,!0),s}(t);case 2:return"function"==typeof e?a(t,t,e,!0):function(t,e){return s=[],a(t,e,o,!1),s}(t,e);case 3:return a(t,e,r,!1);default:throw new Error("box-intersect: Invalid arguments")}};var s,l=t("typedarray-pool"),c=t("./lib/sweep"),u=t("./lib/intersect")},{"./lib/intersect":77,"./lib/sweep":81,"typedarray-pool":554}],76:[function(t,e,r){"use strict";function n(t){function e(e,r){var s=function(t,e,r){var n="bruteForce"+(t?"Red":"Blue")+(e?"Flip":"")+(r?"Full":""),s=["function ",n,"(",_.join(),"){","var ",l,"=2*",i,";"],w="for(var i="+c+","+d+"="+l+"*"+c+";i<"+u+";++i,"+d+"+="+l+"){var x0="+f+"["+a+"+"+d+"],x1="+f+"["+a+"+"+d+"+"+i+"],xi="+h+"[i];",M="for(var j="+p+","+y+"="+l+"*"+p+";j<"+m+";++j,"+y+"+="+l+"){var y0="+g+"["+a+"+"+y+"],"+(r?"y1="+g+"["+a+"+"+y+"+"+i+"],":"")+"yi="+v+"[j];";return t?s.push(w,b,":",M):s.push(M,b,":",w),r?s.push("if(y1"+m+"-"+p+"){"),t?(e(!0,!1),M.push("}else{"),e(!1,!1)):(M.push("if("+s+"){"),e(!0,!0),M.push("}else{"),e(!0,!1),M.push("}}else{if("+s+"){"),e(!1,!0),M.push("}else{"),e(!1,!1),M.push("}")),M.push("}}return "+r);var k=n.join("")+M.join("");return new Function(k)()}var i="d",a="ax",o="vv",s="fp",l="es",c="rs",u="re",f="rb",h="ri",d="rp",p="bs",m="be",g="bb",v="bi",y="bp",x="rv",b="Q",_=[i,a,o,c,u,f,h,p,m,g,v];r.partial=n(!1),r.full=n(!0)},{}],77:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l){var c=M*t;A[c]=e,A[c+1]=r,A[c+2]=n,A[c+3]=i,A[c+4]=a,A[c+5]=o;var u=k*t;T[u]=s,T[u+1]=l}function i(t,e,r,n,i,a,o,s,l,c,u){var f=2*t,h=l*f,d=c[h+e];t:for(var p=i,m=i*f;p0;){var P=(D-=1)*M,O=A[P],F=A[P+1],R=A[P+2],N=A[P+3],j=A[P+4],B=A[P+5],U=D*k,V=T[U],q=T[U+1],H=1&B,G=!!(16&B),Y=d,W=S,X=L,Z=C;if(H&&(Y=L,W=C,X=d,Z=S),!(2&B&&(R=x(t,O,F,R,Y,W,q),F>=R)||4&B&&(F=b(t,O,F,R,Y,W,V))>=R)){var J=R-F,K=j-N;if(G){if(t*J*(J+K)=p0)&&!(p1>=hi)",["p0","p1"]),y=d("lo===p0",["p0"]),x=d("lor&&i[f+e]>c;--u,f-=o){for(var h=f,d=f+o,p=0;p>>1,h=2*t,d=f,p=s[h*f+e];c=x?(d=y,p=x):v>=_?(d=g,p=v):(d=b,p=_):x>=_?(d=y,p=x):_>=v?(d=g,p=v):(d=b,p=_);for(var w=h*(u-1),M=h*d,k=0;k=0&&i.push("lo=e[k+n]"),t.indexOf("hi")>=0&&i.push("hi=e[k+o]"),r.push(n.replace("_",i.join()).replace("$",t)),Function.apply(void 0,r)};var n="for(var j=2*a,k=j*c,l=k,m=c,n=b,o=a+b,p=c;d>p;++p,k+=j){var _;if($)if(m===p)m+=1,l+=j;else{for(var s=0;j>s;++s){var t=e[k+s];e[k+s]=e[l],e[l++]=t}var u=f[p];f[p]=f[m],f[m++]=u}}return m"},{}],80:[function(t,e,r){"use strict";function n(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 c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>1,g=m-h,v=m+h,y=d,x=g,b=m,_=v,w=p,M=t+1,k=e-1,A=0;l(y,x,r)&&(A=y,y=x,x=A),l(_,w,r)&&(A=_,_=w,w=A),l(y,b,r)&&(A=y,y=b,b=A),l(x,b,r)&&(A=x,x=b,b=A),l(y,_,r)&&(A=y,y=_,_=A),l(b,_,r)&&(A=b,b=_,_=A),l(x,w,r)&&(A=x,x=w,w=A),l(x,b,r)&&(A=x,x=b,b=A),l(_,w,r)&&(A=_,_=w,w=A);for(var T=r[2*x],S=r[2*x+1],E=r[2*_],L=r[2*_+1],C=2*y,z=2*b,D=2*w,I=2*d,P=2*m,O=2*p,F=0;F<2;++F){var R=r[C+F],N=r[z+F],j=r[D+F];r[I+F]=R,r[P+F]=N,r[O+F]=j}a(g,t,r),a(v,e,r);for(var B=M;B<=k;++B)if(c(B,T,S,r))B!==M&&i(B,M,r),++M;else if(!c(B,E,L,r))for(;;){if(c(k,E,L,r)){c(k,T,S,r)?(o(B,M,k,r),++M,--k):(i(B,k,r),--k);break}if(--k>>1;s(m,S);var E=0,L=0;for(M=0;M=l)n(f,h,L--,C=C-l|0);else if(C>=0)n(c,u,E--,C);else if(C<=-l){C=-C-l|0;for(var z=0;z>>1;s(m,E);var L=0,C=0,z=0;for(k=0;k>1==m[2*k+3]>>1&&(I=2,k+=1),D<0){for(var P=-(D>>1)-1,O=0;O>1)-1,0===I?n(c,u,L--,P):1===I?n(f,h,C--,P):2===I&&n(d,p,z--,P)}},scanBipartite:function(t,e,r,a,o,f,h,d,p,g,v,y){var x=0,b=2*t,_=e,w=e+t,M=1,k=1;a?k=l:M=l;for(var A=o;A>>1;s(m,L);var C=0;for(A=0;A=l?(D=!a,T-=l):(D=!!a,T-=1),D)i(c,u,C++,T);else{var I=y[T],P=b*T,O=v[P+e+1],F=v[P+e+1+t];t:for(var R=0;R>>1;s(m,M);var k=0;for(x=0;x=l)c[k++]=b-l;else{var T=d[b-=1],S=g*b,E=h[S+e+1],L=h[S+e+1+t];t:for(var C=0;C=0;--C)if(c[C]===b){for(P=C+1;PP)throw new RangeError("Invalid typed array length");var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return s(t)}return a(t,e,r)}function a(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return t instanceof ArrayBuffer?function(t,e,r){if(e<0||t.byteLength=P)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+P.toString(16)+" bytes");return 0|t}function u(t,e){if(i.isBuffer(t))return t.length;if(C(t)||t instanceof ArrayBuffer)return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function f(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,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,z(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0){if(!a)return-1;r=0}if("string"==typeof e&&(e=i.from(e,n)),i.isBuffer(e))return 0===e.length?-1:p(t,e,r,n,a);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):p(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function p(t,e,r,n,i){function a(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}var 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}var c;if(i){var u=-1;for(c=r;cs&&(r=s-l),c=r;c>=0;c--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function _(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,c,u,f;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],c=t[i+2],128==(192&l)&&128==(192&c)&&(f=(15&a)<<12|(63&l)<<6|63&c)>2047&&(f<55296||f>57343)&&(o=f);break;case 4:l=t[i+1],c=t[i+2],u=t[i+3],128==(192&l)&&128==(192&c)&&128==(192&u)&&(f=(15&a)<<18|(63&l)<<12|(63&c)<<6|63&u)>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<=O)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nr)throw new RangeError("Trying to access beyond buffer length")}function M(t,e,r,n,a,o){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||et.length)throw new RangeError("Index out of range")}function k(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 A(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,4),I.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,i){return e=+e,r>>>=0,i||k(t,0,r,8),I.write(t,e,r,n,52,8),r+8}function S(t,e){e=e||1/0;for(var r,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 E(t){return D.toByteArray(function(t){if((t=t.trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function L(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function C(t){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(t)}function z(t){return t!=t}var D=t("base64-js"),I=t("ieee754");r.Buffer=i,r.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},r.INSPECT_MAX_BYTES=50;var P=2147483647;r.kMaxLength=P,(i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,r){return a(t,e,r)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,r){return function(t,e,r){return o(t),t<=0?n(t):void 0!==e?"string"==typeof r?n(t).fill(e,r):n(t).fill(e):n(t)}(t,e,r)},i.allocUnsafe=function(t){return s(t)},i.allocUnsafeSlow=function(t){return s(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer},i.compare=function(t,e){if(!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,a=0,o=Math.min(r,n);a0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),""},i.prototype.compare=function(t,e,r,n,a){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),e<0||r>t.length||n<0||a>this.length)throw new RangeError("out of range index");if(n>=a&&e>=r)return 0;if(n>=a)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,a>>>=0,this===t)return 0;for(var o=a-n,s=r-e,l=Math.min(o,s),c=this.slice(n,a),u=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 m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return y(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;i.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r)<0&&(t=0):t>r&&(t=r),e<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},i.prototype.readUInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||w(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=this[t],i=1,a=0;++a=i&&(n-=Math.pow(2,8*e)),n},i.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||w(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*e)),a},i.prototype.readInt8=function(t,e){return t>>>=0,e||w(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(t,e){t>>>=0,e||w(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||w(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||w(t,4,this.length),I.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||w(t,8,this.length),I.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){M(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){M(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},i.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);M(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},i.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||M(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||M(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},i.prototype.writeFloatLE=function(t,e,r){return A(this,t,e,!0,r)},i.prototype.writeFloatBE=function(t,e,r){return A(this,t,e,!1,r)},i.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},i.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},i.prototype.copy=function(t,e,r,n){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("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(a<1e3)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0);var o;if("number"==typeof t)for(o=e;o0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function i(t){return o[t>>18&63]+o[t>>12&63]+o[t>>6&63]+o[63&t]}function a(t,e,r){for(var n,a=[],o=e;o0?u-4:u;var f=0;for(e=0,r=0;e>16&255,c[f++]=a>>8&255,c[f++]=255&a;return 2===o?(a=s[t.charCodeAt(e)]<<2|s[t.charCodeAt(e+1)]>>4,c[f++]=255&a):1===o&&(a=s[t.charCodeAt(e)]<<10|s[t.charCodeAt(e+1)]<<4|s[t.charCodeAt(e+2)]>>2,c[f++]=a>>8&255,c[f++]=255&a),c},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,i="",s=[],l=0,c=r-n;lc?c:l+16383));return 1===n?(e=t[r-1],i+=o[e>>2],i+=o[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=o[e>>10],i+=o[e>>4&63],i+=o[e<<2&63],i+="="),s.push(i),s.join("")};for(var o=[],s=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,f=c.length;u0;){for(var d=r.pop(),p=(u=-1,f=-1,l=o[s=r.pop()],1);p=0||(e.flip(s,d),n(t,e,r,u,s,f),n(t,e,r,s,f,u),n(t,e,r,f,d,u),n(t,e,r,d,u,f))}}},{"binary-search-bounds":89,"robust-in-sphere":513}],86:[function(t,e,r){"use strict";function n(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 i(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}var a=t("binary-search-bounds");e.exports=function(t,e,r){var a=function(t,e){for(var r=t.cells(),a=r.length,o=0;o0||l.length>0;){for(;s.length>0;){var d=s.pop();if(c[d]!==-o){c[d]=o,u[d];for(var p=0;p<3;++p){var m=h[3*d+p];m>=0&&0===c[m]&&(f[3*d+p]?l.push(m):(s.push(m),c[m]=o))}}}var g=l;l=s,s=g,l.length=0,o=-o}var v=function(t,e,r){for(var n=0,i=0;i1&&h(r[u[d-2]],r[u[d-1]],n)>0;)t.push([u[d-1],u[d-2],i]),d-=1;u.length=d,u.push(i);var p=c.upperIds;for(d=p.length;d>1&&h(r[p[d-2]],r[p[d-1]],n)<0;)t.push([p[d-2],p[d-1],i]),d-=1;p.length=d,p.push(i)}}function l(t,e){var r;return(r=t.a[0]v[0]&&l.push(new i(v,g,m,f),new i(g,v,p,f))}l.sort(a);for(var y=l[0].a[0]-(1+Math.abs(l[0].a[0]))*Math.pow(2,-52),x=[new n([y,1],[y,0],-1,[],[],[],[])],b=[],_=(f=0,l.length);f<_;++f){var w=l[f],M=w.type;M===d?s(b,x,t,w.a,w.idx):M===m?c(x,0,w):u(x,0,w)}return b}},{"binary-search-bounds":89,"robust-orientation":515}],88:[function(t,e,r){"use strict";function n(t,e){this.stars=t,this.edges=e}function i(t,e,r){for(var n=1,i=t.length;n=0}}(),o.removeTriangle=function(t,e,r){var n=this.stars;i(n[t],e,r),i(n[e],r,t),i(n[r],t,e)},o.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},o.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;n>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],90:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1,r=1;rr?r:t:te?e:t}},{}],94:[function(t,e,r){"use strict";function n(t){var e=m(t);return[v(e,-1/0),v(e,1/0)]}function i(t){for(var e=new Array(t.length),r=0;re[2]?1:0)}function l(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[o=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],M=t[_];if((w[0]-M[0]||w[1]-M[1])<0){var k=b;b=_,_=k}x[0]=b;var A,T=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===o;){var S,E=(S=n[--a])[1];i?e.push([T,E,A]):e.push([T,E]),T=E}i?e.push([T,_,A]):e.push([T,_])}return s}(t,e,o,c,r));return l(e,u,r),!!u||(o.length>0||c.length>0)}e.exports=function(t,e,r){var n;if(r){n=e;for(var o=new Array(e.length),s=0;s>>24,n=(16711680&t)>>>16,i=(65280&t)>>>8,a=255&t;return!1===e?[r,n,i,a]:[r/255,n/255,i/255,a/255]}},{clamp:93}],98:[function(t,e,r){"use strict";e.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]}},{}],99:[function(t,e,r){"use strict";var n=t("color-rgba"),i=t("clamp"),a=t("dtype");e.exports=function(t,e){"float"!==e&&e||(e="array"),"uint"===e&&(e="uint8"),"uint_clamped"===e&&(e="uint8_clamped");var r=a(e),o=new r(4);if(t instanceof r)return Array.isArray(t)?t.slice():(o.set(t),o);var s="uint8"!==e&&"uint8_clamped"!==e;return t instanceof Uint8Array||t instanceof Uint8ClampedArray?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:255,s&&(o[0]/=255,o[1]/=255,o[2]/=255,o[3]/=255),o):(t.length&&"string"!=typeof t||((t=n(t))[0]/=255,t[1]/=255,t[2]/=255),s?(o[0]=t[0],o[1]=t[1],o[2]=t[2],o[3]=null!=t[3]?t[3]:1):(o[0]=i(Math.round(255*t[0]),0,255),o[1]=i(Math.round(255*t[1]),0,255),o[2]=i(Math.round(255*t[2]),0,255),o[3]=null==t[3]?255:i(Math.floor(255*t[3]),0,255)),o)}},{clamp:93,"color-rgba":101,dtype:133}],100:[function(t,e,r){(function(r){"use strict";var n=t("color-name"),i=t("is-plain-obj"),a=t("defined");e.exports=function(t){var e,s,l=[],c=1;if("string"==typeof t)if(n[t])l=n[t].slice(),s="rgb";else if("transparent"===t)c=0,s="rgb",l=[0,0,0];else if(/^#[A-Fa-f0-9]+$/.test(t)){var u=t.slice(1);c=1,(h=u.length)<=4?(l=[parseInt(u[0]+u[0],16),parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16)],4===h&&(c=parseInt(u[3]+u[3],16)/255)):(l=[parseInt(u[0]+u[1],16),parseInt(u[2]+u[3],16),parseInt(u[4]+u[5],16)],8===h&&(c=parseInt(u[6]+u[7],16)/255)),l[0]||(l[0]=0),l[1]||(l[1]=0),l[2]||(l[2]=0),s="rgb"}else if(e=/^((?:rgb|hs[lvb]|hwb|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms)a?)\s*\(([^\)]*)\)/.exec(t)){var f=e[1];s=u=f.replace(/a$/,"");var h="cmyk"===u?4:"gray"===u?1:3;l=e[2].trim().split(/\s*,\s*/).map(function(t,e){if(/%$/.test(t))return e===h?parseFloat(t)/100:"rgb"===u?255*parseFloat(t)/100:parseFloat(t);if("h"===u[e]){if(/deg$/.test(t))return parseFloat(t);if(void 0!==o[t])return o[t]}return parseFloat(t)}),f===u&&l.push(1),c=void 0===l[h]?1:l[h],l=l.slice(0,h)}else t.length>10&&/[0-9](?:\s|\/)/.test(t)&&(l=t.match(/([0-9]+)/g).map(function(t){return parseFloat(t)}),s=t.match(/([a-z])/gi).join("").toLowerCase());else if("number"==typeof t)s="rgb",l=[t>>>16,(65280&t)>>>8,255&t];else if(i(t)){var d=a(t.r,t.red,t.R,null);null!==d?(s="rgb",l=[d,a(t.g,t.green,t.G),a(t.b,t.blue,t.B)]):(s="hsl",l=[a(t.h,t.hue,t.H),a(t.s,t.saturation,t.S),a(t.l,t.lightness,t.L,t.b,t.brightness)]),c=a(t.a,t.alpha,t.opacity,1),null!=t.opacity&&(c/=100)}else(Array.isArray(t)||r.ArrayBuffer&&ArrayBuffer.isView&&ArrayBuffer.isView(t))&&(l=[t[0],t[1],t[2]],s="rgb",c=4===t.length?t[3]:1);return{space:s,values:l,alpha:c}};var o={red:0,orange:60,yellow:120,green:180,blue:240,purple:300}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"color-name":98,defined:129,"is-plain-obj":286}],101:[function(t,e,r){"use strict";var n=t("color-parse"),i=t("color-space/hsl"),a=t("clamp");e.exports=function(t){var e;if("string"!=typeof t)throw Error("Argument should be a string");var r=n(t);return r.space?(e=Array(3),e[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):[]}},{clamp:93,"color-parse":100,"color-space/hsl":102}],102:[function(t,e,r){"use strict";var n=t("./rgb");e.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,a];e=2*l-(r=l<.5?l*(1+s):l+s-l*s),i=[0,0,0];for(var c=0;c<3;c++)(n=o+1/3*-(c-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[c]=255*a;return i}},n.hsl=function(t){var e,r,n,i=t[0]/255,a=t[1]/255,o=t[2]/255,s=Math.min(i,a,o),l=Math.max(i,a,o),c=l-s;return l===s?e=0:i===l?e=(a-o)/c:a===l?e=2+(o-i)/c:o===l&&(e=4+(i-a)/c),(e=Math.min(60*e,360))<0&&(e+=360),n=(s+l)/2,r=l===s?0:n<=.5?c/(l+s):c/(2-l-s),[e,100*r,100*n]}},{"./rgb":103}],103:[function(t,e,r){"use strict";e.exports={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]}},{}],104:[function(t,e,r){e.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]}],cool:[{index:0,rgb:[0,255,255]},{index:1,rgb:[255,0,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:0,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]}]}},{}],105:[function(t,e,r){"use strict";function n(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function i(t){return"rgba("+t.join(",")+")"}var a=t("arraytools"),o=t("clone"),s=t("./colorScales");e.exports=function(t){var e,r,l,c,u,f,h,d,p,m,g,v,y,x=[],b=[],_=[],w=[];if(a.isPlainObject(t)||(t={}),p=t.nshades||72,d=t.format||"hex",(h=t.colormap)||(h="jet"),"string"==typeof h){if(h=h.toLowerCase(),!s[h])throw Error(h+" not a supported colorscale");f=o(s[h])}else{if(!Array.isArray(h))throw Error("unsupported colormap option",h);f=o(h)}if(f.length>p)throw new Error(h+" map requires nshades to be at least size "+f.length);for(g=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:o(t.alpha):"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1],e=f.map(function(t){return Math.round(t.index*p)}),g[0]<0&&(g[0]=0),g[1]<0&&(g[0]=0),g[0]>1&&(g[0]=1),g[1]>1&&(g[0]=1),y=0;y=0&&r[3]<=1||(r[3]=g[0]+(g[1]-g[0])*v);for(y=0;y=0}e.exports=function(t,e,r,o){var s=i(e,r,o);if(0===s){var l=a(i(t,e,r)),c=a(i(t,e,o));if(l===c){if(0===l){var u=n(t,e,r);return u===n(t,e,o)?0:u?1:-1}return 0}return 0===c?l>0?-1:n(t,e,o)?-1:1:0===l?c>0?1:n(t,e,r)?1:-1:a(c-l)}var f=i(t,e,r);return f>0?s>0&&i(t,e,o)>0?1:-1:f<0?s>0||i(t,e,o)>0?1:-1:i(t,e,o)>0?1:n(t,e,r)?1:-1};var i=t("robust-orientation"),a=t("signum"),o=t("two-sum"),s=t("robust-product"),l=t("robust-sum")},{"robust-orientation":515,"robust-product":516,"robust-sum":520,signum:522,"two-sum":553}],107:[function(t,e,r){function n(t,e){return t-e}e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||i(t[0],t[1])-i(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=i(t[0],t[1]),c=i(e[0],e[1]);return i(l,t[2])-i(c,e[2])||i(l+t[2],o)-i(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],d=t[3],p=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+d-(p+m+g+v)||i(u,f,h,d)-i(p,m,g,v,p)||i(u+f,u+h,u+d,f+h,f+d,h+d)-i(p+m,p+g,p+v,m+g,m+v,g+v)||i(u+f+h,u+f+d,u+h+d,f+h+d)-i(p+m+g,p+m+v,p+g+v,m+g+v);default:for(var y=t.slice().sort(n),x=e.slice().sort(n),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],111:[function(t,e,r){"use strict";e.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=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":45,"incremental-convex-hull":278}],113:[function(t,e,r){e.exports={AFG:"afghan",ALA:"\\b\\wland",ALB:"albania",DZA:"algeria",ASM:"^(?=.*americ).*samoa",AND:"andorra",AGO:"angola",AIA:"anguill?a",ATA:"antarctica",ATG:"antigua",ARG:"argentin",ARM:"armenia",ABW:"^(?!.*bonaire).*\\baruba",AUS:"australia",AUT:"^(?!.*hungary).*austria|\\baustri.*\\bemp",AZE:"azerbaijan",BHS:"bahamas",BHR:"bahrain",BGD:"bangladesh|^(?=.*east).*paki?stan",BRB:"barbados",BLR:"belarus|byelo",BEL:"^(?!.*luxem).*belgium",BLZ:"belize|^(?=.*british).*honduras",BEN:"benin|dahome",BMU:"bermuda",BTN:"bhutan",BOL:"bolivia",BES:"^(?=.*bonaire).*eustatius|^(?=.*carib).*netherlands|\\bbes.?islands",BIH:"herzegovina|bosnia",BWA:"botswana|bechuana",BVT:"bouvet",BRA:"brazil",IOT:"british.?indian.?ocean",BRN:"brunei",BGR:"bulgaria",BFA:"burkina|\\bfaso|upper.?volta",BDI:"burundi",CPV:"verde",KHM:"cambodia|kampuchea|khmer",CMR:"cameroon",CAN:"canada",CYM:"cayman",CAF:"\\bcentral.african.republic",TCD:"\\bchad",CHL:"\\bchile",CHN:"^(?!.*\\bmac)(?!.*\\bhong)(?!.*\\btai)(?!.*\\brep).*china|^(?=.*peo)(?=.*rep).*china",CXR:"christmas",CCK:"\\bcocos|keeling",COL:"colombia",COM:"comoro",COG:"^(?!.*\\bdem)(?!.*\\bd[\\.]?r)(?!.*kinshasa)(?!.*zaire)(?!.*belg)(?!.*l.opoldville)(?!.*free).*\\bcongo",COK:"\\bcook",CRI:"costa.?rica",CIV:"ivoire|ivory",HRV:"croatia",CUB:"\\bcuba",CUW:"^(?!.*bonaire).*\\bcura(c|\xe7)ao",CYP:"cyprus",CSK:"czechoslovakia",CZE:"^(?=.*rep).*czech|czechia|bohemia",COD:"\\bdem.*congo|congo.*\\bdem|congo.*\\bd[\\.]?r|\\bd[\\.]?r.*congo|belgian.?congo|congo.?free.?state|kinshasa|zaire|l.opoldville|drc|droc|rdc",DNK:"denmark",DJI:"djibouti",DMA:"dominica(?!n)",DOM:"dominican.rep",ECU:"ecuador",EGY:"egypt",SLV:"el.?salvador",GNQ:"guine.*eq|eq.*guine|^(?=.*span).*guinea",ERI:"eritrea",EST:"estonia",ETH:"ethiopia|abyssinia",FLK:"falkland|malvinas",FRO:"faroe|faeroe",FJI:"fiji",FIN:"finland",FRA:"^(?!.*\\bdep)(?!.*martinique).*france|french.?republic|\\bgaul",GUF:"^(?=.*french).*guiana",PYF:"french.?polynesia|tahiti",ATF:"french.?southern",GAB:"gabon",GMB:"gambia",GEO:"^(?!.*south).*georgia",DDR:"german.?democratic.?republic|democratic.?republic.*germany|east.germany",DEU:"^(?!.*east).*germany|^(?=.*\\bfed.*\\brep).*german",GHA:"ghana|gold.?coast",GIB:"gibraltar",GRC:"greece|hellenic|hellas",GRL:"greenland",GRD:"grenada",GLP:"guadeloupe",GUM:"\\bguam",GTM:"guatemala",GGY:"guernsey",GIN:"^(?!.*eq)(?!.*span)(?!.*bissau)(?!.*portu)(?!.*new).*guinea",GNB:"bissau|^(?=.*portu).*guinea",GUY:"guyana|british.?guiana",HTI:"haiti",HMD:"heard.*mcdonald",VAT:"holy.?see|vatican|papal.?st",HND:"^(?!.*brit).*honduras",HKG:"hong.?kong",HUN:"^(?!.*austr).*hungary",ISL:"iceland",IND:"india(?!.*ocea)",IDN:"indonesia",IRN:"\\biran|persia",IRQ:"\\biraq|mesopotamia",IRL:"(^ireland)|(^republic.*ireland)",IMN:"^(?=.*isle).*\\bman",ISR:"israel",ITA:"italy",JAM:"jamaica",JPN:"japan",JEY:"jersey",JOR:"jordan",KAZ:"kazak",KEN:"kenya|british.?east.?africa|east.?africa.?prot",KIR:"kiribati",PRK:"^(?=.*democrat|people|north|d.*p.*.r).*\\bkorea|dprk|korea.*(d.*p.*r)",KWT:"kuwait",KGZ:"kyrgyz|kirghiz",LAO:"\\blaos?\\b",LVA:"latvia",LBN:"lebanon",LSO:"lesotho|basuto",LBR:"liberia",LBY:"libya",LIE:"liechtenstein",LTU:"lithuania",LUX:"^(?!.*belg).*luxem",MAC:"maca(o|u)",MDG:"madagascar|malagasy",MWI:"malawi|nyasa",MYS:"malaysia",MDV:"maldive",MLI:"\\bmali\\b",MLT:"\\bmalta",MHL:"marshall",MTQ:"martinique",MRT:"mauritania",MUS:"mauritius",MYT:"\\bmayotte",MEX:"\\bmexic",FSM:"fed.*micronesia|micronesia.*fed",MCO:"monaco",MNG:"mongolia",MNE:"^(?!.*serbia).*montenegro",MSR:"montserrat",MAR:"morocco|\\bmaroc",MOZ:"mozambique",MMR:"myanmar|burma",NAM:"namibia",NRU:"nauru",NPL:"nepal",NLD:"^(?!.*\\bant)(?!.*\\bcarib).*netherlands",ANT:"^(?=.*\\bant).*(nether|dutch)",NCL:"new.?caledonia",NZL:"new.?zealand",NIC:"nicaragua",NER:"\\bniger(?!ia)",NGA:"nigeria",NIU:"niue",NFK:"norfolk",MNP:"mariana",NOR:"norway",OMN:"\\boman|trucial",PAK:"^(?!.*east).*paki?stan",PLW:"palau",PSE:"palestin|\\bgaza|west.?bank",PAN:"panama",PNG:"papua|new.?guinea",PRY:"paraguay",PER:"peru",PHL:"philippines",PCN:"pitcairn",POL:"poland",PRT:"portugal",PRI:"puerto.?rico",QAT:"qatar",KOR:"^(?!.*d.*p.*r)(?!.*democrat)(?!.*people)(?!.*north).*\\bkorea(?!.*d.*p.*r)",MDA:"moldov|b(a|e)ssarabia",REU:"r(e|\xe9)union",ROU:"r(o|u|ou)mania",RUS:"\\brussia|soviet.?union|u\\.?s\\.?s\\.?r|socialist.?republics",RWA:"rwanda",BLM:"barth(e|\xe9)lemy",SHN:"helena",KNA:"kitts|\\bnevis",LCA:"\\blucia",MAF:"^(?=.*collectivity).*martin|^(?=.*france).*martin(?!ique)|^(?=.*french).*martin(?!ique)",SPM:"miquelon",VCT:"vincent",WSM:"^(?!.*amer).*samoa",SMR:"san.?marino",STP:"\\bs(a|\xe3)o.?tom(e|\xe9)",SAU:"\\bsa\\w*.?arabia",SEN:"senegal",SRB:"^(?!.*monte).*serbia",SYC:"seychell",SLE:"sierra",SGP:"singapore",SXM:"^(?!.*martin)(?!.*saba).*maarten",SVK:"^(?!.*cze).*slovak",SVN:"slovenia",SLB:"solomon",SOM:"somali",ZAF:"south.africa|s\\\\..?africa",SGS:"south.?georgia|sandwich",SSD:"\\bs\\w*.?sudan",ESP:"spain",LKA:"sri.?lanka|ceylon",SDN:"^(?!.*\\bs(?!u)).*sudan",SUR:"surinam|dutch.?guiana",SJM:"svalbard",SWZ:"swaziland",SWE:"sweden",CHE:"switz|swiss",SYR:"syria",TWN:"taiwan|taipei|formosa|^(?!.*peo)(?=.*rep).*china",TJK:"tajik",THA:"thailand|\\bsiam",MKD:"macedonia|fyrom",TLS:"^(?=.*leste).*timor|^(?=.*east).*timor",TGO:"togo",TKL:"tokelau",TON:"tonga",TTO:"trinidad|tobago",TUN:"tunisia",TUR:"turkey",TKM:"turkmen",TCA:"turks",TUV:"tuvalu",UGA:"uganda",UKR:"ukrain",ARE:"emirates|^u\\.?a\\.?e\\.?$|united.?arab.?em",GBR:"united.?kingdom|britain|^u\\.?k\\.?$",TZA:"tanzania",USA:"united.?states\\b(?!.*islands)|\\bu\\.?s\\.?a\\.?\\b|^\\s*u\\.?s\\.?\\b(?!.*islands)",UMI:"minor.?outlying.?is",URY:"uruguay",UZB:"uzbek",VUT:"vanuatu|new.?hebrides",VEN:"venezuela",VNM:"^(?!.*republic).*viet.?nam|^(?=.*socialist).*viet.?nam",VGB:"^(?=.*\\bu\\.?\\s?k).*virgin|^(?=.*brit).*virgin|^(?=.*kingdom).*virgin",VIR:"^(?=.*\\bu\\.?\\s?s).*virgin|^(?=.*states).*virgin",WLF:"futuna|wallis",ESH:"western.sahara",YEM:"^(?!.*arab)(?!.*north)(?!.*sana)(?!.*peo)(?!.*dem)(?!.*south)(?!.*aden)(?!.*\\bp\\.?d\\.?r).*yemen",YMD:"^(?=.*peo).*yemen|^(?!.*rep)(?=.*dem).*yemen|^(?=.*south).*yemen|^(?=.*aden).*yemen|^(?=.*\\bp\\.?d\\.?r).*yemen",YUG:"yugoslavia",ZMB:"zambia|northern.?rhodesia",EAZ:"zanzibar",ZWE:"zimbabwe|^(?!.*northern).*rhodesia"}},{}],114:[function(t,e,r){function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function i(t){return t<0?0:t>1?1:t}function a(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return i("%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))}function s(t,e,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}function l(t){var e=t.replace(/ /g,"").toLowerCase();if(e in c)return c[e].slice();if("#"===e[0]){if(4===e.length){return(r=parseInt(e.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null}if(7===e.length){var r;return(r=parseInt(e.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null}return null}var i=e.indexOf("("),l=e.indexOf(")");if(-1!==i&&l+1===e.length){var u=e.substr(0,i),f=e.substr(i+1,l-(i+1)).split(","),h=1;switch(u){case"rgba":if(4!==f.length)return null;h=o(f.pop());case"rgb":return 3!==f.length?null:[a(f[0]),a(f[1]),a(f[2]),h];case"hsla":if(4!==f.length)return null;h=o(f.pop());case"hsl":if(3!==f.length)return null;var d=(parseFloat(f[0])%360+360)%360/360,p=o(f[1]),m=o(f[2]),g=m<=.5?m*(p+1):m+p-m*p,v=2*m-g;return[n(255*s(v,g,d+1/3)),n(255*s(v,g,d)),n(255*s(v,g,d-1/3)),h];default:return null}}return null}var c={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};try{r.parseCSSColor=l}catch(t){}},{}],115:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=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]=c*t[d]+u*e[d]+f*r[d]+h*n[d];return a}return c*t+u*e+f*r+h*n},e.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,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],116:[function(t,e,r){"use strict";var n=t("./lib/thunk.js");e.exports=function(t){var e=new function(){this.argTypes=[],this.shimArgs=[],this.arrayArgs=[],this.arrayBlockIndices=[],this.scalarArgs=[],this.offsetArgs=[],this.offsetArgIndex=[],this.indexArgs=[],this.shapeArgs=[],this.funcName="",this.pre=null,this.body=null,this.post=null,this.debug=!1};e.pre=t.pre,e.body=t.body,e.post=t.post;var r=t.args.slice(0);e.argTypes=r;for(var i=0;i0)throw new Error("cwise: pre() block may not reference array args");if(i0)throw new Error("cwise: post() block may not reference array args")}else if("scalar"===a)e.scalarArgs.push(i),e.shimArgs.push("scalar"+i);else if("index"===a){if(e.indexArgs.push(i),i0)throw new Error("cwise: pre() block may not reference array index");if(i0)throw new Error("cwise: post() block may not reference array index")}else if("shape"===a){if(e.shapeArgs.push(i),ir.length)throw new Error("cwise: Too many arguments in pre() block");if(e.body.args.length>r.length)throw new Error("cwise: Too many arguments in body() block");if(e.post.args.length>r.length)throw new Error("cwise: Too many arguments in post() block");return e.debug=!!t.printCode||!!t.debug,e.funcName=t.funcName||"cwise",e.blockSize=t.blockSize||64,n(e)}},{"./lib/thunk.js":118}],117:[function(t,e,r){"use strict";function n(t,e,r){var n,i,a=t.length,o=e.arrayArgs.length,s=e.indexArgs.length>0,l=[],c=[],u=0,f=0;for(n=0;n=0;--n)u=t[n],l.push(["for(i",n,"=0;i",n,"0&&l.push(["index[",f,"]-=s",f].join("")),l.push(["++index[",u,"]"].join(""))),l.push("}")}return l.join("\n")}function i(t,e,r){for(var n=t.body,i=[],a=[],o=0;o0&&y.push("shape=SS.slice(0)"),t.indexArgs.length>0){var x=new Array(r);for(l=0;l3&&v.push(i(t.pre,t,s));var M=i(t.body,t,s),k=function(t){for(var e=0,r=t[0].length;e0,c=[],u=0;u0;){"].join("")),c.push(["if(j",u,"<",s,"){"].join("")),c.push(["s",e[u],"=j",u].join("")),c.push(["j",u,"=0"].join("")),c.push(["}else{s",e[u],"=",s].join("")),c.push(["j",u,"-=",s,"}"].join("")),l&&c.push(["index[",e[u],"]=j",u].join(""));for(u=0;u3&&v.push(i(t.post,t,s)),t.debug&&console.log("-----Generated cwise routine for ",e,":\n"+v.join("\n")+"\n----------");var A=[t.funcName||"unnamed","_cwise_loop_",o[0].join("s"),"m",k,function(t){for(var e=new Array(t.length),r=!0,n=0;n0&&(r=r&&e[n]===e[n-1])}return r?e[0]:e.join("")}(s)].join("");return new Function(["function ",A,"(",g.join(","),"){",v.join("\n"),"} return ",A].join(""))()}},{uniq:556}],118:[function(t,e,r){"use strict";var n=t("./compile.js");e.exports=function(t){var e=["'use strict'","var CACHED={}"],r=[],i=t.funcName+"_cwise_thunk";e.push(["return function ",i,"(",t.shimArgs.join(","),"){"].join(""));for(var a=[],o=[],s=[["array",t.arrayArgs[0],".shape.slice(",Math.max(0,t.arrayBlockIndices[0]),t.arrayBlockIndices[0]<0?","+t.arrayBlockIndices[0]+")":")"].join("")],l=[],c=[],u=0;u0&&(l.push("array"+t.arrayArgs[0]+".shape.length===array"+f+".shape.length+"+(Math.abs(t.arrayBlockIndices[0])-Math.abs(t.arrayBlockIndices[u]))),c.push("array"+t.arrayArgs[0]+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[0])+"]===array"+f+".shape[shapeIndex+"+Math.max(0,t.arrayBlockIndices[u])+"]"))}for(t.arrayArgs.length>1&&(e.push("if (!("+l.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same dimensionality!')"),e.push("for(var shapeIndex=array"+t.arrayArgs[0]+".shape.length-"+Math.abs(t.arrayBlockIndices[0])+"; shapeIndex--\x3e0;) {"),e.push("if (!("+c.join(" && ")+")) throw new Error('cwise: Arrays do not all have the same shape!')"),e.push("}")),u=0;u=0?(a>=b?10:a>=_?5:a>=w?2:1)*Math.pow(10,i):-Math.pow(10,-i)/(a>=b?10:a>=_?5:a>=w?2:1)}function n(t,e,r){var n=Math.abs(e-t)/Math.max(0,r),i=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),a=n/i;return a>=b?i*=10:a>=_?i*=5:a>=w&&(i*=2),ee?1:t>=e?0:NaN},o=function(t){return 1===t.length&&(t=function(t){return function(e,r){return a(t(e),r)}}(t)),{left:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)<0?n=a+1:i=a}return n},right:function(e,r,n,i){for(null==n&&(n=0),null==i&&(i=e.length);n>>1;t(e[a],r)>0?i=a:n=a+1}return n}}},s=o(a),l=s.right,c=s.left,u=function(t){return null===t?NaN:+t},f=function(t,e){var r,n,i=t.length,a=0,o=-1,s=0,l=0;if(null==e)for(;++o1)return l/(a-1)},h=function(t,e){var r=f(t,e);return r?Math.sqrt(r):r},d=function(t,e){var r,n,i,a=t.length,o=-1;if(null==e){for(;++o=r)for(n=i=r;++or&&(n=r),i=r)for(n=i=r;++or&&(n=r),i=1)return+r(t[n-1],n-1,t);var n,i=(n-1)*e,a=Math.floor(i),o=+r(t[a],a,t);return o+(+r(t[a+1],a+1,t)-o)*(i-a)}},A=function(t,e){var r,n,i=t.length,a=-1;if(null==e){for(;++a=r)for(n=r;++ar&&(n=r)}else for(;++a=r)for(n=r;++ar&&(n=r);return n},T=function(t){if(!(a=t.length))return[];for(var e=-1,r=A(t,i),n=new Array(r);++et?1:e>=t?0:NaN},t.deviation=h,t.extent=d,t.histogram=function(){function t(t){var a,o,s=t.length,c=new Array(s);for(a=0;ah;)d.pop(),--p;var m,g=new Array(p+1);for(a=0;a<=p;++a)(m=g[a]=[]).x0=a>0?d[a-1]:f,m.x1=a=r)for(n=r;++an&&(n=r)}else for(;++a=r)for(n=r;++an&&(n=r);return n},t.mean=function(t,e){var r,n=t.length,i=n,a=-1,o=0;if(null==e)for(;++a=0;)for(e=(n=t[i]).length;--e>=0;)r[--o]=n[e];return r},t.min=A,t.pairs=function(t,r){null==r&&(r=e);for(var n=0,i=t.length-1,a=t[0],o=new Array(i<0?0:i);n0)for(t=Math.ceil(t/o),e=Math.floor(e/o),a=new Array(i=Math.ceil(e-t+1));++l=u.length)return null!=l?l(e):null!=s?e.sort(s):e;for(var o,c,f,h=-1,d=e.length,p=u[n++],m=r(),g=i();++hu.length)return t;var n,i=f[r-1];return null!=l&&r>=u.length?n=t.entries():(n=[],t.each(function(t,i){n.push({key:i,values:e(t,r)})})),null!=i?n.sort(function(t,e){return i(t.key,e.key)}):n}var s,l,c,u=[],f=[];return c={object:function(e){return t(e,0,n,i)},map:function(e){return t(e,0,a,o)},entries:function(r){return e(t(r,0,a,o),0)},key:function(t){return u.push(t),c},sortKeys:function(t){return f[u.length-1]=t,c},sortValues:function(t){return s=t,c},rollup:function(t){return l=t,c}}},t.set=l,t.map=r,t.keys=function(t){var e=[];for(var r in t)e.push(r);return e},t.values=function(t){var e=[];for(var r in t)e.push(t[r]);return e},t.entries=function(t){var e=[];for(var r in t)e.push({key:r,value:t[r]});return e},Object.defineProperty(t,"__esModule",{value:!0})})},{}],122:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function r(){}function n(t){var e;return t=(t+"").trim().toLowerCase(),(e=E.exec(t))?(e=parseInt(e[1],16),new l(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1)):(e=L.exec(t))?i(parseInt(e[1],16)):(e=C.exec(t))?new l(e[1],e[2],e[3],1):(e=z.exec(t))?new l(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=D.exec(t))?a(e[1],e[2],e[3],e[4]):(e=I.exec(t))?a(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=P.exec(t))?c(e[1],e[2]/100,e[3]/100,1):(e=O.exec(t))?c(e[1],e[2]/100,e[3]/100,e[4]):F.hasOwnProperty(t)?i(F[t]):"transparent"===t?new l(NaN,NaN,NaN,0):null}function i(t){return new l(t>>16&255,t>>8&255,255&t,1)}function a(t,e,r,n){return n<=0&&(t=e=r=NaN),new l(t,e,r,n)}function o(t){return t instanceof r||(t=n(t)),t?(t=t.rgb(),new l(t.r,t.g,t.b,t.opacity)):new l}function s(t,e,r,n){return 1===arguments.length?o(t):new l(t,e,r,null==n?1:n)}function l(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}function c(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new f(t,e,r,n)}function u(t,e,i,a){return 1===arguments.length?function(t){if(t instanceof f)return new f(t.h,t.s,t.l,t.opacity);if(t instanceof r||(t=n(t)),!t)return new f;if(t instanceof f)return t;var e=(t=t.rgb()).r/255,i=t.g/255,a=t.b/255,o=Math.min(e,i,a),s=Math.max(e,i,a),l=NaN,c=s-o,u=(s+o)/2;return c?(l=e===s?(i-a)/c+6*(i0&&u<1?0:l,new f(l,c,u,t.opacity)}(t):new f(t,e,i,null==a?1:a)}function f(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}function h(t,e,r){return 255*(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)}function d(t){if(t instanceof m)return new m(t.l,t.a,t.b,t.opacity);if(t instanceof _){var e=t.h*R;return new m(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}t instanceof l||(t=o(t));var r=x(t.r),n=x(t.g),i=x(t.b),a=g((.4124564*r+.3575761*n+.1804375*i)/j),s=g((.2126729*r+.7151522*n+.072175*i)/B);return new m(116*s-16,500*(a-s),200*(s-g((.0193339*r+.119192*n+.9503041*i)/U)),t.opacity)}function p(t,e,r,n){return 1===arguments.length?d(t):new m(t,e,r,null==n?1:n)}function m(t,e,r,n){this.l=+t,this.a=+e,this.b=+r,this.opacity=+n}function g(t){return t>G?Math.pow(t,1/3):t/H+V}function v(t){return t>q?t*t*t:H*(t-V)}function y(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function x(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function b(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof _)return new _(t.h,t.c,t.l,t.opacity);t instanceof m||(t=d(t));var e=Math.atan2(t.b,t.a)*N;return new _(e<0?e+360:e,Math.sqrt(t.a*t.a+t.b*t.b),t.l,t.opacity)}(t):new _(t,e,r,null==n?1:n)}function _(t,e,r,n){this.h=+t,this.c=+e,this.l=+r,this.opacity=+n}function w(t,e,r,n){return 1===arguments.length?function(t){if(t instanceof M)return new M(t.h,t.s,t.l,t.opacity);t instanceof l||(t=o(t));var e=t.r/255,r=t.g/255,n=t.b/255,i=(K*n+Z*e-J*r)/(K+Z-J),a=n-i,s=(X*(r-i)-Y*a)/W,c=Math.sqrt(s*s+a*a)/(X*i*(1-i)),u=c?Math.atan2(s,a)*N-120:NaN;return new M(u<0?u+360:u,c,i,t.opacity)}(t):new M(t,e,r,null==n?1:n)}function M(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}var k=function(t,e,r){t.prototype=e.prototype=r,r.constructor=t},A="\\s*([+-]?\\d+)\\s*",T="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",S="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",E=/^#([0-9a-f]{3})$/,L=/^#([0-9a-f]{6})$/,C=new RegExp("^rgb\\("+[A,A,A]+"\\)$"),z=new RegExp("^rgb\\("+[S,S,S]+"\\)$"),D=new RegExp("^rgba\\("+[A,A,A,T]+"\\)$"),I=new RegExp("^rgba\\("+[S,S,S,T]+"\\)$"),P=new RegExp("^hsl\\("+[T,S,S]+"\\)$"),O=new RegExp("^hsla\\("+[T,S,S,T]+"\\)$"),F={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};k(r,n,{displayable:function(){return this.rgb().displayable()},toString:function(){return this.rgb()+""}}),k(l,s,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new l(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return 0<=this.r&&this.r<=255&&0<=this.g&&this.g<=255&&0<=this.b&&this.b<=255&&0<=this.opacity&&this.opacity<=1},toString:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}})),k(f,u,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new f(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new f(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,i=2*r-n;return new l(h(t>=240?t-240:t+120,i,n),h(t,i,n),h(t<120?t+240:t-120,i,n),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1}}));var R=Math.PI/180,N=180/Math.PI,j=.95047,B=1,U=1.08883,V=4/29,q=6/29,H=3*q*q,G=q*q*q;k(m,p,e(r,{brighter:function(t){return new m(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker:function(t){return new m(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb:function(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,r=isNaN(this.b)?t:t-this.b/200;return t=B*v(t),e=j*v(e),r=U*v(r),new l(y(3.2404542*e-1.5371385*t-.4985314*r),y(-.969266*e+1.8760108*t+.041556*r),y(.0556434*e-.2040259*t+1.0572252*r),this.opacity)}})),k(_,b,e(r,{brighter:function(t){return new _(this.h,this.c,this.l+18*(null==t?1:t),this.opacity)},darker:function(t){return new _(this.h,this.c,this.l-18*(null==t?1:t),this.opacity)},rgb:function(){return d(this).rgb()}}));var Y=-.29227,W=-.90649,X=1.97294,Z=X*W,J=1.78277*X,K=1.78277*Y- -.14861*W;k(M,w,e(r,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new M(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new M(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=isNaN(this.h)?0:(this.h+120)*R,e=+this.l,r=isNaN(this.s)?0:this.s*e*(1-e),n=Math.cos(t),i=Math.sin(t);return new l(255*(e+r*(-.14861*n+1.78277*i)),255*(e+r*(Y*n+W*i)),255*(e+r*(X*n)),this.opacity)}})),t.color=n,t.rgb=s,t.hsl=u,t.lab=p,t.hcl=b,t.cubehelix=w,Object.defineProperty(t,"__esModule",{value:!0})})},{}],123:[function(t,e,r){!function(t,n){n("object"==typeof r&&void 0!==e?r:t.d3=t.d3||{})}(this,function(t){"use strict";function e(){for(var t,e=0,n=arguments.length,i={};e=0&&(r=t.slice(n+1),t=t.slice(0,n)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:r}})}(t+"",i),o=-1,s=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++o0)for(var r,n,i=new Array(r),a=0;ad+s||np+s||if.index){var l=d-a.x-a.vx,u=p-a.y-a.vy,v=l*l+u*u;vt.r&&(t.r=t[e].r)}function i(){if(s){var e,r,n=s.length;for(l=new Array(n),e=0;e=m)){(t.data!==o||t.next)&&(0===i&&(i=h(),u+=i*i),0===a&&(a=h(),u+=a*a),u1?(null==e?g.remove(t):g.set(t,s(e)),l):g.get(t)},find:function(e,r,n){var i,a,o,s,l,c=0,u=t.length;for(null==n?n=1/0:n*=n,c=0;c1?(y.on(t,e),l):y.on(t)}}},t.forceX=function(t){function e(t){for(var e,r=0,o=n.length;r180||r<-180?r-360*Math.round(r/360):r):x(isNaN(t)?e:t)}function a(t){return 1==(t=+t)?o:function(e,r){return r-e?function(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}(e,r,t):x(isNaN(e)?r:e)}}function o(t,e){var r=e-t;return r?n(t,r):x(isNaN(t)?e:t)}function s(t){return function(r){var n,i,a=r.length,o=new Array(a),s=new Array(a),l=new Array(a);for(n=0;n180?e+=360:e-t>180&&(t+=360),a.push({i:r.push(i(r)+"rotate(",null,n)-2,x:A(t,e)})):e&&r.push(i(r)+"rotate("+e+n)}(a.rotate,o.rotate,s,l),function(t,e,r,a){t!==e?a.push({i:r.push(i(r)+"skewX(",null,n)-2,x:A(t,e)}):e&&r.push(i(r)+"skewX("+e+n)}(a.skewX,o.skewX,s,l),function(t,e,r,n,a,o){if(t!==r||e!==n){var s=a.push(i(a)+"scale(",null,",",null,")");o.push({i:s-4,x:A(t,r)},{i:s-2,x:A(e,n)})}else 1===r&&1===n||a.push(i(a)+"scale("+r+","+n+")")}(a.scaleX,a.scaleY,o.scaleX,o.scaleY,s,l),a=o=null,function(t){for(var e,r=-1,n=l.length;++r=1?(n=1,e-1):Math.floor(n*e),a=t[i],o=t[i+1],s=i>0?t[i-1]:2*a-o,l=ia&&(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:A(r,n)})),a=E.lastIndex;return a=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o,i=d,!(d=d[f=u<<1|c]))return i[f]=p,t;if(s=+t._x.call(null,d.data),l=+t._y.call(null,d.data),e===s&&r===l)return p.next=d,i?i[f]=p:t._root=p,t;do{i=i?i[f]=new Array(4):t._root=new Array(4),(c=e>=(a=(m+v)/2))?m=a:v=a,(u=r>=(o=(g+y)/2))?g=o:y=o}while((f=u<<1|c)==(h=(l>=o)<<1|s>=a));return i[h]=d,i[f]=p,t}function r(t,e,r){var i=new n(null==e?function(t){return t[0]}:e,null==r?function(t){return t[1]}:r,NaN,NaN,NaN,NaN);return null==t?i:i.addAll(t)}function n(t,e,r,n,i,a){this._x=t,this._y=e,this._x0=r,this._y0=n,this._x1=i,this._y1=a,this._root=void 0}function i(t){for(var e={data:t.data},r=e;t=t.next;)r=r.next={data:t.data};return e}var a=function(t,e,r,n,i){this.node=t,this.x0=e,this.y0=r,this.x1=n,this.y1=i},o=r.prototype=n.prototype;o.copy=function(){var t,e,r=new n(this._x,this._y,this._x0,this._y0,this._x1,this._y1),a=this._root;if(!a)return r;if(!a.length)return r._root=i(a),r;for(t=[{source:a,target:r._root=new Array(4)}];a=t.pop();)for(var o=0;o<4;++o)(e=a.source[o])&&(e.length?t.push({source:e,target:a.target[o]=new Array(4)}):a.target[o]=i(e));return r},o.add=function(t){var r=+this._x.call(null,t),n=+this._y.call(null,t);return e(this.cover(r,n),r,n,t)},o.addAll=function(t){var r,n,i,a,o=t.length,s=new Array(o),l=new Array(o),c=1/0,u=1/0,f=-1/0,h=-1/0;for(n=0;nf&&(f=i),ah&&(h=a));for(ft||t>i||n>e||e>a))return this;var o,s,l=i-r,c=this._root;switch(s=(e<(n+a)/2)<<1|t<(r+i)/2){case 0:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,a=n+l,t>i||e>a);break;case 1:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,a=n+l,r>t||e>a);break;case 2:do{o=new Array(4),o[s]=c,c=o}while(l*=2,i=r+l,n=a-l,t>i||n>e);break;case 3:do{o=new Array(4),o[s]=c,c=o}while(l*=2,r=i-l,n=a-l,r>t||n>e)}this._root&&this._root.length&&(this._root=c)}return this._x0=r,this._y0=n,this._x1=i,this._y1=a,this},o.data=function(){var t=[];return this.visit(function(e){if(!e.length)do{t.push(e.data)}while(e=e.next)}),t},o.extent=function(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]},o.find=function(t,e,r){var n,i,o,s,l,c,u,f=this._x0,h=this._y0,d=this._x1,p=this._y1,m=[],g=this._root;for(g&&m.push(new a(g,f,h,d,p)),null==r?r=1/0:(f=t-r,h=e-r,d=t+r,p=e+r,r*=r);c=m.pop();)if(!(!(g=c.node)||(i=c.x0)>d||(o=c.y0)>p||(s=c.x1)=y)<<1|t>=v)&&(c=m[m.length-1],m[m.length-1]=m[m.length-1-u],m[m.length-1-u]=c)}else{var x=t-+this._x.call(null,g.data),b=e-+this._y.call(null,g.data),_=x*x+b*b;if(_=(s=(p+g)/2))?p=s:g=s,(u=o>=(l=(m+v)/2))?m=l:v=l,e=d,!(d=d[f=u<<1|c]))return this;if(!d.length)break;(e[f+1&3]||e[f+2&3]||e[f+3&3])&&(r=e,h=f)}for(;d.data!==t;)if(n=d,!(d=d.next))return this;return(i=d.next)&&delete d.next,n?(i?n.next=i:delete n.next,this):e?(i?e[f]=i:delete e[f],(d=e[0]||e[1]||e[2]||e[3])&&d===(e[3]||e[2]||e[1]||e[0])&&!d.length&&(r?r[h]=d:this._root=d),this):(this._root=i,this)},o.removeAll=function(t){for(var e=0,r=t.length;e=0&&r._call.call(null,t),r=r._next;--f}function o(){g=(m=y.now())+v,f=h=0;try{a()}finally{f=0,function(){var t,e,r=c,n=1/0;for(;r;)r._call?(n>r._time&&(n=r._time),t=r,r=r._next):(e=r._next,r._next=null,r=t?t._next=e:c=e);u=t,l(n)}(),g=0}}function s(){var t=y.now(),e=t-m;e>p&&(v-=e,m=t)}function l(t){if(!f){h&&(h=clearTimeout(h));var e=t-g;e>24?(t<1/0&&(h=setTimeout(o,e)),d&&(d=clearInterval(d))):(d||(m=g,d=setInterval(s,p)),f=1,x(o))}}var c,u,f=0,h=0,d=0,p=1e3,m=0,g=0,v=0,y="object"==typeof performance&&performance.now?performance:Date,x="function"==typeof requestAnimationFrame?requestAnimationFrame:function(t){setTimeout(t,17)};n.prototype=i.prototype={constructor:n,restart:function(t,r,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?e():+n)+(null==r?0:+r),this._next||u===this||(u?u._next=this:c=this,u=this),this._call=t,this._time=n,l()},stop:function(){this._call&&(this._call=null,this._time=1/0,l())}};t.now=e,t.timer=i,t.timerFlush=a,t.timeout=function(t,e,r){var i=new n;return e=null==e?0:+e,i.restart(function(r){i.stop(),t(r+e)},e,r),i},t.interval=function(t,r,i){var a=new n,o=r;return null==r?(a.restart(t,r,i),a):(r=+r,i=null==i?e():+i,a.restart(function e(n){n+=o,a.restart(e,o+=r,i),t(n)},r,i),a)},Object.defineProperty(t,"__esModule",{value:!0})})},{}],128:[function(t,e,r){!function(){function t(t){return t&&(t.ownerDocument||t.document||t).documentElement}function r(t){return t&&(t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView)}function n(t,e){return te?1:t>=e?0:NaN}function i(t){return null===t?NaN:+t}function a(t){return!isNaN(t)}function o(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}}}function s(t){return t.length}function l(t,e){for(var r in e)Object.defineProperty(t.prototype,r,{value:e[r],enumerable:!1})}function c(){this._=Object.create(null)}function u(t){return(t+="")===oa||t[0]===sa?sa+t:t}function f(t){return(t+="")[0]===sa?t.slice(1):t}function h(t){return u(t)in this._}function d(t){return(t=u(t))in this._&&delete this._[t]}function p(){var t=[];for(var e in this._)t.push(f(e));return t}function m(){var t=0;for(var e in this._)++t;return t}function g(){for(var t in this._)return!1;return!0}function v(){this._=Object.create(null)}function y(t){return t}function x(t,e){if(e in t)return e;e=e.charAt(0).toUpperCase()+e.slice(1);for(var r=0,n=la.length;r0&&(t=t.slice(0,a));var s=ya.get(t);return s&&(t=s,o=G),a?e?function(){var a=o(e,Ki(arguments));n.call(this),this.addEventListener(t,this[i]=a,a.$=r),a._=e}:n:e?b:function(){var e,r=new RegExp("^__on([^.]+)"+Zi.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]}}}function H(t,e){return function(r){var n=Zi.event;Zi.event=r,e[0]=this.__data__;try{t.apply(this,e)}finally{Zi.event=n}}}function G(t,e){var r=H(t,e);return function(t){var e=t.relatedTarget;e&&(e===this||8&e.compareDocumentPosition(this))||r.call(this,t)}}function Y(e){var n=".dragsuppress-"+ ++ba,i="click"+n,a=Zi.select(r(e)).on("touchmove"+n,M).on("dragstart"+n,M).on("selectstart"+n,M);if(null==xa&&(xa=!("onselectstart"in e)&&x(e.style,"userSelect")),xa){var o=t(e).style,s=o[xa];o[xa]="none"}return function(t){if(a.on(n,null),xa&&(o[xa]=s),t){var e=function(){a.on(i,null)};a.on(i,function(){M(),e()},!0),setTimeout(e,0)}}}function W(t,e){e.changedTouches&&(e=e.changedTouches[0]);var n=t.ownerSVGElement||t;if(n.createSVGPoint){var i=n.createSVGPoint();if(_a<0){var a=r(t);if(a.scrollX||a.scrollY){var o=(n=Zi.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important"))[0][0].getScreenCTM();_a=!(o.f||o.e),n.remove()}}return _a?(i.x=e.pageX,i.y=e.pageY):(i.x=e.clientX,i.y=e.clientY),i=i.matrixTransform(t.getScreenCTM().inverse()),[i.x,i.y]}var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}function X(){return Zi.event.changedTouches[0].identifier}function Z(t){return t>0?1:t<0?-1:0}function J(t,e,r){return(e[0]-t[0])*(r[1]-t[1])-(e[1]-t[1])*(r[0]-t[0])}function K(t){return t>1?0:t<-1?ka:Math.acos(t)}function Q(t){return t>1?Sa:t<-1?-Sa:Math.asin(t)}function $(t){return((t=Math.exp(t))+1/t)/2}function tt(t){return(t=Math.sin(t/2))*t}function et(){}function rt(t,e,r){return this instanceof rt?(this.h=+t,this.s=+e,void(this.l=+r)):arguments.length<2?t instanceof rt?new rt(t.h,t.s,t.l):gt(""+t,vt,rt):new rt(t,e,r)}function nt(t,e,r){function n(t){return Math.round(255*function(t){return t>360?t-=360:t<0&&(t+=360),t<60?i+(a-i)*t/60:t<180?a:t<240?i+(a-i)*(240-t)/60:i}(t))}var i,a;return t=isNaN(t)?0:(t%=360)<0?t+360:t,e=isNaN(e)?0:e<0?0:e>1?1:e,r=r<0?0:r>1?1:r,a=r<=.5?r*(1+e):r+e-r*e,i=2*r-a,new ht(n(t+120),n(t),n(t-120))}function it(t,e,r){return this instanceof it?(this.h=+t,this.c=+e,void(this.l=+r)):arguments.length<2?t instanceof it?new it(t.h,t.c,t.l):t instanceof ot?lt(t.l,t.a,t.b):lt((t=yt((t=Zi.rgb(t)).r,t.g,t.b)).l,t.a,t.b):new it(t,e,r)}function at(t,e,r){return isNaN(t)&&(t=0),isNaN(e)&&(e=0),new ot(r,Math.cos(t*=Ea)*e,Math.sin(t)*e)}function ot(t,e,r){return this instanceof ot?(this.l=+t,this.a=+e,void(this.b=+r)):arguments.length<2?t instanceof ot?new ot(t.l,t.a,t.b):t instanceof it?at(t.h,t.c,t.l):yt((t=ht(t)).r,t.g,t.b):new ot(t,e,r)}function st(t,e,r){var n=(t+16)/116,i=n+e/500,a=n-r/200;return i=ct(i)*Ra,n=ct(n)*Na,a=ct(a)*ja,new ht(ft(3.2404542*i-1.5371385*n-.4985314*a),ft(-.969266*i+1.8760108*n+.041556*a),ft(.0556434*i-.2040259*n+1.0572252*a))}function lt(t,e,r){return t>0?new it(Math.atan2(r,e)*La,Math.sqrt(e*e+r*r),t):new it(NaN,NaN,t)}function ct(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function ut(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function ft(t){return Math.round(255*(t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function ht(t,e,r){return this instanceof ht?(this.r=~~t,this.g=~~e,void(this.b=~~r)):arguments.length<2?t instanceof ht?new ht(t.r,t.g,t.b):gt(""+t,ht,nt):new ht(t,e,r)}function dt(t){return new ht(t>>16,t>>8&255,255&t)}function pt(t){return dt(t)+""}function mt(t){return t<16?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function gt(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(bt(i[0]),bt(i[1]),bt(i[2]))}return(a=Va.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 vt(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 rt(n,i,l)}function yt(t,e,r){var n=ut((.4124564*(t=xt(t))+.3575761*(e=xt(e))+.1804375*(r=xt(r)))/Ra),i=ut((.2126729*t+.7151522*e+.072175*r)/Na);return ot(116*i-16,500*(n-i),200*(i-ut((.0193339*t+.119192*e+.9503041*r)/ja)))}function xt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function bt(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function _t(t){return"function"==typeof t?t:function(){return t}}function wt(t){return function(e,r,n){return 2===arguments.length&&"function"==typeof r&&(n=r,r=null),Mt(e,r,t,n)}}function Mt(t,e,r,n){function i(){var t,e=l.status;if(!e&&function(t){var e=t.responseType;return e&&"text"!==e?t.response:t.responseText}(l)||e>=200&&e<300||304===e){try{t=r.call(a,l)}catch(t){return void o.error.call(a,t)}o.load.call(a,t)}else o.error.call(a,l)}var a={},o=Zi.dispatch("beforesend","progress","load","error"),s={},l=new XMLHttpRequest,c=null;return!this.XDomainRequest||"withCredentials"in l||!/^(http(s)?:)?\/\//.test(t)||(l=new XDomainRequest),"onload"in l?l.onload=l.onerror=i:l.onreadystatechange=function(){l.readyState>3&&i()},l.onprogress=function(t){var e=Zi.event;Zi.event=t;try{o.progress.call(a,l)}finally{Zi.event=e}},a.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",a)},a.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",a):e},a.responseType=function(t){return arguments.length?(c=t,a):c},a.response=function(t){return r=t,a},["get","post"].forEach(function(t){a[t]=function(){return a.send.apply(a,[t].concat(Ki(arguments)))}}),a.send=function(r,n,i){if(2===arguments.length&&"function"==typeof n&&(i=n,n=null),l.open(r,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),l.setRequestHeader)for(var u in s)l.setRequestHeader(u,s[u]);return null!=e&&l.overrideMimeType&&l.overrideMimeType(e),null!=c&&(l.responseType=c),null!=i&&a.on("error",i).on("load",function(t){i(null,t)}),o.beforesend.call(a,l),l.send(null==n?null:n),a},a.abort=function(){return l.abort(),a},Zi.rebind(a,o,"on"),null==n?a:a.get(function(t){return 1===t.length?function(e,r){t(null==e?r:null)}:t}(n))}function kt(t,e,r){var n=arguments.length;n<2&&(e=0),n<3&&(r=Date.now());var i={c:t,t:r+e,n:null};return Ha?Ha.n=i:qa=i,Ha=i,Ga||(Ya=clearTimeout(Ya),Ga=1,Wa(At)),i}function At(){var t=Tt(),e=St()-t;e>24?(isFinite(e)&&(clearTimeout(Ya),Ya=setTimeout(At,e)),Ga=0):(Ga=1,Wa(At))}function Tt(){for(var t=Date.now(),e=qa;e;)t>=e.t&&e.c(t-e.t)&&(e.c=null),e=e.n;return t}function St(){for(var t,e=qa,r=1/0;e;)e.c?(e.t1?Date.UTC.apply(this,arguments):arguments[0])}function Ct(t,e,r){function n(e){var r=t(e),n=a(r,1);return e-r1)for(;o68?1900:2e3)}(+n[0]),r+n[0].length):-1}function Bt(t,e,r){return/^[+-]\d{4}$/.test(e=e.slice(r,r+5))?(t.Z=-e,r+5):-1}function Ut(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function Vt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function qt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+3));return n?(t.j=+n[0],r+n[0].length):-1}function Ht(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function Gt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Yt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Wt(t,e,r){eo.lastIndex=0;var n=eo.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Xt(t){var e=t.getTimezoneOffset(),r=e>0?"-":"+",n=aa(e)/60|0,i=aa(e)%60;return r+Dt(n,"0",2)+Dt(i,"0",2)}function Zt(t,e,r){ro.lastIndex=0;var n=ro.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Jt(t){for(var e=t.length,r=-1;++r=0?1:-1,s=o*r,l=Math.cos(e),c=Math.sin(e),u=a*c,f=i*l+u*Math.cos(s),h=u*o*Math.sin(s);lo.add(Math.atan2(h,f)),n=t,i=l,a=c}var e,r,n,i,a;co.point=function(o,s){co.point=t,n=(e=o)*Ea,i=Math.cos(s=(r=s)*Ea/2+ka/4),a=Math.sin(s)},co.lineEnd=function(){t(e,r)}}function ne(t){var e=t[0],r=t[1],n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}function ie(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ae(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function oe(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function se(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function le(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function ce(t){return[Math.atan2(t[1],t[0]),Q(t[2])]}function ue(t,e){return aa(t[0]-e[0])=0;--s)i.point((f=u[s])[0],f[1]);else n(d.x,d.p.x,-1,i);d=d.p}u=(d=d.o).z,p=!p}while(!d.v);i.lineEnd()}}}function xe(t){if(e=t.length){for(var e,r,n=0,i=t[0];++n0){for(_||(a.polygonStart(),_=!0),a.lineStart();++o1&&2&e&&r.push(r.pop().concat(r.shift())),d.push(r.filter(we))}var d,p,m,g=e(a),v=i.invert(n[0],n[1]),y={point:o,lineStart:l,lineEnd:c,polygonStart:function(){y.point=u,y.lineStart=f,y.lineEnd=h,d=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=l,y.lineEnd=c,d=Zi.merge(d);var t=function(t,e){var r=t[0],n=t[1],i=[Math.sin(r),-Math.cos(r),0],a=0,o=0;lo.reset();for(var s=0,l=e.length;s=0?1:-1,M=w*_,k=M>ka,A=p*x;if(lo.add(Math.atan2(A*w*Math.sin(M),m*b+A*Math.cos(M))),a+=k?_+w*Aa:_,k^h>=r^v>=r){var T=ae(ne(f),ne(t));le(T);var S=ae(i,T);le(S);var E=(k^_>=0?-1:1)*Q(S[2]);(n>E||n===E&&(T[0]||T[1]))&&(o+=k^_>=0?1:-1)}if(!g++)break;h=v,p=x,m=b,f=t}}return(a<-wa||a1}function Me(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,r){t.push([e,r])},lineEnd:b,buffer:function(){var r=e;return e=[],t=null,r},rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))}}}function ke(t,e){return((t=t.x)[0]<0?t[1]-Sa-wa:Sa-t[1])-((e=e.x)[0]<0?e[1]-Sa-wa:Sa-e[1])}function Ae(t,e,r,n){return function(i){var a,o=i.a,s=i.b,l=o.x,c=o.y,u=0,f=1,h=s.x-l,d=s.y-c;if(a=t-l,h||!(a>0)){if(a/=h,h<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=r-l,h||!(a<0)){if(a/=h,h<0){if(a>f)return;a>u&&(u=a)}else if(h>0){if(a0)){if(a/=d,d<0){if(a0){if(a>f)return;a>u&&(u=a)}if(a=n-c,d||!(a<0)){if(a/=d,d<0){if(a>f)return;a>u&&(u=a)}else if(d>0){if(a0&&(i.a={x:l+u*h,y:c+u*d}),f<1&&(i.b={x:l+f*h,y:c+f*d}),i}}}}}}function Te(t,e,r,n){function i(n,i){return aa(n[0]-t)0?0:3:aa(n[0]-r)0?2:1:aa(n[1]-e)0?1:0:i>0?3:2}function a(t,e){return o(t.x,e.x)}function o(t,e){var r=i(t,1),n=i(e,1);return r!==n?r-n:0===r?e[1]-t[1]:1===r?t[0]-e[0]:2===r?t[1]-e[1]:e[0]-t[0]}return function(s){function l(a,s,l,c){var u=0,f=0;if(null==a||(u=i(a,l))!==(f=i(s,l))||o(a,s)<0^l>0)do{c.point(0===u||3===u?t:r,u>1?n:e)}while((u=(u+l+4)%4)!==f);else c.point(s[0],s[1])}function c(i,a){return t<=i&&i<=r&&e<=a&&a<=n}function u(t,e){c(t,e)&&s.point(t,e)}function f(t,e){var r=c(t=Math.max(-ko,Math.min(ko,t)),e=Math.max(-ko,Math.min(ko,e)));if(d&&p.push([t,e]),_)m=t,g=e,v=r,_=!1,r&&(s.lineStart(),s.point(t,e));else if(r&&b)s.point(t,e);else{var n={a:{x:y,y:x},b:{x:t,y:e}};A(n)?(b||(s.lineStart(),s.point(n.a.x,n.a.y)),s.point(n.b.x,n.b.y),r||s.lineEnd(),w=!1):r&&(s.lineStart(),s.point(t,e),w=!1)}y=t,x=e,b=r}var h,d,p,m,g,v,y,x,b,_,w,M=s,k=Me(),A=Ae(t,e,r,n),T={point:u,lineStart:function(){T.point=f,d&&d.push(p=[]),_=!0,b=!1,y=x=NaN},lineEnd:function(){h&&(f(m,g),v&&b&&k.rejoin(),h.push(k.buffer())),T.point=u,b&&s.lineEnd()},polygonStart:function(){s=k,h=[],d=[],w=!0},polygonEnd:function(){s=M,h=Zi.merge(h);var e=function(t){for(var e=0,r=d.length,n=t[1],i=0;in&&J(c,a,t)>0&&++e:a[1]<=n&&J(c,a,t)<0&&--e,c=a;return 0!==e}([t,n]),r=w&&e,i=h.length;(r||i)&&(s.polygonStart(),r&&(s.lineStart(),l(null,null,1,s),s.lineEnd()),i&&ye(h,a,e,l,s),s.polygonEnd()),h=d=p=null}};return T}}function Se(t){var e=0,r=ka/3,n=je(t),i=n(e,r);return i.parallels=function(t){return arguments.length?n(e=t[0]*ka/180,r=t[1]*ka/180):[e/ka*180,r/ka*180]},i}function Ee(t,e){function r(t,e){var r=Math.sqrt(a-2*i*Math.sin(e))/i;return[r*Math.sin(t*=i),o-r*Math.cos(t)]}var n=Math.sin(t),i=(n+Math.sin(e))/2,a=1+n*(2*i-n),o=Math.sqrt(a)/i;return r.invert=function(t,e){var r=o-e;return[Math.atan2(t,r)/i,Q((a-(t*t+r*r)*i*i)/(2*i))]},r}function Le(){function t(t,e){To+=i*t-n*e,n=t,i=e}var e,r,n,i;zo.point=function(a,o){zo.point=t,e=n=a,r=i=o},zo.lineEnd=function(){t(e,r)}}function Ce(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function ze(t,e){ho+=t,po+=e,++mo}function De(){function t(t,n){var i=t-e,a=n-r,o=Math.sqrt(i*i+a*a);go+=o*(e+t)/2,vo+=o*(r+n)/2,yo+=o,ze(e=t,r=n)}var e,r;Io.point=function(n,i){Io.point=t,ze(e=n,r=i)}}function Ie(){Io.point=ze}function Pe(){function t(t,e){var r=t-n,a=e-i,o=Math.sqrt(r*r+a*a);go+=o*(n+t)/2,vo+=o*(i+e)/2,yo+=o,xo+=(o=i*t-n*e)*(n+t),bo+=o*(i+e),_o+=3*o,ze(n=t,i=e)}var e,r,n,i;Io.point=function(a,o){Io.point=t,ze(e=n=a,r=i=o)},Io.lineEnd=function(){t(e,r)}}function Oe(t){function e(e){return(a?function(e){function n(r,n){r=t(r,n),e.point(r[0],r[1])}function i(){x=NaN,k.point=o,e.lineStart()}function o(n,i){var o=ne([n,i]),s=t(n,i);r(x,b,y,_,w,M,x=s[0],b=s[1],y=n,_=o[0],w=o[1],M=o[2],a,e),e.point(x,b)}function s(){k.point=n,e.lineEnd()}function l(){i(),k.point=c,k.lineEnd=u}function c(t,e){o(f=t,h=e),d=x,p=b,m=_,g=w,v=M,k.point=o}function u(){r(x,b,y,_,w,M,d,p,f,m,g,v,a,e),k.lineEnd=s,s()}var f,h,d,p,m,g,v,y,x,b,_,w,M,k={point:n,lineStart:i,lineEnd:s,polygonStart:function(){e.polygonStart(),k.lineStart=l},polygonEnd:function(){e.polygonEnd(),k.lineStart=i}};return k}:function(e){return Re(e,function(r,n){r=t(r,n),e.point(r[0],r[1])})})(e)}function r(e,a,o,s,l,c,u,f,h,d,p,m,g,v){var y=u-e,x=f-a,b=y*y+x*x;if(b>4*n&&g--){var _=s+d,w=l+p,M=c+m,k=Math.sqrt(_*_+w*w+M*M),A=Math.asin(M/=k),T=aa(aa(M)-1)n||aa((y*C+x*z)/b-.5)>.3||s*d+l*p+c*m0&&16,e):Math.sqrt(n)},e}function Fe(t){this.stream=t}function Re(t,e){return{point:e,sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}function Ne(t){return je(function(){return t})()}function je(t){function e(t){return t=o(t[0]*Ea,t[1]*Ea),[t[0]*f+s,l-t[1]*f]}function r(){o=ge(a=qe(g,v,x),i);var t=i(p,m);return s=h-t[0]*f,l=d+t[1]*f,n()}function n(){return c&&(c.valid=!1,c=null),e}var i,a,o,s,l,c,u=Oe(function(t,e){return t=i(t,e),[t[0]*f+s,l-t[1]*f]}),f=150,h=480,d=250,p=0,m=0,g=0,v=0,x=0,b=Mo,_=y,w=null,M=null;return e.stream=function(t){return c&&(c.valid=!1),c=Be(b(a,u(_(t)))),c.valid=!0,c},e.clipAngle=function(t){return arguments.length?(b=null==t?(w=t,Mo):function(t){function e(t,e){return Math.cos(t)*Math.cos(e)>i}function r(t,e,r){var n=[1,0,0],a=ae(ne(t),ne(e)),o=ie(a,a),s=a[0],l=o-s*s;if(!l)return!r&&t;var c=i*o/l,u=-i*s/l,f=ae(n,a),h=se(n,c);oe(h,se(a,u));var d=f,p=ie(h,d),m=ie(d,d),g=p*p-m*(ie(h,h)-1);if(!(g<0)){var v=Math.sqrt(g),y=se(d,(-p-v)/m);if(oe(y,h),y=ce(y),!r)return y;var x,b=t[0],_=e[0],w=t[1],M=e[1];_0^y[1]<(aa(y[0]-b)ka^(b<=y[0]&&y[0]<=_)){var T=se(d,(-p+v)/m);return oe(T,h),[y,ce(T)]}}}function n(e,r){var n=a?t:ka-t,i=0;return e<-n?i|=1:e>n&&(i|=2),r<-n?i|=4:r>n&&(i|=8),i}var i=Math.cos(t),a=i>0,o=aa(i)>wa;return _e(e,function(t){var i,s,l,c,u;return{lineStart:function(){c=l=!1,u=1},point:function(f,h){var d,p=[f,h],m=e(f,h),g=a?m?0:n(f,h):m?n(f+(f<0?ka:-ka),h):0;if(!i&&(c=l=m)&&t.lineStart(),m!==l&&(d=r(i,p),(ue(i,d)||ue(p,d))&&(p[0]+=wa,p[1]+=wa,m=e(p[0],p[1]))),m!==l)u=0,m?(t.lineStart(),d=r(p,i),t.point(d[0],d[1])):(d=r(i,p),t.point(d[0],d[1]),t.lineEnd()),i=d;else if(o&&i&&a^m){var v;g&s||!(v=r(p,i,!0))||(u=0,a?(t.lineStart(),t.point(v[0][0],v[0][1]),t.point(v[1][0],v[1][1]),t.lineEnd()):(t.point(v[1][0],v[1][1]),t.lineEnd(),t.lineStart(),t.point(v[0][0],v[0][1])))}!m||i&&ue(i,p)||t.point(p[0],p[1]),i=p,l=m,s=g},lineEnd:function(){l&&t.lineEnd(),i=null},clean:function(){return u|(c&&l)<<1}}},We(t,6*Ea),a?[0,-t]:[-ka,t-ka])}((w=+t)*Ea),n()):w},e.clipExtent=function(t){return arguments.length?(M=t,_=t?Te(t[0][0],t[0][1],t[1][0],t[1][1]):y,n()):M},e.scale=function(t){return arguments.length?(f=+t,r()):f},e.translate=function(t){return arguments.length?(h=+t[0],d=+t[1],r()):[h,d]},e.center=function(t){return arguments.length?(p=t[0]%360*Ea,m=t[1]%360*Ea,r()):[p*La,m*La]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Ea,v=t[1]%360*Ea,x=t.length>2?t[2]%360*Ea:0,r()):[g*La,v*La,x*La]},Zi.rebind(e,u,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&function(t){return(t=o.invert((t[0]-s)/f,(l-t[1])/f))&&[t[0]*La,t[1]*La]},r()}}function Be(t){return Re(t,function(e,r){t.point(e*Ea,r*Ea)})}function Ue(t,e){return[t,e]}function Ve(t,e){return[t>ka?t-Aa:t<-ka?t+Aa:t,e]}function qe(t,e,r){return t?e||r?ge(Ge(t),Ye(e,r)):Ge(t):e||r?Ye(e,r):Ve}function He(t){return function(e,r){return e+=t,[e>ka?e-Aa:e<-ka?e+Aa:e,r]}}function Ge(t){var e=He(t);return e.invert=He(-t),e}function Ye(t,e){function r(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*n+s*i;return[Math.atan2(l*a-u*o,s*n-c*i),Q(u*a+l*o)]}var n=Math.cos(t),i=Math.sin(t),a=Math.cos(e),o=Math.sin(e);return r.invert=function(t,e){var r=Math.cos(e),s=Math.cos(t)*r,l=Math.sin(t)*r,c=Math.sin(e),u=c*a-l*o;return[Math.atan2(l*a+c*o,s*n+u*i),Q(u*n-s*i)]},r}function We(t,e){var r=Math.cos(t),n=Math.sin(t);return function(i,a,o,s){var l=o*e;null!=i?(i=Xe(r,i),a=Xe(r,a),(o>0?ia)&&(i+=o*Aa)):(i=t+o*Aa,a=t-.5*l);for(var c,u=i;o>0?u>a:u0?e<-Sa+wa&&(e=-Sa+wa):e>Sa-wa&&(e=Sa-wa);var r=o/Math.pow(i(e),a);return[r*Math.sin(a*t),o-r*Math.cos(a*t)]}var n=Math.cos(t),i=function(t){return Math.tan(ka/4+t/2)},a=t===e?Math.sin(t):Math.log(n/Math.cos(e))/Math.log(i(e)/i(t)),o=n*Math.pow(i(t),a)/a;return a?(r.invert=function(t,e){var r=o-e,n=Z(a)*Math.sqrt(t*t+r*r);return[Math.atan2(t,r)/a,2*Math.atan(Math.pow(o/n,1/a))-Sa]},r):rr}function er(t,e){function r(t,e){var r=a-e;return[r*Math.sin(i*t),a-r*Math.cos(i*t)]}var n=Math.cos(t),i=t===e?Math.sin(t):(n-Math.cos(e))/(e-t),a=n/i+t;return aa(i)1&&J(t[r[n-2]],t[r[n-1]],t[i])<=0;)--n;r[n++]=i}return r.slice(0,n)}function lr(t,e){return t[0]-e[0]||t[1]-e[1]}function cr(t,e,r){return(r[0]-e[0])*(t[1]-e[1])<(r[1]-e[1])*(t[0]-e[0])}function ur(t,e,r,n){var i=t[0],a=r[0],o=e[0]-i,s=n[0]-a,l=t[1],c=r[1],u=e[1]-l,f=n[1]-c,h=(s*(l-c)-f*(i-a))/(f*o-s*u);return[i+h*o,l+h*u]}function fr(t){var e=t[0],r=t[t.length-1];return!(e[0]-r[0]||e[1]-r[1])}function hr(t){var e=Wo.pop()||new function(){Sr(this),this.edge=this.site=this.circle=null};return e.site=t,e}function dr(t){_r(t),Ho.remove(t),Wo.push(t),Sr(t)}function pr(t){var e=t.circle,r=e.x,n=e.cy,i={x:r,y:n},a=t.P,o=t.N,s=[t];dr(t);for(var l=a;l.circle&&aa(r-l.circle.x)wa)s=s.L;else{if(!((i=a-function(t,e){var r=t.N;if(r)return gr(r,e);var n=t.site;return n.y===e?n.x:1/0}(s,o))>wa)){n>-wa?(e=s.P,r=s):i>-wa?(e=s,r=s.N):e=r=s;break}if(!s.R){e=s;break}s=s.R}var l=hr(t);if(Ho.insert(e,l),e||r){if(e===r)return _r(e),r=hr(e.site),Ho.insert(l,r),l.edge=r.edge=Mr(e.site,l.site),br(e),void br(r);if(r){_r(e),_r(r);var c=e.site,u=c.x,f=c.y,h=t.x-u,d=t.y-f,p=r.site,m=p.x-u,g=p.y-f,v=2*(h*g-d*m),y=h*h+d*d,x=m*m+g*g,b={x:(g*y-d*x)/v+u,y:(h*x-m*y)/v+f};kr(r.edge,c,p,b),l.edge=Mr(c,t,null,b),r.edge=Mr(t,p,null,b),br(e),br(r)}else l.edge=Mr(e.site,l.site)}}function gr(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,c=l-e;if(!c)return s;var u=s-n,f=1/a-1/c,h=u/c;return f?(-h+Math.sqrt(h*h-2*f*(u*u/(-2*c)-l+c/2+i-a/2)))/f+n:(n+s)/2}function vr(t){this.site=t,this.edges=[]}function yr(t){for(var e,r,n,i,a,o,s,l,c,u,f=t[0][0],h=t[1][0],d=t[0][1],p=t[1][1],m=qo,g=m.length;g--;)if((a=m[g])&&a.prepare())for(l=(s=a.edges).length,o=0;owa||aa(i-r)>wa)&&(s.splice(o,0,new Ar(function(t,e,r){var n=new wr(t,null);return n.a=e,n.b=r,Vo.push(n),n}(a.site,u,aa(n-f)wa?{x:f,y:aa(e-f)wa?{x:aa(r-p)wa?{x:h,y:aa(e-h)wa?{x:aa(r-d)=-Ma)){var h=l*l+c*c,d=u*u+g*g,p=(g*h-c*d)/f,m=(l*d-u*h)/f,g=m+s,v=Xo.pop()||new function(){Sr(this),this.x=this.y=this.arc=this.site=this.cy=null};v.arc=t,v.site=i,v.x=p+o,v.y=g+Math.sqrt(p*p+m*m),v.cy=g,t.circle=v;for(var y=null,x=Yo._;x;)if(v.y=s)return;if(h>p){if(a){if(a.y>=c)return}else a={x:g,y:l};r={x:g,y:c}}else{if(a){if(a.y1)if(h>p){if(a){if(a.y>=c)return}else a={x:(l-i)/n,y:l};r={x:(c-i)/n,y:c}}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.xa&&(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:Nr(r,n)})),a=Ko.lastIndex;return a=0&&!(r=Zi.interpolators[n](t,e)););return r}function Ur(t,e){var r,n=[],i=[],a=t.length,o=e.length,s=Math.min(t.length,e.length);for(r=0;r180?e+=360:e-t>180&&(t+=360),n.push({i:r.push(tn(r)+"rotate(",null,")")-2,x:Nr(t,e)})):e&&r.push(tn(r)+"rotate("+e+")")}(t.rotate,e.rotate,r,n),function(t,e,r,n){t!==e?n.push({i:r.push(tn(r)+"skewX(",null,")")-2,x:Nr(t,e)}):e&&r.push(tn(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(tn(r)+"scale(",null,",",null,")");n.push({i:i-4,x:Nr(t[0],e[0])},{i:i-2,x:Nr(t[1],e[1])})}else 1===e[0]&&1===e[1]||r.push(tn(r)+"scale("+e+")")}(t.scale,e.scale,r,n),t=e=null,function(t){for(var e,i=-1,a=n.length;++i=0;)r.push(i[n])}function hn(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;++oi&&(n=r,i=e);return n}function Mn(t){return t.reduce(kn,0)}function kn(t,e){return t+e[1]}function An(t,e){return Tn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function Tn(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 Sn(t){return[Zi.min(t),Zi.max(t)]}function En(t,e){return t.value-e.value}function Ln(t,e){var r=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=r,r._pack_prev=e}function Cn(t,e){t._pack_next=e,e._pack_prev=t}function zn(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 Dn(t){function e(t){u=Math.min(t.x-t.r,u),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),d=Math.max(t.y+t.r,d)}if((r=t.children)&&(c=r.length)){var r,n,i,a,o,s,l,c,u=1/0,f=-1/0,h=1/0,d=-1/0;if(r.forEach(In),n=r[0],n.x=-n.r,n.y=0,e(n),c>1&&(i=r[1],i.x=i.r,i.y=0,e(i),c>2))for(Fn(n,i,a=r[2]),e(a),Ln(n,a),n._pack_prev=a,Ln(a,i),i=n._pack_next,o=3;o2?function(t,e,r,n){var i=[],a=[],o=0,s=Math.min(t.length,e.length)-1;for(t[s]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=Yn(n.map(i),r?Math:fs);return t.domain(e),n=e.map(a),o},o.ticks=function(){var t=Hn(n),o=[],s=t[0],l=t[1],c=Math.floor(i(s)),u=Math.ceil(i(l)),f=e%1?2:e;if(isFinite(u-c)){if(r){for(;c0;h--)o.push(a(c)*h);for(c=0;o[c]l;u--);o=o.slice(c,u)}return o},o.tickFormat=function(t,r){if(!arguments.length)return us;arguments.length<2?r=us:"function"!=typeof r&&(r=Zi.format(r));var n=Math.max(1,e*t/o.ticks().length);return function(t){var o=t/a(Math.round(i(t)));return o*e0?s[r-1]:t[0],r0?0:1}function gi(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,c=-s*a,u=t[0]+l,f=t[1]+c,h=e[0]+l,d=e[1]+c,p=(u+h)/2,m=(f+d)/2,g=h-u,v=d-f,y=g*g+v*v,x=r-n,b=u*d-h*f,_=(v<0?-1:1)*Math.sqrt(Math.max(0,x*x*y-b*b)),w=(b*v-g*_)/y,M=(-b*g-v*_)/y,k=(b*v+g*_)/y,A=(-b*g+v*_)/y,T=w-p,S=M-m,E=k-p,L=A-m;return T*T+S*S>E*E+L*L&&(w=k,M=A),[[w-l,M-c],[w*r/x,M*r/x]]}function vi(t){function e(e){function o(){c.push("M",a(t(u),s))}for(var l,c=[],u=[],f=-1,h=e.length,d=_t(r),p=_t(n);++f1?t.join("L"):t+"Z"}function xi(t){return t.join("L")+"Z"}function bi(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 c=2;c9&&(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}function Li(t){for(var e,r,n,i=-1,a=t.length;++i0;)d[--s].call(t,o);if(a>=1)return m.event&&m.event.end.call(t,t.__data__,e),--p.count?delete p[n]:delete t[r],1}var l,u,f,h,d,p=t[r]||(t[r]={active:0,count:0}),m=p[n];m||(l=i.time,u=kt(a,0,l),m=p[n]={tween:new c,time:l,timer:u,delay:i.delay,duration:i.duration,ease:i.ease,index:e},i=null,++p.count)}function Vi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate("+(isFinite(n)?n:r(t))+",0)"})}function qi(t,e,r){t.attr("transform",function(t){var n=e(t);return"translate(0,"+(isFinite(n)?n:r(t))+")"})}function Hi(t){return t.toISOString()}function Gi(t,e,r){function n(e){return t(e)}function i(t,r){var n=(t[1]-t[0])/r,i=Zi.bisect(Fs,n);return i==Fs.length?[e.year,Kn(t.map(function(t){return t/31536e6}),r)[2]]:i?e[n/Fs[i-1]1?{floor:function(e){for(;r(e=t.floor(e));)e=Yi(e-1);return e},ceil:function(e){for(;r(e=t.ceil(e));)e=Yi(+e+1);return e}}:t))},n.ticks=function(t,e){var r=Hn(n.domain()),a=null==t?i(r,10):"number"==typeof t?i(r,t):!t.range&&[{range:t},e];return a&&(t=a[0],e=a[1]),t.range(r[0],Yi(+r[1]+1),e<1?1:e)},n.tickFormat=function(){return r},n.copy=function(){return Gi(t.copy(),e,r)},Zn(n,t)}function Yi(t){return new Date(t)}function Wi(t){return JSON.parse(t.responseText)}function Xi(t){var e=Qi.createRange();return e.selectNode(Qi.body),e.createContextualFragment(t.responseText)}var Zi={version:"3.5.17"},Ji=[].slice,Ki=function(t){return Ji.call(t)},Qi=this.document;if(Qi)try{Ki(Qi.documentElement.childNodes)[0].nodeType}catch(t){Ki=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}),Qi)try{Qi.createElement("DIV").style.setProperty("opacity",0,"")}catch(t){var $i=this.Element.prototype,ta=$i.setAttribute,ea=$i.setAttributeNS,ra=this.CSSStyleDeclaration.prototype,na=ra.setProperty;$i.setAttribute=function(t,e){ta.call(this,t,e+"")},$i.setAttributeNS=function(t,e,r){ea.call(this,t,e,r+"")},ra.setProperty=function(t,e,r){na.call(this,t,e+"",r)}}Zi.ascending=n,Zi.descending=function(t,e){return et?1:e>=t?0:NaN},Zi.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},Zi.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},Zi.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 l/(u-1)},Zi.deviation=function(){var t=Zi.variance.apply(this,arguments);return t?Math.sqrt(t):t};var ia=o(n);Zi.bisectLeft=ia.left,Zi.bisect=Zi.bisectRight=ia.right,Zi.bisector=function(t){return o(1===t.length?function(e,r){return n(t(e),r)}:t)},Zi.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},Zi.permute=function(t,e){for(var r=e.length,n=new Array(r);r--;)n[r]=t[e[r]];return n},Zi.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 aa=Math.abs;Zi.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}(aa(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)=a.length)return n?n.call(i,o):r?o.sort(r):o;for(var l,u,f,h,d=-1,p=o.length,m=a[s++],g=new c;++d=a.length)return t;var n=[],i=o[r++];return t.forEach(function(t,i){n.push({key:t,values:e(i,r)})}),i?n.sort(function(t,e){return i(t.key,e.key)}):n}var r,n,i={},a=[],o=[];return i.map=function(e,r){return t(r,e,0)},i.entries=function(r){return e(t(Zi.map,r,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return o[a.length-1]=t,i},i.sortValues=function(t){return r=t,i},i.rollup=function(t){return n=t,i},i},Zi.set=function(t){var e=new v;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}},Zi.event=null,Zi.requote=function(t){return t.replace(ca,"\\$&")};var ca=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ua={}.__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var r in e)t[r]=e[r]},fa=function(t,e){return e.querySelector(t)},ha=function(t,e){return e.querySelectorAll(t)},da=function(t,e){var r=t.matches||t[x(t,"matchesSelector")];return(da=function(t,e){return r.call(t,e)})(t,e)};"function"==typeof Sizzle&&(fa=function(t,e){return Sizzle(t,e)[0]||null},ha=Sizzle,da=Sizzle.matchesSelector),Zi.selection=function(){return Zi.select(Qi.documentElement)};var pa=Zi.selection.prototype=[];pa.select=function(t){var e,r,n,i,a=[];t=S(t);for(var o=-1,s=this.length;++o=0&&"xmlns"!==(r=t.slice(0,e))&&(t=t.slice(e+1)),ga.hasOwnProperty(r)?{space:ga[r],local:t}:t}},pa.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node();return(t=Zi.ns.qualify(t)).local?r.getAttributeNS(t.space,t.local):r.getAttribute(t)}for(e in t)this.each(L(e,t[e]));return this}return this.each(L(t,e))},pa.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var r=this.node(),n=(t=D(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},pa.sort=function(t){t=function(t){return arguments.length||(t=n),function(e,r){return e&&r?t(e.__data__,r.__data__):!e-!r}}.apply(this,arguments);for(var e=-1,r=this.length;++e=e&&(e=i+1);!(o=s[e])&&++e0&&(e=e.transition().duration(E)),e.call(t.event)}function o(){b&&b.domain(x.range().map(function(t){return(t-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(t){return(t-k.y)/k.k}).map(_.invert))}function s(t){L++||t({type:"zoomstart"})}function l(t){o(),t({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function c(t){--L||(t({type:"zoomend"}),m=null)}function u(){var t=this,n=P.of(t,arguments),a=0,o=Zi.select(r(t)).on(z,function(){a=1,i(Zi.mouse(t),u),l(n)}).on(D,function(){o.on(z,null).on(D,null),f(a),c(n)}),u=e(Zi.mouse(t)),f=Y(t);Ts.call(t),s(n)}function f(){function t(){var t=Zi.touches(p);return d=k.k,t.forEach(function(t){t.identifier in g&&(g[t.identifier]=e(t))}),t}function r(){var e=Zi.event.target;Zi.select(e).on(b,o).on(_,h),w.push(e);for(var r=Zi.event.changedTouches,n=0,i=r.length;n1){c=s[0];var u=s[1],f=c[0]-u[0],d=c[1]-u[1];v=f*f+d*d}}function o(){var t,e,r,a,o=Zi.touches(p);Ts.call(p);for(var s=0,c=o.length;s=c)return o;if(i)return i=!1,a;var e=u;if(34===t.charCodeAt(e)){for(var r=e;r++8?function(t){return t/r}:function(t){return t*r},symbol:t}});Zi.formatPrefix=function(t,e){var r=0;return(t=+t)&&(t<0&&(t*=-1),e&&(t=Zi.round(t,Et(t,e))),r=1+Math.floor(1e-12+Math.log(t)/Math.LN10),r=Math.max(-24,Math.min(24,3*Math.floor((r-1)/3)))),Xa[8+r/3]};var Za=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,Ja=Zi.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Zi.round(t,Et(t,e))).toFixed(Math.max(0,Math.min(20,Et(t*(1+1e-15),e))))}}),Ka=Zi.time={},Qa=Date;Lt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){$a.setUTCDate.apply(this._,arguments)},setDay:function(){$a.setUTCDay.apply(this._,arguments)},setFullYear:function(){$a.setUTCFullYear.apply(this._,arguments)},setHours:function(){$a.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){$a.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){$a.setUTCMinutes.apply(this._,arguments)},setMonth:function(){$a.setUTCMonth.apply(this._,arguments)},setSeconds:function(){$a.setUTCSeconds.apply(this._,arguments)},setTime:function(){$a.setTime.apply(this._,arguments)}};var $a=Date.prototype;Ka.year=Ct(function(t){return(t=Ka.day(t)).setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Ka.years=Ka.year.range,Ka.years.utc=Ka.year.utc.range,Ka.day=Ct(function(t){var e=new Qa(2e3,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Ka.days=Ka.day.range,Ka.days.utc=Ka.day.utc.range,Ka.dayOfYear=function(t){var e=Ka.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(t,e){e=7-e;var r=Ka[t]=Ct(function(t){return(t=Ka.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var r=Ka.year(t).getDay();return Math.floor((Ka.dayOfYear(t)+(r+e)%7)/7)-(r!==e)});Ka[t+"s"]=r.range,Ka[t+"s"].utc=r.utc.range,Ka[t+"OfYear"]=function(t){var r=Ka.year(t).getDay();return Math.floor((Ka.dayOfYear(t)+(r+e)%7)/7)}}),Ka.week=Ka.sunday,Ka.weeks=Ka.sunday.range,Ka.weeks.utc=Ka.sunday.utc.range,Ka.weekOfYear=Ka.sundayOfYear;var to={"-":"",_:" ",0:"0"},eo=/^\s*\d+/,ro=/^%/;Zi.locale=function(t){return{numberFormat:function(t){var e=t.decimal,r=t.thousands,n=t.grouping,i=t.currency,a=n&&r?function(t,e){for(var i=t.length,a=[],o=0,s=n[0],l=0;i>0&&s>0&&(l+s+1>e&&(s=Math.max(1,e-l)),a.push(t.substring(i-=s,i+s)),!((l+=s+1)>e));)s=n[o=(o+1)%n.length];return a.reverse().join(r)}:y;return function(t){var r=Za.exec(t),n=r[1]||" ",o=r[2]||">",s=r[3]||"-",l=r[4]||"",c=r[5],u=+r[6],f=r[7],h=r[8],d=r[9],p=1,m="",g="",v=!1,y=!0;switch(h&&(h=+h.substring(1)),(c||"0"===n&&"="===o)&&(c=n="0",o="="),d){case"n":f=!0,d="g";break;case"%":p=100,g="%",d="f";break;case"p":p=100,g="%",d="r";break;case"b":case"o":case"x":case"X":"#"===l&&(m="0"+d.toLowerCase());case"c":y=!1;case"d":v=!0,h=0;break;case"s":p=-1,d="r"}"$"===l&&(m=i[0],g=i[1]),"r"!=d||h||(d="g"),null!=h&&("g"==d?h=Math.max(1,Math.min(21,h)):"e"!=d&&"f"!=d||(h=Math.max(0,Math.min(20,h)))),d=Ja.get(d)||function(t){return t+""};var x=c&&f;return function(t){var r=g;if(v&&t%1)return"";var i=t<0||0===t&&1/t<0?(t=-t,"-"):"-"===s?"":s;if(p<0){var l=Zi.formatPrefix(t,h);t=l.scale(t),r=l.symbol+g}else t*=p;var b,_,w=(t=d(t,h)).lastIndexOf(".");if(w<0){var M=y?t.lastIndexOf("e"):-1;M<0?(b=t,_=""):(b=t.substring(0,M),_=t.substring(M))}else b=t.substring(0,w),_=e+t.substring(w+1);!c&&f&&(b=a(b,1/0));var k=m.length+b.length+_.length+(x?0:i.length),A=k"===o?A+i+t:"^"===o?A.substring(0,k>>=1)+i+t+A.substring(k):i+(x?t:A+t))+r}}}(t),timeFormat:function(t){function e(t){function e(e){for(var r,i,a,o=[],s=-1,l=0;++s=c)return-1;if(37===(i=e.charCodeAt(s++))){if(o=e.charAt(s++),!(a=_[o in to?e.charAt(s++):o])||(n=a(t,r,n))<0)return-1}else if(i!=r.charCodeAt(n++))return-1}return n}var n=t.dateTime,i=t.date,a=t.time,o=t.periods,s=t.days,l=t.shortDays,c=t.months,u=t.shortMonths;e.multi=(e.utc=function(t){function r(t){try{var e=new(Qa=Lt);return e._=t,n(e)}finally{Qa=Date}}var n=e(t);return r.parse=function(t){try{Qa=Lt;var e=n.parse(t);return e&&e._}finally{Qa=Date}},r.toString=n.toString,r}).multi=Jt;var f=Zi.map(),h=It(s),d=Pt(s),p=It(l),m=Pt(l),g=It(c),v=Pt(c),y=It(u),x=Pt(u);o.forEach(function(t,e){f.set(t.toLowerCase(),e)});var b={a:function(t){return l[t.getDay()]},A:function(t){return s[t.getDay()]},b:function(t){return u[t.getMonth()]},B:function(t){return c[t.getMonth()]},c:e(n),d:function(t,e){return Dt(t.getDate(),e,2)},e:function(t,e){return Dt(t.getDate(),e,2)},H:function(t,e){return Dt(t.getHours(),e,2)},I:function(t,e){return Dt(t.getHours()%12||12,e,2)},j:function(t,e){return Dt(1+Ka.dayOfYear(t),e,3)},L:function(t,e){return Dt(t.getMilliseconds(),e,3)},m:function(t,e){return Dt(t.getMonth()+1,e,2)},M:function(t,e){return Dt(t.getMinutes(),e,2)},p:function(t){return o[+(t.getHours()>=12)]},S:function(t,e){return Dt(t.getSeconds(),e,2)},U:function(t,e){return Dt(Ka.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Dt(Ka.mondayOfYear(t),e,2)},x:e(i),X:e(a),y:function(t,e){return Dt(t.getFullYear()%100,e,2)},Y:function(t,e){return Dt(t.getFullYear()%1e4,e,4)},Z:Xt,"%":function(){return"%"}},_={a:function(t,e,r){p.lastIndex=0;var n=p.exec(e.slice(r));return n?(t.w=m.get(n[0].toLowerCase()),r+n[0].length):-1},A:function(t,e,r){h.lastIndex=0;var n=h.exec(e.slice(r));return n?(t.w=d.get(n[0].toLowerCase()),r+n[0].length):-1},b:function(t,e,r){y.lastIndex=0;var n=y.exec(e.slice(r));return n?(t.m=x.get(n[0].toLowerCase()),r+n[0].length):-1},B:function(t,e,r){g.lastIndex=0;var n=g.exec(e.slice(r));return n?(t.m=v.get(n[0].toLowerCase()),r+n[0].length):-1},c:function(t,e,n){return r(t,b.c.toString(),e,n)},d:Vt,e:Vt,H:Ht,I:Ht,j:qt,L:Wt,m:Ut,M:Gt,p:function(t,e,r){var n=f.get(e.slice(r,r+=2).toLowerCase());return null==n?-1:(t.p=n,r)},S:Yt,U:Ft,w:Ot,W:Rt,x:function(t,e,n){return r(t,b.x.toString(),e,n)},X:function(t,e,n){return r(t,b.X.toString(),e,n)},y:jt,Y:Nt,Z:Bt,"%":Zt};return e}(t)}};var no=Zi.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",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"]});Zi.format=no.numberFormat,Zi.geo={},Kt.prototype={s:0,t:0,add:function(t){Qt(t,this.t,io),Qt(io.s,this.s,this),this.s?this.t+=io.t:this.s=io.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var io=new Kt;Zi.geo.stream=function(t,e){t&&ao.hasOwnProperty(t.type)?ao[t.type](t,e):$t(t,e)};var ao={Feature:function(t,e){$t(t.geometry,e)},FeatureCollection:function(t,e){for(var r=t.features,n=-1,i=r.length;++nd&&(d=e)}function e(e,r){var n=ne([e*Ea,r*Ea]);if(v){var i=ae(v,n),a=ae([i[1],-i[0],0],i);le(a),a=ce(a);var o=e-p,l=o>0?1:-1,c=a[0]*La*l,m=aa(o)>180;if(m^(l*pd&&(d=g)}else if(c=(c+360)%360-180,m^(l*pd&&(d=r);m?es(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e):h>=u?(eh&&(h=e)):e>p?s(u,e)>s(u,h)&&(h=e):s(e,h)>s(u,h)&&(u=e)}else t(e,r);v=n,p=e}function r(){_.point=e}function n(){b[0]=u,b[1]=h,_.point=t,v=null}function i(t,r){if(v){var n=t-p;y+=aa(n)>180?n+(n>0?360:-360):n}else m=t,g=r;co.point(t,r),e(t,r)}function a(){co.lineStart()}function o(){i(m,g),co.lineEnd(),aa(y)>wa&&(u=-(h=180)),b[0]=u,b[1]=h,v=null}function s(t,e){return(e-=t)<0?e+360:e}function l(t,e){return t[0]-e[0]}function c(t,e){return e[0]<=e[1]?e[0]<=t&&t<=e[1]:twa?d=90:y<-wa&&(f=-90),b[0]=u,b[1]=h}};return function(t){d=h=-(u=f=1/0),x=[],Zi.geo.stream(t,_);if(i=x.length){x.sort(l);for(var e=1,r=[p=x[0]];es(p[0],p[1])&&(p[1]=a[1]),s(a[0],p[1])>s(p[0],p[1])&&(p[0]=a[0])):r.push(p=a);for(var n,i,a,o=-1/0,p=(e=0,r[i=r.length-1]);e<=i;p=a,++e)a=r[e],(n=s(p[1],a[0]))>o&&(o=n,u=a[0],h=p[1])}return x=b=null,u===1/0||f===1/0?[[NaN,NaN],[NaN,NaN]]:[[u,f],[h,d]]}}(),Zi.geo.centroid=function(t){uo=fo=ho=po=mo=go=vo=yo=xo=bo=_o=0,Zi.geo.stream(t,wo);var e=xo,r=bo,n=_o,i=e*e+r*r+n*n;return i0?ka:-ka,l=aa(a-r);aa(l-ka)0?Sa:-Sa),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),t.point(a,n),e=0):i!==s&&l>=ka&&(aa(r-i)wa?Math.atan((Math.sin(e)*(a=Math.cos(n))*Math.sin(r)-Math.sin(n)*(i=Math.cos(e))*Math.sin(t))/(i*a*o)):(e+n)/2}(r,n,a,o),t.point(i,n),t.lineEnd(),t.lineStart(),t.point(s,n),e=0),t.point(r=a,n=o),i=s},lineEnd:function(){t.lineEnd(),r=n=NaN},clean:function(){return 2-e}}},function(t,e,r,n){var i;if(null==t)i=r*Sa,n.point(-ka,i),n.point(0,i),n.point(ka,i),n.point(ka,0),n.point(ka,-i),n.point(0,-i),n.point(-ka,-i),n.point(-ka,0),n.point(-ka,i);else if(aa(t[0]-e[0])>wa){var a=t[0]=.12&&i<.234&&n>=-.425&&n<-.214?o:i>=.166&&i<.234&&n>=-.214&&n<-.115?s:a).invert(t)},t.stream=function(t){var e=a.stream(t),r=o.stream(t),n=s.stream(t);return{point:function(t,i){e.point(t,i),r.point(t,i),n.point(t,i)},sphere:function(){e.sphere(),r.sphere(),n.sphere()},lineStart:function(){e.lineStart(),r.lineStart(),n.lineStart()},lineEnd:function(){e.lineEnd(),r.lineEnd(),n.lineEnd()},polygonStart:function(){e.polygonStart(),r.polygonStart(),n.polygonStart()},polygonEnd:function(){e.polygonEnd(),r.polygonEnd(),n.polygonEnd()}}},t.precision=function(e){return arguments.length?(a.precision(e),o.precision(e),s.precision(e),t):a.precision()},t.scale=function(e){return arguments.length?(a.scale(e),o.scale(.35*e),s.scale(e),t.translate(a.translate())):a.scale()},t.translate=function(e){if(!arguments.length)return a.translate();var c=a.scale(),u=+e[0],f=+e[1];return r=a.translate(e).clipExtent([[u-.455*c,f-.238*c],[u+.455*c,f+.238*c]]).stream(l).point,n=o.translate([u-.307*c,f+.201*c]).clipExtent([[u-.425*c+wa,f+.12*c+wa],[u-.214*c-wa,f+.234*c-wa]]).stream(l).point,i=s.translate([u-.205*c,f+.212*c]).clipExtent([[u-.214*c+wa,f+.166*c+wa],[u-.115*c-wa,f+.234*c-wa]]).stream(l).point,t},t.scale(1070)};var Ao,To,So,Eo,Lo,Co,zo={point:b,lineStart:b,lineEnd:b,polygonStart:function(){To=0,zo.lineStart=Le},polygonEnd:function(){zo.lineStart=zo.lineEnd=zo.point=b,Ao+=aa(To/2)}},Do={point:function(t,e){tLo&&(Lo=t),eCo&&(Co=e)},lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Io={point:ze,lineStart:De,lineEnd:Ie,polygonStart:function(){Io.lineStart=Pe},polygonEnd:function(){Io.point=ze,Io.lineStart=De,Io.lineEnd=Ie}};Zi.geo.path=function(){function t(t){return t&&("function"==typeof s&&a.pointRadius(+s.apply(this,arguments)),o&&o.valid||(o=i(a)),Zi.geo.stream(t,o)),a.result()}function e(){return o=null,t}var r,n,i,a,o,s=4.5;return t.area=function(t){return Ao=0,Zi.geo.stream(t,i(zo)),Ao},t.centroid=function(t){return ho=po=mo=go=vo=yo=xo=bo=_o=0,Zi.geo.stream(t,i(Io)),_o?[xo/_o,bo/_o]:yo?[go/yo,vo/yo]:mo?[ho/mo,po/mo]:[NaN,NaN]},t.bounds=function(t){return Lo=Co=-(So=Eo=1/0),Zi.geo.stream(t,i(Do)),[[So,Eo],[Lo,Co]]},t.projection=function(t){return arguments.length?(i=(r=t)?t.stream||function(t){var e=Oe(function(e,r){return t([e*La,r*La])});return function(t){return Be(e(t))}}(t):y,e()):r},t.context=function(t){return arguments.length?(a=null==(n=t)?new function(){function t(t,e){o.push("M",t,",",e,a)}function e(t,e){o.push("M",t,",",e),s.point=r}function r(t,e){o.push("L",t,",",e)}function n(){s.point=t}function i(){o.push("Z")}var a=Ce(4.5),o=[],s={point:t,lineStart:function(){s.point=e},lineEnd:n,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=n,s.point=t},pointRadius:function(t){return a=Ce(t),s},result:function(){if(o.length){var t=o.join("");return o=[],t}}};return s}:new function(t){function e(e,r){t.moveTo(e+o,r),t.arc(e,r,o,0,Aa)}function r(e,r){t.moveTo(e,r),s.point=n}function n(e,r){t.lineTo(e,r)}function i(){s.point=e}function a(){t.closePath()}var o=4.5,s={point:e,lineStart:function(){s.point=r},lineEnd:i,polygonStart:function(){s.lineEnd=a},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return o=t,s},result:b};return s}(t),"function"!=typeof s&&a.pointRadius(s),e()):n},t.pointRadius=function(e){return arguments.length?(s="function"==typeof e?e:(a.pointRadius(+e),+e),t):s},t.projection(Zi.geo.albersUsa()).context(null)},Zi.geo.transform=function(t){return{stream:function(e){var r=new Fe(e);for(var n in t)r[n]=t[n];return r}}},Fe.prototype={point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},Zi.geo.projection=Ne,Zi.geo.projectionMutator=je,(Zi.geo.equirectangular=function(){return Ne(Ue)}).raw=Ue.invert=Ue,Zi.geo.rotation=function(t){function e(e){return e=t(e[0]*Ea,e[1]*Ea),e[0]*=La,e[1]*=La,e}return t=qe(t[0]%360*Ea,t[1]*Ea,t.length>2?t[2]*Ea:0),e.invert=function(e){return e=t.invert(e[0]*Ea,e[1]*Ea),e[0]*=La,e[1]*=La,e},e},Ve.invert=Ue,Zi.geo.circle=function(){function t(){var t="function"==typeof n?n.apply(this,arguments):n,e=qe(-t[0]*Ea,-t[1]*Ea,0).invert,i=[];return r(null,null,1,{point:function(t,r){i.push(t=e(t,r)),t[0]*=La,t[1]*=La}}),{type:"Polygon",coordinates:[i]}}var e,r,n=[0,0],i=6;return t.origin=function(e){return arguments.length?(n=e,t):n},t.angle=function(n){return arguments.length?(r=We((e=+n)*Ea,i*Ea),t):e},t.precision=function(n){return arguments.length?(r=We(e*Ea,(i=+n)*Ea),t):i},t.angle(90)},Zi.geo.distance=function(t,e){var r,n=(e[0]-t[0])*Ea,i=t[1]*Ea,a=e[1]*Ea,o=Math.sin(n),s=Math.cos(n),l=Math.sin(i),c=Math.cos(i),u=Math.sin(a),f=Math.cos(a);return Math.atan2(Math.sqrt((r=f*o)*r+(r=c*u-l*f*s)*r),l*u+c*f*s)},Zi.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Zi.range(Math.ceil(a/g)*g,i,g).map(h).concat(Zi.range(Math.ceil(c/v)*v,l,v).map(d)).concat(Zi.range(Math.ceil(n/p)*p,r,p).filter(function(t){return aa(t%g)>wa}).map(u)).concat(Zi.range(Math.ceil(s/m)*m,o,m).filter(function(t){return aa(t%v)>wa}).map(f))}var r,n,i,a,o,s,l,c,u,f,h,d,p=10,m=p,g=90,v=360,y=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[h(a).concat(d(l).slice(1),h(i).reverse().slice(1),d(c).reverse().slice(1))]}},t.extent=function(e){return arguments.length?t.majorExtent(e).minorExtent(e):t.minorExtent()},t.majorExtent=function(e){return arguments.length?(a=+e[0][0],i=+e[1][0],c=+e[0][1],l=+e[1][1],a>i&&(e=a,a=i,i=e),c>l&&(e=c,c=l,l=e),t.precision(y)):[[a,c],[i,l]]},t.minorExtent=function(e){return arguments.length?(n=+e[0][0],r=+e[1][0],s=+e[0][1],o=+e[1][1],n>r&&(e=n,n=r,r=e),s>o&&(e=s,s=o,o=e),t.precision(y)):[[n,s],[r,o]]},t.step=function(e){return arguments.length?t.majorStep(e).minorStep(e):t.minorStep()},t.majorStep=function(e){return arguments.length?(g=+e[0],v=+e[1],t):[g,v]},t.minorStep=function(e){return arguments.length?(p=+e[0],m=+e[1],t):[p,m]},t.precision=function(e){return arguments.length?(y=+e,u=Ze(s,o,90),f=Je(n,r,y),h=Ze(c,l,90),d=Je(a,i,y),t):y},t.majorExtent([[-180,-90+wa],[180,90-wa]]).minorExtent([[-180,-80-wa],[180,80+wa]])},Zi.geo.greatArc=function(){function t(){return{type:"LineString",coordinates:[e||n.apply(this,arguments),r||i.apply(this,arguments)]}}var e,r,n=Ke,i=Qe;return t.distance=function(){return Zi.geo.distance(e||n.apply(this,arguments),r||i.apply(this,arguments))},t.source=function(r){return arguments.length?(n=r,e="function"==typeof r?null:r,t):n},t.target=function(e){return arguments.length?(i=e,r="function"==typeof e?null:e,t):i},t.precision=function(){return arguments.length?t:0},t},Zi.geo.interpolate=function(t,e){return function(t,e,r,n){var i=Math.cos(e),a=Math.sin(e),o=Math.cos(n),s=Math.sin(n),l=i*Math.cos(t),c=i*Math.sin(t),u=o*Math.cos(r),f=o*Math.sin(r),h=2*Math.asin(Math.sqrt(tt(n-e)+i*o*tt(r-t))),d=1/Math.sin(h),p=h?function(t){var e=Math.sin(t*=h)*d,r=Math.sin(h-t)*d,n=r*l+e*u,i=r*c+e*f,o=r*a+e*s;return[Math.atan2(i,n)*La,Math.atan2(o,Math.sqrt(n*n+i*i))*La]}:function(){return[t*La,e*La]};return p.distance=h,p}(t[0]*Ea,t[1]*Ea,e[0]*Ea,e[1]*Ea)},Zi.geo.length=function(t){return Po=0,Zi.geo.stream(t,Oo),Po};var Po,Oo={sphere:b,point:b,lineStart:function(){function t(t,i){var a=Math.sin(i*=Ea),o=Math.cos(i),s=aa((t*=Ea)-e),l=Math.cos(s);Po+=Math.atan2(Math.sqrt((s=o*Math.sin(s))*s+(s=n*a-r*o*l)*s),r*a+n*o*l),e=t,r=a,n=o}var e,r,n;Oo.point=function(i,a){e=i*Ea,r=Math.sin(a*=Ea),n=Math.cos(a),Oo.point=t},Oo.lineEnd=function(){Oo.point=Oo.lineEnd=b}},lineEnd:b,polygonStart:b,polygonEnd:b},Fo=$e(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Zi.geo.azimuthalEqualArea=function(){return Ne(Fo)}).raw=Fo;var Ro=$e(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},y);(Zi.geo.azimuthalEquidistant=function(){return Ne(Ro)}).raw=Ro,(Zi.geo.conicConformal=function(){return Se(tr)}).raw=tr,(Zi.geo.conicEquidistant=function(){return Se(er)}).raw=er;var No=$e(function(t){return 1/t},Math.atan);(Zi.geo.gnomonic=function(){return Ne(No)}).raw=No,rr.invert=function(t,e){return[t,2*Math.atan(Math.exp(e))-Sa]},(Zi.geo.mercator=function(){return nr(rr)}).raw=rr;var jo=$e(function(){return 1},Math.asin);(Zi.geo.orthographic=function(){return Ne(jo)}).raw=jo;var Bo=$e(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Zi.geo.stereographic=function(){return Ne(Bo)}).raw=Bo,ir.invert=function(t,e){return[-e,2*Math.atan(Math.exp(t))-Sa]},(Zi.geo.transverseMercator=function(){var t=nr(ir),e=t.center,r=t.rotate;return t.center=function(t){return t?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return t?r([t[0],t[1],t.length>2?t[2]+90:90]):(t=r(),[t[0],t[1],t[2]-90])},r([0,0,90])}).raw=ir,Zi.geom={},Zi.geom.hull=function(t){function e(t){if(t.length<3)return[];var e,i=_t(r),a=_t(n),o=t.length,s=[],l=[];for(e=0;e=0;--e)d.push(t[s[c[e]][2]]);for(e=+f;e=n&&c.x<=a&&c.y>=i&&c.y<=o?[[n,o],[a,o],[a,i],[n,i]]:[]).point=t[s]}),e}function r(t){return t.map(function(t,e){return{x:Math.round(a(t,e)/wa)*wa,y:Math.round(o(t,e)/wa)*wa,i:e}})}var n=ar,i=or,a=n,o=i,s=Zo;return t?e(t):(e.links=function(t){return zr(r(t)).edges.filter(function(t){return t.l&&t.r}).map(function(e){return{source:t[e.l.i],target:t[e.r.i]}})},e.triangles=function(t){var e=[];return zr(r(t)).cells.forEach(function(r,n){for(var i,a=r.site,o=r.edges.sort(xr),s=-1,l=o.length,c=o[l-1].edge,u=c.l===a?c.r:c.l;++s=c,h=n>=u,d=h<<1|f;t.leaf=!1,t=t.nodes[d]||(t.nodes[d]={leaf:!0,nodes:[],point:null,x:null,y:null}),f?i=c:s=c,h?o=u:l=u,a(t,e,r,n,i,o,s,l)}var u,f,h,d,p,m,g,v,y,x=_t(s),b=_t(l);if(null!=e)m=e,g=r,v=n,y=i;else if(v=y=-(m=g=1/0),f=[],h=[],p=t.length,o)for(d=0;dv&&(v=u.x),u.y>y&&(y=u.y),f.push(u.x),h.push(u.y);else for(d=0;dv&&(v=_),w>y&&(y=w),f.push(_),h.push(w)}var M=v-m,k=y-g;M>k?y=g+M:v=m+k;var A={leaf:!0,nodes:[],point:null,x:null,y:null};if(A.add=function(t){a(A,t,+x(t,++d),+b(t,d),m,g,v,y)},A.visit=function(t){Or(t,A,m,g,v,y)},A.find=function(t){return function(t,e,r,n,i,a,o){var s,l=1/0;return function t(c,u,f,h,d){if(!(u>a||f>o||h=_)<<1|e>=b,M=w+4;w=0?t.slice(0,e):t,n=e>=0?t.slice(e+1):"in";return r=$o.get(r)||Qo,n=ts.get(n)||y,function(t){return function(e){return e<=0?0:e>=1?1:t(e)}}(n(r.apply(null,Ji.call(arguments,1))))},Zi.interpolateHcl=function(t,e){t=Zi.hcl(t),e=Zi.hcl(e);var r=t.h,n=t.c,i=t.l,a=e.h-r,o=e.c-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.c:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return at(r+a*t,n+o*t,i+s*t)+""}},Zi.interpolateHsl=function(t,e){t=Zi.hsl(t),e=Zi.hsl(e);var r=t.h,n=t.s,i=t.l,a=e.h-r,o=e.s-n,s=e.l-i;return isNaN(o)&&(o=0,n=isNaN(n)?e.s:n),isNaN(a)?(a=0,r=isNaN(r)?e.h:r):a>180?a-=360:a<-180&&(a+=360),function(t){return nt(r+a*t,n+o*t,i+s*t)+""}},Zi.interpolateLab=function(t,e){t=Zi.lab(t),e=Zi.lab(e);var r=t.l,n=t.a,i=t.b,a=e.l-r,o=e.a-n,s=e.b-i;return function(t){return st(r+a*t,n+o*t,i+s*t)+""}},Zi.interpolateRound=Jr,Zi.transform=function(t){var e=Qi.createElementNS(Zi.ns.prefix.svg,"g");return(Zi.transform=function(t){if(null!=t){e.setAttribute("transform",t);var r=e.transform.baseVal.consolidate()}return new Kr(r?r.matrix:es)})(t)},Kr.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var es={a:1,b:0,c:0,d:1,e:0,f:0};Zi.interpolateTransform=en,Zi.layout={},Zi.layout.bundle=function(){return function(t){for(var e=[],r=-1,n=t.length;++r0?i=t:(r.c=null,r.t=NaN,r=null,c.end({type:"end",alpha:i=0})):t>0&&(c.start({type:"start",alpha:i=t}),r=kt(l.tick)),l):i},l.start=function(){function t(t,n){if(!r){for(r=new Array(i),l=0;l=0;)o.push(u=c[l]),u.parent=a,u.depth=a.depth+1;n&&(a.value=0),a.children=c}else n&&(a.value=+n.call(t,a,a.depth)||0),delete a.children;return hn(i,function(t){var r,i;e&&(r=t.children)&&r.sort(e),n&&(i=t.parent)&&(i.value+=t.value)}),s}var e=mn,r=dn,n=pn;return t.sort=function(r){return arguments.length?(e=r,t):e},t.children=function(e){return arguments.length?(r=e,t):r},t.value=function(e){return arguments.length?(n=e,t):n},t.revalue=function(e){return n&&(fn(e,function(t){t.children&&(t.value=0)}),hn(e,function(e){var r;e.children||(e.value=+n.call(t,e,e.depth)||0),(r=e.parent)&&(r.value+=e.value)})),e},t},Zi.layout.partition=function(){function t(e,r,n,i){var a=e.children;if(e.x=r,e.y=e.depth*i,e.dx=n,e.dy=i,a&&(o=a.length)){var o,s,l,c=-1;for(n=e.value?n/e.value:0;++cs&&(s=n),o.push(n)}for(r=0;r0)for(a=-1;++a=u[0]&&s<=u[1]&&((o=l[Zi.bisect(f,s,1,d)-1]).y+=p,o.push(t[a]));return l}var e=!0,r=Number,n=Sn,i=An;return t.value=function(e){return arguments.length?(r=e,t):r},t.range=function(e){return arguments.length?(n=_t(e),t):n},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return Tn(t,e)}:_t(e),t):i},t.frequency=function(r){return arguments.length?(e=!!r,t):e},t},Zi.layout.pack=function(){function t(t,a){var o=r.call(this,t,a),s=o[0],l=i[0],c=i[1],u=null==e?Math.sqrt:"function"==typeof e?e:function(){return e};if(s.x=s.y=0,hn(s,function(t){t.r=+u(t.value)}),hn(s,Dn),n){var f=n*(e?1:Math.max(2*s.r/l,2*s.r/c))/2;hn(s,function(t){t.r+=f}),hn(s,Dn),hn(s,function(t){t.r-=f})}return On(s,l/2,c/2,e?1:1/Math.max(2*s.r/l,2*s.r/c)),o}var e,r=Zi.layout.hierarchy().sort(En),n=0,i=[1,1];return t.size=function(e){return arguments.length?(i=e,t):i},t.radius=function(r){return arguments.length?(e=null==r||"function"==typeof r?r:+r,t):e},t.padding=function(e){return arguments.length?(n=+e,t):n},un(t,r)},Zi.layout.tree=function(){function t(t,l){var c=i.call(this,t,l),u=c[0],f=function(t){var e,r={A:null,children:[t]},n=[r];for(;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 m=a(h,d)/2-h.x,g=o[0]/(d.x+a(d,h)/2+m),v=o[1]/(p.depth||1);fn(u,function(t){t.x=(t.x+m)*g,t.y=t.depth*v})}return c}function e(t){var e=t.children,r=t.parent.children,n=t.i?r[t.i-1]:null;if(e.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 i=(e[0].z+e[e.length-1].z)/2;n?(t.z=n.z+a(t._,n._),t.m=t.z-i):t.z=i}else n&&(t.z=n.z+a(t._,n._));t.parent.A=function(t,e,r){if(e){for(var n,i=t,o=t,s=e,l=i.parent.children[0],c=i.m,u=o.m,f=s.m,h=l.m;s=jn(s),i=Nn(i),s&&i;)l=Nn(l),(o=jn(o)).a=t,(n=s.z+f-i.z-c+a(s._,i._))>0&&(!function(t,e,r){var n=r/(e.i-t.i);e.c-=n,e.s+=r,t.c+=n,e.z+=r,e.m+=r}(function(t,e,r){return t.a.parent===e.parent?t.a:r}(s,t,r),t,n),c+=n,u+=n),f+=s.m,c+=i.m,h+=l.m,u+=o.m;s&&!jn(o)&&(o.t=s,o.m+=f-u),i&&!Nn(l)&&(l.t=i,l.m+=c-h,r=t)}return r}(t,n,t.parent.A||r[0])}function r(t){t._.x=t.z+t.parent.m,t.m+=t.parent.m}function n(t){t.x*=o[0],t.y=t.depth*o[1]}var i=Zi.layout.hierarchy().sort(null).value(null),a=Rn,o=[1,1],s=null;return t.separation=function(e){return arguments.length?(a=e,t):a},t.size=function(e){return arguments.length?(s=null==(o=e)?n:null,t):s?null:o},t.nodeSize=function(e){return arguments.length?(s=null==(o=e)?null:n,t):s?o:null},un(t,i)},Zi.layout.cluster=function(){function t(t,a){var o,s=e.call(this,t,a),l=s[0],c=0;hn(l,function(t){var e=t.children;e&&e.length?(t.x=function(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}(e),t.y=function(t){return 1+Zi.max(t,function(t){return t.y})}(e)):(t.x=o?c+=r(t,o):0,t.y=0,o=t)});var u=Bn(l),f=Un(l),h=u.x-r(u,f)/2,d=f.x+r(f,u)/2;return hn(l,i?function(t){t.x=(t.x-l.x)*n[0],t.y=(l.y-t.y)*n[1]}:function(t){t.x=(t.x-h)/(d-h)*n[0],t.y=(1-(l.y?t.y/l.y:1))*n[1]}),s}var e=Zi.layout.hierarchy().sort(null).value(null),r=Rn,n=[1,1],i=!1;return t.separation=function(e){return arguments.length?(r=e,t):r},t.size=function(e){return arguments.length?(i=null==(n=e),t):i?null:n},t.nodeSize=function(e){return arguments.length?(i=null!=(n=e),t):i?n:null},un(t,e)},Zi.layout.treemap=function(){function t(t,e){for(var r,n,i=-1,a=t.length;++i0;)c.push(a=f[s-1]),c.area+=a.area,"squarify"!==h||(o=function(t,e){var r,n=t.area,i=0,a=1/0,o=-1,s=t.length;for(;++oi&&(i=r));return n*=n,e*=e,n?Math.max(e*i*d/n,n/(e*a*d)):1/0}(c,m))<=p?(f.pop(),p=o):(c.area-=c.pop().area,n(c,m,l,!1),m=Math.min(l.dx,l.dy),c.length=c.area=0,p=1/0);c.length&&(n(c,m,l,!0),c.length=c.area=0),i.forEach(e)}}function r(e){var i=e.children;if(i&&i.length){var a,o=u(e),s=i.slice(),l=[];for(t(s,o.dx*o.dy/e.value),l.area=0;a=s.pop();)l.push(a),l.area+=a.area,null!=a.z&&(n(l,a.z?o.dx:o.dy,o,!s.length),l.length=l.area=0);i.forEach(r)}}function n(t,e,r,n){var i,a=-1,o=t.length,l=r.x,c=r.y,u=e?s(t.area/e):0;if(e==r.dx){for((n||u>r.dy)&&(u=r.dy);++ar.dx)&&(u=r.dx);++a1);return t+e*r*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Zi.random.normal.apply(Zi,arguments);return function(){return Math.exp(t())}},bates:function(t){var e=Zi.random.irwinHall(t);return function(){return e()/t}},irwinHall:function(t){return function(){for(var e=0,r=0;rf?0:1;if(c=Ta)return e(c,d)+(t?e(t,1-d):"")+"Z";var p,m,g,v,y,x,b,_,w,M,k,A,T=0,S=0,E=[];if((v=(+l.apply(this,arguments)||0)/2)&&(g=a===gs?Math.sqrt(t*t+c*c):+a.apply(this,arguments),d||(S*=-1),c&&(S=Q(g/c*Math.sin(v))),t&&(T=Q(g/t*Math.sin(v)))),c){y=c*Math.cos(u+S),x=c*Math.sin(u+S),b=c*Math.cos(f-S),_=c*Math.sin(f-S);var L=Math.abs(f-u-2*S)<=ka?0:1;if(S&&mi(y,x,b,_)===d^L){var C=(u+f)/2;y=c*Math.cos(C),x=c*Math.sin(C),b=_=null}}else y=x=0;if(t){w=t*Math.cos(f-T),M=t*Math.sin(f-T),k=t*Math.cos(u+T),A=t*Math.sin(u+T);var z=Math.abs(u-f+2*T)<=ka?0:1;if(T&&mi(w,M,k,A)===1-d^z){var D=(u+f)/2;w=t*Math.cos(D),M=t*Math.sin(D),k=A=null}}else w=M=0;if(h>wa&&(p=Math.min(Math.abs(c-t)/2,+i.apply(this,arguments)))>.001){m=t1&&i.push("H",n[0]),i.join("")},"step-before":bi,"step-after":_i,basis:ki,"basis-open":function(t){if(t.length<4)return yi(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(Ai(bs,a)+","+Ai(bs,o)),--n;++nka)+",1 "+e}function n(t,e,r,n){return"Q 0,0 "+n}var i=Ke,a=Qe,o=zi,s=hi,l=di;return t.radius=function(e){return arguments.length?(o=_t(e),t):o},t.source=function(e){return arguments.length?(i=_t(e),t):i},t.target=function(e){return arguments.length?(a=_t(e),t):a},t.startAngle=function(e){return arguments.length?(s=_t(e),t):s},t.endAngle=function(e){return arguments.length?(l=_t(e),t):l},t},Zi.svg.diagonal=function(){function t(t,i){var a=e.call(this,t,i),o=r.call(this,t,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(n))[0]+"C"+l[1]+" "+l[2]+" "+l[3]}var e=Ke,r=Qe,n=Di;return t.source=function(r){return arguments.length?(e=_t(r),t):e},t.target=function(e){return arguments.length?(r=_t(e),t):r},t.projection=function(e){return arguments.length?(n=e,t):n},t},Zi.svg.diagonal.radial=function(){var t=Zi.svg.diagonal(),e=Di,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]-Sa;return[r*Math.cos(n),r*Math.sin(n)]}}(e=t)):e},t},Zi.svg.symbol=function(){function t(t,n){return(_s.get(e.call(this,t,n))||Oi)(r.call(this,t,n))}var e=Pi,r=Ii;return t.type=function(r){return arguments.length?(e=_t(r),t):e},t.size=function(e){return arguments.length?(r=_t(e),t):r},t};var _s=Zi.map({circle:Oi,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*Ms)),r=e*Ms;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/ws),r=e*ws/2;return"M0,"+r+"L"+e+","+-r+" "+-e+","+-r+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/ws),r=e*ws/2;return"M0,"+-r+"L"+e+","+r+" "+-e+","+r+"Z"}});Zi.svg.symbolTypes=_s.keys();var ws=Math.sqrt(3),Ms=Math.tan(30*Ea);pa.transition=function(t){for(var e,r,n=ks||++Es,i=Bi(t),a=[],o=As||{time:Date.now(),ease:function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},delay:0,duration:250},s=-1,l=this.length;++srect,.s>rect").attr("width",f[1]-f[0])}function i(t){t.select(".extent").attr("y",h[0]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function a(){function a(){var t=Zi.mouse(x),r=!1;y&&(t[0]+=y[0],t[1]+=y[1]),S||(Zi.event.altKey?(v||(v=[(f[0]+f[1])/2,(h[0]+h[1])/2]),L[0]=f[+(t[0]=2)return!1;t[r]=n}return!0}):_.filter(function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}),1&s)for(u=0;u<_.length;++u)h=(b=_[u])[0],b[0]=b[1],b[1]=h;return _}},{"incremental-convex-hull":278,uniq:556}],131:[function(t,e,r){(function(t){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]};function a(t,e){return i[0]=t,i[1]=e,n[0]}e.exports.pack=a;function o(t){return n[0]=t,i[0]}e.exports.lo=o;function s(t){return n[0]=t,i[1]}e.exports.hi=s}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]};function l(t,e){return i[1]=t,i[0]=e,n[0]}e.exports.pack=l;function c(t){return n[0]=t,i[1]}e.exports.lo=c;function u(t){return n[0]=t,i[0]}e.exports.hi=u}else r=!1}if(!r){var f=new t(8);e.exports=function(t){return f.writeDoubleLE(t,0,!0),[f.readUInt32LE(0,!0),f.readUInt32LE(4,!0)]};function h(t,e){return f.writeUInt32LE(t,0,!0),f.writeUInt32LE(e,4,!0),f.readDoubleLE(0,!0)}e.exports.pack=h;function d(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(0,!0)}e.exports.lo=d;function p(t){return f.writeDoubleLE(t,0,!0),f.readUInt32LE(4,!0)}e.exports.hi=p}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this,t("buffer").Buffer)},{buffer:82}],132:[function(t,e,r){var n=t("abs-svg-path"),i=t("normalize-svg-path"),a={M:"moveTo",C:"bezierCurveTo"};e.exports=function(t,e){t.beginPath(),i(n(e)).forEach(function(e){var r=e[0],n=e.slice(1);t[a[r]].apply(t,n)}),t.closePath()}},{"abs-svg-path":43,"normalize-svg-path":460}],133:[function(t,e,r){e.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}}},{}],134:[function(t,e,r){"use strict";function n(t,e,r){var i=0|t[r];if(i<=0)return[];var a,o=new Array(i);if(r===t.length-1)for(a=0;a0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=n.next.y){var s=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=i&&s>o){if(o=s,s===i){if(a===n.y)return n;if(a===n.next.y)return n.next}r=n.x=n.x&&n.x>=f&&c(ar.x)&&d(n,t)&&(r=n,p=l),n=n.next;return r}(t,e)){var r=p(e,t);a(r,r.next)}}(m[o],r),r=a(r,r.next);return r}(t,e,u,r)),t.length>80*r){h=g=t[0],m=v=t[1];for(var _=r;_g&&(g=y),x>v&&(v=x);b=Math.max(g-h,v-m)}return o(u,f,r,h,m,b),f}function i(t,e,r,n,i){var a,o;if(i===y(t,e,r,n)>0)for(a=e;a=e;a-=n)o=m(a,t[a],t[a+1],o);return o&&f(o,o.next)&&(g(o),o=o.next),o}function a(t,e){if(!t)return t;e||(e=t);var r,n=t;do{if(r=!1,n.steiner||!f(n,n.next)&&0!==u(n.prev,n,n.next))n=n.next;else{if(g(n),(n=e=n.prev)===n.next)return null;r=!0}}while(r||n!==e);return e}function o(t,e,r,n,i,s,m){if(t){!m&&s&&function(t,e,r,n){var i=t;do{null===i.z&&(i.z=l(i.x,i.y,e,r,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var e,r,n,i,a,o,s,l,c=1;do{for(r=t,t=null,a=null,o=0;r;){for(o++,n=r,s=0,e=0;e0||l>0&&n;)0===s?(i=n,n=n.nextZ,l--):0!==l&&n?r.z<=n.z?(i=r,r=r.nextZ,s--):(i=n,n=n.nextZ,l--):(i=r,r=r.nextZ,s--),a?a.nextZ=i:t=i,i.prevZ=a,a=i;r=n}a.nextZ=null,c*=2}while(o>1)}(i)}(t,n,i,s);for(var v,y,x=t;t.prev!==t.next;)if(v=t.prev,y=t.next,s?function(t,e,r,n){var i=t.prev,a=t,o=t.next;if(u(i,a,o)>=0)return!1;var s=i.xa.x?i.x>o.x?i.x:o.x:a.x>o.x?a.x:o.x,d=i.y>a.y?i.y>o.y?i.y:o.y:a.y>o.y?a.y:o.y,p=l(s,f,e,r,n),m=l(h,d,e,r,n),g=t.nextZ;for(;g&&g.z<=m;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.nextZ}g=t.prevZ;for(;g&&g.z>=p;){if(g!==t.prev&&g!==t.next&&c(i.x,i.y,a.x,a.y,o.x,o.y,g.x,g.y)&&u(g.prev,g,g.next)>=0)return!1;g=g.prevZ}return!0}(t,n,i,s):function(t){var e=t.prev,r=t,n=t.next;if(u(e,r,n)>=0)return!1;var i=t.next.next;for(;i!==t.prev;){if(c(e.x,e.y,r.x,r.y,n.x,n.y,i.x,i.y)&&u(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}(t))e.push(v.i/r),e.push(t.i/r),e.push(y.i/r),g(t),t=y.next,x=y.next;else if((t=y)===x){m?1===m?o(t=function(t,e,r){var n=t;do{var i=n.prev,a=n.next.next;!f(i,a)&&h(i,n,n.next,a)&&d(i,a)&&d(a,i)&&(e.push(i.i/r),e.push(n.i/r),e.push(a.i/r),g(n),g(n.next),n=t=a),n=n.next}while(n!==t);return n}(t,e,r),e,r,n,i,s,2):2===m&&function(t,e,r,n,i,s){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&h(r,r.next,t,e))return!0;r=r.next}while(r!==t);return!1}(t,e)&&d(t,e)&&d(e,t)&&function(t,e){var r=t,n=!1,i=(t.x+e.x)/2,a=(t.y+e.y)/2;do{r.y>a!=r.next.y>a&&i<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(n=!n),r=r.next}while(r!==t);return n}(t,e)}(l,c)){var u=p(l,c);return l=a(l,l.next),u=a(u,u.next),o(l,e,r,n,i,s),void o(u,e,r,n,i,s)}c=c.next}l=l.next}while(l!==t)}(t,e,r,n,i,s):o(a(t),e,r,n,i,s,1);break}}}function s(t,e){return t.x-e.x}function l(t,e,r,n,i){return t=32767*(t-r)/i,e=32767*(e-n)/i,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function c(t,e,r,n,i,a,o,s){return(i-o)*(e-s)-(t-o)*(a-s)>=0&&(t-o)*(n-s)-(r-o)*(e-s)>=0&&(r-o)*(a-s)-(i-o)*(n-s)>=0}function u(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function f(t,e){return t.x===e.x&&t.y===e.y}function h(t,e,r,n){return!!(f(t,e)&&f(r,n)||f(t,n)&&f(r,e))||u(t,e,r)>0!=u(t,e,n)>0&&u(r,n,t)>0!=u(r,n,e)>0}function d(t,e){return u(t.prev,t,t.next)<0?u(t,e,t.next)>=0&&u(t,t.prev,e)>=0:u(t,e,t.prev)<0||u(t,t.next,e)<0}function p(t,e){var r=new v(t.i,t.x,t.y),n=new v(e.i,e.x,e.y),i=t.next,a=e.prev;return t.next=e,e.prev=t,r.next=i,i.prev=r,n.next=r,r.prev=n,a.next=n,n.prev=a,n}function m(t,e,r,n){var i=new v(t,e,r);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function g(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function v(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function y(t,e,r,n){for(var i=0,a=e,o=r-n;a0&&(n+=t[i-1].length,r.holes.push(n))}return r}},{}],136:[function(t,e,r){"use strict";e.exports=function(t,e){var r=t.length;if("number"!=typeof e){e=0;for(var i=0;i0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],o=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(s=o;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){n=s;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],139:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n=e||0,i=r||1;return[[t[12]+t[0],t[13]+t[1],t[14]+t[2],t[15]+t[3]],[t[12]-t[0],t[13]-t[1],t[14]-t[2],t[15]-t[3]],[t[12]+t[4],t[13]+t[5],t[14]+t[6],t[15]+t[7]],[t[12]-t[4],t[13]-t[5],t[14]-t[6],t[15]-t[7]],[n*t[12]+t[8],n*t[13]+t[9],n*t[14]+t[10],n*t[15]+t[11]],[i*t[12]-t[8],i*t[13]-t[9],i*t[14]-t[10],i*t[15]-t[11]]]}},{}],140:[function(t,e,r){"use strict";e.exports=function(t){var e=typeof t;if("string"===e){var r=t;if(0===(t=+t)&&function(t){for(var e,r=t.length,n=0;n13)&&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}(r))return!1}else if("number"!==e)return!1;return t-t<1}},{}],141:[function(t,e,r){"use strict";function n(t){if(!t)return"true";var e=t[0];if(t.length<=1)return"any"===e?"false":"true";return"("+("=="===e?a(t[1],t[2],"===",!1):"!="===e?a(t[1],t[2],"!==",!1):"<"===e||">"===e||"<="===e||">="===e?a(t[1],t[2],e,!0):"any"===e?o(t.slice(1),"||"):"all"===e?o(t.slice(1),"&&"):"none"===e?c(o(t.slice(1),"||")):"in"===e?s(t[1],t.slice(2)):"!in"===e?c(s(t[1],t.slice(2))):"has"===e?l(t[1]):"!has"===e?c(l([t[1]])):"true")+")"}function i(t){return"$type"===t?"f.type":"$id"===t?"f.id":"p["+JSON.stringify(t)+"]"}function a(t,e,r,n){var a=i(t),o="$type"===t?f.indexOf(e):JSON.stringify(e);return(n?"typeof "+a+"=== typeof "+o+"&&":"")+a+r+o}function o(t,e){return t.map(n).join(e)}function s(t,e){"$type"===t&&(e=e.map(function(t){return f.indexOf(t)}));var r=JSON.stringify(e.sort(u)),n=i(t);return e.length<=200?r+".indexOf("+n+") !== -1":"function(v, a, i, j) {while (i <= j) { var m = (i + j) >> 1; if (a[m] === v) return true; if (a[m] > v) j = m - 1; else i = m + 1;}return false; }("+n+", "+r+",0,"+(e.length-1)+")"}function l(t){return JSON.stringify(t)+" in p"}function c(t){return"!("+t+")"}function u(t,e){return te?1:0}e.exports=function(t){return new Function("f","var p = (f && f.properties || {}); return "+n(t))};var f=["Unknown","Point","LineString","Polygon"]},{}],142:[function(t,e,r){"use strict";function n(t,e,r){return Math.min(e,Math.max(t,r))}function i(t,e,r){this.dimension=t.length,this.bounds=[new Array(this.dimension),new Array(this.dimension)];for(var n=0;n=r-1){h=l.length-1;var p=t-e[r-1];for(d=0;d=r-1)for(var u=a.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},l.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)i.push(n(l[f-1],c[f-1],arguments[f])),a.push(0)}},l.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=n(c[h-1],u[h-1],arguments[h]);i.push(d),a.push((d-i[o++])*f)}}},l.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(n(o[l-1],s[l-1],arguments[l])),i.push(0)}},l.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var i=this._state,a=this._velocity,o=i.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var d=arguments[h];i.push(n(l[h-1],c[h-1],i[o++]+d)),a.push(d*f)}}},l.idle=function(t){var e=this.lastT();if(!(t=0;--f)i.push(n(l[f],c[f],i[o]+u*a[o])),a.push(0),o+=1}}},{"binary-search-bounds":70,"cubic-hermite":115}],143:[function(t,e,r){var n=t("dtype");e.exports=function(t,e,r){if(!t)throw new TypeError("must specify data as first parameter");if(r=0|+(r||0),Array.isArray(t)&&Array.isArray(t[0])){var i=t[0].length,a=t.length*i;e&&"string"!=typeof e||(e=new(n(e||"float32"))(a+r));var o=e.length-r;if(a!==o)throw new Error("source length "+a+" ("+i+"x"+t.length+") does not match destination length "+o);for(var s=0,l=r;s0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return u(t,e,r,n,i.right)}function f(t,e){this.tree=t,this._stack=e}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}e.exports=function(t){return new s(t||function(t,e){return te?1:0},null)};var d=0,p=1,m=s.prototype;Object.defineProperty(m,"keys",{get:function(){var t=[];return this.forEach(function(e,r){t.push(e)}),t}}),Object.defineProperty(m,"values",{get:function(){var t=[];return this.forEach(function(e,r){t.push(r)}),t}}),Object.defineProperty(m,"length",{get:function(){return this.root?this.root._count:0}}),m.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(d,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(h._color===p||i._color===p)break;var m=l[f-2];if(m.left===h)if(h.left===i){if(!(g=m.right)||g._color!==d){if(m._color=d,m.left=h.right,h._color=p,h.right=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).left===m?v.left=h:v.right=h}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else{if(!(g=m.right)||g._color!==d){if(h.right=i.left,m._color=d,m.left=i.right,i._color=p,i.left=h,i.right=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){(v=l[f-3]).left===m?v.left=i:v.right=i}break}h._color=p,m.right=a(p,g),m._color=d,f-=1}else if(h.right===i){if(!(g=m.left)||g._color!==d){if(m._color=d,m.right=h.left,h._color=p,h.left=m,l[f-2]=h,l[f-1]=i,o(m),o(h),f>=3){(v=l[f-3]).right===m?v.right=h:v.left=h}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}else{var g;if(!(g=m.left)||g._color!==d){if(h.left=i.right,m._color=d,m.right=i.left,i._color=p,i.right=h,i.left=m,l[f-2]=i,l[f-1]=h,o(m),o(h),o(i),f>=3){var v;(v=l[f-3]).right===m?v.right=i:v.left=i}break}h._color=p,m.left=a(p,g),m._color=d,f-=1}}return l[0]._color=p,new s(r,l[0])},m.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return l(t,this.root);case 2:return c(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(m,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new f(this,t)}}),Object.defineProperty(m,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new f(this,t)}}),m.at=function(t){if(t<0)return new f(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new f(this,[])},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n)},m.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 f(this,n);r=i<=0?r.left:r.right}return new f(this,[])},m.remove=function(t){var e=this.find(t);return e?e.remove():this},m.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 g=f.prototype;Object.defineProperty(g,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(g,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),g.clone=function(){return new f(this.tree,this._stack.slice())},g.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if((r=e[e.length-1])._color===d){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=p);if((r=t[l-1]).left===e){if((n=r.right).right&&n.right._color===d)return n=r.right=i(n),s=n.right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=p,r._color=p,s._color=p,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),void(t[l-1]=n);if(n.left&&n.left._color===d)return n=r.right=i(n),s=n.left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).left===r?c.left=s:c.right=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.right=a(d,n));r.right=a(d,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=d,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11&&((c=t[l-2]).right===r?c.right=n:c.left=n),void(t[l-1]=n);if(n.right&&n.right._color===d)return n=r.left=i(n),s=n.right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=p,n._color=p,e._color=p,o(r),o(n),o(s),l>1&&((c=t[l-2]).right===r?c.right=s:c.left=s),void(t[l-1]=s);if(n._color===p){if(r._color===d)return r._color=p,void(r.left=a(d,n));r.left=a(d,n);continue}if(n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=d,o(r),o(n),l>1){var c;(c=t[l-2]).right===r?c.right=n:c.left=n}t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(g,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(g,"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}),g.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(g,"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}}),g.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},g.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(g,"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}})},{}],145:[function(t,e,r){function n(t){if(t<0)return Number("0/0");for(var e=o[0],r=o.length-1;r>0;--r)e+=o[r]/(t+r);var n=t+a+.5;return.5*Math.log(2*Math.PI)+(t+.5)*Math.log(n)-n+Math.log(e)-Math.log(t)}var i=[.9999999999998099,676.5203681218851,-1259.1392167224028,771.3234287776531,-176.6150291621406,12.507343278686905,-.13857109526572012,9984369578019572e-21,1.5056327351493116e-7],a=607/128,o=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];e.exports=function t(e){if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*t(1-e));if(e>100)return Math.exp(n(e));e-=1;for(var r=i[0],a=1;a<9;a++)r+=i[a]/(e+a);var o=e+7+.5;return Math.sqrt(2*Math.PI)*Math.pow(o,e+.5)*Math.exp(-o)*r},e.exports.log=n},{}],146:[function(t,e,r){function n(t){var e=0;if(t&&t.length>0){e+=Math.abs(i(t[0]));for(var r=1;r2){for(var r,n,i=0;i=0}(t)===e?t:t.reverse()}var s=t("geojson-area");e.exports=n},{"geojson-area":146}],148:[function(t,e,r){"use strict";function n(t,e,r,n,i){return e.length&&(e.area=r,e.dist=n,void 0!==i&&(e.outer=i),t.push(e)),[]}e.exports=function(t,e,r,a,o,s,l,c){if(r/=e,a/=e,l>=r&&c<=a)return t;if(l>a||c=r&&d<=a)u.push(p);else if(!(h>a||d=e&&s<=r&&i.push(o)}return i}(m,r,a,o):function(t,e,r,i,a,o){for(var s=[],l=0;lr?(b.push(a(c,p,e),a(c,p,r)),o||(b=n(s,b,g,v,y))):d>=e&&b.push(a(c,p,e)):h>r?dr&&(b.push(a(c,p,r)),o||(b=n(s,b,g,v,y))));c=m[x-1],(h=c[i])>=e&&h<=r&&b.push(c),f=b[b.length-1],o&&f&&(b[0][0]!==f[0]||b[0][1]!==f[1])&&b.push(b[0]),n(s,b,g,v,y)}return s}(m,r,a,o,s,3===g);v.length&&u.push(i(p.tags,g,v,p.id))}}return u.length?u:null};var i=t("./feature")},{"./feature":150}],149:[function(t,e,r){"use strict";function n(t,e,r){if(null!==e.geometry){var o,l,c,u,f=e.geometry,h=f.type,d=f.coordinates,p=e.properties,m=e.id;if("Point"===h)t.push(s(p,1,[a(d)],m));else if("MultiPoint"===h)t.push(s(p,1,i(d),m));else if("LineString"===h)t.push(s(p,2,[i(d,r)],m));else if("MultiLineString"===h||"Polygon"===h){for(c=[],o=0;o1?1:n,[r,n,0]}e.exports=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i1)return!1;var a=i.geometry[0].length;if(5!==a)return!1;for(var o=0;o1&&console.time("creation"),x=this.tiles[y]=h(t,v,r,n,b,e===p.maxZoom),this.tileCoords.push({z:e,x:r,y:n}),m)){m>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,n,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation"));var _="z"+e;this.stats[_]=(this.stats[_]||0)+1,this.total++}if(x.source=t,l){if(e===p.maxZoom||e===l)continue;var w=1<1&&console.time("clipping");var M,k,A,T,S,E,L=.5*p.buffer/p.extent,C=.5-L,z=.5+L,D=1+L;M=k=A=T=null,S=u(t,v,r-L,r+z,0,a,x.min[0],x.max[0]),E=u(t,v,r+C,r+D,0,a,x.min[0],x.max[0]),S&&(M=u(S,v,n-L,n+z,1,o,x.min[1],x.max[1]),k=u(S,v,n+C,n+D,1,o,x.min[1],x.max[1])),E&&(A=u(E,v,n-L,n+z,1,o,x.min[1],x.max[1]),T=u(E,v,n+C,n+D,1,o,x.min[1],x.max[1])),m>1&&console.timeEnd("clipping"),t.length&&(d.push(M||[],e+1,2*r,2*n),d.push(k||[],e+1,2*r,2*n+1),d.push(A||[],e+1,2*r+1,2*n),d.push(T||[],e+1,2*r+1,2*n+1))}else l&&(g=e)}return g},n.prototype.getTile=function(t,e,r){var n=this.options,a=n.extent,o=n.debug,l=1<1&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var f,h=t,d=e,p=r;!f&&h>0;)h--,d=Math.floor(d/2),p=Math.floor(p/2),f=this.tiles[i(h,d,p)];if(!f||!f.source)return null;if(o>1&&console.log("found parent tile z%d-%d-%d",h,d,p),s(f,a,n.buffer))return c.tile(f,a);o>1&&console.time("drilling down");var m=this.splitTile(f.source,h,d,p,t,e,r);if(o>1&&console.timeEnd("drilling down"),null!==m){var g=1<1?(n=a,i=o):f>0&&(n+=c*f,i+=u*f)}return c=s-n,u=l-i,c*c+u*u}(t[r],t[s],t[l]))>n&&(a=r,n=i);n>o?(t[a][2]=n,c.push(s),c.push(a),s=a):(l=c.pop(),s=c.pop())}}},{}],153:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){for(var o={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:n,z2:e,transformed:!1,min:[2,1],max:[-1,0]},s=0;sf)&&(h.push(s),t.numSimplified++),t.numPoints++;3===c&&function(t,e){(function(t){for(var e,r,n=0,i=0,a=t.length,o=a-1;io.max[0]&&(o.max[0]=c[0]),c[1]>o.max[1]&&(o.max[1]=c[1])}return o}},{}],154:[function(t,e,r){"use strict";function n(t,e,r,n,i){return[Math.round(e*(t[0]*r-n)),Math.round(e*(t[1]*r-i))]}r.tile=function(t,e){if(t.transformed)return t;var r,i,a,o=t.z2,s=t.x,l=t.y;for(r=0;r0?(d[u]=-1,p[u]=0):(d[u]=0,p[u]=1)}}e.exports=function(t,e){var r=new i(t);return r.update(e),r};var s=t("./lib/text.js"),l=t("./lib/lines.js"),c=t("./lib/background.js"),u=t("./lib/cube.js"),f=t("./lib/ticks.js"),h=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),d=i.prototype;d.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(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,n=e.bind(this,!1,Number),i=e.bind(this,!1,Boolean),a=e.bind(this,!1,String),o=e.bind(this,!0,function(t){if(Array.isArray(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,u=!1;if("bounds"in t)for(var h=t.bounds,d=0;d<2;++d)for(var p=0;p<3;++p)h[d][p]!==this.bounds[d][p]&&(u=!0),this.bounds[d][p]=h[d][p];if("ticks"in t){r=t.ticks,c=!0,this.autoTicks=!1;for(d=0;d<3;++d)this.tickSpacing[d]=0}else n("tickSpacing")&&(this.autoTicks=!0,u=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),u=!0,c=!0,this._firstInit=!1),u&&this.autoTicks&&(r=f.create(this.bounds,this.tickSpacing),c=!0),c){for(d=0;d<3;++d)r[d].sort(function(t,e){return t.x-e.x});f.equal(r,this.ticks)?c=!1:this.ticks=r}i("tickEnable"),a("tickFont")&&(c=!0),n("tickSize"),n("tickAngle"),n("tickPad"),o("tickColor");var m=a("labels");a("labelFont")&&(m=!0),i("labelEnable"),n("labelSize"),n("labelPad"),o("labelColor"),i("lineEnable"),i("lineMirror"),n("lineWidth"),o("lineColor"),i("lineTickEnable"),i("lineTickMirror"),n("lineTickLength"),n("lineTickWidth"),o("lineTickColor"),i("gridEnable"),n("gridWidth"),o("gridColor"),i("zeroEnable"),o("zeroLineColor"),n("zeroLineWidth"),i("backgroundEnable"),o("backgroundColor"),this._text?this._text&&(m||c)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=s(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&c&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=l(this.gl,this.bounds,this.ticks))};var p=[new a,new a,new a],m=[0,0,0],g={model:h,view:h,projection:h};d.isOpaque=function(){return!0},d.isTransparent=function(){return!1},d.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];d.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||h,i=t.view||h,a=t.projection||h,s=this.bounds,l=u(r,i,a,s),c=l.cubeEdges,f=l.axis,d=i[12],b=i[13],_=i[14],w=i[15],M=this.pixelRatio*(a[3]*d+a[7]*b+a[11]*_+a[15]*w)/e.drawingBufferHeight,k=0;k<3;++k)this.lastCubeProps.cubeEdges[k]=c[k],this.lastCubeProps.axis[k]=f[k];var A=p;for(k=0;k<3;++k)o(p[k],k,this.bounds,c,f);e=this.gl;var T=m;for(k=0;k<3;++k)this.backgroundEnable[k]?T[k]=f[k]:T[k]=0;this._background.draw(r,i,a,s,T,this.backgroundColor),this._lines.bind(r,i,a,this);for(k=0;k<3;++k){var S=[0,0,0];f[k]>0?S[k]=s[1][k]:S[k]=s[0][k];for(var E=0;E<2;++E){var L=(k+1+E)%3,C=(k+1+(1^E))%3;this.gridEnable[L]&&this._lines.drawGrid(L,C,this.bounds,S,this.gridColor[L],this.gridWidth[L]*this.pixelRatio)}for(E=0;E<2;++E){L=(k+1+E)%3,C=(k+1+(1^E))%3;this.zeroEnable[C]&&s[0][C]<=0&&s[1][C]>=0&&this._lines.drawZero(L,C,this.bounds,S,this.zeroLineColor[C],this.zeroLineWidth[C]*this.pixelRatio)}}for(k=0;k<3;++k){this.lineEnable[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].primalOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio),this.lineMirror[k]&&this._lines.drawAxisLine(k,this.bounds,A[k].mirrorOffset,this.lineColor[k],this.lineWidth[k]*this.pixelRatio);var z=n(v,A[k].primalMinor),D=n(y,A[k].mirrorMinor),I=this.lineTickLength;for(E=0;E<3;++E){var P=M/r[5*E];z[E]*=I[E]*P,D[E]*=I[E]*P}this.lineTickEnable[k]&&this._lines.drawAxisTicks(k,A[k].primalOffset,z,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio),this.lineTickMirror[k]&&this._lines.drawAxisTicks(k,A[k].mirrorOffset,D,this.lineTickColor[k],this.lineTickWidth[k]*this.pixelRatio)}this._text.bind(r,i,a,this.pixelRatio);for(k=0;k<3;++k){var O=A[k].primalMinor,F=n(x,A[k].primalOffset);for(E=0;E<3;++E)this.lineTickEnable[k]&&(F[E]+=M*O[E]*Math.max(this.lineTickLength[E],0)/r[5*E]);if(this.tickEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.tickPad[E]/r[5*E];this._text.drawTicks(k,this.tickSize[k],this.tickAngle[k],F,this.tickColor[k])}if(this.labelEnable[k]){for(E=0;E<3;++E)F[E]+=M*O[E]*this.labelPad[E]/r[5*E];F[k]+=.5*(s[0][k]+s[1][k]),this._text.drawLabel(k,this.labelSize[k],this.labelAngle[k],F,this.labelColor[k])}}},d.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":158,"./lib/cube.js":159,"./lib/lines.js":160,"./lib/text.js":162,"./lib/ticks.js":163}],158:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(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[c]=p;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=i(t,new Float32Array(e)),y=i(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=a(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=o(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new n(t,v,x,b)};var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders").bg,s=n.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),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":161,"gl-buffer":165,"gl-vao":259}],159:[function(t,e,r){"use strict";function n(t,e,r){for(var n=0;n<4;++n){t[n]=r[12+n];for(var i=0;i<3;++i)t[n]+=e[i]*r[4*i+n]}}function i(t){for(var e=0;eS&&(_|=1<S&&(_|=1<f[y][1]&&(O=y));var F=-1;for(y=0;y<3;++y)(N=O^1<f[R][0]&&(R=N))}var j=m;j[0]=j[1]=j[2]=0,j[a.log2(F^O)]=O&F,j[a.log2(O^R)]=O&R;var B=7^R;B===_||B===P?(B=7^F,j[a.log2(R^B)]=B&R):j[a.log2(F^B)]=B&F;var U=g,V=_;for(k=0;k<3;++k)U[k]=V&1< 0.0) {\n vec3 nPosition = mix(bounds[0], bounds[1], 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 colorChannel = abs(normal);\n}","precision mediump 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}",null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":243}],162:[function(t,e,r){(function(r){"use strict";function n(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}e.exports=function(t,e,r,o,l,c){var u=i(t),f=a(t,[{buffer:u,size:3}]),h=s(t);h.attributes.position.location=0;var d=new n(t,h,u,f);return d.update(e,r,o,l,c),d};var i=t("gl-buffer"),a=t("gl-vao"),o=t("vectorize-text"),s=t("./shaders").text,l=window||r.global||{},c=l.__TEXT_CACHE||{};l.__TEXT_CACHE={};var u=n.prototype,f=[0,0];u.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,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.update=function(t,e,r,n,i){function a(t,e,r,n){var i=c[r];i||(i=c[r]={});var a=i[e];a||(a=i[e]=function(t,e){try{return o(t,e)}catch(t){return console.warn("error vectorizing text:",t),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle"}));for(var l=(n||12)/12,u=a.positions,f=a.cells,h=0,d=f.length;h=0;--m){var g=u[p[m]];s.push(l*g[0],-l*g[1],t)}}this.gl;for(var s=[],l=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],d=0;d<3;++d){f[d]=s.length/3|0,a(.5*(t[0][d]+t[1][d]),e[d],r),h[d]=(s.length/3|0)-f[d],l[d]=s.length/3|0;for(var p=0;p=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,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.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 a(t,e){for(var r=o.malloc(t.length,e),n=t.length,i=0;i=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=i(this.gl,this.type,this.length,this.usage,t.data,e):this.length=i(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var n=o.malloc(t.size,r),u=l(n,t.shape);s.assign(u,t),this.length=e<0?i(this.gl,this.type,this.length,this.usage,n,e):i(this.gl,this.type,this.length,this.usage,n.subarray(0,t.size),e),o.free(n)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?a(t,"uint16"):a(t,"float32"),this.length=e<0?i(this.gl,this.type,this.length,this.usage,f,e):i(this.gl,this.type,this.length,this.usage,f.subarray(0,t.length),e),o.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=i(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}},e.exports=function(t,e,r,i){if(r=r||t.ARRAY_BUFFER,i=i||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(i!==t.DYNAMIC_DRAW&&i!==t.STATIC_DRAW&&i!==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 a=new n(t,r,t.createBuffer(),0,i);return a.update(e),a}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],166:[function(t,e,r){e.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"}},{}],167:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":166}],168:[function(t,e,r){"use strict";function n(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}function i(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])}function a(t,e,r,n){for(var i=f[n],a=0;a=1},u.isTransparent=function(){return this.opacity<1},u.drawTransparent=u.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||c,i=r.projection=t.projection||c;r.model=t.model||c,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],o=n[13],s=n[14],l=n[15],u=this.pixelRatio*(i[3]*a+i[7]*o+i[11]*s+i[15]*l)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var f=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}();u.update=function(t){"lineWidth"in(t=t||{})&&(this.lineWidth=t.lineWidth,Array.isArray(this.lineWidth)||(this.lineWidth=[this.lineWidth,this.lineWidth,this.lineWidth])),"capSize"in t&&(this.capSize=t.capSize,Array.isArray(this.capSize)||(this.capSize=[this.capSize,this.capSize,this.capSize])),"opacity"in t&&(this.opacity=t.opacity);var e=t.color||[[0,0,0],[0,0,0],[0,0,0]],r=t.position,n=t.error;if(Array.isArray(e[0])||(e=[e,e,e]),r&&n){var o=[],s=r.length,l=0;this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.lineCount=[0,0,0];for(var c=0;c<3;++c){this.lineOffset[c]=l;t:for(var u=0;u0){var m;(m=f.slice())[c]+=d[1][c],o.push(f[0],f[1],f[2],p[0],p[1],p[2],p[3],0,0,0,m[0],m[1],m[2],p[0],p[1],p[2],p[3],0,0,0),i(this.bounds,m),l+=2+a(o,m,p,c)}}}this.lineCount[c]=l-this.lineOffset[c]}this.buffer.update(o)}},u.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":170,"gl-buffer":165,"gl-vao":259}],169:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n1&&h.drawBuffersWEBGL(m[f]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=o(r,c,u,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p&&(t.depth=o(r,c,u,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):p&&d?t._depth_rb=s(r,c,u,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):p?t._depth_rb=s(r,c,u,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=s(r,c,u,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),v=0;vs||r<0||r>s)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var l=n(o),c=0;ca||r<0||r>a)throw new Error("gl-fbo: Parameters are too large for FBO");var o=1;if("color"in(n=n||{})){if((o=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(o>1){if(!i)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(o>t.getParameter(i.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+o+" draw buffers")}}var s=t.UNSIGNED_BYTE,c=t.getExtension("OES_texture_float");if(n.float&&o>0){if(!c)throw new Error("gl-fbo: Context does not support floating point textures");s=t.FLOAT}else n.preferFloat&&o>0&&c&&(s=t.FLOAT);var u=!0;"depth"in n&&(u=!!n.depth);var g=!1;return"stencil"in n&&(g=!!n.stencil),new l(t,e,r,s,o,u,g,i)};var f,h,d,p,m=null,g=l.prototype;Object.defineProperties(g,{shape:{get:function(){return this._destroyed?[0,0]:this._shapeVector},set:function(t){if(Array.isArray(t)||(t=[0|t,0|t]),2!==t.length)throw new Error("gl-fbo: Shape vector must be length 2");var e=0|t[0],r=0|t[1];return c(this,e,r),[e,r]},enumerable:!1},width:{get:function(){return this._destroyed?0:this._shape[0]},set:function(t){return t|=0,c(this,t,this._shape[1]),t},enumerable:!1},height:{get:function(){return this._destroyed?0:this._shape[1]},set:function(t){return t|=0,c(this,this._shape[0],t),t},enumerable:!1}}),g.bind=function(){if(!this._destroyed){var t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,this.handle),t.viewport(0,0,this._shape[0],this._shape[1])}},g.dispose=function(){if(!this._destroyed){this._destroyed=!0;var t=this.gl;t.deleteFramebuffer(this.handle),this.handle=null,this.depth&&(this.depth.dispose(),this.depth=null),this._depth_rb&&(t.deleteRenderbuffer(this._depth_rb),this._depth_rb=null);for(var e=0;e>8*d&255;this.pickOffset=r,i.bind();var p=i.uniforms;p.viewTransform=t,p.pickOffset=e,p.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),u.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]]}},u.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||a(e[0]),n=t.y||a(e[1]),s=t.z||new Float32Array(e[0]*e[1]);this.xData=r,this.yData=n;var l=t.colorLevels||[0],c=t.colorValues||[0,0,0,1],u=l.length,h=this.bounds,d=h[0]=r[0],p=h[1]=n[0],m=1/((h[2]=r[r.length-1])-d),g=1/((h[3]=n[n.length-1])-p),v=e[0],y=e[1];this.shape=[v,y];var x=(v-1)*(y-1)*(f.length>>>1);this.numVertices=x;for(var b=o.mallocUint8(4*x),_=o.mallocFloat32(2*x),w=o.mallocUint8(2*x),M=o.mallocUint32(x),k=0,A=0;A 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 highp vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n highp float e = floor(log2(av));\n highp 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 highp 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\n\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if(any(lessThan(worldPosition, clipBounds[0])) || any(greaterThan(worldPosition, clipBounds[1]))) {\n discard;\n }\n gl_FragColor = vec4(pickId/255.0, encode_float_1_0(pixelArcLength).xyz);\n}",null,a)}},{"gl-shader":243}],177:[function(t,e,r){"use strict";function n(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 i(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 a(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function o(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.dirty=!0,this.pixelRatio=1}e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=p(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 n=m(e);n.attributes.position.location=0,n.attributes.nextPosition.location=1,n.attributes.arcLength.location=2,n.attributes.lineWidth.location=3,n.attributes.color.location=4;for(var i=s(e),a=l(e,[{buffer:i,size:3,offset:0,stride:48},{buffer:i,size:3,offset:12,stride:48},{buffer:i,size:1,offset:24,stride:48},{buffer:i,size:1,offset:28,stride:48},{buffer:i,size:4,offset:32,stride:48}]),u=h(new Array(1024),[256,1,4]),f=0;f<1024;++f)u.data[f]=255;var d=c(e,u);d.wrap=e.REPEAT;var g=new o(e,r,n,i,a,d);return g.update(t),g};var s=t("gl-buffer"),l=t("gl-vao"),c=t("gl-texture2d"),u=t("glsl-read-float"),f=t("binary-search-bounds"),h=t("ndarray"),d=t("./lib/shaders"),p=d.createShader,m=d.createPickShader,g=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],v=o.prototype;v.isTransparent=function(){return this.opacity<1},v.isOpaque=function(){return this.opacity>=1},v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.drawTransparent=v.draw=function(t){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,clipBounds:i(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)},v.drawPick=function(t){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||g,view:t.view||g,projection:t.projection||g,pickId:this.pickId,clipBounds:i(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount)},v.update=function(t){var e,r;this.dirty=!0;var i=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),"opacity"in t&&(this.opacity=+t.opacity);var a=t.position||t.positions;if(a){var o=t.color||t.colors||[0,0,0,1],s=t.lineWidth||1,l=[],c=[],u=[],d=0,p=0,m=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],g=!1;t:for(e=1;e0){for(var x=0;x<24;++x)l.push(l[l.length-12]);p+=2,g=!0}continue t}m[0][r]=Math.min(m[0][r],v[r],y[r]),m[1][r]=Math.max(m[1][r],v[r],y[r])}var b,_;Array.isArray(o[0])?(b=o[e-1],_=o[e]):b=_=o,3===b.length&&(b=[b[0],b[1],b[2],1]),3===_.length&&(_=[_[0],_[1],_[2],1]);var w;w=Array.isArray(s)?s[e-1]:s;var M=d;if(d+=n(v,y),g){for(r=0;r<2;++r)l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3]);p+=2,g=!1}l.push(v[0],v[1],v[2],y[0],y[1],y[2],M,w,b[0],b[1],b[2],b[3],v[0],v[1],v[2],y[0],y[1],y[2],M,-w,b[0],b[1],b[2],b[3],y[0],y[1],y[2],v[0],v[1],v[2],d,-w,_[0],_[1],_[2],_[3],y[0],y[1],y[2],v[0],v[1],v[2],d,w,_[0],_[1],_[2],_[3]),p+=4}if(this.buffer.update(l),c.push(d),u.push(a[a.length-1].slice()),this.bounds=m,this.vertexCount=p,this.points=u,this.arcLength=c,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e0?(n=2*Math.sqrt(r+1),t[3]=.25*n,t[0]=(e[6]-e[9])/n,t[1]=(e[8]-e[2])/n,t[2]=(e[1]-e[4])/n):e[0]>e[5]&e[0]>e[10]?(n=2*Math.sqrt(1+e[0]-e[5]-e[10]),t[3]=(e[6]-e[9])/n,t[0]=.25*n,t[1]=(e[1]+e[4])/n,t[2]=(e[8]+e[2])/n):e[5]>e[10]?(n=2*Math.sqrt(1+e[5]-e[0]-e[10]),t[3]=(e[8]-e[2])/n,t[0]=(e[1]+e[4])/n,t[1]=.25*n,t[2]=(e[6]+e[9])/n):(n=2*Math.sqrt(1+e[10]-e[0]-e[5]),t[3]=(e[1]-e[4])/n,t[0]=(e[8]+e[2])/n,t[1]=(e[6]+e[9])/n,t[2]=.25*n),t},i.fromRotationTranslationScale=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3],l=i+i,c=a+a,u=o+o,f=i*l,h=i*c,d=i*u,p=a*c,m=a*u,g=o*u,v=s*l,y=s*c,x=s*u,b=n[0],_=n[1],w=n[2];return t[0]=(1-(p+g))*b,t[1]=(h+x)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(h-x)*_,t[5]=(1-(f+g))*_,t[6]=(m+v)*_,t[7]=0,t[8]=(d+y)*w,t[9]=(m-v)*w,t[10]=(1-(f+p))*w,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t},i.fromRotationTranslationScaleOrigin=function(t,e,r,n,i){var a=e[0],o=e[1],s=e[2],l=e[3],c=a+a,u=o+o,f=s+s,h=a*c,d=a*u,p=a*f,m=o*u,g=o*f,v=s*f,y=l*c,x=l*u,b=l*f,_=n[0],w=n[1],M=n[2],k=i[0],A=i[1],T=i[2];return t[0]=(1-(m+v))*_,t[1]=(d+b)*_,t[2]=(p-x)*_,t[3]=0,t[4]=(d-b)*w,t[5]=(1-(h+v))*w,t[6]=(g+y)*w,t[7]=0,t[8]=(p+x)*M,t[9]=(g-y)*M,t[10]=(1-(h+m))*M,t[11]=0,t[12]=r[0]+k-(t[0]*k+t[4]*A+t[8]*T),t[13]=r[1]+A-(t[1]*k+t[5]*A+t[9]*T),t[14]=r[2]+T-(t[2]*k+t[6]*A+t[10]*T),t[15]=1,t},i.fromQuat=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r+r,s=n+n,l=i+i,c=r*o,u=n*o,f=n*s,h=i*o,d=i*s,p=i*l,m=a*o,g=a*s,v=a*l;return t[0]=1-f-p,t[1]=u+v,t[2]=h-g,t[3]=0,t[4]=u-v,t[5]=1-c-p,t[6]=d+m,t[7]=0,t[8]=h+g,t[9]=d-m,t[10]=1-c-f,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},i.frustum=function(t,e,r,n,i,a,o){var s=1/(r-e),l=1/(i-n),c=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*l,t[6]=0,t[7]=0,t[8]=(r+e)*s,t[9]=(i+n)*l,t[10]=(o+a)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*c,t[15]=0,t},i.perspective=function(t,e,r,n,i){var a=1/Math.tan(e/2),o=1/(n-i);return t[0]=a/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=(i+n)*o,t[11]=-1,t[12]=0,t[13]=0,t[14]=2*i*n*o,t[15]=0,t},i.perspectiveFromFieldOfView=function(t,e,r,n){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),l=2/(o+s),c=2/(i+a);return t[0]=l,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(o-s)*l*.5,t[9]=(i-a)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t},i.ortho=function(t,e,r,n,i,a,o){var s=1/(e-r),l=1/(n-i),c=1/(a-o);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*s,t[13]=(i+n)*l,t[14]=(o+a)*c,t[15]=1,t},i.lookAt=function(t,e,r,a){var o,s,l,c,u,f,h,d,p,m,g=e[0],v=e[1],y=e[2],x=a[0],b=a[1],_=a[2],w=r[0],M=r[1],k=r[2];return Math.abs(g-w).999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.cross(t,i,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+l,s.normalize(n,n))}}(),s.setAxes=function(){var t=i.create();return function(e,r,n,i){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=i[0],t[4]=i[1],t[7]=i[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],s.normalize(e,s.fromMat3(e,t))}}(),s.clone=o.clone,s.fromValues=o.fromValues,s.copy=o.copy,s.set=o.set,s.identity=function(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t},s.setAxisAngle=function(t,e,r){r*=.5;var n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t},s.getAxisAngle=function(t,e){var r=2*Math.acos(e[3]),n=Math.sin(r/2);return 0!=n?(t[0]=e[0]/n,t[1]=e[1]/n,t[2]=e[2]/n):(t[0]=1,t[1]=0,t[2]=0),r},s.add=o.add,s.multiply=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3],s=r[0],l=r[1],c=r[2],u=r[3];return t[0]=n*u+o*s+i*c-a*l,t[1]=i*u+o*l+a*s-n*c,t[2]=a*u+o*c+n*l-i*s,t[3]=o*u-n*s-i*l-a*c,t},s.mul=s.multiply,s.scale=o.scale,s.rotateX=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+o*s,t[1]=i*l+a*s,t[2]=a*l-i*s,t[3]=o*l-n*s,t},s.rotateY=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l-a*s,t[1]=i*l+o*s,t[2]=a*l+n*s,t[3]=o*l-i*s,t},s.rotateZ=function(t,e,r){r*=.5;var n=e[0],i=e[1],a=e[2],o=e[3],s=Math.sin(r),l=Math.cos(r);return t[0]=n*l+i*s,t[1]=i*l-n*s,t[2]=a*l+o*s,t[3]=o*l-a*s,t},s.calculateW=function(t,e){var r=e[0],n=e[1],i=e[2];return t[0]=r,t[1]=n,t[2]=i,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),t},s.dot=o.dot,s.lerp=o.lerp,s.slerp=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t},s.sqlerp=function(){var t=s.create(),e=s.create();return function(r,n,i,a,o,l){return s.slerp(t,n,o,l),s.slerp(e,i,a,l),s.slerp(r,t,e,2*l*(1-l)),r}}(),s.invert=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,s=o?1/o:0;return t[0]=-r*s,t[1]=-n*s,t[2]=-i*s,t[3]=a*s,t},s.conjugate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t},s.length=o.length,s.len=s.length,s.squaredLength=o.squaredLength,s.sqrLen=s.squaredLength,s.normalize=o.normalize,s.fromMat3=function(t,e){var r,n=e[0]+e[4]+e[8];if(n>0)r=Math.sqrt(n+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{var i=0;e[4]>e[0]&&(i=1),e[8]>e[3*i+i]&&(i=2);var a=(i+1)%3,o=(i+2)%3;r=Math.sqrt(e[3*i+i]-e[3*a+a]-e[3*o+o]+1),t[i]=.5*r,r=.5/r,t[3]=(e[3*a+o]-e[3*o+a])*r,t[a]=(e[3*a+i]+e[3*i+a])*r,t[o]=(e[3*o+i]+e[3*i+o])*r}return t},s.str=function(t){return"quat("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+")"},s.exactEquals=o.exactEquals,s.equals=o.equals,e.exports=s},{"./common.js":199,"./mat3.js":202,"./vec3.js":206,"./vec4.js":207}],205:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(2);return t[0]=0,t[1]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(2);return e[0]=t[0],e[1]=t[1],e},i.fromValues=function(t,e){var r=new n.ARRAY_TYPE(2);return r[0]=t,r[1]=e,r},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t},i.set=function(t,e,r){return t[0]=e,t[1]=r,t},i.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t},i.subtract=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t},i.sub=i.subtract,i.multiply=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t},i.mul=i.multiply,i.divide=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t},i.min=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t},i.max=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t},i.scale=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t},i.scaleAndAdd=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t},i.distance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return Math.sqrt(r*r+n*n)},i.dist=i.distance,i.squaredDistance=function(t,e){var r=e[0]-t[0],n=e[1]-t[1];return r*r+n*n},i.sqrDist=i.squaredDistance,i.length=function(t){var e=t[0],r=t[1];return Math.sqrt(e*e+r*r)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1];return e*e+r*r},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t},i.inverse=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t},i.normalize=function(t,e){var r=e[0],n=e[1],i=r*r+n*n;return i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]},i.cross=function(t,e,r){var n=e[0]*r[1]-e[1]*r[0];return t[0]=t[1]=0,t[2]=n,t},i.lerp=function(t,e,r,n){var i=e[0],a=e[1];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI;return t[0]=Math.cos(r)*e,t[1]=Math.sin(r)*e,t},i.transformMat2=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i,t[1]=r[1]*n+r[3]*i,t},i.transformMat2d=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[2]*i+r[4],t[1]=r[1]*n+r[3]*i+r[5],t},i.transformMat3=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[3]*i+r[6],t[1]=r[1]*n+r[4]*i+r[7],t},i.transformMat4=function(t,e,r){var n=e[0],i=e[1];return t[0]=r[0]*n+r[4]*i+r[12],t[1]=r[1]*n+r[5]*i+r[13],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=2),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},i.cross=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},i.lerp=function(t,e,r,n){var i=e[0],a=e[1],o=e[2];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t},i.hermite=function(t,e,r,n,i,a){var o=a*a,s=o*(2*a-3)+1,l=o*(a-2)+a,c=o*(a-1),u=o*(3-2*a);return t[0]=e[0]*s+r[0]*l+n[0]*c+i[0]*u,t[1]=e[1]*s+r[1]*l+n[1]*c+i[1]*u,t[2]=e[2]*s+r[2]*l+n[2]*c+i[2]*u,t},i.bezier=function(t,e,r,n,i,a){var o=1-a,s=o*o,l=a*a,c=s*o,u=3*a*s,f=3*l*o,h=l*a;return t[0]=e[0]*c+r[0]*u+n[0]*f+i[0]*h,t[1]=e[1]*c+r[1]*u+n[1]*f+i[1]*h,t[2]=e[2]*c+r[2]*u+n[2]*f+i[2]*h,t},i.random=function(t,e){e=e||1;var r=2*n.RANDOM()*Math.PI,i=2*n.RANDOM()-1,a=Math.sqrt(1-i*i)*e;return t[0]=Math.cos(r)*a,t[1]=Math.sin(r)*a,t[2]=i*e,t},i.transformMat4=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},i.transformMat3=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t},i.rotateX=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateY=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.rotateZ=function(t,e,r,n){var i=[],a=[];return i[0]=e[0]-r[0],i[1]=e[1]-r[1],i[2]=e[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],t[0]=a[0]+r[0],t[1]=a[1]+r[1],t[2]=a[2]+r[2],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=3),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1?0:Math.acos(a)},i.str=function(t){return"vec3("+t[0]+", "+t[1]+", "+t[2]+")"},i.exactEquals=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]},i.equals=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.EPSILON*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n.EPSILON*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n.EPSILON*Math.max(1,Math.abs(a),Math.abs(l))},e.exports=i},{"./common.js":199}],207:[function(t,e,r){var n=t("./common.js"),i={};i.create=function(){var t=new n.ARRAY_TYPE(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t},i.clone=function(t){var e=new n.ARRAY_TYPE(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e},i.fromValues=function(t,e,r,i){var a=new n.ARRAY_TYPE(4);return a[0]=t,a[1]=e,a[2]=r,a[3]=i,a},i.copy=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},i.set=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t},i.add=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},i.subtract=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},i.sub=i.subtract,i.multiply=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},i.mul=i.multiply,i.divide=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},i.div=i.divide,i.ceil=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t[3]=Math.ceil(e[3]),t},i.floor=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t[3]=Math.floor(e[3]),t},i.min=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},i.max=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},i.round=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t[3]=Math.round(e[3]),t},i.scale=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},i.scaleAndAdd=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},i.distance=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)},i.dist=i.distance,i.squaredDistance=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},i.sqrDist=i.squaredDistance,i.length=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)},i.len=i.length,i.squaredLength=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i},i.sqrLen=i.squaredLength,i.negate=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t},i.inverse=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},i.normalize=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},i.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},i.lerp=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},i.random=function(t,e){return e=e||1,t[0]=n.RANDOM(),t[1]=n.RANDOM(),t[2]=n.RANDOM(),t[3]=n.RANDOM(),i.normalize(t,t),i.scale(t,t,e),t},i.transformMat4=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},i.transformQuat=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,d=-o*n-s*i-l*a;return t[0]=u*c+d*-o+f*-l-h*-s,t[1]=f*c+d*-s+h*-o-u*-l,t[2]=h*c+d*-l+u*-s-f*-o,t[3]=e[3],t},i.forEach=function(){var t=i.create();return function(e,r,n,i,a,o){var s,l;for(r||(r=4),n||(n=0),l=i?Math.min(i*r+n,e.length):e.length,s=n;s1.0001)return null;g+=m[u]}return Math.abs(g-1)>.001?null:[f,function(t,e){for(var r=[0,0,0],n=0;n 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}",attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:"precision mediump 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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:"precision mediump float;\n#define GLSLIFY 1\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(any(lessThan(position, clipBounds[0])) || \n any(greaterThan(position, clipBounds[1]))) {\n gl_Position = vec4(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}",fragment:n,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:"precision mediump 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}",fragment:"precision mediump float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor,1);\n}\n",attributes:[{name:"position",type:"vec3"}]}},{}],210:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d,p,m,g,v,y,x,b,_,w,k,A,T,S){this.gl=t,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=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=d,this.triangleCount=0,this.lineWidth=1,this.edgePositions=p,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=w,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=T,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!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._model=M,this._view=M,this._projection=M,this._resolution=[1,1]}var i=t("gl-shader"),a=t("gl-buffer"),o=t("gl-vao"),s=t("gl-texture2d"),l=t("normals"),c=t("gl-mat4/multiply"),u=t("gl-mat4/invert"),f=t("ndarray"),h=t("colormap"),d=t("simplicial-complex-contour"),p=t("typedarray-pool"),m=t("./lib/shaders"),g=t("./lib/closest-point"),v=m.meshShader,y=m.wireShader,x=m.pointShader,b=m.pickShader,_=m.pointPickShader,w=m.contourShader,M=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],k=n.prototype;k.isOpaque=function(){return this.opacity>=1},k.isTransparent=function(){return this.opacity<1},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=d(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0){(p=this.triShader).bind(),p.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}if(this.edgeCount>0&&this.lineWidth>0){(p=this.lineShader).bind(),p.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()}if(this.pointCount>0){(p=this.pointShader).bind(),p.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}if(this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0){var p;(p=this.contourShader).bind(),p.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind()}},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||M,n=t.view||M,i=t.projection||M,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,pickId:this.pickId/255};if((l=this.pickShader).bind(),l.uniforms=s,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),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0){var l;(l=this.pointPickShader).bind(),l.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind()}},k.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;al[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n],a.uniforms.angle=v[n],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n]&&M&&(e[1^n]-=T*d*x[n],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n],a.uniforms.angle=_[n],c.drawArrays(c.TRIANGLES,w,M)),e[1^n]=T*u[2+(1^n)]-1,p[n+2]&&(e[1^n]+=T*d*m[n+2],kl[k]&&(a.uniforms.dataAxis=t,a.uniforms.screenOffset=e,a.uniforms.color=g[n+2],a.uniforms.angle=v[n+2],c.drawArrays(c.TRIANGLES,l[k],l[A]-l[k]))),y[n+2]&&M&&(e[1^n]+=T*d*x[n+2],a.uniforms.dataAxis=r,a.uniforms.screenOffset=e,a.uniforms.color=b[n+2],a.uniforms.angle=_[n+2],c.drawArrays(c.TRIANGLES,w,M))}}(),c.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,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-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)}}}(),c.bind=function(){var t=[0,0],e=[0,0],r=[0,0];return function(){var n=this.plot,i=this.shader,a=n._tickBounds,o=n.dataBox,s=n.screenBox,l=n.viewBox;i.bind();for(var c=0;c<2;++c){var u=a[c],f=a[c+2]-u,h=.5*(o[c+2]+o[c]),d=o[c+2]-o[c],p=l[c],m=l[c+2]-p,g=s[c],v=s[c+2]-g;e[c]=2*f/d*m/v,t[c]=2*(u-h)/d*m/v}r[1]=2*n.pixelRatio/(s[3]-s[1]),r[0]=r[1]*(s[3]-s[1])/(s[2]-s[0]),i.uniforms.dataScale=e,i.uniforms.dataShift=t,i.uniforms.textScale=r,this.vbo.bind(),i.attributes.textCoordinate.pointer()}}(),c.update=function(t){var e,r,n,i,a,s=[],l=t.ticks,c=t.bounds;for(a=0;a<2;++a){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[a];for(e=0;er)for(t=r;te)for(t=e;t=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;w[x]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,b,w),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":218,"./lib/create-attributes":219,"./lib/create-uniforms":220,"./lib/reflect":221,"./lib/runtime-reflect":222,"./lib/shader-cache":223}],218:[function(t,e,r){function n(t,e,r){this.shortMessage=e||"",this.longMessage=r||"",this.rawError=t||"",this.message="gl-shader: "+(e||t||"")+(r?"\n"+r:""),this.stack=(new Error).stack}(n.prototype=new Error).name="GLError",n.prototype.constructor=n,e.exports=n},{}],219:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}function i(t,e,r,i,a,o,s){for(var l=["gl","v"],c=[],u=0;u=0){if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);i(t,e,d[0],n,p,s,f)}else{if(!(h.indexOf("mat")>=0))throw new o("","Unknown data type for attribute "+f+": "+h);var p;if((p=h.charCodeAt(h.length-1)-48)<2||p>4)throw new o("","Invalid data type for attribute "+f+": "+h);a(t,e,d,n,p,s,f)}}}return s};var o=t("./GLError"),s=n.prototype;s.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},s.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(s,"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}})},{"./GLError":218}],220:[function(t,e,r){"use strict";function n(t){return new Function("y","return function(){return y}")(t)}function i(t,e){for(var r=new Array(t),n=0;n4)throw new o("","Invalid uniform dimension type for matrix "+name+": "+r);return"gl.uniformMatrix"+i+"fv(locations["+e+"],false,obj"+t+")"}throw new o("","Unknown uniform data type for "+name+": "+r)}var i;if((i=r.charCodeAt(r.length-1)-48)<2||i>4)throw new o("","Invalid data type");switch(r.charAt(0)){case"b":case"i":return"gl.uniform"+i+"iv(locations["+e+"],obj"+t+")";case"v":return"gl.uniform"+i+"fv(locations["+e+"],obj"+t+")";default:throw new o("","Unrecognized data type for vector "+name+": "+r)}}}function c(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,c(a,i)):r.push([a,i])}return r}function u(e){for(var n=["return function updateProperty(obj){"],i=c("",e),a=0;a4)throw new o("","Invalid data type");return"b"===t.charAt(0)?i(r,!1):i(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 o("","Invalid uniform dimension type for matrix "+name+": "+t);return i(r*r,0)}throw new o("","Unknown uniform data type for "+name+": "+t)}}(r[c].type)}function h(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){var m=e[p]-n[p]*(e[p+2]-e[p])/(n[p+2]-n[p]);0===p?o.drawLine(m,e[1],m,e[3],d[p],h[p]):o.drawLine(e[0],m,e[2],m,d[p],h[p])}}for(p=0;p=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},f.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},f.removeObject=function(t){for(var e=this.objects,r=0;r0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function i(t){return"boolean"!=typeof t||t}e.exports=function(t){function e(){if(!x&&U.autoResize){var t=b.parentNode,e=1,r=1;t&&t!==document.body?(e=t.clientWidth,r=t.clientHeight):(e=window.innerWidth,r=window.innerHeight);var n=0|Math.ceil(e*U.pixelRatio),i=0|Math.ceil(r*U.pixelRatio);if(n!==b.width||i!==b.height){b.width=n,b.height=i;var a=b.style;a.position=a.position||"absolute",a.left="0px",a.top="0px",a.width=e+"px",a.height=r+"px",O=!0}}}function r(){for(var t=z.length,e=P.length,r=0;r0&&0===I[e-1];)I.pop(),P.pop().dispose()}function g(){if(U.contextLost)return!0;_.isContextLost()&&(U.contextLost=!0,U.mouseListener.enabled=!1,U.selection.object=null,U.oncontextloss&&U.oncontextloss())}function v(){if(!g()){e();var t=U.camera.tick();j.view=U.camera.matrix,O=O||t,F=F||t,E.pixelRatio=U.pixelRatio,C.pixelRatio=U.pixelRatio;var r=z.length,i=G[0],a=G[1];i[0]=i[1]=i[2]=1/0,a[0]=a[1]=a[2]=-1/0;for(var o=0;oM.distance)continue;for(var c=0;c>>1,i=t.positions instanceof Float32Array,a=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:o.mallocFloat32(s.length),c=a?t.idToIndex:o.mallocInt32(n);if(i||l.set(s),!a)for(l.set(s),r=0;r>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,o),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(c,.33333)));t[0]=2/s,t[4]=2/l,t[6]=-2*o[0]/s-1,t[7]=-2*o[1]/l-1,this.offsetBuffer.bind(),i.bind(),i.attributes.position.pointer(),i.uniforms.matrix=t,i.uniforms.color=this.color,i.uniforms.borderColor=this.borderColor,i.uniforms.pointCloud=u<5,i.uniforms.pointSize=u,i.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),n&&(e[0]=255&r,e[1]=r>>8&255,e[2]=r>>16&255,e[3]=r>>24&255,this.pickBuffer.bind(),i.attributes.pickId.pointer(a.UNSIGNED_BYTE),i.uniforms.pickOffset=e,this.pickOffset=r);var f=a.getParameter(a.BLEND),h=a.getParameter(a.DITHER);return f&&!this.blend&&a.disable(a.BLEND),h&&a.disable(a.DITHER),a.drawArrays(a.POINTS,0,this.pointCount),f&&!this.blend&&a.enable(a.BLEND),h&&a.enable(a.DITHER),r+this.pointCount}}(),l.draw=l.unifiedDraw,l.drawPick=l.unifiedDraw,l.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]]}}},{"./lib/shader":227,"gl-buffer":165,"gl-shader":228,"typedarray-pool":554}],236:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],d=r[0],p=r[1],m=r[2],g=r[3];return(a=c*d+u*p+f*m+h*g)<0&&(a=-a,d=-d,p=-p,m=-m,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*c+l*d,t[1]=s*u+l*p,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],237:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e){var r=i[e];if(r||(r=i[e]={}),t in r)return r[t];for(var a=n(t,{textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),o=n(t,{triangles:!0,textAlign:"center",textBaseline:"middle",lineHeight:1,font:e}),s=[[1/0,1/0],[-1/0,-1/0]],l=0;lMath.abs(F[1])){var R=O;O=F,F=R,R=I,I=P,P=R;var N=z;z=D,D=N}O[0]<0&&(I[z]=-1),F[1]>0&&(P[D]=-1);var j=0,B=0;for(C=0;C<4;++C)j+=Math.pow(d[4*z+C],2),B+=Math.pow(d[4*D+C],2);I[z]/=Math.sqrt(j),P[D]/=Math.sqrt(B),h.axes[0]=I,h.axes[1]=P,h.fragClipBounds[0]=l(A,S[0],E,-1e8),h.fragClipBounds[1]=l(A,S[1],E,1e8),e.vao.draw(f.TRIANGLES,e.vertexCount),e.lineWidth>0&&(f.lineWidth(e.lineWidth),e.vao.draw(f.LINES,e.lineVertexCount,e.vertexCount))}}function u(t,e,r,n,i,a){var o=r.gl;if(r.vao.bind(),i===r.opacity<1||a){t.bind();var s=t.uniforms;s.model=n.model||v,s.view=n.view||v,s.projection=n.projection||v,x[0]=2/o.drawingBufferWidth,x[1]=2/o.drawingBufferHeight,s.screenSize=x,s.highlightId=r.highlightId,s.highlightScale=r.highlightScale,s.fragClipBounds=S,s.clipBounds=r.axes.bounds,s.opacity=r.opacity,s.pickGroup=r.pickId/255,s.pixelRatio=r.pixelRatio,r.vao.draw(o.TRIANGLES,r.vertexCount),r.lineWidth>0&&(o.lineWidth(r.lineWidth),r.vao.draw(o.LINES,r.lineVertexCount,r.vertexCount))}c(e,r,n,i),r.vao.unbind()}var f=t("gl-buffer"),h=t("gl-vao"),d=t("typedarray-pool"),p=t("gl-mat4/multiply"),m=t("./lib/shaders"),g=t("./lib/glyphs"),v=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];e.exports=function(t){var e=t.gl,r=m.createPerspective(e),n=m.createOrtho(e),i=m.createProject(e),o=m.createPickPerspective(e),s=m.createPickOrtho(e),l=m.createPickProject(e),c=f(e),u=f(e),d=f(e),p=f(e),g=new a(e,r,n,i,c,u,d,p,h(e,[{buffer:c,size:3,type:e.FLOAT},{buffer:u,size:4,type:e.FLOAT},{buffer:d,size:2,type:e.FLOAT},{buffer:p,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),o,s,l);return g.update(t),g};var y=a.prototype;y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.isTransparent=function(){if(this.opacity<1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]<1)return!0;return!1},y.isOpaque=function(){if(this.opacity>=1)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectOpacity[t]>=1)return!0;return!1};var x=[0,0],b=[0,0,0],_=[0,0,0],w=[0,0,0,1],M=[0,0,0,1],k=v.slice(),A=[0,0,0],T=[[0,0,0],[0,0,0]],S=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];y.draw=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!1,!1)},y.drawTransparent=function(t){u(this.useOrtho?this.orthoShader:this.shader,this.projectShader,this,t,!0,!1)},y.drawPick=function(t){u(this.useOrtho?this.pickOrthoShader:this.pickPerspectiveShader,this.pickProjectShader,this,t,!1,!0)},y.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[2]+(t.value[1]<<8)+(t.value[0]<<16);if(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},y.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]},y.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(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if("projectOpacity"in t)if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}"opacity"in t&&(this.opacity=t.opacity),this.dirty=!0;var n=t.position;if(n){var i=t.font||"normal",a=t.alignment||[0,0],o=[1/0,1/0,1/0],s=[-1/0,-1/0,-1/0],l=t.glyph,c=t.color,u=t.size,f=t.angle,h=t.lineColor,p=0,m=0,v=0,y=n.length;t:for(var x=0;x0&&(C[0]=-a[0]*(1+k[0][0]));var q=w.cells,H=w.positions;for(_=0;_0){var v=r*u;o.drawBox(f-v,h-v,d+v,h+v,a),o.drawBox(f-v,p-v,d+v,p+v,a),o.drawBox(f-v,h-v,f+v,p+v,a),o.drawBox(d-v,h-v,d+v,p+v,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)}},{"./lib/shaders":240,"gl-buffer":165,"gl-shader":243}],242:[function(t,e,r){"use strict";function n(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)}}e.exports=function(t,e){return new n(t,i(t,e),a.mallocUint8(e[0]*e[1]*4))};var i=t("gl-fbo"),a=t("typedarray-pool"),o=t("ndarray"),s=t("bit-twiddle").nextPow2,l=t("cwise/lib/wrapper")({args:["array",{offset:[0,0,1],array:0},{offset:[0,0,2],array:0},{offset:[0,0,3],array:0},"scalar","scalar","index"],pre:{body:"{this_closestD2=1e8,this_closestX=-1,this_closestY=-1}",args:[],thisVars:["this_closestD2","this_closestX","this_closestY"],localVars:[]},body:{body:"{if(_inline_46_arg0_<255||_inline_46_arg1_<255||_inline_46_arg2_<255||_inline_46_arg3_<255){var _inline_46_l=_inline_46_arg4_-_inline_46_arg6_[0],_inline_46_a=_inline_46_arg5_-_inline_46_arg6_[1],_inline_46_f=_inline_46_l*_inline_46_l+_inline_46_a*_inline_46_a;_inline_46_fthis.buffer.length){a.free(this.buffer);for(var n=this.buffer=a.mallocUint8(s(r*e*4)),i=0;i=0){for(var k=0|M.type.charAt(M.type.length-1),A=new Array(k),T=0;T=0;)S+=1;_[w]=S}var E=new Array(r.length);f(),d._relink=f,d.types={uniforms:s(r),attributes:s(n)},d.attributes=o(p,d,x,_),Object.defineProperty(d,"uniforms",a(p,d,r,E))},e.exports=function(t,e,r,i,a){var o=new n(t);return o.update(e,r,i,a),o}},{"./lib/GLError":244,"./lib/create-attributes":245,"./lib/create-uniforms":246,"./lib/reflect":247,"./lib/runtime-reflect":248,"./lib/shader-cache":249}],244:[function(t,e,r){arguments[4][218][0].apply(r,arguments)},{dup:218}],245:[function(t,e,r){arguments[4][219][0].apply(r,arguments)},{"./GLError":244,dup:219}],246:[function(t,e,r){arguments[4][220][0].apply(r,arguments)},{"./GLError":244,"./reflect":247,dup:220}],247:[function(t,e,r){arguments[4][221][0].apply(r,arguments)},{dup:221}],248:[function(t,e,r){arguments[4][222][0].apply(r,arguments)},{dup:222}],249:[function(t,e,r){arguments[4][223][0].apply(r,arguments)},{"./GLError":244,dup:223,"gl-format-compiler-error":172,"weakmap-shim":576}],250:[function(t,e,r){"use strict";function n(t){this.plot=t,this.enable=[!0,!0,!1,!1],this.width=[1,1,1,1],this.color=[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.center=[1/0,1/0]}e.exports=function(t,e){var r=new n(t);return r.update(e),t.addOverlay(r),r};var i=n.prototype;i.update=function(t){t=t||{},this.enable=(t.enable||[!0,!0,!1,!1]).slice(),this.width=(t.width||[1,1,1,1]).slice(),this.color=(t.color||[[0,0,0,1],[0,0,0,1],[0,0,0,1],[0,0,0,1]]).map(function(t){return t.slice()}),this.center=(t.center||[1/0,1/0]).slice(),this.plot.setOverlayDirty()},i.draw=function(){var t=this.enable,e=this.width,r=this.color,n=this.center,i=this.plot,a=i.line,o=i.dataBox,s=i.viewBox;if(a.bind(),o[0]<=n[0]&&n[0]<=o[2]&&o[1]<=n[1]&&n[1]<=o[3]){var l=s[0]+(n[0]-o[0])/(o[2]-o[0])*(s[2]-s[0]),c=s[1]+(n[1]-o[1])/(o[3]-o[1])*(s[3]-s[1]);t[0]&&a.drawLine(l,c,s[0],c,e[0],r[0]),t[1]&&a.drawLine(l,c,l,s[1],e[1],r[1]),t[2]&&a.drawLine(l,c,s[2],c,e[2],r[2]),t[3]&&a.drawLine(l,c,l,s[3],e[3],r[3])}},i.dispose=function(){this.plot.removeOverlay(this)}},{}],251:[function(t,e,r){"use strict";var n=t("gl-shader");e.exports=function(t){return n(t,"precision mediump float;\n#define GLSLIFY 1\n\nattribute vec3 position, color;\nattribute float weight;\n\nuniform mat4 model, view, projection;\nuniform vec3 coordinates[3];\nuniform vec4 colors[3];\nuniform vec2 screenShape;\nuniform float lineWidth;\n\nvarying vec4 fragColor;\n\nvoid main() {\n vec3 vertexPosition = mix(coordinates[0],\n mix(coordinates[2], coordinates[1], 0.5 * (position + 1.0)), abs(position));\n\n vec4 clipPos = projection * view * model * vec4(vertexPosition, 1.0);\n vec2 clipOffset = (projection * view * model * vec4(color, 0.0)).xy;\n vec2 delta = weight * clipOffset * screenShape;\n vec2 lineOffset = normalize(vec2(delta.y, -delta.x)) / screenShape;\n\n gl_Position = vec4(clipPos.xy + clipPos.w * 0.5 * lineWidth * lineOffset, clipPos.z, clipPos.w);\n fragColor = color.x * colors[0] + color.y * colors[1] + color.z * colors[2];\n}\n","precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}",null,[{name:"position",type:"vec3"},{name:"color",type:"vec3"},{name:"weight",type:"float"}])}},{"gl-shader":243}],252:[function(t,e,r){"use strict";function n(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n,this.pixelRatio=1,this.bounds=[[-1e3,-1e3,-1e3],[1e3,1e3,1e3]],this.position=[0,0,0],this.lineWidth=[2,2,2],this.colors=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.enabled=[!0,!0,!0],this.drawSides=[!0,!0,!0],this.axes=null}var i=t("gl-buffer"),a=t("gl-vao"),o=t("./shaders/index");e.exports=function(t,e){function r(t,e,r,n,i,a){var o=[t,e,r,0,0,0,1];o[n+3]=1,o[n]=i,s.push.apply(s,o),o[6]=-1,s.push.apply(s,o),o[n]=a,s.push.apply(s,o),s.push.apply(s,o),o[6]=1,s.push.apply(s,o),o[n]=i,s.push.apply(s,o)}var s=[];r(0,0,0,0,0,1),r(0,0,0,1,0,1),r(0,0,0,2,0,1),r(1,0,0,1,-1,1),r(1,0,0,2,-1,1),r(0,1,0,0,-1,1),r(0,1,0,2,-1,1),r(0,0,1,0,-1,1),r(0,0,1,1,-1,1);var l=i(t,s),c=a(t,[{type:t.FLOAT,buffer:l,size:3,offset:0,stride:28},{type:t.FLOAT,buffer:l,size:3,offset:12,stride:28},{type:t.FLOAT,buffer:l,size:1,offset:24,stride:28}]),u=o(t);u.attributes.position.location=0,u.attributes.color.location=1,u.attributes.weight.location=2;var f=new n(t,l,c,u);return f.update(e),f};var s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],l=n.prototype,c=[0,0,0],u=[0,0,0],f=[0,0];l.isTransparent=function(){return!1},l.drawTransparent=function(t){},l.draw=function(t){var e=this.gl,r=this.vao,n=this.shader;r.bind(),n.bind();var i,a=t.model||s,o=t.view||s,l=t.projection||s;this.axes&&(i=this.axes.lastCubeProps.axis);for(var h=c,d=u,p=0;p<3;++p)i&&i[p]<0?(h[p]=this.bounds[0][p],d[p]=this.bounds[1][p]):(h[p]=this.bounds[1][p],d[p]=this.bounds[0][p]);f[0]=e.drawingBufferWidth,f[1]=e.drawingBufferHeight,n.uniforms.model=a,n.uniforms.view=o,n.uniforms.projection=l,n.uniforms.coordinates=[this.position,h,d],n.uniforms.colors=this.colors,n.uniforms.screenShape=f;for(p=0;p<3;++p)n.uniforms.lineWidth=this.lineWidth[p]*this.pixelRatio,this.enabled[p]&&(r.draw(e.TRIANGLES,6,6*p),this.drawSides[p]&&r.draw(e.TRIANGLES,12,18+12*p));r.unbind()},l.update=function(t){t&&("bounds"in t&&(this.bounds=t.bounds),"position"in t&&(this.position=t.position),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"colors"in t&&(this.colors=t.colors),"enabled"in t&&(this.enabled=t.enabled),"drawSides"in t&&(this.drawSides=t.drawSides))},l.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders/index":251,"gl-buffer":165,"gl-vao":259}],253:[function(t,e,r){var n=t("gl-shader"),i="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\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 worldCoordinate = vec3(uv.zw, f.x);\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n",a="precision mediump float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution_2_0(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\n\n\nfloat beckmannSpecular_1_1(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution_2_0(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\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 (kill > 0.0 ||\n any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n discard;\n }\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_1_1(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 \u2014 in vertex or in fragment\n vec4 surfaceColor = step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) + 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",o="precision mediump float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\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 vec4 worldPosition = model * vec4(dataCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z = clipPosition.z + zOffset;\n\n gl_Position = clipPosition;\n value = f;\n kill = -1.0;\n worldCoordinate = dataCoordinate;\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",s="precision mediump float;\n#define GLSLIFY 1\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 any(lessThan(worldCoordinate, clipBounds[0])) || any(greaterThan(worldCoordinate, clipBounds[1]))) {\n 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";r.createShader=function(t){var e=n(t,i,a,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},r.createPickShader=function(t){var e=n(t,i,s,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},r.createContourShader=function(t){var e=n(t,o,a,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,o,s,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":243}],254:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u,f,h,d){this.gl=t,this.shape=e,this.bounds=r,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=s,this._contourShader=l,this._contourPickShader=c,this._contourBuffer=u,this._contourVAO=f,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new function(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=h,this._dynamicVAO=d,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=[y(p.mallocFloat(1024),[0,0]),y(p.mallocFloat(1024),[0,0]),y(p.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.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}function i(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=F.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],b(l,t.model,l);var c=F.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return F.showSurface=o,F.showContour=s,F}function a(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=R;n.model=t.model||C,n.view=t.view||C,n.projection=t.projection||C,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.contourColor=this.contourColor[0],n.inverseModel=_(n.inverseModel,n.model);for(var a=0;a<2;++a)for(var o=n.clipBounds[a],s=0;s<3;++s)o[s]=Math.min(Math.max(this.clipBounds[a][s],-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=j,n.vertexColor=this.vertexColor;var l=N;for(b(l,n.view,n.model),b(l,n.projection,l),_(l,l),a=0;a<3;++a)n.eyePosition[a]=l[12+a]/l[15];var c=l[15];for(a=0;a<3;++a)c+=this.lightPosition[a]*l[4*a+3];for(a=0;a<3;++a){var u=l[12+a];for(s=0;s<3;++s)u+=l[4*s+a]*this.lightPosition[s];n.lightPosition[a]=u/c}var f=i(n,this);if(f.showSurface&&e===this.opacity<1){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),a=0;a<3;++a)this.surfaceProject[a]&&this.vertexCount&&(this._shader.uniforms.model=f.projections[a],this._shader.uniforms.clipBounds=f.clipBounds[a],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(f.showContour&&!e){var h=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,h.bind(),h.uniforms=n;var d=this._contourVAO;for(d.bind(),a=0;a<3;++a)for(h.uniforms.permutation=D[a],r.lineWidth(this.contourWidth[a]),s=0;s=1)return!0;for(var t=0;t<3;++t)if(this._contourCounts[t].length>0||this._dynamicCounts[t]>0)return!0;return!1},P.pickSlots=1,P.setPickBase=function(t){this.pickId=t};var O=[0,0,0],F={showSurface:!1,showContour:!1,projections:[C.slice(),C.slice(),C.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]},R={model:C,view:C,projection:C,inverseModel:C.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,kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},N=C.slice(),j=[1,0,0,0,1,0,0,0,1];P.draw=function(t){return a.call(this,t,!1)},P.drawTransparent=function(t){return a.call(this,t,!0)};var B={model:C,view:C,projection:C,inverseModel:C,clipBounds:[[0,0,0],[0,0,0]],height:0,shape:[0,0],pickId:0,lowerBound:[0,0,0],upperBound:[0,0,0],zOffset:0,permutation:[1,0,0,0,1,0,0,0,1],lightPosition:[0,0,0],eyePosition:[0,0,0]};P.drawPick=function(t){t=t||{};var e=this.gl;e.disable(e.CULL_FACE);var r=B;r.model=t.model||C,r.view=t.view||C,r.projection=t.projection||C,r.shape=this._field[2].shape,r.pickId=this.pickId/255,r.lowerBound=this.bounds[0],r.upperBound=this.bounds[1],r.permutation=j;for(var n=0;n<2;++n)for(var a=r.clipBounds[n],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[n][o],-1e8),1e8);var s=i(r,this);if(s.showSurface){for(this._pickShader.bind(),this._pickShader.uniforms=r,this._vao.bind(),this._vao.draw(e.TRIANGLES,this._vertexCount),n=0;n<3;++n)this.surfaceProject[n]&&(this._pickShader.uniforms.model=s.projections[n],this._pickShader.uniforms.clipBounds=s.clipBounds[n],this._vao.draw(e.TRIANGLES,this._vertexCount));this._vao.unbind()}if(s.showContour){var l=this._contourPickShader;l.bind(),l.uniforms=r;var c=this._contourVAO;for(c.bind(),o=0;o<3;++o)for(e.lineWidth(this.contourWidth[o]),l.uniforms.permutation=D[o],n=0;n>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 c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var d=i+u,p=s+h,m=f*(h?l:1-l),g=0;g<3;++g)c[g]+=this._field[g].get(d,p)*m;for(var v=this._pickResult.level,y=0;y<3;++y)if(v[y]=w.le(this.contourLevels[y],c[y]),v[y]<0)this.contourLevels[y].length>0&&(v[y]=0);else if(v[y]Math.abs(b-c[y])&&(v[y]+=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],g=0;g<3;++g)r.dataCoordinate[g]=this._field[g].get(r.index[0],r.index[1]);return r},P.update=function(t){t=t||{},this.dirty=!0,"contourWidth"in t&&(this.contourWidth=s(t.contourWidth,Number)),"showContour"in t&&(this.showContour=s(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=s(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=c(t.contourColor)),"contourProject"in t&&(this.contourProject=s(t.contourProject,function(t){return s(t,Boolean)})),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=c(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=s(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=s(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0);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 n=(e.shape[0]+2)*(e.shape[1]+2);n>this._field[2].data.length&&(p.freeFloat(this._field[2].data),this._field[2].data=p.mallocFloat(u.nextPow2(n))),this._field[2]=y(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),o(this._field[2],e),this.shape=e.shape.slice();for(var i=this.shape,a=0;a<2;++a)this._field[2].size>this._field[a].data.length&&(p.freeFloat(this._field[a].data),this._field[a].data=p.mallocFloat(this._field[2].size)),this._field[a]=y(this._field[a].data,[i[0]+2,i[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(a=0;a<2;++a){var f=l[a];for(w=0;w<2;++w)if(f.shape[w]!==i[w])throw new Error("gl-surface: coords have incorrect shape");o(this._field[a],f)}}else if(t.ticks){var h=t.ticks;if(!Array.isArray(h)||2!==h.length)throw new Error("gl-surface: invalid ticks");for(a=0;a<2;++a){var d=h[a];if((Array.isArray(d)||d.length)&&(d=y(d)),d.shape[0]!==i[a])throw new Error("gl-surface: invalid tick length");var b=y(d.data,i);b.stride[a]=d.stride[0],b.stride[1^a]=0,o(this._field[a],b)}}else{for(a=0;a<2;++a){var _=[0,0];_[a]=1,this._field[a]=y(this._field[a].data,[i[0]+2,i[1]+2],_,0)}this._field[0].set(0,0,0);for(var w=0;w0){for(var Mt=0;Mt<5;++Mt)nt.pop();Y-=1}continue t}nt.push(st[0],st[1],ut[0],ut[1],st[2]),Y+=1}}ot.push(Y)}this._contourOffsets[it]=at,this._contourCounts[it]=ot}var kt=p.mallocFloat(nt.length);for(a=0;ai||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 a(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}function o(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 s(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 l(t,e,r,n,i){var o=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>o||r<0||r>o)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 l=s(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new a(t,l,e,r,n,i)}var c=t("ndarray"),u=t("ndarray-ops"),f=t("typedarray-pool");e.exports=function(t){if(arguments.length<=1)throw new Error("gl-texture2d: Missing arguments for texture2d constructor");if(h||function(t){h=[t.LINEAR,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_NEAREST],d=[t.NEAREST,t.LINEAR,t.NEAREST_MIPMAP_NEAREST,t.NEAREST_MIPMAP_LINEAR,t.LINEAR_MIPMAP_NEAREST,t.LINEAR_MIPMAP_LINEAR],p=[t.REPEAT,t.CLAMP_TO_EDGE,t.MIRRORED_REPEAT]}(t),"number"==typeof arguments[1])return l(t,arguments[1],arguments[2],arguments[3]||t.RGBA,arguments[4]||t.UNSIGNED_BYTE);if(Array.isArray(arguments[1]))return l(t,0|arguments[1][0],0|arguments[1][1],arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if("object"==typeof arguments[1]){var e=arguments[1],r=n(e)?e:e.raw;if(r)return function(t,e,r,n,i,o){var l=s(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,o,e),new a(t,l,r,n,i,o)}(t,r,0|e.width,0|e.height,arguments[2]||t.RGBA,arguments[3]||t.UNSIGNED_BYTE);if(e.shape&&e.data&&e.stride)return function(t,e){var r=e.dtype,n=e.shape.slice(),i=t.getParameter(t.MAX_TEXTURE_SIZE);if(n[0]<0||n[0]>i||n[1]<0||n[1]>i)throw new Error("gl-texture2d: Invalid texture size");var l=o(n,e.stride.slice()),h=0;"float32"===r?h=t.FLOAT:"float64"===r?(h=t.FLOAT,l=!1,r="float32"):"uint8"===r?h=t.UNSIGNED_BYTE:(h=t.UNSIGNED_BYTE,l=!1,r="uint8");var d=0;if(2===n.length)d=t.LUMINANCE,n=[n[0],n[1],1],e=c(e.data,n,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==n.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===n[2])d=t.ALPHA;else if(2===n[2])d=t.LUMINANCE_ALPHA;else if(3===n[2])d=t.RGB;else{if(4!==n[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}h!==t.FLOAT||t.getExtension("OES_texture_float")||(h=t.UNSIGNED_BYTE,l=!1);var p,g,v=e.size;if(l)p=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[n[2],n[2]*n[0],1];g=f.malloc(v,r);var x=c(g,n,y,0);"float32"!==r&&"float64"!==r||h!==t.UNSIGNED_BYTE?u.assign(x,e):m(x,e),p=g.subarray(0,v)}var b=s(t);return t.texImage2D(t.TEXTURE_2D,0,d,n[0],n[1],0,d,h,p),l||f.free(g),new a(t,b,n[0],n[1],d,h)}(t,e)}throw new Error("gl-texture2d: Invalid arguments for texture2d constructor")};var h=null,d=null,p=null,m=function(t,e){u.muls(t,e,255)},g=a.prototype;Object.defineProperties(g,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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&&h.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),d.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(),p.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(),p.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(p.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 i(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return t|=0,i(this,t,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,i(this,this._shape[0],t),t}}}),g.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},g.dispose=function(){this.gl.deleteTexture(this.handle)},g.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)},g.setPixels=function(t,e,r,i){var a=this.gl;this.bind(),Array.isArray(e)?(i=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),i=i||0;var s=n(t)?t:t.raw;if(s){this._mipLevels.indexOf(i)<0?(a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,this.type,s),this._mipLevels.push(i)):a.texSubImage2D(a.TEXTURE_2D,i,e,r,this.format,this.type,s)}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]>>>i||r+t.shape[0]>this._shape[0]>>>i||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,n,i,a,s,l){var h=l.dtype,d=l.shape.slice();if(d.length<2||d.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var p=0,g=0,v=o(d,l.stride.slice());if("float32"===h?p=t.FLOAT:"float64"===h?(p=t.FLOAT,v=!1,h="float32"):"uint8"===h?p=t.UNSIGNED_BYTE:(p=t.UNSIGNED_BYTE,v=!1,h="uint8"),2===d.length)g=t.LUMINANCE,d=[d[0],d[1],1],l=c(l.data,d,[l.stride[0],l.stride[1],1],l.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||i!==t.LUMINANCE&&i!==t.ALPHA||(g=i),g!==i)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=l.size,x=s.indexOf(n)<0;if(x&&s.push(n),p===a&&v)0===l.offset&&l.data.length===y?x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data):x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,l.data.subarray(l.offset,l.offset+y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,l.data.subarray(l.offset,l.offset+y));else{var b;b=a===t.FLOAT?f.mallocFloat32(y):f.mallocUint8(y);var _=c(b,d,[d[2],d[2]*d[0],1]);p===t.FLOAT&&a===t.UNSIGNED_BYTE?m(_,l):u.assign(_,l),x?t.texImage2D(t.TEXTURE_2D,n,i,d[0],d[1],0,i,a,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,n,e,r,d[0],d[1],i,a,b.subarray(0,y)),a===t.FLOAT?f.freeFloat32(b):f.freeUint8(b)}}(a,e,r,i,this.format,this.type,this._mipLevels,t)}}},{ndarray:458,"ndarray-ops":452,"typedarray-pool":554}],256:[function(t,e,r){"use strict";e.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;i0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a),t}},{}],265:[function(t,e,r){e.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}},{}],266:[function(t,e,r){e.exports=function(t,e,r,a){return n[0]=a,n[1]=r,n[2]=e,n[3]=t,i[0]};var n=new Uint8Array(4),i=new Float32Array(n.buffer)},{}],267:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r-1?y:j.indexOf(t)>-1?v:g,e(z.join("")),C=l,E}return z.push(A),T=A,E+1}();break;case x:E=/[^\s]/g.test(A)?(e(z.join("")),C=l,E):(z.push(A),T=A,E+1);break;case l:z=z.length?[]:z,E="/"===T&&"*"===A?(O=L+E-1,C=u,T=A,E+1):"/"===T&&"/"===A?(O=L+E-1,C=f,T=A,E+1):"#"===A?(C=h,O=L+E,E):/\s/.test(A)?(C=x,O=L+E,E):(F=/\d/.test(A),R=/[^\w_]/.test(A),O=L+E,C=F?p:R?d:c,E)}if(r!==E)switch(N[r]){case"\n":P=0,++I;break;default:++P}}return L+=E,N=N.slice(E),D}function M(){return"\r"!==A&&"\n"!==A||"\\"===T?(z.push(A),T=A,E+1):(e(z.join("")),C=l,E)}function k(t){for(var r,n,a=0;;){if(r=i.indexOf(t.slice(0,t.length+a).join("")),n=i[r],-1===r){if(a--+t.length>0)continue;n=t.slice(0,1).join("")}return e(n),O+=n.length,(z=z.slice(n.length)).length}}var A,T,S,E=0,L=0,C=l,z=[],D=[],I=1,P=0,O=0,F=!1,R=!1,N="",j=a,B=n;return"300 es"===(t=t||{}).version&&(j=s,B=o),function(t){return D=[],null!==t?r(t.replace?t.replace(/\r\n/g,"\n"):t):(z.length&&e(z.join("")),C=b,e("(eof)"),D)}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=999,c=9999,u=0,f=1,h=2,d=3,p=4,m=5,g=6,v=7,y=8,x=9,b=10,_=11,w=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":270,"./lib/builtins-300es":269,"./lib/literals":272,"./lib/literals-300es":271,"./lib/operators":273}],269:[function(t,e,r){var n=t("./builtins");n=n.slice().filter(function(t){return!/^(gl\_|texture)/.test(t)}),e.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"])},{"./builtins":270}],270:[function(t,e,r){e.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"]},{}],271:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","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"])},{"./literals":272}],272:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","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"]},{}],273:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],274:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=i.concat(r(t)),i=i.concat(r(null))}},{"./index":268}],275:[function(t,e,r){"use strict";function n(t,e,r){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var a=new Int32Array(this.arrayBuffer);t=a[0],e=a[1],r=a[2],this.d=e+2*r;for(var o=0;o=c[h+0]&&n>=c[h+1]?(o[f]=!0,a.push(l[f])):o[f]=!1}}},n.prototype._forEachCell=function(t,e,r,n,i,a,o){for(var s=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),u=this._convertToCellCoord(n),f=s;f<=c;f++)for(var h=l;h<=u;h++){var d=this.d*h+f;if(i.call(this,t,e,r,n,d,a,o))return}},n.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},n.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=i+this.cells.length+1+1,r=0,n=0;n>1,u=-7,f=r?i-1:0,h=r?-1:1,d=t[e+f];for(f+=h,a=d&(1<<-u)-1,d>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=c}return(d?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,m=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=u):(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>=u?(s=0,o=u):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,c-=8);t[r+d-p]|=128*m}},{}],278:[function(t,e,r){"use strict";function n(t,e,r){this.vertices=t,this.adjacent=e,this.boundary=r,this.lastVisited=-1}function i(t,e,r){this.vertices=t,this.cell=e,this.index=r}function a(t,e){return l(t.vertices,e.vertices)}function o(t,e,r){this.dimension=t,this.vertices=e,this.simplices=r,this.interior=r.filter(function(t){return!t.boundary}),this.tuple=new Array(t+1);for(var n=0;n<=t;++n)this.tuple[n]=this.vertices[n];var i=c[t];i||(i=c[t]=function(t){for(var e=["function orient(){var tuple=this.tuple;return test("],r=0;r<=t;++r)r>0&&e.push(","),e.push("tuple[",r,"]");e.push(")}return orient");var n=new Function("test",e.join("")),i=s[t+1];return i||(i=s),n(i)}(t)),this.orient=i}e.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 a=t.slice(0,i+1),l=s.apply(void 0,a);if(0===l)throw new Error("Input not in general position");for(var c=new Array(i+1),u=0;u<=i;++u)c[u]=u;l<0&&(c[0]=1,c[1]=0);var f=new n(c,new Array(i+1),!1),h=f.adjacent,d=new Array(i+2);for(u=0;u<=i;++u){for(var p=c.slice(),m=0;m<=i;++m)m===u&&(p[m]=-1);var g=p[0];p[0]=p[1],p[1]=g;var v=new n(p,new Array(i+1),!0);h[u]=v,d[u]=v}for(d[i+1]=f,u=0;u<=i;++u){p=h[u].vertices;var y=h[u].adjacent;for(m=0;m<=i;++m){var x=p[m];if(x<0)y[m]=f;else for(var b=0;b<=i;++b)h[b].vertices.indexOf(x)<0&&(y[m]=h[b])}}var _=new o(i,a,d),w=!!e;for(u=i+1;u0;){(t=o.pop()).vertices;for(var s=t.adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var d=this.orient();if(d>0)return c;c.lastVisited=-n,0===d&&o.push(c)}}}return null},u.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,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var d=this.orient();if(a[u]=h,d<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,o=this.dimension,s=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var d=(e=f.pop()).vertices,p=e.adjacent,m=d.indexOf(r);if(!(m<0))for(var g=0;g<=o;++g)if(g!==m){var v=p[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=o;++b)y[b]<0?(x=b,l[b]=t):l[b]=s[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=d.slice(),M=p.slice(),k=new n(w,M,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,M[m]=v,w[g]=-1,M[g]=e,p[g]=k,k.flip();for(b=0;b<=o;++b){var T=w[b];if(!(T<0||T===r)){for(var S=new Array(o-1),E=0,L=0;L<=o;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new i(S,k,b))}}}}}}h.sort(a);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":515,"simplicial-complex":526}],279:[function(t,e,r){"use strict";function n(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}function i(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 a(t,e){var r=p(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 o(t,e){var r=t.intervals([]);r.push(e),a(t,r)}function s(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?v:(r.splice(n,1),a(t,r),y)}function l(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function u(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?o(this,t):this.left.insert(t):this.left=p([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?o(this,t):this.right.insert(t):this.right=p([t]);else{var r=g.ge(this.leftPoints,t,h),n=g.ge(this.rightPoints,t,d);this.leftPoints.splice(r,0,t),this.rightPoints.splice(n,0,t)}},x.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1))return s(this,t);return 2===(o=this.left.remove(t))?(this.left=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(t[0]>this.mid){if(!this.right)return v;if(4*(this.left?this.left.count:0)>3*(e-1))return s(this,t);return 2===(o=this.right.remove(t))?(this.right=null,this.count-=1,y):(o===y&&(this.count-=1),o)}if(1===this.count)return this.leftPoints[0]===t?2:v;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,n=this.left;n.right;)r=n,n=n.right;if(r===this)n.right=this.right;else{var a=this.left,o=this.right;r.count-=n.count,r.right=n.left,n.left=a,n.right=o}i(this,n),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?i(this,this.left):i(this,this.right);return y}for(a=g.ge(this.leftPoints,t,h);athis.mid){if(this.right){var r;if(r=this.right.queryPoint(t,e))return r}return c(this.rightPoints,t,e)}return u(this.leftPoints,e)},x.queryInterval=function(t,e,r){if(tthis.mid&&this.right){var n;if(n=this.right.queryInterval(t,e,r))return n}return ethis.mid?c(this.rightPoints,t,r):u(this.leftPoints,r)};var b=m.prototype;b.insert=function(t){this.root?this.root.insert(t):this.root=new n(t[0],null,null,[t],[t])},b.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),e!==v}return!1},b.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},b.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(b,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(b,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":70}],280:[function(t,e,r){"use strict";e.exports=function(t,e){e=e||new Array(t.length);for(var r=0;r4))}},{}],288:[function(t,e,r){"use strict";function n(t,e,r,n,a){e=e||function(t){return t[0]},r=r||function(t){return t[1]},a=a||Array,this.nodeSize=n||64,this.points=t,this.ids=new a(t.length),this.coords=new a(2*t.length);for(var o=0;o=r&&s<=i&&l>=n&&l<=a&&u.push(t[p]);else{var m=Math.floor((d+h)/2);s=e[2*m],l=e[2*m+1],s>=r&&s<=i&&l>=n&&l<=a&&u.push(t[m]);var g=(f+1)%2;(0===f?r<=s:n<=l)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?i>=s:a>=l)&&(c.push(m+1),c.push(h),c.push(g))}}return u}},{}],290:[function(t,e,r){"use strict";function n(t,e,r,a,o,s){if(!(o-a<=r)){var l=Math.floor((a+o)/2);i(t,e,l,a,o,s%2),n(t,e,r,a,l-1,s+1),n(t,e,r,l+1,o,s+1)}}function i(t,e,r,n,o,s){for(;o>n;){if(o-n>600){var l=o-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);i(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(o,Math.floor(r+(l-c)*f/l+h)),s)}var d=e[2*r+s],p=n,m=o;for(a(t,e,n,r),e[2*o+s]>d&&a(t,e,n,o);pd;)m--}e[2*n+s]===d?a(t,e,n,m):a(t,e,++m,o),m<=r&&(n=m+1),r<=m&&(o=m-1)}}function a(t,e,r,n){o(t,r,n),o(e,2*r,2*n),o(e,2*r+1,2*n+1)}function o(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],291:[function(t,e,r){"use strict";function n(t,e,r,n){var i=t-r,a=e-n;return i*i+a*a}e.exports=function(t,e,r,i,a,o){for(var s=[0,t.length-1,0],l=[],c=a*a;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)n(e[2*d],e[2*d+1],r,i)<=c&&l.push(t[d]);else{var p=Math.floor((h+f)/2),m=e[2*p],g=e[2*p+1];n(m,g,r,i)<=c&&l.push(t[p]);var v=(u+1)%2;(0===u?r-a<=m:i-a<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?r+a>=m:i+a>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],292:[function(t,e,r){"use strict";function n(t,e){if(!(this instanceof n))return new n(t,e);this.nodeSize=e||64,this.coords=t.slice();var r=Math.floor(t.length/2);this.ids=Array(r);for(var i=0;in;){if(i-n>600){var l=i-n+1,c=r-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),h=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1);o(t,e,r,Math.max(n,Math.floor(r-c*f/l+h)),Math.min(i,Math.floor(r+(l-c)*f/l+h)),a)}var d=e[2*r+a],p=n,m=i;for(s(t,e,n,r),e[2*i+a]>d&&s(t,e,n,i);pd;)m--}e[2*n+a]===d?s(t,e,n,m):s(t,e,++m,i),m<=r&&(n=m+1),r<=m&&(i=m-1)}}function s(t,e,r,n){l(t,r,n),l(e,2*r,2*n),l(e,2*r+1,2*n+1)}function l(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n,n.prototype.range=function(t,e,r,n){for(var i,a,o=this.ids,s=this.coords,l=this.nodeSize,c=[0,o.length-1,0],u=[];c.length;){var f=c.pop(),h=c.pop(),d=c.pop();if(h-d<=l)for(var p=d;p<=h;p++)i=s[2*p],a=s[2*p+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[p]);else{var m=Math.floor((d+h)/2);i=s[2*m],a=s[2*m+1],i>=t&&i<=r&&a>=e&&a<=n&&u.push(o[m]);var g=(f+1)%2;(0===f?t<=i:e<=a)&&(c.push(d),c.push(m-1),c.push(g)),(0===f?r>=i:n>=a)&&(c.push(m+1),c.push(h),c.push(g))}}return u},n.prototype.within=function(t,e,r){for(var n=this.ids,a=this.coords,o=this.nodeSize,s=[0,n.length-1,0],l=[],c=r*r;s.length;){var u=s.pop(),f=s.pop(),h=s.pop();if(f-h<=o)for(var d=h;d<=f;d++)i(a[2*d],a[2*d+1],t,e)<=c&&l.push(n[d]);else{var p=Math.floor((h+f)/2),m=a[2*p],g=a[2*p+1];i(m,g,t,e)<=c&&l.push(n[p]);var v=(u+1)%2;(0===u?t-r<=m:e-r<=g)&&(s.push(h),s.push(p-1),s.push(v)),(0===u?t+r>=m:e+r>=g)&&(s.push(p+1),s.push(f),s.push(v))}}return l}},{}],293:[function(t,e,r){"use strict";function n(t,e){var r;if(u(t)){var l,c=t.stops&&"object"==typeof t.stops[0][0],f=c||void 0!==t.property,h=c||!f,d=t.type||e||"exponential";if("exponential"===d)l=o;else if("interval"===d)l=a;else if("categorical"===d)l=i;else{if("identity"!==d)throw new Error('Unknown function type "'+d+'"');l=s}if(c){for(var p={},m=[],g=0;g=t.stops.length||e<=t.stops[n][0]);)n++;return 0===n?t.stops[n][1]:n===t.stops.length?t.stops[n-1][1]:l(e,r,t.stops[n-1][0],t.stops[n][0],t.stops[n-1][1],t.stops[n][1])}function s(t,e){return e}function l(t,e,r,n,i,a){return"function"==typeof i?function(){var o=i.apply(void 0,arguments),s=a.apply(void 0,arguments);return l(t,e,r,n,o,s)}:i.length?function(t,e,r,n,i,a){for(var o=[],s=0;s -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_blur;\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_fade;\nuniform float u_opacity;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float x_a = mod(v_linesofar / u_pattern_size_a.x, 1.0);\n float x_b = mod(v_linesofar / u_pattern_size_b.x, 1.0);\n float y_a = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_a.y);\n float y_b = 0.5 + (v_normal.y * v_linewidth.s / u_pattern_size_b.y);\n vec2 pos_a = mix(u_pattern_tl_a, u_pattern_br_a, vec2(x_a, y_a));\n vec2 pos_b = mix(u_pattern_tl_b, u_pattern_br_b, vec2(x_b, y_b));\n\n vec4 color = mix(texture2D(u_image, pos_a), texture2D(u_image, pos_b), u_fade);\n\n alpha *= u_opacity;\n\n gl_FragColor = color * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform mediump float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying float v_linesofar;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n v_linesofar = a_linesofar;\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},linesdfpattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\n\nuniform float u_blur;\nuniform sampler2D u_image;\nuniform float u_sdfgamma;\nuniform float u_mix;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n // Calculate the distance of the pixel from the line in pixels.\n float dist = length(v_normal) * v_linewidth.s;\n\n // Calculate the antialiasing fade factor. This is either when fading in\n // the line in case of an offset line (v_linewidth.t) or when fading out\n // (v_linewidth.s)\n float blur = u_blur * v_gamma_scale;\n float alpha = clamp(min(dist - (v_linewidth.t - blur), v_linewidth.s - dist) / blur, 0.0, 1.0);\n\n float sdfdist_a = texture2D(u_image, v_tex_a).a;\n float sdfdist_b = texture2D(u_image, v_tex_b).a;\n float sdfdist = mix(sdfdist_a, sdfdist_b, u_mix);\n alpha *= smoothstep(0.5 - u_sdfgamma, 0.5 + u_sdfgamma, sdfdist);\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n// floor(127 / 2) == 63.0\n// the maximum allowed miter limit is 2.0 at the moment. the extrude normal is\n// stored in a byte (-128..127). we scale regular normals up to length 63, but\n// there are also \"special\" normals that have a bigger length (of up to 126 in\n// this case).\n// #define scale 63.0\n#define scale 0.015873016\n\n// We scale the distance before adding it to the buffers so that we can store\n// long distances for long segments. Use this value to unscale the distance.\n#define LINE_DISTANCE_SCALE 2.0\n\nattribute vec2 a_pos;\nattribute vec4 a_data;\n\nuniform mat4 u_matrix;\nuniform mediump float u_ratio;\nuniform mediump float u_linewidth;\nuniform mediump float u_gapwidth;\nuniform mediump float u_antialiasing;\nuniform vec2 u_patternscale_a;\nuniform float u_tex_y_a;\nuniform vec2 u_patternscale_b;\nuniform float u_tex_y_b;\nuniform float u_extra;\nuniform mat2 u_antialiasingmatrix;\nuniform mediump float u_offset;\n\nvarying vec2 v_normal;\nvarying vec2 v_linewidth;\nvarying vec2 v_tex_a;\nvarying vec2 v_tex_b;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_extrude = a_data.xy - 128.0;\n float a_direction = mod(a_data.z, 4.0) - 1.0;\n float a_linesofar = (floor(a_data.z / 4.0) + a_data.w * 64.0) * LINE_DISTANCE_SCALE;\n\n // We store the texture normals in the most insignificant bit\n // transform y so that 0 => -1 and 1 => 1\n // In the texture normal, x is 0 if the normal points straight up/down and 1 if it's a round cap\n // y is 1 if the normal points up, and -1 if it points down\n mediump vec2 normal = mod(a_pos, 2.0);\n normal.y = sign(normal.y - 0.5);\n v_normal = normal;\n\n float inset = u_gapwidth + (u_gapwidth > 0.0 ? u_antialiasing : 0.0);\n float outset = u_gapwidth + u_linewidth * (u_gapwidth > 0.0 ? 2.0 : 1.0) + u_antialiasing;\n\n // Scale the extrusion vector down to a normal and then up by the line width\n // of this vertex.\n mediump vec2 dist = outset * a_extrude * scale;\n\n // Calculate the offset when drawing a line that is to the side of the actual line.\n // We do this by creating a vector that points towards the extrude, but rotate\n // it when we're drawing round end points (a_direction = -1 or 1) since their\n // extrude vector points in another direction.\n mediump float u = 0.5 * a_direction;\n mediump float t = 1.0 - abs(u);\n mediump vec2 offset = u_offset * a_extrude * scale * normal.y * mat2(t, -u, u, t);\n\n // Remove the texture normal bit of the position before scaling it with the\n // model/view matrix.\n gl_Position = u_matrix * vec4(floor(a_pos * 0.5) + (offset + dist) / u_ratio, 0.0, 1.0);\n\n v_tex_a = vec2(a_linesofar * u_patternscale_a.x, normal.y * u_patternscale_a.y + u_tex_y_a);\n v_tex_b = vec2(a_linesofar * u_patternscale_b.x, normal.y * u_patternscale_b.y + u_tex_y_b);\n\n // position of y on the screen\n float y = gl_Position.y / gl_Position.w;\n\n // how much features are squished in the y direction by the tilt\n float squish_scale = length(a_extrude) / length(u_antialiasingmatrix * a_extrude);\n\n // how much features are squished in all directions by the perspectiveness\n float perspective_scale = 1.0 / (1.0 - min(y * u_extra, 0.9));\n\n v_linewidth = vec2(outset, inset);\n v_gamma_scale = perspective_scale * squish_scale;\n}\n"},outline:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvarying vec2 v_pos;\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n gl_FragColor = outline_color * (alpha * opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos;\n\n#pragma mapbox: define lowp vec4 outline_color\n#pragma mapbox: define lowp float opacity\n\nvoid main() {\n #pragma mapbox: initialize lowp vec4 outline_color\n #pragma mapbox: initialize lowp float opacity\n\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},outlinepattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n // find distance to outline for alpha interpolation\n\n float dist = length(v_pos - gl_FragCoord.xy);\n float alpha = smoothstep(1.0, 0.0, dist);\n \n\n gl_FragColor = mix(color1, color2, u_mix) * alpha * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nuniform mat4 u_matrix;\nuniform vec2 u_world;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\nvarying vec2 v_pos;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n\n v_pos = (gl_Position.xy / gl_Position.w + 1.0) / 2.0 * u_world;\n}\n"},pattern:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity;\nuniform vec2 u_pattern_tl_a;\nuniform vec2 u_pattern_br_a;\nuniform vec2 u_pattern_tl_b;\nuniform vec2 u_pattern_br_b;\nuniform float u_mix;\n\nuniform sampler2D u_image;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n\n vec2 imagecoord = mod(v_pos_a, 1.0);\n vec2 pos = mix(u_pattern_tl_a, u_pattern_br_a, imagecoord);\n vec4 color1 = texture2D(u_image, pos);\n\n vec2 imagecoord_b = mod(v_pos_b, 1.0);\n vec2 pos2 = mix(u_pattern_tl_b, u_pattern_br_b, imagecoord_b);\n vec4 color2 = texture2D(u_image, pos2);\n\n gl_FragColor = mix(color1, color2, u_mix) * u_opacity;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_pattern_size_a;\nuniform vec2 u_pattern_size_b;\nuniform vec2 u_pixel_coord_upper;\nuniform vec2 u_pixel_coord_lower;\nuniform float u_scale_a;\nuniform float u_scale_b;\nuniform float u_tile_units_to_pixels;\n\nattribute vec2 a_pos;\n\nvarying vec2 v_pos_a;\nvarying vec2 v_pos_b;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n vec2 scaled_size_a = u_scale_a * u_pattern_size_a;\n vec2 scaled_size_b = u_scale_b * u_pattern_size_b;\n\n // the correct offset needs to be calculated.\n //\n // The offset depends on how many pixels are between the world origin and\n // the edge of the tile:\n // vec2 offset = mod(pixel_coord, size)\n //\n // At high zoom levels there are a ton of pixels between the world origin\n // and the edge of the tile. The glsl spec only guarantees 16 bits of\n // precision for highp floats. We need more than that.\n //\n // The pixel_coord is passed in as two 16 bit values:\n // pixel_coord_upper = floor(pixel_coord / 2^16)\n // pixel_coord_lower = mod(pixel_coord, 2^16)\n //\n // The offset is calculated in a series of steps that should preserve this precision:\n vec2 offset_a = mod(mod(mod(u_pixel_coord_upper, scaled_size_a) * 256.0, scaled_size_a) * 256.0 + u_pixel_coord_lower, scaled_size_a);\n vec2 offset_b = mod(mod(mod(u_pixel_coord_upper, scaled_size_b) * 256.0, scaled_size_b) * 256.0 + u_pixel_coord_lower, scaled_size_b);\n\n v_pos_a = (u_tile_units_to_pixels * a_pos + offset_a) / scaled_size_a;\n v_pos_b = (u_tile_units_to_pixels * a_pos + offset_b) / scaled_size_b;\n}\n"},raster:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_opacity0;\nuniform float u_opacity1;\nuniform sampler2D u_image0;\nuniform sampler2D u_image1;\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nuniform float u_brightness_low;\nuniform float u_brightness_high;\n\nuniform float u_saturation_factor;\nuniform float u_contrast_factor;\nuniform vec3 u_spin_weights;\n\nvoid main() {\n\n // read and cross-fade colors from the main and parent tiles\n vec4 color0 = texture2D(u_image0, v_pos0);\n vec4 color1 = texture2D(u_image1, v_pos1);\n vec4 color = color0 * u_opacity0 + color1 * u_opacity1;\n vec3 rgb = color.rgb;\n\n // spin\n rgb = vec3(\n dot(rgb, u_spin_weights.xyz),\n dot(rgb, u_spin_weights.zxy),\n dot(rgb, u_spin_weights.yzx));\n\n // saturation\n float average = (color.r + color.g + color.b) / 3.0;\n rgb += (average - rgb) * u_saturation_factor;\n\n // contrast\n rgb = (rgb - 0.5) * u_contrast_factor + 0.5;\n\n // brightness\n vec3 u_high_vec = vec3(u_brightness_low, u_brightness_low, u_brightness_low);\n vec3 u_low_vec = vec3(u_brightness_high, u_brightness_high, u_brightness_high);\n\n gl_FragColor = vec4(mix(u_high_vec, u_low_vec, rgb), color.a);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform mat4 u_matrix;\nuniform vec2 u_tl_parent;\nuniform float u_scale_parent;\nuniform float u_buffer_scale;\n\nattribute vec2 a_pos;\nattribute vec2 a_texture_pos;\n\nvarying vec2 v_pos0;\nvarying vec2 v_pos1;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos, 0, 1);\n v_pos0 = (((a_texture_pos / 32767.0) - 0.5) / u_buffer_scale ) + 0.5;\n v_pos1 = (v_pos0 * u_scale_parent) + u_tl_parent;\n}\n"},icon:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp float u_opacity;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n lowp float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity;\n gl_FragColor = texture2D(u_texture, v_tex) * alpha;\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n if (u_rotate_with_map) {\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n } else {\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},sdf:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform sampler2D u_texture;\nuniform sampler2D u_fadetexture;\nuniform lowp vec4 u_color;\nuniform lowp float u_opacity;\nuniform lowp float u_buffer;\nuniform lowp float u_gamma;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n lowp float dist = texture2D(u_texture, v_tex).a;\n lowp float fade_alpha = texture2D(u_fadetexture, v_fade_tex).a;\n lowp float gamma = u_gamma * v_gamma_scale;\n lowp float alpha = smoothstep(u_buffer - gamma, u_buffer + gamma, dist) * fade_alpha;\n\n gl_FragColor = u_color * (alpha * u_opacity);\n\n#ifdef OVERDRAW_INSPECTOR\n gl_FragColor = vec4(1.0);\n#endif\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nconst float PI = 3.141592653589793;\n\nattribute vec2 a_pos;\nattribute vec2 a_offset;\nattribute vec2 a_texture_pos;\nattribute vec4 a_data;\n\n\n// matrix is for the vertex position.\nuniform mat4 u_matrix;\n\nuniform mediump float u_zoom;\nuniform bool u_rotate_with_map;\nuniform bool u_pitch_with_map;\nuniform mediump float u_pitch;\nuniform mediump float u_bearing;\nuniform mediump float u_aspect_ratio;\nuniform vec2 u_extrude_scale;\n\nuniform vec2 u_texsize;\n\nvarying vec2 v_tex;\nvarying vec2 v_fade_tex;\nvarying float v_gamma_scale;\n\nvoid main() {\n vec2 a_tex = a_texture_pos.xy;\n mediump float a_labelminzoom = a_data[0];\n mediump vec2 a_zoom = a_data.pq;\n mediump float a_minzoom = a_zoom[0];\n mediump float a_maxzoom = a_zoom[1];\n\n // u_zoom is the current zoom level adjusted for the change in font size\n mediump float z = 2.0 - step(a_minzoom, u_zoom) - (1.0 - step(a_maxzoom, u_zoom));\n\n // pitch-alignment: map\n // rotation-alignment: map | viewport\n if (u_pitch_with_map) {\n lowp float angle = u_rotate_with_map ? (a_data[1] / 256.0 * 2.0 * PI) : u_bearing;\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, asin, -1.0 * asin, acos);\n vec2 offset = RotationMatrix * a_offset;\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos + extrude, 0, 1);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: map\n } else if (u_rotate_with_map) {\n // foreshortening factor to apply on pitched maps\n // as a label goes from horizontal <=> vertical in angle\n // it goes from 0% foreshortening to up to around 70% foreshortening\n lowp float pitchfactor = 1.0 - cos(u_pitch * sin(u_pitch * 0.75));\n\n lowp float lineangle = a_data[1] / 256.0 * 2.0 * PI;\n\n // use the lineangle to position points a,b along the line\n // project the points and calculate the label angle in projected space\n // this calculation allows labels to be rendered unskewed on pitched maps\n vec4 a = u_matrix * vec4(a_pos, 0, 1);\n vec4 b = u_matrix * vec4(a_pos + vec2(cos(lineangle),sin(lineangle)), 0, 1);\n lowp float angle = atan((b[1]/b[3] - a[1]/a[3])/u_aspect_ratio, b[0]/b[3] - a[0]/a[3]);\n lowp float asin = sin(angle);\n lowp float acos = cos(angle);\n mat2 RotationMatrix = mat2(acos, -1.0 * asin, asin, acos);\n\n vec2 offset = RotationMatrix * (vec2((1.0-pitchfactor)+(pitchfactor*cos(angle*2.0)), 1.0) * a_offset);\n vec2 extrude = u_extrude_scale * (offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n gl_Position.z += z * gl_Position.w;\n // pitch-alignment: viewport\n // rotation-alignment: viewport\n } else {\n vec2 extrude = u_extrude_scale * (a_offset / 64.0);\n gl_Position = u_matrix * vec4(a_pos, 0, 1) + vec4(extrude, 0, 0);\n }\n\n v_gamma_scale = (gl_Position.w - 0.5);\n\n v_tex = a_tex / u_texsize;\n v_fade_tex = vec2(a_labelminzoom / 255.0, 0.0);\n}\n"},collisionbox:{fragmentSource:"#ifdef GL_ES\nprecision mediump float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nuniform float u_zoom;\nuniform float u_maxzoom;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n\n float alpha = 0.5;\n\n gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0) * alpha;\n\n if (v_placement_zoom > u_zoom) {\n gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0) * alpha;\n }\n\n if (u_zoom >= v_max_zoom) {\n gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0) * alpha * 0.25;\n }\n\n if (v_placement_zoom >= u_maxzoom) {\n gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0) * alpha * 0.2;\n }\n}\n",vertexSource:"#ifdef GL_ES\nprecision highp float;\n#else\n#define lowp\n#define mediump\n#define highp\n#endif\n\nattribute vec2 a_pos;\nattribute vec2 a_extrude;\nattribute vec2 a_data;\n\nuniform mat4 u_matrix;\nuniform float u_scale;\n\nvarying float v_max_zoom;\nvarying float v_placement_zoom;\n\nvoid main() {\n gl_Position = u_matrix * vec4(a_pos + a_extrude / u_scale, 0.0, 1.0);\n\n v_max_zoom = a_data.x;\n v_placement_zoom = a_data.y;\n}\n"}},e.exports.util="float evaluate_zoom_function_1(const vec4 values, const float t) {\n if (t < 1.0) {\n return mix(values[0], values[1], t);\n } else if (t < 2.0) {\n return mix(values[1], values[2], t - 1.0);\n } else {\n return mix(values[2], values[3], t - 2.0);\n }\n}\nvec4 evaluate_zoom_function_4(const vec4 value0, const vec4 value1, const vec4 value2, const vec4 value3, const float t) {\n if (t < 1.0) {\n return mix(value0, value1, t);\n } else if (t < 2.0) {\n return mix(value1, value2, t - 1.0);\n } else {\n return mix(value2, value3, t - 2.0);\n }\n}\n"},{path:468}],295:[function(t,e,r){"use strict";var n=t("util").format;e.exports=function(t,e){this.message=(t?t+": ":"")+n.apply(n,Array.prototype.slice.call(arguments,2)),null!==e&&void 0!==e&&e.__line__&&(this.line=e.__line__)}},{util:563}],296:[function(t,e,r){"use strict";e.exports=function(t){for(var e=1;e7)return[new n(u,l,"constants have been deprecated as of v8")];if(!(l in h.constants))return[new n(u,l,'constant "%s" not found',l)];e=a({},e,{value:h.constants[l]})}return c.function&&"object"===i(l)?r(e):c.type&&s[c.type]?s[c.type](e):o(a({},e,{valueSpec:c.type?f[c.type]:c}))}},{"../error/validation_error":295,"../util/extend":296,"../util/get_type":297,"./validate_array":300,"./validate_boolean":301,"./validate_color":302,"./validate_constants":303,"./validate_enum":304,"./validate_filter":305,"./validate_function":306,"./validate_layer":308,"./validate_number":310,"./validate_object":311,"./validate_source":313,"./validate_string":314}],300:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("./validate"),a=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.valueSpec,o=t.style,s=t.styleSpec,l=t.key,c=t.arrayElementValidator||i;if("array"!==n(e))return[new a(l,e,"array expected, %s found",n(e))];if(r.length&&e.length!==r.length)return[new a(l,e,"array length %d expected, length %d found",r.length,e.length)];if(r["min-length"]&&e.length7)return r?[new n(e,r,"constants have been deprecated as of v8")]:[];var a=i(r);if("object"!==a)return[new n(e,r,"object expected, %s found",a)];var o=[];for(var s in r)"@"!==s[0]&&o.push(new n(e+"."+s,r[s],'constants must start with "@"'));return o}},{"../error/validation_error":295,"../util/get_type":297}],304:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint");e.exports=function(t){var e=t.key,r=t.value,a=t.valueSpec,o=[];return-1===a.values.indexOf(i(r))&&o.push(new n(e,r,"expected one of [%s], %s found",a.values.join(", "),r)),o}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298}],305:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_enum"),a=t("../util/get_type"),o=t("../util/unbundle_jsonlint");e.exports=function t(e){var r,s=e.value,l=e.key,c=e.styleSpec,u=[];if("array"!==a(s))return[new n(l,s,"array expected, %s found",a(s))];if(s.length<1)return[new n(l,s,"filter array must have at least 1 element")];switch(u=u.concat(i({key:l+"[0]",value:s[0],valueSpec:c.filter_operator,style:e.style,styleSpec:e.styleSpec})),o(s[0])){case"<":case"<=":case">":case">=":s.length>=2&&"$type"==s[1]&&u.push(new n(l,s,'"$type" cannot be use with operator "%s"',s[0]));case"==":case"!=":3!=s.length&&u.push(new n(l,s,'filter array for operator "%s" must have 3 elements',s[0]));case"in":case"!in":s.length>=2&&("string"!==(r=a(s[1]))?u.push(new n(l+"[1]",s[1],"string expected, %s found",r)):"@"===s[1][0]&&u.push(new n(l+"[1]",s[1],"filter key cannot be a constant")));for(var f=2;f=8&&(f&&!t.valueSpec["property-function"]?d.push(new n(t.key,t.value,"property functions not supported")):h&&!t.valueSpec["zoom-function"]&&d.push(new n(t.key,t.value,"zoom functions not supported"))),d}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299,"./validate_array":300,"./validate_number":310,"./validate_object":311}],307:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("./validate_string");e.exports=function(t){var e=t.value,r=t.key,a=i(t);return a.length?a:(-1===e.indexOf("{fontstack}")&&a.push(new n(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&a.push(new n(r,e,'"glyphs" url must include a "{range}" token')),a)}},{"../error/validation_error":295,"./validate_string":314}],308:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_filter"),s=t("./validate_paint_property"),l=t("./validate_layout_property"),c=t("../util/extend");e.exports=function(t){var e=[],r=t.value,u=t.key,f=t.style,h=t.styleSpec;r.type||r.ref||e.push(new n(u,r,'either "type" or "ref" is required'));var d=i(r.type),p=i(r.ref);if(r.id)for(var m=0;ma.maximum?[new i(e,r,"%s is greater than the maximum value %s",r,a.maximum)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],311:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/get_type"),a=t("./validate");e.exports=function(t){var e=t.key,r=t.value,o=t.valueSpec,s=t.objectElementValidators||{},l=t.style,c=t.styleSpec,u=[],f=i(r);if("object"!==f)return[new n(e,r,"object expected, %s found",f)];for(var h in r){var d=h.split(".")[0],p=o&&(o[d]||o["*"]),m=s[d]||s["*"];p||m?u=u.concat((m||a)({key:(e?e+".":e)+h,value:r[h],valueSpec:p,style:l,styleSpec:c,object:r,objectKey:h})):""!==e&&1!==e.split(".").length&&u.push(new n(e,r[h],'unknown property "%s"',h))}for(d in o)o[d].required&&void 0===o[d].default&&void 0===r[d]&&u.push(new n(e,r,'missing required property "%s"',d));return u}},{"../error/validation_error":295,"../util/get_type":297,"./validate":299}],312:[function(t,e,r){"use strict";var n=t("./validate"),i=t("../error/validation_error");e.exports=function(t){var e=t.key,r=t.style,a=t.styleSpec,o=t.value,s=t.objectKey,l=a["paint_"+t.layerType],c=s.match(/^(.*)-transition$/);return c&&l[c[1]]&&l[c[1]].transition?n({key:e,value:o,valueSpec:a.transition,style:r,styleSpec:a}):t.valueSpec||l[s]?n({key:t.key,value:o,valueSpec:t.valueSpec||l[s],style:r,styleSpec:a}):[new i(e,o,'unknown property "%s"',s)]}},{"../error/validation_error":295,"./validate":299}],313:[function(t,e,r){"use strict";var n=t("../error/validation_error"),i=t("../util/unbundle_jsonlint"),a=t("./validate_object"),o=t("./validate_enum");e.exports=function(t){var e=t.value,r=t.key,s=t.styleSpec,l=t.style;if(!e.type)return[new n(r,e,'"type" is required')];switch(i(e.type)){case"vector":case"raster":var c=[];if(c=c.concat(a({key:r,value:e,valueSpec:s.source_tile,style:t.style,styleSpec:s})),"url"in e)for(var u in e)["type","url","tileSize"].indexOf(u)<0&&c.push(new n(r+"."+u,e[u],'a source with a "url" property may not include a "%s" property',u));return c;case"geojson":return a({key:r,value:e,valueSpec:s.source_geojson,style:l,styleSpec:s});case"video":return a({key:r,value:e,valueSpec:s.source_video,style:l,styleSpec:s});case"image":return a({key:r,value:e,valueSpec:s.source_image,style:l,styleSpec:s});default:return o({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","geojson","video","image"]},style:l,styleSpec:s})}}},{"../error/validation_error":295,"../util/unbundle_jsonlint":298,"./validate_enum":304,"./validate_object":311}],314:[function(t,e,r){"use strict";var n=t("../util/get_type"),i=t("../error/validation_error");e.exports=function(t){var e=t.value,r=t.key,a=n(e);return"string"!==a?[new i(r,e,"string expected, %s found",a)]:[]}},{"../error/validation_error":295,"../util/get_type":297}],315:[function(t,e,r){"use strict";function n(t,e){e=e||l;var r=[];return r=r.concat(s({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:c}})),e.$version>7&&t.constants&&(r=r.concat(o({key:"constants",value:t.constants,style:t,styleSpec:e}))),i(r)}function i(t){return[].concat(t).sort(function(t,e){return t.line-e.line})}function a(t){return function(){return i(t.apply(this,arguments))}}var o=t("./validate/validate_constants"),s=t("./validate/validate"),l=t("../reference/latest.min"),c=t("./validate/validate_glyphs_url");n.source=a(t("./validate/validate_source")),n.layer=a(t("./validate/validate_layer")),n.filter=a(t("./validate/validate_filter")),n.paintProperty=a(t("./validate/validate_paint_property")),n.layoutProperty=a(t("./validate/validate_layout_property")),e.exports=n},{"../reference/latest.min":316,"./validate/validate":299,"./validate/validate_constants":303,"./validate/validate_filter":305,"./validate/validate_glyphs_url":307,"./validate/validate_layer":308,"./validate/validate_layout_property":309,"./validate/validate_paint_property":312,"./validate/validate_source":313}],316:[function(t,e,r){e.exports=t("./v8.min.json")},{"./v8.min.json":317}],317:[function(t,e,r){e.exports={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_tile","source_geojson","source_video","source_image"],source_tile:{type:{required:!0,type:"enum",values:["vector","raster"]},url:{type:"string"},tiles:{type:"array",value:"string"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:["geojson"]},data:{type:"*"},maxzoom:{type:"number",default:14},buffer:{type:"number",default:64},tolerance:{type:"number",default:3},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:400},clusterMaxZoom:{type:"number"}},source_video:{type:{required:!0,type:"enum",values:["video"]},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:["image"]},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:["fill","line","symbol","circle","raster","background"]},metadata:{type:"*"},ref:{type:"string"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:22},maxzoom:{type:"number",minimum:0,maximum:22},interactive:{type:"boolean",default:!1},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"},"paint.*":{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_symbol","layout_raster","layout_background"],layout_background:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_fill:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_circle:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_line:{"line-cap":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["butt","round","square"],default:"butt"},"line-join":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["bevel","round","miter"],default:"miter"},"line-miter-limit":{type:"number",default:2,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"miter"}]},"line-round-limit":{type:"number",default:1.05,function:"interpolated","zoom-function":!0,"property-function":!0,requires:[{"line-join":"round"}]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_symbol:{"symbol-placement":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["point","line"],default:"point"},"symbol-spacing":{type:"number",default:250,minimum:1,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:[{"symbol-placement":"line"}]},"symbol-avoid-edges":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1},"icon-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image"]},"icon-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image","text-field"]},"icon-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["icon-image"]},"icon-size":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"icon-text-fit":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!1,values:["none","both","width","height"],default:"none",requires:["icon-image","text-field"]},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image","icon-text-fit","text-field"]},"icon-image":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,tokens:!0},"icon-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,"property-function":!0,units:"degrees",requires:["icon-image"]},"icon-padding":{type:"number",default:2,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,units:"pixels",requires:["icon-image"]},"icon-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":"line"}]},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,requires:["icon-image"]},"text-pitch-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],requires:["text-field"]},"text-rotation-alignment":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"viewport",requires:["text-field"]},"text-field":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:"",tokens:!0},"text-font":{type:"array",value:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"]},"text-size":{type:"number",default:16,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-max-width":{type:"number",default:10,minimum:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-line-height":{type:"number",default:1.2,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-letter-spacing":{type:"number",default:0,units:"em",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-justify":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["left","center","right"],default:"center",requires:["text-field"]},"text-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"],default:"center",requires:["text-field"]},"text-max-angle":{type:"number",default:45,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field",{"symbol-placement":"line"}]},"text-rotate":{type:"number",default:0,period:360,units:"degrees",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",function:"interpolated","zoom-function":!0,"property-function":!0,requires:["text-field"]},"text-keep-upright":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":"line"}]},"text-transform":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["none","uppercase","lowercase"],default:"none",requires:["text-field"]},"text-offset":{type:"array",value:"number",units:"ems",function:"interpolated","zoom-function":!0,"property-function":!0,length:2,default:[0,0],requires:["text-field"]},"text-allow-overlap":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-ignore-placement":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field"]},"text-optional":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!1,requires:["text-field","icon-image"]},visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},layout_raster:{visibility:{type:"enum",function:"piecewise-constant","zoom-function":!0,values:["visible","none"],default:"visible"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:["==","!=",">",">=","<","<=","in","!in","all","any","none","has","!has"]},geometry_type:{type:"enum",values:["Point","LineString","Polygon"]},color_operation:{type:"enum",values:["lighten","saturate","spin","fade","mix"]},function:{stops:{type:"array",required:!0,value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:["exponential","interval","categorical"],default:"exponential"}},function_stop:{type:"array",minimum:0,maximum:22,value:["number","color"],length:2},paint:["paint_fill","paint_line","paint_circle","paint_symbol","paint_raster","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",function:"piecewise-constant","zoom-function":!0,"property-function":!0,default:!0},"fill-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"fill-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"}]},"fill-outline-color":{type:"color",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}]},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"fill-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["fill-translate"]},"fill-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_line:{"line-opacity":{type:"number",function:"interpolated","zoom-function":!0,"property-function":!0,default:1,minimum:0,maximum:1,transition:!0},"line-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:[{"!":"line-pattern"}]},"line-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["line-translate"]},"line-width":{type:"number",default:1,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-gap-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-offset":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"line-dasharray":{type:"array",value:"number",function:"piecewise-constant","zoom-function":!0,"property-function":!0,minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}]},"line-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,"property-function":!0,transition:!0}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-blur":{type:"number",default:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels"},"circle-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["circle-translate"]},"circle-pitch-scale":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["icon-image"]},"icon-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["icon-image"]},"icon-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["icon-image","icon-translate"]},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,requires:["text-field"]},"text-halo-width":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-halo-blur":{type:"number",default:0,minimum:0,function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate":{type:"array",value:"number",length:2,default:[0,0],function:"interpolated","zoom-function":!0,"property-function":!0,transition:!0,units:"pixels",requires:["text-field"]},"text-translate-anchor":{type:"enum",function:"piecewise-constant","zoom-function":!0,"property-function":!0,values:["map","viewport"],default:"map",requires:["text-field","text-translate"]}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-hue-rotate":{type:"number",default:0,period:360,function:"interpolated","zoom-function":!0,transition:!0,units:"degrees"},"raster-brightness-min":{type:"number",function:"interpolated","zoom-function":!0,default:0,minimum:0,maximum:1,transition:!0},"raster-brightness-max":{type:"number",function:"interpolated","zoom-function":!0,default:1,minimum:0,maximum:1,transition:!0},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,function:"interpolated","zoom-function":!0,transition:!0},"raster-fade-duration":{type:"number",default:300,minimum:0,function:"interpolated","zoom-function":!0,transition:!0,units:"milliseconds"}},paint_background:{"background-color":{type:"color",default:"#000000",function:"interpolated","zoom-function":!0,transition:!0,requires:[{"!":"background-pattern"}]},"background-pattern":{type:"string",function:"piecewise-constant","zoom-function":!0,transition:!0},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,function:"interpolated","zoom-function":!0,transition:!0}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}}}},{}],318:[function(t,e,r){"use strict";function n(t){return!!("undefined"!=typeof window&&"undefined"!=typeof document&&Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray&&Function.prototype&&Function.prototype.bind&&Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions&&"JSON"in window&&"parse"in JSON&&"stringify"in JSON&&"Worker"in window&&"Uint8ClampedArray"in window&&function(t){void 0===i[t]&&(i[t]=function(t){var e=document.createElement("canvas"),r=Object.create(n.webGLContextAttributes);return r.failIfMajorPerformanceCaveat=t,e.probablySupportsContext?e.probablySupportsContext("webgl",r)||e.probablySupportsContext("experimental-webgl",r):e.supportsContext?e.supportsContext("webgl",r)||e.supportsContext("experimental-webgl",r):e.getContext("webgl",r)||e.getContext("experimental-webgl",r)}(t));return i[t]}(t&&t.failIfMajorPerformanceCaveat))}void 0!==e&&e.exports?e.exports=n:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=n);var i={};n.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}},{}],319:[function(t,e,r){"use strict";function n(t){var e=t.layoutVertexArrayType;this.layoutVertexArray=new e;var r=t.elementArrayType;r&&(this.elementArray=new r);var n=t.elementArrayType2;n&&(this.elementArray2=new n),this.paintVertexArrays=i.mapObject(t.paintVertexArrayTypes,function(t){return new t})}var i=t("../util/util");e.exports=n,n.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,n.prototype.hasCapacityFor=function(t){return this.layoutVertexArray.length+t<=n.MAX_VERTEX_ARRAY_LENGTH},n.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},n.prototype.trim=function(){this.layoutVertexArray.trim(),this.elementArray&&this.elementArray.trim(),this.elementArray2&&this.elementArray2.trim();for(var t in this.paintVertexArrays)this.paintVertexArrays[t].trim()},n.prototype.serialize=function(){return{layoutVertexArray:this.layoutVertexArray.serialize(),elementArray:this.elementArray&&this.elementArray.serialize(),elementArray2:this.elementArray2&&this.elementArray2.serialize(),paintVertexArrays:i.mapObject(this.paintVertexArrays,function(t){return t.serialize()})}},n.prototype.getTransferables=function(t){t.push(this.layoutVertexArray.arrayBuffer),this.elementArray&&t.push(this.elementArray.arrayBuffer),this.elementArray2&&t.push(this.elementArray2.arrayBuffer);for(var e in this.paintVertexArrays)t.push(this.paintVertexArrays[e].arrayBuffer)}},{"../util/util":433}],320:[function(t,e,r){"use strict";function n(t){if(this.zoom=t.zoom,this.overscaling=t.overscaling,this.layer=t.layer,this.childLayers=t.childLayers,this.type=this.layer.type,this.features=[],this.id=this.layer.id,this.index=t.index,this.sourceLayer=this.layer.sourceLayer,this.sourceLayerIndex=t.sourceLayerIndex,this.minZoom=this.layer.minzoom,this.maxZoom=this.layer.maxzoom,this.paintAttributes=function(t){var e={};for(var r in t.programInterfaces){for(var n=e[r]={},a=0;a1?p.name+b:p.name]=m[b]*g}}},n.VertexArrayType=function(t){return new c({members:t,alignment:4})},n.ElementArrayType=function(t){return new c({members:[{type:"Uint16",name:"vertices",components:t||3}]})}},{"../util/struct_array":431,"../util/util":433,"./array_group":319,"./bucket/circle_bucket":321,"./bucket/fill_bucket":322,"./bucket/line_bucket":323,"./bucket/symbol_bucket":324,"./buffer_group":326,assert:51,"feature-filter":141}],321:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=i.EXTENT;e.exports=n,(n.prototype=a.inherit(i,{})).addCircleVertex=function(t,e,r,n,i){return t.emplaceBack(2*e+(n+1)/2,2*r+(i+1)/2)},n.prototype.programInterfaces={circle:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType,paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("circle-color",e,r)},multiplier:255,paintProperty:"circle-color"},{name:"a_radius",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-radius",e,r)]},multiplier:10,paintProperty:"circle-radius"},{name:"a_blur",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-blur",e,r)]},multiplier:10,paintProperty:"circle-blur"},{name:"a_opacity",components:1,type:"Uint16",isLayerConstant:!1,getValue:function(t,e,r){return[t.getPaintValue("circle-opacity",e,r)]},multiplier:255,paintProperty:"circle-opacity"}]}},n.prototype.addFeature=function(t){for(var e={zoom:this.zoom},r=o(t),n=this.prepareArrayGroup("circle",0),i=n.layoutVertexArray.length,a=0;a=s||u<0||u>=s)){var f=this.prepareArrayGroup("circle",4),h=f.layoutVertexArray,d=this.addCircleVertex(h,c,u,-1,-1);this.addCircleVertex(h,c,u,1,-1),this.addCircleVertex(h,c,u,1,1),this.addCircleVertex(h,c,u,-1,1),f.elementArray.emplaceBack(d,d+1,d+2),f.elementArray.emplaceBack(d,d+3,d+2)}}this.populatePaintArrays("circle",e,t.properties,n,i)}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],322:[function(t,e,r){"use strict";function n(){i.apply(this,arguments)}var i=t("../bucket"),a=t("../../util/util"),o=t("../load_geometry"),s=t("earcut"),l=t("../../util/classify_rings");e.exports=n,(n.prototype=a.inherit(i,{})).programInterfaces={fill:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"}]),elementArrayType:new i.ElementArrayType(1),elementArrayType2:new i.ElementArrayType(2),paintAttributes:[{name:"a_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-color",e,r)},multiplier:255,paintProperty:"fill-color"},{name:"a_outline_color",components:4,type:"Uint8",getValue:function(t,e,r){return t.getPaintValue("fill-outline-color",e,r)},multiplier:255,paintProperty:"fill-outline-color"},{name:"a_opacity",components:1,type:"Uint8",getValue:function(t,e,r){return[t.getPaintValue("fill-opacity",e,r)]},multiplier:255,paintProperty:"fill-opacity"}]}},n.prototype.addFeature=function(t){for(var e=o(t),r=l(e,500),n=this.prepareArrayGroup("fill",0),i=n.layoutVertexArray.length,a=0;a0&&a.push(i.length/2);for(var u=0;u=1&&n.elementArray2.emplaceBack(h-1,h),i.push(f.x),i.push(f.y)}}for(var d=s(i,a),p=0;p>6)},n.prototype.programInterfaces={line:{layoutVertexArrayType:new i.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}]),elementArrayType:new i.ElementArrayType}},n.prototype.addFeature=function(t){for(var e=o(t,15),r=0;r2&&t[a-1].equals(t[a-2]);)a--;if(!(t.length<2)){"bevel"===e&&(n=1.05);var o=s/(512*this.overscaling)*15,c=t[0],u=t[a-1],f=c.equals(u);if(this.prepareArrayGroup("line",10*a),2!==a||!f){this.distance=0;var h,d,p,m,g,v,y,x=r,b=f?"butt":r,_=!0;this.e1=this.e2=this.e3=-1,f&&(h=t[a-2],g=c.sub(h)._unit()._perp());for(var w=0;w0){var S=h.dist(d);if(S>2*o){var E=h.sub(h.sub(d)._mult(o/S)._round());this.distance+=E.dist(d),this.addCurrentVertex(E,this.distance,m.mult(1),0,0,!1),d=E}}var L=d&&p,C=L?e:p?x:b;if(L&&"round"===C&&(An&&(C="bevel"),"bevel"===C&&(A>2&&(C="flipbevel"),A100)M=g.clone();else{var z=m.x*g.y-m.y*g.x>0?-1:1,D=A*m.add(g).mag()/m.sub(g).mag();M._perp()._mult(D*z)}this.addCurrentVertex(h,this.distance,M,0,0,!1),this.addCurrentVertex(h,this.distance,M.mult(-1),0,0,!1)}else if("bevel"===C||"fakeround"===C){var I=m.x*g.y-m.y*g.x>0,P=-Math.sqrt(A*A-1);if(I?(y=0,v=P):(v=0,y=P),_||this.addCurrentVertex(h,this.distance,m,v,y,!1),"fakeround"===C){for(var O,F=Math.floor(8*(.5-(k-.5))),R=0;R=0;N--)O=m.mult((N+1)/(F+1))._add(g)._unit(),this.addPieSliceVertex(h,this.distance,O,I)}p&&this.addCurrentVertex(h,this.distance,g,-v,-y,!1)}else"butt"===C?(_||this.addCurrentVertex(h,this.distance,m,0,0,!1),p&&this.addCurrentVertex(h,this.distance,g,0,0,!1)):"square"===C?(_||(this.addCurrentVertex(h,this.distance,m,1,1,!1),this.e1=this.e2=-1),p&&this.addCurrentVertex(h,this.distance,g,-1,-1,!1)):"round"===C&&(_||(this.addCurrentVertex(h,this.distance,m,0,0,!1),this.addCurrentVertex(h,this.distance,m,1,1,!0),this.e1=this.e2=-1),p&&(this.addCurrentVertex(h,this.distance,g,-1,-1,!0),this.addCurrentVertex(h,this.distance,g,0,0,!1)));if(T&&w2*o){var B=h.add(p.sub(h)._mult(o/j)._round());this.distance+=B.dist(h),this.addCurrentVertex(B,this.distance,g.mult(1),0,0,!1),h=B}}_=!1}}}},n.prototype.addCurrentVertex=function(t,e,r,n,i,a){var o,s=a?1:0,l=this.arrayGroups.line[this.arrayGroups.line.length-1],u=l.layoutVertexArray,f=l.elementArray;o=r.clone(),n&&o._sub(r.perp()._mult(n)),this.e3=this.addLineVertex(u,t,o,s,0,n,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,o=r.mult(-1),i&&o._sub(r.perp()._mult(i)),this.e3=this.addLineVertex(u,t,o,s,1,-i,e),this.e1>=0&&this.e2>=0&&f.emplaceBack(this.e1,this.e2,this.e3),this.e1=this.e2,this.e2=this.e3,e>c/2&&(this.distance=0,this.addCurrentVertex(t,this.distance,r,n,i,a))},n.prototype.addPieSliceVertex=function(t,e,r,n){var i=n?1:0;r=r.mult(n?-1:1);var a=this.arrayGroups.line[this.arrayGroups.line.length-1],o=a.layoutVertexArray,s=a.elementArray;this.e3=this.addLineVertex(o,t,r,0,i,0,e),this.e1>=0&&this.e2>=0&&s.emplaceBack(this.e1,this.e2,this.e3),n?this.e2=this.e3:this.e1=this.e3}},{"../../util/util":433,"../bucket":320,"../load_geometry":328}],324:[function(t,e,r){"use strict";function n(t){o.apply(this,arguments),this.showCollisionBoxes=t.showCollisionBoxes,this.overscaling=t.overscaling,this.collisionBoxArray=t.collisionBoxArray,this.symbolQuadsArray=t.symbolQuadsArray,this.symbolInstancesArray=t.symbolInstancesArray,this.sdfIcons=t.sdfIcons,this.iconsNeedLinear=t.iconsNeedLinear,this.adjustedTextSize=t.adjustedTextSize,this.adjustedIconSize=t.adjustedIconSize,this.fontstack=t.fontstack}function i(t,e,r,n,i,a,o,s,l,c,u){return t.emplaceBack(e,r,Math.round(64*n),Math.round(64*i),a/4,o/4,10*(c||0),u,10*(s||0),10*Math.min(l||25,25))}var a=t("point-geometry"),o=t("../bucket"),s=t("../../symbol/anchor"),l=t("../../symbol/get_anchors"),c=t("../../util/token"),u=t("../../symbol/quads"),f=t("../../symbol/shaping"),h=t("../../symbol/resolve_text"),d=t("../../symbol/mergelines"),p=t("../../symbol/clip_line"),m=t("../../util/util"),g=t("../load_geometry"),v=t("../../symbol/collision_feature"),y=f.shapeText,x=f.shapeIcon,b=u.getGlyphQuads,_=u.getIconQuads,w=o.EXTENT;e.exports=n,n.MAX_QUADS=65535,(n.prototype=m.inherit(o,{})).serialize=function(){var t=o.prototype.serialize.apply(this);return t.sdfIcons=this.sdfIcons,t.iconsNeedLinear=this.iconsNeedLinear,t.adjustedTextSize=this.adjustedTextSize,t.adjustedIconSize=this.adjustedIconSize,t.fontstack=this.fontstack,t};var M=new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_offset",components:2,type:"Int16"},{name:"a_texture_pos",components:2,type:"Uint16"},{name:"a_data",components:4,type:"Uint8"}]),k=new o.ElementArrayType;n.prototype.addCollisionBoxVertex=function(t,e,r,n,i){return t.emplaceBack(e.x,e.y,Math.round(r.x),Math.round(r.y),10*n,10*i)},n.prototype.programInterfaces={glyph:{layoutVertexArrayType:M,elementArrayType:k},icon:{layoutVertexArrayType:M,elementArrayType:k},collisionBox:{layoutVertexArrayType:new o.VertexArrayType([{name:"a_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"},{name:"a_data",components:2,type:"Uint8"}])}},n.prototype.populateArrays=function(t,e,r){var n={lastIntegerZoom:1/0,lastIntegerZoomTime:0,lastZoom:0};this.adjustedTextMaxSize=this.layer.getLayoutValue("text-size",{zoom:18,zoomHistory:n}),this.adjustedTextSize=this.layer.getLayoutValue("text-size",{zoom:this.zoom+1,zoomHistory:n}),this.adjustedIconMaxSize=this.layer.getLayoutValue("icon-size",{zoom:18,zoomHistory:n}),this.adjustedIconSize=this.layer.getLayoutValue("icon-size",{zoom:this.zoom+1,zoomHistory:n});var i=512*this.overscaling;this.tilePixelRatio=w/i,this.compareText={},this.iconsNeedLinear=!1,this.symbolInstancesStartIndex=this.symbolInstancesArray.length;var a=this.layer.layout,o=this.features,s=this.textFeatures,l=.5,u=.5;switch(a["text-anchor"]){case"right":case"top-right":case"bottom-right":l=1;break;case"left":case"top-left":case"bottom-left":l=0}switch(a["text-anchor"]){case"bottom":case"bottom-right":case"bottom-left":u=1;break;case"top":case"top-right":case"top-left":u=0}for(var f="right"===a["text-justify"]?1:"left"===a["text-justify"]?0:.5,h=24*a["text-line-height"],p="line"!==a["symbol-placement"]?24*a["text-max-width"]:0,v=24*a["text-letter-spacing"],b=[24*a["text-offset"][0],24*a["text-offset"][1]],_=this.fontstack=a["text-font"].join(","),M=[],k=0;kw||L.y<0||L.y>w);if(!d||C){var z=C||b;this.addSymbolInstance(L,T,e,r,this.layer,z,this.symbolInstancesArray.length,this.collisionBoxArray,n.index,this.sourceLayerIndex,this.index,c,m,y,f,g,x,{zoom:this.zoom},n.properties)}}}},n.prototype.anchorIsTooClose=function(t,e,r){var n=this.compareText;if(t in n){for(var i=n[t],a=i.length-1;a>=0;a--)if(r.dist(i[a])3*Math.PI/2))){var g=p.tl,v=p.tr,y=p.bl,x=p.br,b=p.tex,_=p.anchorPoint,w=Math.max(f+Math.log(p.minScale)/Math.LN2,h),M=Math.min(f+Math.log(p.maxScale)/Math.LN2,25);if(!(M<=w)){w===h&&(w=0);var k=Math.round(p.glyphAngle/(2*Math.PI)*256),A=i(u,_.x,_.y,g.x,g.y,b.x,b.y,w,M,h,k);i(u,_.x,_.y,v.x,v.y,b.x+b.w,b.y,w,M,h,k),i(u,_.x,_.y,y.x,y.y,b.x,b.y+b.h,w,M,h,k),i(u,_.x,_.y,x.x,x.y,b.x+b.w,b.y+b.h,w,M,h,k),c.emplaceBack(A,A+1,A+2),c.emplaceBack(A+1,A+2,A+3)}}}},n.prototype.updateIcons=function(t){this.recalculateStyleLayers();var e=this.layer.layout["icon-image"];if(e)for(var r=0;rn.MAX_QUADS&&m.warnOnce("Too many symbols being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),A>n.MAX_QUADS&&m.warnOnce("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),this.symbolInstancesArray.emplaceBack(I,P,O,F,k,A,T,S,t.x,t.y,s)},n.prototype.addSymbolQuad=function(t){return this.symbolQuadsArray.emplaceBack(t.anchorPoint.x,t.anchorPoint.y,t.tl.x,t.tl.y,t.tr.x,t.tr.y,t.bl.x,t.bl.y,t.br.x,t.br.y,t.tex.h,t.tex.w,t.tex.x,t.tex.y,t.anchorAngle,t.glyphAngle,t.maxScale,t.minScale)}},{"../../symbol/anchor":382,"../../symbol/clip_line":384,"../../symbol/collision_feature":386,"../../symbol/get_anchors":388,"../../symbol/mergelines":391,"../../symbol/quads":392,"../../symbol/resolve_text":393,"../../symbol/shaping":394,"../../util/token":432,"../../util/util":433,"../bucket":320,"../load_geometry":328,"point-geometry":477}],325:[function(t,e,r){"use strict";function n(t,e,r){this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.attributes=e.members,this.itemSize=e.bytesPerElement,this.type=r,this.arrayType=e}e.exports=n,n.prototype.bind=function(t){var e=t[this.type];this.buffer?t.bindBuffer(e,this.buffer):(this.buffer=t.createBuffer(),t.bindBuffer(e,this.buffer),t.bufferData(e,this.arrayBuffer,t.STATIC_DRAW),this.arrayBuffer=null)};var i={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT"};n.prototype.setVertexAttribPointers=function(t,e){for(var r=0;r0?t["line-gap-width"]+2*t["line-width"]:t["line-width"]}function s(t,e,r,n,i){if(!e[0]&&!e[1])return t;e=l.convert(e),"viewport"===r&&e._rotate(-n);for(var a=[],o=0;or.max||h.yr.max)&&i.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return l}},{"../util/util":433,"./bucket":320,assert:51}],329:[function(t,e,r){"use strict";function n(t,e,r){this.column=t,this.row=e,this.zoom=r}e.exports=n,n.prototype={clone:function(){return new n(this.column,this.row,this.zoom)},zoomTo:function(t){return this.clone()._zoomTo(t)},sub:function(t){return this.clone()._sub(t)},_zoomTo:function(t){var e=Math.pow(2,t-this.zoom);return this.column*=e,this.row*=e,this.zoom=t,this},_sub:function(t){return t=t.zoomTo(this.zoom),this.column-=t.column,this.row-=t.row,this}}},{}],330:[function(t,e,r){"use strict";function n(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}e.exports=n;var i=t("../util/util").wrap;n.prototype.wrap=function(){return new n(i(this.lng,-180,180),this.lat)},n.prototype.toArray=function(){return[this.lng,this.lat]},n.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{"../util/util":433}],331:[function(t,e,r){"use strict";function n(t,e){t&&(e?this.extend(t).extend(e):4===t.length?this.extend([t[0],t[1]]).extend([t[2],t[3]]):this.extend(t[0]).extend(t[1]))}e.exports=n;var i=t("./lng_lat");n.prototype={extend:function(t){var e,r,a=this._sw,o=this._ne;if(t instanceof i)e=t,r=t;else{if(!(t instanceof n))return t?this.extend(i.convert(t)||n.convert(t)):this;if(e=t._sw,r=t._ne,!e||!r)return this}return a||o?(a.lng=Math.min(e.lng,a.lng),a.lat=Math.min(e.lat,a.lat),o.lng=Math.max(r.lng,o.lng),o.lat=Math.max(r.lat,o.lat)):(this._sw=new i(e.lng,e.lat),this._ne=new i(r.lng,r.lat)),this},getCenter:function(){return new i((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},getSouthWest:function(){return this._sw},getNorthEast:function(){return this._ne},getNorthWest:function(){return new i(this.getWest(),this.getNorth())},getSouthEast:function(){return new i(this.getEast(),this.getSouth())},getWest:function(){return this._sw.lng},getSouth:function(){return this._sw.lat},getEast:function(){return this._ne.lng},getNorth:function(){return this._ne.lat},toArray:function(){return[this._sw.toArray(),this._ne.toArray()]},toString:function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"}},n.convert=function(t){return!t||t instanceof n?t:new n(t)}},{"./lng_lat":330}],332:[function(t,e,r){"use strict";function n(t,e){this.tileSize=512,this._minZoom=t||0,this._maxZoom=e||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new i(0,0),this.zoom=0,this.angle=0,this._altitude=1.5,this._pitch=0,this._unmodified=!0}var i=t("./lng_lat"),a=t("point-geometry"),o=t("./coordinate"),s=t("../util/util").wrap,l=t("../util/interpolate"),c=t("../source/tile_coord"),u=t("../data/bucket").EXTENT,f=t("gl-matrix"),h=f.vec4,d=f.mat4,p=f.mat2;e.exports=n,n.prototype={get minZoom(){return this._minZoom},set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},get maxZoom(){return this._maxZoom},set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},get worldSize(){return this.tileSize*this.scale},get centerPoint(){return this.size._div(2)},get size(){return new a(this.width,this.height)},get bearing(){return-this.angle/Math.PI*180},set bearing(t){var e=-s(t,-180,180)*Math.PI/180;this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=p.create(),p.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},get pitch(){return this._pitch/Math.PI*180},set pitch(t){var e=Math.min(60,t)/180*Math.PI;this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},get altitude(){return this._altitude},set altitude(t){var e=Math.max(.75,t);this._altitude!==e&&(this._unmodified=!1,this._altitude=e,this._calcMatrices())},get zoom(){return this._zoom},set zoom(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._calcMatrices(),this._constrain())},get center(){return this._center},set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._calcMatrices(),this._constrain())},coveringZoomLevel:function(t){return(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize))},coveringTiles:function(t){var e=this.coveringZoomLevel(t),r=e;if(et.maxzoom&&(e=t.maxzoom);var n=this.locationCoordinate(this.center)._zoomTo(e),i=new a(n.column-.5,n.row-.5);return c.cover(e,[this.pointCoordinate(new a(0,0))._zoomTo(e),this.pointCoordinate(new a(this.width,0))._zoomTo(e),this.pointCoordinate(new a(this.width,this.height))._zoomTo(e),this.pointCoordinate(new a(0,this.height))._zoomTo(e)],t.reparseOverscaled?r:e).sort(function(t,e){return i.dist(t)-i.dist(e)})},resize:function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._calcMatrices(),this._constrain()},get unmodified(){return this._unmodified},zoomScale:function(t){return Math.pow(2,t)},scaleZoom:function(t){return Math.log(t)/Math.LN2},project:function(t,e){return new a(this.lngX(t.lng,e),this.latY(t.lat,e))},unproject:function(t,e){return new i(this.xLng(t.x,e),this.yLat(t.y,e))},get x(){return this.lngX(this.center.lng)},get y(){return this.latY(this.center.lat)},get point(){return new a(this.x,this.y)},lngX:function(t,e){return(180+t)*(e||this.worldSize)/360},latY:function(t,e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))*(e||this.worldSize)/360},xLng:function(t,e){return 360*t/(e||this.worldSize)-180},yLat:function(t,e){var r=180-360*t/(e||this.worldSize);return 360/Math.PI*Math.atan(Math.exp(r*Math.PI/180))-90},panBy:function(t){var e=this.centerPoint._add(t);this.center=this.pointLocation(e)},setLocationAtPoint:function(t,e){var r=this.locationCoordinate(t),n=this.pointCoordinate(e),i=this.pointCoordinate(this.centerPoint),a=n._sub(r);this._unmodified=!1,this.center=this.coordinateLocation(i._sub(a))},locationPoint:function(t){return this.coordinatePoint(this.locationCoordinate(t))},pointLocation:function(t){return this.coordinateLocation(this.pointCoordinate(t))},locationCoordinate:function(t){var e=this.zoomScale(this.tileZoom)/this.worldSize,r=i.convert(t);return new o(this.lngX(r.lng)*e,this.latY(r.lat)*e,this.tileZoom)},coordinateLocation:function(t){var e=this.zoomScale(t.zoom);return new i(this.xLng(t.column,e),this.yLat(t.row,e))},pointCoordinate:function(t){var e=[t.x,t.y,0,1],r=[t.x,t.y,1,1];h.transformMat4(e,e,this.pixelMatrixInverse),h.transformMat4(r,r,this.pixelMatrixInverse);var n=e[3],i=r[3],a=e[0]/n,s=r[0]/i,c=e[1]/n,u=r[1]/i,f=e[2]/n,d=r[2]/i,p=f===d?0:(0-f)/(d-f),m=this.worldSize/this.zoomScale(this.tileZoom);return new o(l(a,s,p)/m,l(c,u,p)/m,this.tileZoom)},coordinatePoint:function(t){var e=this.worldSize/this.zoomScale(t.zoom),r=[t.column*e,t.row*e,0,1];return h.transformMat4(r,r,this.pixelMatrix),new a(r[0]/r[3],r[1]/r[3])},calculatePosMatrix:function(t,e){void 0===e&&(e=1/0),t instanceof c&&(t=t.toCoordinate(e));var r=Math.min(t.zoom,e),n=this.worldSize/Math.pow(2,r),i=new Float64Array(16);return d.identity(i),d.translate(i,i,[t.column*n,t.row*n,0]),d.scale(i,i,[n/u,n/u,1]),d.multiply(i,this.projMatrix,i),new Float32Array(i)},_constrain:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var t,e,r,n,i,o,s,l,c=this.size,u=this._unmodified;this.latRange&&(t=this.latY(this.latRange[1]),i=(e=this.latY(this.latRange[0]))-te&&(l=e-d)}if(this.lngRange){var p=this.x,m=c.x/2;p-mn&&(s=n-m)}void 0===s&&void 0===l||(this.center=this.unproject(new a(void 0!==s?s:this.x,void 0!==l?l:this.y))),this._unmodified=u,this._constraining=!1}},_calcMatrices:function(){if(this.height){var t=Math.atan(.5/this.altitude),e=Math.sin(t)*this.altitude/Math.sin(Math.PI/2-this._pitch-t),r=Math.cos(Math.PI/2-this._pitch)*e+this.altitude,n=new Float64Array(16);if(d.perspective(n,2*Math.atan(this.height/2/this.altitude),this.width/this.height,.1,r),d.translate(n,n,[0,0,-this.altitude]),d.scale(n,n,[1,-1,1/this.height]),d.rotateX(n,n,this._pitch),d.rotateZ(n,n,this.angle),d.translate(n,n,[-this.x,-this.y,0]),this.projMatrix=n,n=d.create(),d.scale(n,n,[this.width/2,-this.height/2,1]),d.translate(n,n,[1,-1,0]),this.pixelMatrix=d.multiply(new Float64Array(16),n,this.projMatrix),!(n=d.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=n}}}},{"../data/bucket":320,"../source/tile_coord":360,"../util/interpolate":427,"../util/util":433,"./coordinate":329,"./lng_lat":330,"gl-matrix":198,"point-geometry":477}],333:[function(t,e,r){"use strict";var n={" ":[16,[]],"!":[10,[5,21,5,7,-1,-1,5,2,4,1,5,0,6,1,5,2]],'"':[16,[4,21,4,14,-1,-1,12,21,12,14]],"#":[21,[11,25,4,-7,-1,-1,17,25,10,-7,-1,-1,4,12,18,12,-1,-1,3,6,17,6]],$:[20,[8,25,8,-4,-1,-1,12,25,12,-4,-1,-1,17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],"%":[24,[21,21,3,0,-1,-1,8,21,10,19,10,17,9,15,7,14,5,14,3,16,3,18,4,20,6,21,8,21,10,20,13,19,16,19,19,20,21,21,-1,-1,17,7,15,6,14,4,14,2,16,0,18,0,20,1,21,3,21,5,19,7,17,7]],"&":[26,[23,12,23,13,22,14,21,14,20,13,19,11,17,6,15,3,13,1,11,0,7,0,5,1,4,2,3,4,3,6,4,8,5,9,12,13,13,14,14,16,14,18,13,20,11,21,9,20,8,18,8,16,9,13,11,10,16,3,18,1,20,0,22,0,23,1,23,2]],"'":[10,[5,19,4,20,5,21,6,20,6,18,5,16,4,15]],"(":[14,[11,25,9,23,7,20,5,16,4,11,4,7,5,2,7,-2,9,-5,11,-7]],")":[14,[3,25,5,23,7,20,9,16,10,11,10,7,9,2,7,-2,5,-5,3,-7]],"*":[16,[8,21,8,9,-1,-1,3,18,13,12,-1,-1,13,18,3,12]],"+":[26,[13,18,13,0,-1,-1,4,9,22,9]],",":[10,[6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"-":[26,[4,9,22,9]],".":[10,[5,2,4,1,5,0,6,1,5,2]],"/":[22,[20,25,2,-7]],0:[20,[9,21,6,20,4,17,3,12,3,9,4,4,6,1,9,0,11,0,14,1,16,4,17,9,17,12,16,17,14,20,11,21,9,21]],1:[20,[6,17,8,18,11,21,11,0]],2:[20,[4,16,4,17,5,19,6,20,8,21,12,21,14,20,15,19,16,17,16,15,15,13,13,10,3,0,17,0]],3:[20,[5,21,16,21,10,13,13,13,15,12,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],4:[20,[13,21,3,7,18,7,-1,-1,13,21,13,0]],5:[20,[15,21,5,21,4,12,5,13,8,14,11,14,14,13,16,11,17,8,17,6,16,3,14,1,11,0,8,0,5,1,4,2,3,4]],6:[20,[16,18,15,20,12,21,10,21,7,20,5,17,4,12,4,7,5,3,7,1,10,0,11,0,14,1,16,3,17,6,17,7,16,10,14,12,11,13,10,13,7,12,5,10,4,7]],7:[20,[17,21,7,0,-1,-1,3,21,17,21]],8:[20,[8,21,5,20,4,18,4,16,5,14,7,13,11,12,14,11,16,9,17,7,17,4,16,2,15,1,12,0,8,0,5,1,4,2,3,4,3,7,4,9,6,11,9,12,13,13,15,14,16,16,16,18,15,20,12,21,8,21]],9:[20,[16,14,15,11,13,9,10,8,9,8,6,9,4,11,3,14,3,15,4,18,6,20,9,21,10,21,13,20,15,18,16,14,16,9,15,4,13,1,10,0,8,0,5,1,4,3]],":":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,5,2,4,1,5,0,6,1,5,2]],";":[10,[5,14,4,13,5,12,6,13,5,14,-1,-1,6,1,5,0,4,1,5,2,6,1,6,-1,5,-3,4,-4]],"<":[24,[20,18,4,9,20,0]],"=":[26,[4,12,22,12,-1,-1,4,6,22,6]],">":[24,[4,18,20,9,4,0]],"?":[18,[3,16,3,17,4,19,5,20,7,21,11,21,13,20,14,19,15,17,15,15,14,13,13,12,9,10,9,7,-1,-1,9,2,8,1,9,0,10,1,9,2]],"@":[27,[18,13,17,15,15,16,12,16,10,15,9,14,8,11,8,8,9,6,11,5,14,5,16,6,17,8,-1,-1,12,16,10,14,9,11,9,8,10,6,11,5,-1,-1,18,16,17,8,17,6,19,5,21,5,23,7,24,10,24,12,23,15,22,17,20,19,18,20,15,21,12,21,9,20,7,19,5,17,4,15,3,12,3,9,4,6,5,4,7,2,9,1,12,0,15,0,18,1,20,2,21,3,-1,-1,19,16,18,8,18,6,19,5]],A:[18,[9,21,1,0,-1,-1,9,21,17,0,-1,-1,4,7,14,7]],B:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,-1,-1,4,11,13,11,16,10,17,9,18,7,18,4,17,2,16,1,13,0,4,0]],C:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5]],D:[21,[4,21,4,0,-1,-1,4,21,11,21,14,20,16,18,17,16,18,13,18,8,17,5,16,3,14,1,11,0,4,0]],E:[19,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11,-1,-1,4,0,17,0]],F:[18,[4,21,4,0,-1,-1,4,21,17,21,-1,-1,4,11,12,11]],G:[21,[18,16,17,18,15,20,13,21,9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,18,8,-1,-1,13,8,18,8]],H:[22,[4,21,4,0,-1,-1,18,21,18,0,-1,-1,4,11,18,11]],I:[8,[4,21,4,0]],J:[16,[12,21,12,5,11,2,10,1,8,0,6,0,4,1,3,2,2,5,2,7]],K:[21,[4,21,4,0,-1,-1,18,21,4,7,-1,-1,9,12,18,0]],L:[17,[4,21,4,0,-1,-1,4,0,16,0]],M:[24,[4,21,4,0,-1,-1,4,21,12,0,-1,-1,20,21,12,0,-1,-1,20,21,20,0]],N:[22,[4,21,4,0,-1,-1,4,21,18,0,-1,-1,18,21,18,0]],O:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21]],P:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,14,17,12,16,11,13,10,4,10]],Q:[22,[9,21,7,20,5,18,4,16,3,13,3,8,4,5,5,3,7,1,9,0,13,0,15,1,17,3,18,5,19,8,19,13,18,16,17,18,15,20,13,21,9,21,-1,-1,12,4,18,-2]],R:[21,[4,21,4,0,-1,-1,4,21,13,21,16,20,17,19,18,17,18,15,17,13,16,12,13,11,4,11,-1,-1,11,11,18,0]],S:[20,[17,18,15,20,12,21,8,21,5,20,3,18,3,16,4,14,5,13,7,12,13,10,15,9,16,8,17,6,17,3,15,1,12,0,8,0,5,1,3,3]],T:[16,[8,21,8,0,-1,-1,1,21,15,21]],U:[22,[4,21,4,6,5,3,7,1,10,0,12,0,15,1,17,3,18,6,18,21]],V:[18,[1,21,9,0,-1,-1,17,21,9,0]],W:[24,[2,21,7,0,-1,-1,12,21,7,0,-1,-1,12,21,17,0,-1,-1,22,21,17,0]],X:[20,[3,21,17,0,-1,-1,17,21,3,0]],Y:[18,[1,21,9,11,9,0,-1,-1,17,21,9,11]],Z:[20,[17,21,3,0,-1,-1,3,21,17,21,-1,-1,3,0,17,0]],"[":[14,[4,25,4,-7,-1,-1,5,25,5,-7,-1,-1,4,25,11,25,-1,-1,4,-7,11,-7]],"\\":[14,[0,21,14,-3]],"]":[14,[9,25,9,-7,-1,-1,10,25,10,-7,-1,-1,3,25,10,25,-1,-1,3,-7,10,-7]],"^":[16,[6,15,8,18,10,15,-1,-1,3,12,8,17,13,12,-1,-1,8,17,8,0]],_:[16,[0,-2,16,-2]],"`":[10,[6,21,5,20,4,18,4,16,5,15,6,16,5,17]],a:[19,[15,14,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],b:[19,[4,21,4,0,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],c:[18,[15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],d:[19,[15,21,15,0,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],e:[18,[3,8,15,8,15,10,14,12,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],f:[12,[10,21,8,21,6,20,5,17,5,0,-1,-1,2,14,9,14]],g:[19,[15,14,15,-2,14,-5,13,-6,11,-7,8,-7,6,-6,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],h:[19,[4,21,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],i:[8,[3,21,4,20,5,21,4,22,3,21,-1,-1,4,14,4,0]],j:[10,[5,21,6,20,7,21,6,22,5,21,-1,-1,6,14,6,-3,5,-6,3,-7,1,-7]],k:[17,[4,21,4,0,-1,-1,14,14,4,4,-1,-1,8,8,15,0]],l:[8,[4,21,4,0]],m:[30,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0,-1,-1,15,10,18,13,20,14,23,14,25,13,26,10,26,0]],n:[19,[4,14,4,0,-1,-1,4,10,7,13,9,14,12,14,14,13,15,10,15,0]],o:[19,[8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3,16,6,16,8,15,11,13,13,11,14,8,14]],p:[19,[4,14,4,-7,-1,-1,4,11,6,13,8,14,11,14,13,13,15,11,16,8,16,6,15,3,13,1,11,0,8,0,6,1,4,3]],q:[19,[15,14,15,-7,-1,-1,15,11,13,13,11,14,8,14,6,13,4,11,3,8,3,6,4,3,6,1,8,0,11,0,13,1,15,3]],r:[13,[4,14,4,0,-1,-1,4,8,5,11,7,13,9,14,12,14]],s:[17,[14,11,13,13,10,14,7,14,4,13,3,11,4,9,6,8,11,7,13,6,14,4,14,3,13,1,10,0,7,0,4,1,3,3]],t:[12,[5,21,5,4,6,1,8,0,10,0,-1,-1,2,14,9,14]],u:[19,[4,14,4,4,5,1,7,0,10,0,12,1,15,4,-1,-1,15,14,15,0]],v:[16,[2,14,8,0,-1,-1,14,14,8,0]],w:[22,[3,14,7,0,-1,-1,11,14,7,0,-1,-1,11,14,15,0,-1,-1,19,14,15,0]],x:[17,[3,14,14,0,-1,-1,14,14,3,0]],y:[16,[2,14,8,0,-1,-1,14,14,8,0,6,-4,4,-6,2,-7,1,-7]],z:[17,[14,14,3,0,-1,-1,3,14,14,14,-1,-1,3,0,14,0]],"{":[14,[9,25,7,24,6,23,5,21,5,19,6,17,7,16,8,14,8,12,6,10,-1,-1,7,24,6,22,6,20,7,18,8,17,9,15,9,13,8,11,4,9,8,7,9,5,9,3,8,1,7,0,6,-2,6,-4,7,-6,-1,-1,6,8,8,6,8,4,7,2,6,1,5,-1,5,-3,6,-5,7,-6,9,-7]],"|":[8,[4,25,4,-7]],"}":[14,[5,25,7,24,8,23,9,21,9,19,8,17,7,16,6,14,6,12,8,10,-1,-1,7,24,8,22,8,20,7,18,6,17,5,15,5,13,6,11,10,9,6,7,5,5,5,3,6,1,7,0,8,-2,8,-4,7,-6,-1,-1,8,8,6,6,6,4,7,2,8,1,9,-1,9,-3,8,-5,7,-6,5,-7]],"~":[24,[3,6,3,8,4,11,6,12,8,12,10,11,14,8,16,7,18,7,20,8,21,10,-1,-1,3,8,4,10,6,11,8,11,10,10,14,7,16,6,18,6,20,7,21,10,21,12]]};e.exports=function(t,e,r,i){i=i||1;var a,o,s,l,c,u,f,h,d=[];for(a=0,o=t.length;a>16,_>>16),s.uniform2f(o.u_pixel_coord_lower,65535&b,65535&_)}s.uniformMatrix4fv(o.u_matrix,!1,t.transform.calculatePosMatrix(v)),s.drawArrays(s.TRIANGLE_STRIP,0,t.tileExtentBuffer.length)}s.stencilMask(0),s.stencilFunc(s.EQUAL,128,128)}},{"../source/pixels_to_tile_units":354,"./create_uniform_pragmas":335}],337:[function(t,e,r){"use strict";var n=t("../util/browser");e.exports=function(t,e,r,i){if(!t.isOpaquePass){var a=t.gl;t.setDepthSublayer(0),t.depthMask(!1),a.disable(a.STENCIL_TEST);for(var o=0;o>16,h>>16),s.uniform2f(o.u_pixel_coord_lower,65535&f,65535&h),s.activeTexture(s.TEXTURE0),a.spriteAtlas.bind(s,!0)}}var i=t("../source/pixels_to_tile_units");e.exports=function(t,e,r,i){var a=t.gl;a.enable(a.STENCIL_TEST);var o;if(o=!r.paint["fill-pattern"]&&r.isPaintValueFeatureConstant("fill-color")&&r.isPaintValueFeatureConstant("fill-opacity")&&1===r.paint["fill-color"][3]&&1===r.paint["fill-opacity"],t.isOpaquePass===o){t.setDepthSublayer(1);for(var s=0;s0?1-1/(1.001-t):-t}(r.paint["raster-saturation"])),a.uniform1f(l.u_contrast_factor,function(t){return t>0?1/(1-t):1+t}(r.paint["raster-contrast"])),a.uniform3fv(l.u_spin_weights,function(t){t*=Math.PI/180;var e=Math.sin(t),r=Math.cos(t);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}(r.paint["raster-hue-rotate"]));var c,u,f=o.source&&o.source.findLoadedParent(n,0,{}),h=function(t,e,r,n){var a=[1,0],o=r.paint["raster-fade-duration"];if(t.source&&o>0){var s=(new Date).getTime(),l=(s-t.timeAdded)/o,c=e?(s-e.timeAdded)/o:-1,u=n.coveringZoomLevel(t.source),f=!!e&&Math.abs(e.coord.z-u)>Math.abs(t.coord.z-u);!e||f?(a[0]=i.clamp(l,0,1),a[1]=1-a[0]):(a[0]=i.clamp(1-c,0,1),a[1]=1-a[0])}var h=r.paint["raster-opacity"];return a[0]*=h,a[1]*=h,a}(o,f,r,t.transform);a.activeTexture(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,o.texture),a.activeTexture(a.TEXTURE1),f?(a.bindTexture(a.TEXTURE_2D,f.texture),c=Math.pow(2,f.coord.z-o.coord.z),u=[o.coord.x*c%1,o.coord.y*c%1]):(a.bindTexture(a.TEXTURE_2D,o.texture),h[1]=0);a.uniform2fv(l.u_tl_parent,u||[0,0]),a.uniform1f(l.u_scale_parent,c||1),a.uniform1f(l.u_buffer_scale,1),a.uniform1f(l.u_opacity0,h[0]),a.uniform1f(l.u_opacity1,h[1]),a.uniform1i(l.u_image0,0),a.uniform1i(l.u_image1,1);var d=o.boundsBuffer||t.rasterBoundsBuffer;(o.boundsVAO||t.rasterBoundsVAO).bind(a,l,d),a.drawArrays(a.TRIANGLE_STRIP,0,d.length)}(t,e,r,l)}a.depthFunc(a.LEQUAL)}}var i=t("../util/util"),a=t("../util/struct_array");e.exports=n,n.RasterBoundsArray=new a({members:[{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]})},{"../util/struct_array":431,"../util/util":433}],343:[function(t,e,r){"use strict";function n(t,e,r,n,a,s,l,c,u,f,h,d,p,m,g){for(var v=0;vthis.previousZoom;r--)this.changeTimes[r]=e,this.changeOpacities[r]=this.opacities[r];for(r=0;r<256;r++){var n=(e-this.changeTimes[r])/this.fadeDuration*255;this.opacities[r]=r<=t?this.changeOpacities[r]+n:this.changeOpacities[r]-n}this.changed=!0,this.previousZoom=t},n.prototype.bind=function(t){this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.changed&&(t.texSubImage2D(t.TEXTURE_2D,0,0,0,256,1,t.ALPHA,t.UNSIGNED_BYTE,this.array),this.changed=!1)):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,256,1,0,t.ALPHA,t.UNSIGNED_BYTE,this.array))}},{}],345:[function(t,e,r){"use strict";function n(t,e){this.width=t,this.height=e,this.nextRow=0,this.bytes=4,this.data=new Uint8Array(this.width*this.height*this.bytes),this.positions={}}var i=t("../util/util");e.exports=n,n.prototype.setSprite=function(t){this.sprite=t},n.prototype.getDash=function(t,e){var r=t.join(",")+e;return this.positions[r]||(this.positions[r]=this.addDash(t,e)),this.positions[r]},n.prototype.addDash=function(t,e){var r=e?7:0,n=2*r+1;if(this.nextRow+n>this.height)return i.warnOnce("LineAtlas out of space"),null;for(var a=0,o=0;o0?e.pop():null},n.prototype.lineWidth=function(t){this.gl.lineWidth(u.clamp(t,this.lineWidthRange[0],this.lineWidthRange[1]))},n.prototype.showOverdrawInspector=function(t){if(t||this._showOverdrawInspector){this._showOverdrawInspector=t;var e=this.gl;if(t){e.blendFunc(e.CONSTANT_COLOR,e.ONE);e.blendColor(1/8,1/8,1/8,0),e.clearColor(0,0,0,1),e.clear(e.COLOR_BUFFER_BIT)}else e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}}},{"../data/bucket":320,"../data/buffer":325,"../source/pixels_to_tile_units":354,"../source/source_cache":358,"../util/browser":417,"../util/struct_array":431,"../util/util":433,"./create_uniform_pragmas":335,"./draw_background":336,"./draw_circle":337,"./draw_debug":339,"./draw_fill":340,"./draw_line":341,"./draw_raster":342,"./draw_symbol":343,"./frame_history":344,"./painter/use_program":347,"./vertex_array_object":348,"gl-matrix":198}],347:[function(t,e,r){"use strict";function n(t,e){return t.replace(/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,function(t,r,n,i,a){return e[r][a].replace(/{type}/g,i).replace(/{precision}/g,n)})}var i=t("assert"),a=t("../../util/util"),o=t("mapbox-gl-shaders"),s=o.util;e.exports._createProgram=function(t,e,r,l){for(var c=this.gl,u=c.createProgram(),f=o[t],h="#define MAPBOX_GL_JS;\n",d=0;dthis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,n={type:this.type,uid:t.uid,coord:t.coord,zoom:t.coord.z,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,overscaling:r,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID=this.dispatcher.send("load tile",n,function(r,n){if(t.unloadVectorData(this.map.painter),!t.aborted)return r?e(r):(t.loadVectorData(n,this.map.style),t.redoWhenDone&&(t.redoWhenDone=!1,t.redoPlacement(this)),e(null))}.bind(this),this.workerID)},abortTile:function(t){t.aborted=!0},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},function(){},t.workerID)},serialize:function(){return{type:this.type,data:this._data}}})},{"../data/bucket":320,"../util/evented":425,"../util/util":433,"resolve-url":508}],350:[function(t,e,r){"use strict";function n(t,e,r){r&&(this.loadGeoJSON=r),f.call(this,t,e)}var i=t("../util/util"),a=t("../util/ajax"),o=t("geojson-rewind"),s=t("./geojson_wrapper"),l=t("vt-pbf"),c=t("supercluster"),u=t("geojson-vt"),f=t("./vector_tile_worker_source");e.exports=n,n.prototype=i.inherit(f,{_geoJSONIndexes:{},loadVectorData:function(t,e){var r=t.source,n=t.coord;if(!this._geoJSONIndexes[r])return e(null,null);var i=this._geoJSONIndexes[r].getTile(Math.min(n.z,t.maxZoom),n.x,n.y);if(!i)return e(null,null);var a=new s(i.features);a.name="_geojsonTileLayer";var o=l({layers:{_geojsonTileLayer:a}});0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{tile:a,rawTileData:o.buffer})},loadData:function(t,e){var r=function(r,n){return r?e(r):"object"!=typeof n?e(new Error("Input data is not a valid GeoJSON object.")):(o(n,!0),void this._indexData(n,t,function(r,n){if(r)return e(r);this._geoJSONIndexes[t.source]=n,e(null)}.bind(this)))}.bind(this);this.loadGeoJSON(t,r)},loadGeoJSON:function(t,e){if(t.url)a.getJSON(t.url,e);else{if("string"!=typeof t.data)return e(new Error("Input data is not a valid GeoJSON object."));try{return e(null,JSON.parse(t.data))}catch(t){return e(new Error("Input data is not a valid GeoJSON object."))}}},_indexData:function(t,e,r){try{e.cluster?r(null,c(e.superclusterOptions).load(t.features)):r(null,u(t,e.geojsonVtOptions))}catch(t){return r(t)}}})},{"../util/ajax":416,"../util/util":433,"./geojson_wrapper":351,"./vector_tile_worker_source":362,"geojson-rewind":147,"geojson-vt":151,supercluster:538,"vt-pbf":570}],351:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length,this.extent=s}function i(t){if(this.type=t.type,1===t.type){this.rawGeometry=[];for(var e=0;ee)){var o=Math.pow(2,Math.min(a.coord.z,this.maxzoom)-Math.min(t.z,this.maxzoom));if(Math.floor(a.coord.x/o)===t.x&&Math.floor(a.coord.y/o)===t.y)for(r[i]=!0,n=!0;a&&a.coord.z-1>t.z;){var s=a.coord.parent(this.maxzoom).id;(a=this._tiles[s])&&a.isRenderable()&&(delete r[i],r[s]=!0)}}}return n},findLoadedParent:function(t,e,r){for(var n=t.z-1;n>=e;n--){t=t.parent(this.maxzoom);var i=this._tiles[t.id];if(i&&i.isRenderable())return r[t.id]=!0,i;if(this._cache.has(t.id))return this.addTile(t),r[t.id]=!0,this._tiles[t.id]}},updateCacheSize:function(t){var e=(Math.ceil(t.width/t.tileSize)+1)*(Math.ceil(t.height/t.tileSize)+1);this._cache.setMaxSize(Math.floor(5*e))},update:function(t,e){if(this._sourceLoaded){var r,i,a;this.updateCacheSize(t);var o=(this.roundZoom?Math.round:Math.floor)(this.getZoom(t)),s=Math.max(o-n.maxOverzooming,this.minzoom),l=Math.max(o+n.maxUnderzooming,this.minzoom),u={},f=(new Date).getTime();this._coveredTiles={};var d=this.used?t.coveringTiles(this._source):[];for(r=0;rf-(e||0)&&(this.findLoadedChildren(i,l,u)&&(u[v]=!0),this.findLoadedParent(i,s,p))}var y;for(y in p)u[y]||(this._coveredTiles[y]=!0);for(y in p)u[y]=!0;var x=h.keysDifference(this._tiles,u);for(r=0;rthis.maxzoom?Math.pow(2,n-this.maxzoom):1;e=new s(r,this.tileSize*i,this.maxzoom),this.loadTile(e,this._tileLoaded.bind(this,e))}return e.uses++,this._tiles[t.id]=e,this.fire("tile.add",{tile:e}),this._source.fire("tile.add",{tile:e}),e},removeTile:function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this.fire("tile.remove",{tile:e}),this._source.fire("tile.remove",{tile:e}),e.uses>0||(e.isRenderable()?this._cache.add(e.coord.wrapped().id,e):(e.aborted=!0,this.abortTile(e),this.unloadTile(e))))},clearTiles:function(){for(var t in this._tiles)this.removeTile(t);this._cache.reset()},tilesIn:function(t){for(var e={},r=this.getIds(),n=1/0,a=1/0,o=-1/0,s=-1/0,l=t[0].zoom,u=0;u=0&&v[1].y>=0){for(var y=[],x=0;x=0&&t%1==0),s(!isNaN(e)&&e>=0&&e%1==0),s(!isNaN(r)&&r>=0&&r%1==0),isNaN(n)&&(n=0),this.z=+t,this.x=+e,this.y=+r,this.w=+n,(n*=2)<0&&(n=-1*n-1);var i=1<e.row){var r=t;t=e,e=r}return{x0:t.column,y0:t.row,x1:e.column,y1:e.row,dx:e.column-t.column,dy:e.row-t.row}}function a(t,e,r,n,i){var a=Math.max(r,Math.floor(e.y0)),o=Math.min(n,Math.ceil(e.y1));if(t.x0===e.x0&&t.y0===e.y0?t.x0+e.dy/t.dy*t.dx0,f=e.dx<0,h=a;hu.dy&&(l=c,c=u,u=l),c.dy>f.dy&&(l=c,c=f,f=l),u.dy>f.dy&&(l=u,u=f,f=l),c.dy&&a(f,c,n,o,s),u.dy&&a(f,u,n,o,s)}var s=t("assert"),l=t("whoots-js"),c=t("../geo/coordinate");e.exports=n,n.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},n.prototype.toCoordinate=function(t){var e=Math.min(this.z,t),r=Math.pow(2,e),n=this.y,i=this.x+r*this.w;return new c(i,n,e)},n.fromID=function(t){var e=t%32,r=1<0;a--)i+=(e&(n=1<t?new n(this.z-1,this.x,this.y,this.w):new n(this.z-1,Math.floor(this.x/2),Math.floor(this.y/2),this.w)},n.prototype.wrapped=function(){return new n(this.z,this.x,this.y,0)},n.prototype.children=function(t){if(this.z>=t)return[new n(this.z+1,this.x,this.y,this.w)];var e=this.z+1,r=2*this.x,i=2*this.y;return[new n(e,r,i,this.w),new n(e,r+1,i,this.w),new n(e,r,i+1,this.w),new n(e,r+1,i+1,this.w)]},n.cover=function(t,e,r){function i(t,e,i){var o,l;if(i>=0&&i<=a)for(o=t;othis.maxzoom?Math.pow(2,t.coord.z-this.maxzoom):1,i={url:s(t.coord.url(this.tiles,this.maxzoom,this.scheme),this.url),uid:t.uid,coord:t.coord,zoom:t.coord.z,tileSize:this.tileSize*n,source:this.id,overscaling:n,angle:this.map.transform.angle,pitch:this.map.transform.pitch,showCollisionBoxes:this.map.showCollisionBoxes};t.workerID?"loading"===t.state?t.reloadCallback=e:(i.rawTileData=t.rawTileData,this.dispatcher.send("reload tile",i,r.bind(this),t.workerID)):t.workerID=this.dispatcher.send("load tile",i,r.bind(this))},abortTile:function(t){this.dispatcher.send("abort tile",{uid:t.uid,source:this.id},null,t.workerID)},unloadTile:function(t){t.unloadVectorData(this.map.painter),this.dispatcher.send("remove tile",{uid:t.uid,source:this.id},null,t.workerID)}})},{"../util/evented":425,"../util/mapbox":430,"../util/util":433,"./load_tilejson":353}],362:[function(t,e,r){"use strict";function n(t,e,r){this.actor=t,this.styleLayers=e,r&&(this.loadVectorData=r),this.loading={},this.loaded={}}var i=t("../util/ajax"),a=t("vector-tile"),o=t("pbf"),s=t("./worker_tile");e.exports=n,n.prototype={loadTile:function(t,e){var r=t.source,n=t.uid;this.loading[r]||(this.loading[r]={});var i=this.loading[r][n]=new s(t);i.abort=this.loadVectorData(t,function(t,a){return delete this.loading[r][n],t?e(t):a?(i.data=a.tile,i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,a.rawTileData,e),this.loaded[r]=this.loaded[r]||{},void(this.loaded[r][n]=i)):e(null,null)}.bind(this))},reloadTile:function(t,e){var r=this.loaded[t.source],n=t.uid;if(r&&r[n]){var i=r[n];i.parse(i.data,this.styleLayers.getLayerFamilies(),this.actor,t.rawTileData,e)}},abortTile:function(t){var e=this.loading[t.source],r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort(),delete e[r])},removeTile:function(t){var e=this.loaded[t.source],r=t.uid;e&&e[r]&&delete e[r]},loadVectorData:function(t,e){var r=i.getArrayBuffer(t.url,function(t,r){if(t)return e(t);var n=new a.VectorTile(new o(new Uint8Array(r)));e(t,{tile:n,rawTileData:r})}.bind(this));return function(){r.abort()}},redoPlacement:function(t,e){var r=this.loaded[t.source],n=this.loading[t.source],i=t.uid;if(r&&r[i]){var a=r[i].redoPlacement(t.angle,t.pitch,t.showCollisionBoxes);a.result&&e(null,a.result,a.transferables)}else n&&n[i]&&(n[i].angle=t.angle)}}},{"../util/ajax":416,"./worker_tile":365,pbf:470,"vector-tile":564}],363:[function(t,e,r){"use strict";function n(t,e){this.id=t,this.urls=e.urls,this.coordinates=e.coordinates,c.getVideo(e.urls,function(t,r){if(t)return this.fire("error",{error:t});this.video=r,this.video.loop=!0;var n;this.video.addEventListener("playing",function(){n=this.map.style.animationLoop.set(1/0),this.map._rerender()}.bind(this)),this.video.addEventListener("pause",function(){this.map.style.animationLoop.cancel(n)}.bind(this)),this.map&&(this.video.play(),this.setCoordinates(e.coordinates)),this.fire("load")}.bind(this))}var i=t("../util/util"),a=t("./tile_coord"),o=t("../geo/lng_lat"),s=t("point-geometry"),l=t("../util/evented"),c=t("../util/ajax"),u=t("../data/bucket").EXTENT,f=t("../render/draw_raster").RasterBoundsArray,h=t("../data/buffer"),d=t("../render/vertex_array_object");e.exports=n,n.prototype=i.inherit(l,{minzoom:0,maxzoom:22,tileSize:512,roundZoom:!0,getVideo:function(){return this.video},onAdd:function(t){this.map||(this.map=t,this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},setCoordinates:function(t){this.coordinates=t;var e=this.map,r=t.map(function(t){return e.transform.locationCoordinate(o.convert(t)).zoomTo(0)}),n=this.centerCoord=i.getCoordinatesCenter(r);return n.column=Math.round(n.column),n.row=Math.round(n.row),this.minzoom=this.maxzoom=n.zoom,this._coord=new a(n.zoom,n.column,n.row),this._tileCoords=r.map(function(t){var e=t.zoomTo(n.zoom);return new s(Math.round((e.column-n.column)*u),Math.round((e.row-n.row)*u))}),this.fire("change"),this},_setTile:function(t){this._prepared=!1,this.tile=t;var e=new f;e.emplaceBack(this._tileCoords[0].x,this._tileCoords[0].y,0,0),e.emplaceBack(this._tileCoords[1].x,this._tileCoords[1].y,32767,0),e.emplaceBack(this._tileCoords[3].x,this._tileCoords[3].y,0,32767),e.emplaceBack(this._tileCoords[2].x,this._tileCoords[2].y,32767,32767),this.tile.buckets={},this.tile.boundsBuffer=new h(e.serialize(),f.serialize(),h.BufferType.VERTEX),this.tile.boundsVAO=new d,this.tile.state="loaded"},prepare:function(){if(!(this.video.readyState<2)&&this.tile){var t=this.map.painter.gl;this._prepared?(t.bindTexture(t.TEXTURE_2D,this.tile.texture),t.texSubImage2D(t.TEXTURE_2D,0,0,0,t.RGBA,t.UNSIGNED_BYTE,this.video)):(this._prepared=!0,this.tile.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.tile.texture),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),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.video)),this._currentTime=this.video.currentTime}},loadTile:function(t,e){this._coord&&this._coord.toString()===t.coord.toString()?(this._setTile(t),e(null)):(t.state="errored",e(null))},serialize:function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}})},{"../data/bucket":320,"../data/buffer":325,"../geo/lng_lat":330,"../render/draw_raster":342,"../render/vertex_array_object":348,"../util/ajax":416,"../util/evented":425,"../util/util":433,"./tile_coord":360,"point-geometry":477}],364:[function(t,e,r){"use strict";function n(t){this.self=t,this.actor=new a(t,this);var e={getLayers:function(){return this.layers}.bind(this),getLayerFamilies:function(){return this.layerFamilies}.bind(this)};this.workerSources={vector:new l(this.actor,e),geojson:new c(this.actor,e)},this.self.registerWorkerSource=function(t,r){if(this.workerSources[t])throw new Error('Worker source with name "'+t+'" already registered.');this.workerSources[t]=new r(this.actor,e)}.bind(this)}function i(t){var e={};for(var r in t){var n=t[r],i=n.ref||n.id,a=t[i];a.layout&&"none"===a.layout.visibility||(e[i]=e[i]||[],r===i?e[i].unshift(n):e[i].push(n))}return e}var a=t("../util/actor"),o=t("../style/style_layer"),s=t("../util/util"),l=t("./vector_tile_worker_source"),c=t("./geojson_worker_source");e.exports=function(t){return new n(t)},s.extend(n.prototype,{"set layers":function(t){function e(t){var e=o.create(t,t.ref&&r.layers[t.ref]);e.updatePaintTransitions({},{transition:!1}),r.layers[e.id]=e}this.layers={};for(var r=this,n=[],a=0;a=0;e--)x(E,P[e]);b()}}function x(t,e){if(e.populateArrays(A,N,R),"symbol"!==e.type)for(var r=0;r=w.maxzoom||w.layout&&"none"===w.layout.visibility||t.layers&&!t.layers[w.sourceLayer]||((k=u.create({layer:w,index:z++,childLayers:e[D],zoom:this.zoom,overscaling:this.overscaling,showCollisionBoxes:this.showCollisionBoxes,collisionBoxArray:this.collisionBoxArray,symbolQuadsArray:this.symbolQuadsArray,symbolInstancesArray:this.symbolInstancesArray,sourceLayerIndex:S.encode(w.sourceLayer||"_geojsonTileLayer")})).createFilter(),L[w.id]=k,t.layers&&(C[M=w.sourceLayer]=C[M]||{},C[M][w.id]=k)));if(t.layers)for(M in C)1===w.version&&d.warnOnce('Vector tile source "'+this.source+'" layer "'+M+'" does not use vector tile spec v2 and therefore may have some rendering errors.'),(w=t.layers[M])&&v(w,C[M]);else v(t,L);var I=[],P=this.symbolBuckets=[],O=[];T.bucketLayerIDs={};for(var F in L)0!==(k=L[F]).features.length&&(T.bucketLayerIDs[k.index]=k.childLayers.map(s),I.push(k),"symbol"===k.type?P.push(k):O.push(k));var R={},N={},j=0;if(P.length>0){for(_=P.length-1;_>=0;_--)P[_].updateIcons(R),P[_].updateFont(N);for(var B in N)N[B]=Object.keys(N[B]).map(Number);R=Object.keys(R),r.send("get glyphs",{uid:this.uid,stacks:N},function(t,e){N=e,y(t)}),R.length?r.send("get icons",{icons:R},function(t,e){R=e,y(t)}):y()}for(_=O.length-1;_>=0;_--)x(0,O[_]);if(0===P.length)return b()},n.prototype.redoPlacement=function(t,e,r){if("done"!==this.status)return this.redoPlacementAfterDone=!0,this.angle=t,{};for(var n=new c(t,e,this.collisionBoxArray),s=this.symbolBuckets,l=s.length-1;l>=0;l--)s[l].placeFeatures(n,r);var u=n.serialize(),f=s.filter(i);return{result:{buckets:f.map(a),collisionTile:u.data},transferables:o(f).concat(u.transferables)}}},{"../data/bucket":320,"../data/feature_index":327,"../symbol/collision_box":385,"../symbol/collision_tile":387,"../symbol/symbol_instances":396,"../symbol/symbol_quads":397,"../util/dictionary_coder":423,"../util/util":433}],366:[function(t,e,r){"use strict";function n(){this.n=0,this.times=[]}e.exports=n,n.prototype.stopped=function(){return this.times=this.times.filter(function(t){return t.time>=(new Date).getTime()}),!this.times.length},n.prototype.set=function(t){return this.times.push({id:this.n,time:t+(new Date).getTime()}),this.n++},n.prototype.cancel=function(t){this.times=this.times.filter(function(e){return e.id!==t})}},{}],367:[function(t,e,r){"use strict";function n(t){this.base=t,this.retina=s.devicePixelRatio>1;var e=this.retina?"@2x":"";o.getJSON(l(t,e,".json"),function(t,e){t?this.fire("error",{error:t}):(this.data=e,this.img&&this.fire("load"))}.bind(this)),o.getImage(l(t,e,".png"),function(t,e){if(t)this.fire("error",{error:t});else{for(var r=e.getData(),n=e.data=new Uint8Array(r.length),i=0;i1!==this.retina){var t=new n(this.base);t.on("load",function(){this.img=t.img,this.data=t.data,this.retina=t.retina}.bind(this))}},i.prototype={x:0,y:0,width:0,height:0,pixelRatio:1,sdf:!1},n.prototype.getSpritePosition=function(t){if(!this.loaded())return new i;var e=this.data&&this.data[t];return e&&this.img?e:new i}},{"../util/ajax":416,"../util/browser":417,"../util/evented":425,"../util/mapbox":430}],368:[function(t,e,r){"use strict";var n=t("csscolorparser").parseCSSColor,i=t("../util/util"),a=t("./style_function"),o={};e.exports=function t(e){if(a.isFunctionDefinition(e))return i.extend({},e,{stops:e.stops.map(function(e){return[e[0],t(e[1])]})});if("string"==typeof e){if(!o[e]){var r=n(e);if(!r)throw new Error("Invalid color "+e);o[e]=[r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]]}return o[e]}throw new Error("Invalid color "+e)}},{"../util/util":433,"./style_function":371,csscolorparser:114}],369:[function(t,e,r){"use strict";function n(t,e,r){this.animationLoop=e||new m,this.dispatcher=new p(r||1,this),this.spriteAtlas=new l(1024,1024),this.lineAtlas=new c(256,512),this._layers={},this._order=[],this._groups=[],this.sources={},this.zoomHistory={},u.bindAll(["_forwardSourceEvent","_forwardTileEvent","_forwardLayerEvent","_redoPlacement"],this),this._resetUpdates();var n=function(t,e){if(t)this.fire("error",{error:t});else if(!g.emitErrors(this,g(e))){this._loaded=!0,this.stylesheet=e,this.updateClasses();var r=e.sources;for(var n in r)this.addSource(n,r[n]);e.sprite&&(this.sprite=new o(e.sprite),this.sprite.on("load",this.fire.bind(this,"change"))),this.glyphSource=new s(e.glyphs),this._resolve(),this.fire("load")}}.bind(this);"string"==typeof t?f.getJSON(h(t),n):d.frame(n.bind(this,null,t)),this.on("source.load",function(t){var e=t.source;if(e&&e.vectorLayerIds)for(var r in this._layers){var n=this._layers[r];n.source===e.id&&this._validateLayer(n)}})}var i=t("../util/evented"),a=t("./style_layer"),o=t("./image_sprite"),s=t("../symbol/glyph_source"),l=t("../symbol/sprite_atlas"),c=t("../render/line_atlas"),u=t("../util/util"),f=t("../util/ajax"),h=t("../util/mapbox").normalizeStyleURL,d=t("../util/browser"),p=t("../util/dispatcher"),m=t("./animation_loop"),g=t("./validate_style"),v=t("../source/source"),y=t("../source/query_features"),x=t("../source/source_cache"),b=t("./style_spec"),_=t("./style_function");e.exports=n,n.prototype=u.inherit(i,{_loaded:!1,_validateLayer:function(t){var e=this.sources[t.source];t.sourceLayer&&e&&e.vectorLayerIds&&-1===e.vectorLayerIds.indexOf(t.sourceLayer)&&this.fire("error",{error:new Error('Source layer "'+t.sourceLayer+'" does not exist on source "'+e.id+'" as specified by style layer "'+t.id+'"')})},loaded:function(){if(!this._loaded)return!1;if(Object.keys(this._updates.sources).length)return!1;for(var t in this.sources)if(!this.sources[t].loaded())return!1;return!(this.sprite&&!this.sprite.loaded())},_resolve:function(){var t,e;this._layers={},this._order=this.stylesheet.layers.map(function(t){return t.id});for(var r=0;rMath.floor(t)&&(e.lastIntegerZoom=Math.floor(t+1),e.lastIntegerZoomTime=Date.now()),e.lastZoom=t},_checkLoaded:function(){if(!this._loaded)throw new Error("Style is not done loading")},update:function(t,e){if(!this._updates.changed)return this;if(this._updates.allLayers)this._groupLayers(),this._updateWorkerLayers();else{var r=Object.keys(this._updates.layers);r.length&&this._updateWorkerLayers(r)}var n,i=Object.keys(this._updates.sources);for(n=0;n=0&&this._handleErrors(g.source,"sources."+t,e)?this:(e=new x(t,e,this.dispatcher),this.sources[t]=e,e.style=this,e.on("load",this._forwardSourceEvent).on("error",this._forwardSourceEvent).on("change",this._forwardSourceEvent).on("tile.add",this._forwardTileEvent).on("tile.load",this._forwardTileEvent).on("tile.error",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.add",{source:e}]),this._updates.changed=!0,this)},removeSource:function(t){if(this._checkLoaded(),void 0===this.sources[t])throw new Error("There is no source with this ID");var e=this.sources[t];return delete this.sources[t],delete this._updates.sources[t],e.off("load",this._forwardSourceEvent).off("error",this._forwardSourceEvent).off("change",this._forwardSourceEvent).off("tile.add",this._forwardTileEvent).off("tile.load",this._forwardTileEvent).off("tile.error",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent),this._updates.events.push(["source.remove",{source:e}]),this._updates.changed=!0,this},getSource:function(t){return this.sources[t]&&this.sources[t].getSource()},addLayer:function(t,e){if(this._checkLoaded(),!(t instanceof a)){if(this._handleErrors(g.layer,"layers."+t.id,t,!1,{arrayIndex:-1}))return this;var r=t.ref&&this.getLayer(t.ref);t=a.create(t,r)}return this._validateLayer(t),t.on("error",this._forwardLayerEvent),this._layers[t.id]=t,this._order.splice(e?this._order.indexOf(e):1/0,0,t.id),this._updates.allLayers=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.events.push(["layer.add",{layer:t}]),this.updateClasses(t.id)},removeLayer:function(t){this._checkLoaded();var e=this._layers[t];if(void 0===e)throw new Error("There is no layer with this ID");for(var r in this._layers)this._layers[r].ref===t&&this.removeLayer(r);return e.off("error",this._forwardLayerEvent),delete this._layers[t],delete this._updates.layers[t],delete this._updates.paintProps[t],this._order.splice(this._order.indexOf(t),1),this._updates.allLayers=!0,this._updates.events.push(["layer.remove",{layer:e}]),this._updates.changed=!0,this},getLayer:function(t){return this._layers[t]},getReferentLayer:function(t){var e=this.getLayer(t);return e.ref&&(e=this.getLayer(e.ref)),e},setLayerZoomRange:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return n.minzoom===e&&n.maxzoom===r?this:(null!=e&&(n.minzoom=e),null!=r&&(n.maxzoom=r),this._updateLayer(n))},setFilter:function(t,e){this._checkLoaded();var r=this.getReferentLayer(t);return null!==e&&this._handleErrors(g.filter,"layers."+r.id+".filter",e)?this:u.deepEqual(r.filter,e)?this:(r.filter=u.clone(e),this._updateLayer(r))},getFilter:function(t){return this.getReferentLayer(t).filter},setLayoutProperty:function(t,e,r){this._checkLoaded();var n=this.getReferentLayer(t);return u.deepEqual(n.getLayoutProperty(e),r)?this:(n.setLayoutProperty(e,r),this._updateLayer(n))},getLayoutProperty:function(t,e){return this.getReferentLayer(t).getLayoutProperty(e)},setPaintProperty:function(t,e,r,n){this._checkLoaded();var i=this.getLayer(t);if(u.deepEqual(i.getPaintProperty(e,n),r))return this;var a=i.isPaintValueFeatureConstant(e);i.setPaintProperty(e,r,n);return!(r&&_.isFunctionDefinition(r)&&"$zoom"!==r.property&&void 0!==r.property)&&a||(this._updates.layers[t]=!0,i.source&&(this._updates.sources[i.source]=!0)),this.updateClasses(t,e)},getPaintProperty:function(t,e,r){return this.getLayer(t).getPaintProperty(e,r)},updateClasses:function(t,e){if(this._updates.changed=!0,t){var r=this._updates.paintProps;r[t]||(r[t]={}),r[t][e||"all"]=!0}else this._updates.allPaintProps=!0;return this},serialize:function(){return u.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:u.mapObject(this.sources,function(t){return t.serialize()}),layers:this._order.map(function(t){return this._layers[t].serialize()},this)},function(t){return void 0!==t})},_updateLayer:function(t){return this._updates.layers[t.id]=!0,t.source&&(this._updates.sources[t.source]=!0),this._updates.changed=!0,this},_flattenRenderedFeatures:function(t){for(var e=[],r=this._order.length-1;r>=0;r--)for(var n=this._order[r],i=0;is.lastIntegerZoom?(n=c+(1-c)*u,f*=2,i=t({zoom:o-1},r),a=t({zoom:o},r)):(n=1-(1-u)*c,a=t({zoom:o},r),i=t({zoom:o+1},r),f/=2),void 0===i||void 0===a?void 0:{from:i,fromScale:f,to:a,toScale:1,t:n}}}(this.calculate)),!this.isFeatureConstant&&!this.isZoomConstant){this.stopZoomLevels=[];for(var o=[],s=this.value.stops,l=0;l=this.maxzoom)||("none"===this.layout.visibility||0===this.paint[this.type+"-opacity"]))},updatePaintTransitions:function(t,e,r,n){for(var i=a.extend({},this._paintDeclarations[""]),o=0;o-r/2;){if(--o<0)return!1;s-=t[o].dist(a),a=t[o]}s+=t[o].dist(t[o+1]),o++;for(var l=[],c=0;sn;)c-=l.shift().angleDelta;if(c>i)return!1;o++,s+=f.dist(h)}return!0}},{}],384:[function(t,e,r){"use strict";var n=t("point-geometry");e.exports=function(t,e,r,i,a){for(var o=[],s=0;s=i&&h.x>=i||(f.x>=i?f=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round():h.x>=i&&(h=new n(i,f.y+(h.y-f.y)*((i-f.x)/(h.x-f.x)))._round()),f.y>=a&&h.y>=a||(f.y>=a?f=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round():h.y>=a&&(h=new n(f.x+(h.x-f.x)*((a-f.y)/(h.y-f.y)),a)._round()),l&&f.equals(l[l.length-1])||(l=[f],o.push(l)),l.push(h)))))}return o}},{"point-geometry":477}],385:[function(t,e,r){"use strict";var n=t("../util/struct_array"),i=t("../util/util"),a=t("point-geometry"),o=e.exports=new n({members:[{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Float32",name:"maxScale"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"bbox0"},{type:"Int16",name:"bbox1"},{type:"Int16",name:"bbox2"},{type:"Int16",name:"bbox3"},{type:"Float32",name:"placementScale"}]});i.extendAll(o.prototype.StructType.prototype,{get anchorPoint(){return new a(this.anchorPointX,this.anchorPointY)}})},{"../util/struct_array":431,"../util/util":433,"point-geometry":477}],386:[function(t,e,r){"use strict";function n(t,e,r,n,i,a,o,s,l,c,u){var f=o.top*s-l,h=o.bottom*s+l,d=o.left*s-l,p=o.right*s+l;if(this.boxStartIndex=t.length,c){var m=h-f,g=p-d;if(m>0)if(m=Math.max(10*s,m),u){var v=e[r.segment+1].sub(e[r.segment])._unit()._mult(g),y=[r.sub(v),r.add(v)];this._addLineCollisionBoxes(t,y,r,0,g,m,n,i,a)}else this._addLineCollisionBoxes(t,e,r,r.segment,g,m,n,i,a)}else t.emplaceBack(r.x,r.y,d,f,p,h,1/0,n,i,a,0,0,0,0,0);this.boxEndIndex=t.length}e.exports=n,n.prototype._addLineCollisionBoxes=function(t,e,r,n,i,a,o,s,l){var c=a/2,u=Math.floor(i/c),f=-a/2,h=this.boxes,d=r,p=n+1,m=f;do{if(--p<0)return h;m-=e[p].dist(d),d=e[p]}while(m>-i/2);for(var g=e[p].dist(e[p+1]),v=0;v=e.length)return h;g=e[p].dist(e[p+1])}var x=y-m,b=e[p],_=e[p+1].sub(b)._unit()._mult(x)._add(b)._round(),w=i/2/Math.max(Math.abs(y-f)-c/2,0);t.emplaceBack(_.x,_.y,-a/2,-a/2,a/2,a/2,w,o,s,l,0,0,0,0,0)}return h}},{}],387:[function(t,e,r){"use strict";function n(t,e,r){if("object"==typeof t){var n=t;r=e,t=n.angle,e=n.pitch,this.grid=new o(n.grid),this.ignoredGrid=new o(n.ignoredGrid)}else this.grid=new o(a,12,6),this.ignoredGrid=new o(a,12,0);this.angle=t,this.pitch=e;var i=Math.sin(t),s=Math.cos(t);if(this.rotationMatrix=[s,-i,i,s],this.reverseRotationMatrix=[s,i,-i,s],this.yStretch=1/Math.cos(e/180*Math.PI),this.yStretch=Math.pow(this.yStretch,1.3),this.collisionBoxArray=r,0===r.length){r.emplaceBack();r.emplaceBack(0,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(a,0,0,-32767,0,32767,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,0,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0),r.emplaceBack(0,a,-32767,0,32767,0,32767,0,0,0,0,0,0,0,0,0)}this.tempCollisionBox=r.get(0),this.edges=[r.get(1),r.get(2),r.get(3),r.get(4)]}var i=t("point-geometry"),a=t("../data/bucket").EXTENT,o=t("grid-index");e.exports=n,n.prototype.serialize=function(){var t={angle:this.angle,pitch:this.pitch,grid:this.grid.toArrayBuffer(),ignoredGrid:this.ignoredGrid.toArrayBuffer()};return{data:t,transferables:[t.grid,t.ignoredGrid]}},n.prototype.minScale=.25,n.prototype.maxScale=2,n.prototype.placeCollisionFeature=function(t,e,r){for(var n=this.collisionBoxArray,a=this.minScale,o=this.rotationMatrix,s=this.yStretch,l=t.boxStartIndex;l=this.maxScale)return a}if(r){var _;if(this.angle){var w=this.reverseRotationMatrix,M=new i(c.x1,c.y1).matMult(w),k=new i(c.x2,c.y1).matMult(w),A=new i(c.x1,c.y2).matMult(w),T=new i(c.x2,c.y2).matMult(w);(_=this.tempCollisionBox).anchorPointX=c.anchorPoint.x,_.anchorPointY=c.anchorPoint.y,_.x1=Math.min(M.x,k.x,A.x,T.x),_.y1=Math.min(M.y,k.x,A.x,T.x),_.x2=Math.max(M.x,k.x,A.x,T.x),_.y2=Math.max(M.y,k.x,A.x,T.x),_.maxScale=c.maxScale}else _=c;for(var S=0;S=this.maxScale)return a}}}return a},n.prototype.queryRenderedSymbols=function(t,e,r,n,a){var o={},s=[],l=this.collisionBoxArray,c=this.rotationMatrix,u=new i(t,e)._matMult(c),f=this.tempCollisionBox;f.anchorX=u.x,f.anchorY=u.y,f.x1=0,f.y1=0,f.x2=r-t,f.y2=n-e,f.maxScale=a,a=f.maxScale;for(var h=[u.x+f.x1/a,u.y+f.y1/a*this.yStretch,u.x+f.x2/a,u.y+f.y2/a*this.yStretch],d=this.grid.query(h[0],h[1],h[2],h[3]),p=this.ignoredGrid.query(h[0],h[1],h[2],h[3]),m=0;m=a&&(o[y][x]=!0,s.push(d[g]))}}return s},n.prototype.getPlacementScale=function(t,e,r,n,i){var a=e.x-n.x,o=e.y-n.y,s=(i.x1-r.x2)/a,l=(i.x2-r.x1)/a,c=(i.y1-r.y2)*this.yStretch/o,u=(i.y2-r.y1)*this.yStretch/o;(isNaN(s)||isNaN(l))&&(s=l=1),(isNaN(c)||isNaN(u))&&(c=u=1);var f=Math.min(Math.max(s,l),Math.max(c,u)),h=i.maxScale,d=r.maxScale;return f>h&&(f=h),f>d&&(f=d),f>t&&f>=i.placementScale&&(t=f),t},n.prototype.insertCollisionFeature=function(t,e,r){for(var n=r?this.ignoredGrid:this.grid,i=this.collisionBoxArray,a=t.boxStartIndex;a=0&&A=0&&T=0&&v+d<=p){var S=new a(A,T,M,x)._round();s&&!o(t,S,c,s,l)||y.push(S)}}g+=w}return f||y.length||u||(y=n(t,g/2,r,s,l,c,u,!0,h)),y}var i=t("../util/interpolate"),a=t("../symbol/anchor"),o=t("./check_max_angle");e.exports=function(t,e,r,i,a,o,s,l,c){var u=i?.6*o*s:0,f=Math.max(i?i.right-i.left:0,a?a.right-a.left:0),h=0===t[0].x||t[0].x===c||0===t[0].y||t[0].y===c;return e-f*s=2048||e>=2048)){this.texture&&(this.gl&&this.gl.deleteTexture(this.texture),this.texture=null),this.width*=4,this.height*=4,this.bin.resize(this.width,this.height);for(var r=new ArrayBuffer(this.width*this.height),n=0;n65535)return r("glyphs > 65535 not supported");void 0===this.loading[t]&&(this.loading[t]={});var n=this.loading[t];if(n[e])n[e].push(r);else{n[e]=[r];var i=function(t,e,r,n){return n=n||"abc",r.replace("{s}",n[t.length%n.length]).replace("{fontstack}",t).replace("{range}",e)}(t,256*e+"-"+(256*e+255),this.url);o(i,function(t,r){for(var i=!t&&new s(new c(new Uint8Array(r))),a=0;an&&null!==f){var x=g[f+1].x;m=Math.max(x,m);for(var b=f+1;b<=v;b++)g[b].y+=r,g[b].x-=x;if(c){var _=f;a[g[f].codePoint]&&_--,i(g,e,d,_,c)}d=f+1,f=null,h+=x,p++}o[y.codePoint]&&(f=v)}var w=g[g.length-1],M=w.x+e[w.codePoint].advance;m=Math.max(m,M);var k=(p+1)*r;i(g,e,d,g.length-1,c),function(t,e,r,n,i,a,o,s){for(var l=(e-r)*i+s[0],c=(-n*(o+1)+.5)*a+s[1],u=0;u1?2:1,this.canvas&&(this.canvas.width=this.width*this.pixelRatio,this.canvas.height=this.height*this.pixelRatio)),this.sprite=t},n.prototype.addIcons=function(t,e){for(var r=0;r1||(f?(clearTimeout(f),f=null,o("dblclick",e)):f=setTimeout(r,300))},!1),l.addEventListener("touchend",function(t){s("touchend",t)},!1),l.addEventListener("touchmove",function(t){s("touchmove",t)},!1),l.addEventListener("touchcancel",function(t){s("touchcancel",t)},!1),l.addEventListener("click",function(t){n.mousePos(l,t).equals(u)&&o("click",t)},!1),l.addEventListener("dblclick",function(t){o("dblclick",t),t.preventDefault()},!1),l.addEventListener("contextmenu",function(t){c=t,t.preventDefault()},!1)}},{"../util/dom":419,"./handler/box_zoom":404,"./handler/dblclick_zoom":405,"./handler/drag_pan":406,"./handler/drag_rotate":407,"./handler/keyboard":408,"./handler/scroll_zoom":409,"./handler/touch_zoom_rotate":410,"point-geometry":477}],399:[function(t,e,r){"use strict";var n=t("../util/util"),i=t("../util/interpolate"),a=t("../util/browser"),o=t("../geo/lng_lat"),s=t("../geo/lng_lat_bounds"),l=t("point-geometry"),c=e.exports=function(){};n.extend(c.prototype,{getCenter:function(){return this.transform.center},setCenter:function(t,e){return this.jumpTo({center:t},e),this},panBy:function(t,e,r){return this.panTo(this.transform.center,n.extend({offset:l.convert(t).mult(-1)},e),r),this},panTo:function(t,e,r){return this.easeTo(n.extend({center:t},e),r)},getZoom:function(){return this.transform.zoom},setZoom:function(t,e){return this.jumpTo({zoom:t},e),this},zoomTo:function(t,e,r){return this.easeTo(n.extend({zoom:t},e),r)},zoomIn:function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},zoomOut:function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},getBearing:function(){return this.transform.bearing},setBearing:function(t,e){return this.jumpTo({bearing:t},e),this},rotateTo:function(t,e,r){return this.easeTo(n.extend({bearing:t},e),r)},resetNorth:function(t,e){return this.rotateTo(0,n.extend({duration:1e3},t),e),this},snapToNorth:function(t,e){return Math.abs(this.getBearing())180&&(c.center.lng>0&&p.lng<0?p.lng+=360:c.center.lng<0&&p.lng>0&&(p.lng-=360));var y=c.zoomScale(m-f),x=c.point,b="center"in t?c.project(p).sub(u.div(y)):x,_=c.worldSize,w=t.curve,M=Math.max(c.width,c.height),k=M/y,A=b.sub(x).mag();if("minZoom"in t){var T=n.clamp(Math.min(t.minZoom,f,m),c.minZoom,c.maxZoom),S=M/c.zoomScale(T-f);w=Math.sqrt(S/A*2)}var E=w*w,L=r(0),C=function(t){return s(L)/s(L+w*t)},z=function(t){return M*((s(L)*function(t){return a(t)/s(t)}(L+w*t)-a(L))/E)/A},D=(r(1)-L)/w;if(Math.abs(A)<1e-6){if(Math.abs(M-k)<1e-6)return this.easeTo(t);var I=k=0)return!1;return!0})).join(" | ")},n.prototype=o.inherit(i,{options:{position:"bottom-right"},onAdd:function(t){var e=this._container=a.create("div","mapboxgl-ctrl-attrib",t.getContainer());return this._update(),t.on("source.load",this._update.bind(this)),t.on("source.change",this._update.bind(this)),t.on("source.remove",this._update.bind(this)),t.on("moveend",this._updateEditLink.bind(this)),e},_update:function(){this._map.style&&(this._container.innerHTML=n.createAttributionString(this._map.style.sources)),this._editLink=this._container.getElementsByClassName("mapbox-improve-map")[0],this._updateEditLink()},_updateEditLink:function(){if(this._editLink){var t=this._map.getCenter();this._editLink.href="https://www.mapbox.com/map-feedback/#/"+t.lng+"/"+t.lat+"/"+Math.round(this._map.getZoom()+1)}}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],401:[function(t,e,r){"use strict";function n(){}var i=t("../../util/util"),a=t("../../util/evented");e.exports=n,n.prototype={addTo:function(t){this._map=t;var e=this._container=this.onAdd(t);if(this.options&&this.options.position){var r=this.options.position,n=t._controlCorners[r];e.className+=" mapboxgl-ctrl",-1!==r.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e)}return this},remove:function(){return this._container.parentNode.removeChild(this._container),this.onRemove&&this.onRemove(this._map),this._map=null,this}},i.extend(n.prototype,a)},{"../../util/evented":425,"../../util/util":433}],402:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}var i=t("./control"),a=t("../../util/browser"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n;var l={enableHighAccuracy:!1,timeout:6e3};n.prototype=s.inherit(i,{options:{position:"top-right"},onAdd:function(t){var e=this._container=o.create("div","mapboxgl-ctrl-group",t.getContainer());return a.supportsGeolocation?(this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._geolocateButton=o.create("button","mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",this._container),this._geolocateButton.type="button",this._geolocateButton.addEventListener("click",this._onClickGeolocate.bind(this)),e):e},_onContextMenu:function(t){t.preventDefault()},_onClickGeolocate:function(){navigator.geolocation.getCurrentPosition(this._success.bind(this),this._error.bind(this),l),this._timeoutId=setTimeout(this._finish.bind(this),1e4)},_success:function(t){this._map.jumpTo({center:[t.coords.longitude,t.coords.latitude],zoom:17,bearing:0,pitch:0}),this.fire("geolocate",t),this._finish()},_error:function(t){this.fire("error",t),this._finish()},_finish:function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}})},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433,"./control":401}],403:[function(t,e,r){"use strict";function n(t){s.setOptions(this,t)}function i(t){return new MouseEvent(t.type,{button:2,buttons:2,bubbles:!0,cancelable:!0,detail:t.detail,view:t.view,screenX:t.screenX,screenY:t.screenY,clientX:t.clientX,clientY:t.clientY,movementX:t.movementX,movementY:t.movementY,ctrlKey:t.ctrlKey,shiftKey:t.shiftKey,altKey:t.altKey,metaKey:t.metaKey})}var a=t("./control"),o=t("../../util/dom"),s=t("../../util/util");e.exports=n,n.prototype=s.inherit(a,{options:{position:"top-right"},onAdd:function(t){var e="mapboxgl-ctrl",r=this._container=o.create("div",e+"-group",t.getContainer());return this._container.addEventListener("contextmenu",this._onContextMenu.bind(this)),this._zoomInButton=this._createButton(e+"-icon "+e+"-zoom-in",t.zoomIn.bind(t)),this._zoomOutButton=this._createButton(e+"-icon "+e+"-zoom-out",t.zoomOut.bind(t)),this._compass=this._createButton(e+"-icon "+e+"-compass",t.resetNorth.bind(t)),this._compassArrow=o.create("div","arrow",this._compass),this._compass.addEventListener("mousedown",this._onCompassDown.bind(this)),this._onCompassMove=this._onCompassMove.bind(this),this._onCompassUp=this._onCompassUp.bind(this),t.on("rotate",this._rotateCompassArrow.bind(this)),this._rotateCompassArrow(),this._el=t.getCanvasContainer(),r},_onContextMenu:function(t){t.preventDefault()},_onCompassDown:function(t){0===t.button&&(o.disableDrag(),document.addEventListener("mousemove",this._onCompassMove),document.addEventListener("mouseup",this._onCompassUp),this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassMove:function(t){0===t.button&&(this._el.dispatchEvent(i(t)),t.stopPropagation())},_onCompassUp:function(t){0===t.button&&(document.removeEventListener("mousemove",this._onCompassMove),document.removeEventListener("mouseup",this._onCompassUp),o.enableDrag(),this._el.dispatchEvent(i(t)),t.stopPropagation())},_createButton:function(t,e){var r=o.create("button",t,this._container);return r.type="button",r.addEventListener("click",function(){e()}),r},_rotateCompassArrow:function(){var t="rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassArrow.style.transform=t}})},{"../../util/dom":419,"../../util/util":433,"./control":401}],404:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../geo/lng_lat_bounds"),o=t("../../util/util");e.exports=n,n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onMouseDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onMouseDown),this._enabled=!1)},_onMouseDown:function(t){t.shiftKey&&0===t.button&&(document.addEventListener("mousemove",this._onMouseMove,!1),document.addEventListener("keydown",this._onKeyDown,!1),document.addEventListener("mouseup",this._onMouseUp,!1),i.disableDrag(),this._startPos=i.mousePos(this._el,t),this._active=!0)},_onMouseMove:function(t){var e=this._startPos,r=i.mousePos(this._el,t);this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var n=Math.min(e.x,r.x),a=Math.max(e.x,r.x),o=Math.min(e.y,r.y),s=Math.max(e.y,r.y);i.setTransform(this._box,"translate("+n+"px,"+o+"px)"),this._box.style.width=a-n+"px",this._box.style.height=s-o+"px"},_onMouseUp:function(t){if(0===t.button){var e=this._startPos,r=i.mousePos(this._el,t),n=new a(this._map.unproject(e),this._map.unproject(r));this._finish(),e.x===r.x&&e.y===r.y?this._fireEvent("boxzoomcancel",t):this._map.fitBounds(n,{linear:!0}).fire("boxzoomend",{originalEvent:t,boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._fireEvent("boxzoomcancel",t))},_finish:function(){this._active=!1,document.removeEventListener("mousemove",this._onMouseMove,!1),document.removeEventListener("keydown",this._onKeyDown,!1),document.removeEventListener("mouseup",this._onMouseUp,!1),this._container.classList.remove("mapboxgl-crosshair"),this._box&&(this._box.parentNode.removeChild(this._box),this._box=null),i.enableDrag()},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})}}},{"../../geo/lng_lat_bounds":331,"../../util/dom":419,"../../util/util":433}],405:[function(t,e,r){"use strict";function n(t){this._map=t,this._onDblClick=this._onDblClick.bind(this)}e.exports=n,n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._map.on("dblclick",this._onDblClick),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._map.off("dblclick",this._onDblClick),this._enabled=!1)},_onDblClick:function(t){this._map.zoomTo(this._map.getZoom()+(t.originalEvent.shiftKey?-1:1),{around:t.lngLat},t)}}},{}],406:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.3,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._el.addEventListener("touchstart",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._el.removeEventListener("touchstart",this._onDown),this._enabled=!1)},_onDown:function(t){this._ignoreEvent(t)||this.isActive()||(t.touches?(document.addEventListener("touchmove",this._onMove),document.addEventListener("touchend",this._onTouchEnd)):(document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onMouseUp)),this._active=!1,this._startPos=this._pos=i.mousePos(this._el,t),this._inertia=[[Date.now(),this._pos]])},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("dragstart",t),this._fireEvent("movestart",t));var e=i.mousePos(this._el,t),r=this._map;r.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),e]),r.transform.setLocationAtPoint(r.transform.pointLocation(this._pos),e),this._fireEvent("drag",t),this._fireEvent("move",t),this._pos=e,t.preventDefault()}},_onUp:function(t){if(this.isActive()){this._active=!1,this._fireEvent("dragend",t),this._drainInertiaBuffer();var e=function(){this._fireEvent("moveend",t)}.bind(this),r=this._inertia;if(r.length<2)e();else{var n=r[r.length-1],i=r[0],a=n[1].sub(i[1]),s=(n[0]-i[0])/1e3;if(0===s||n[1].equals(i[1]))e();else{var l=a.mult(.3/s),c=l.mag();c>1400&&(c=1400,l._unit()._mult(c));var u=c/750,f=l.mult(-u/2);this._map.panBy(f,{duration:1e3*u,easing:o,noMoveStart:!0},{originalEvent:t})}}}},_onMouseUp:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onMouseUp))},_onTouchEnd:function(t){this._ignoreEvent(t)||(this._onUp(t),document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onTouchEnd))},_fireEvent:function(t,e){return this._map.fire(t,{originalEvent:e})},_ignoreEvent:function(t){var e=this._map;if(e.boxZoom&&e.boxZoom.isActive())return!0;if(e.dragRotate&&e.dragRotate.isActive())return!0;if(t.touches)return t.touches.length>1;if(t.ctrlKey)return!0;return"mousemove"===t.type?!1&t.buttons:0!==t.button},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],407:[function(t,e,r){"use strict";function n(t,e){this._map=t,this._el=t.getCanvasContainer(),this._bearingSnap=e.bearingSnap,o.bindHandlers(this)}var i=t("../../util/dom"),a=t("point-geometry"),o=t("../../util/util");e.exports=n;var s=o.bezier(0,0,.25,1);n.prototype={_enabled:!1,_active:!1,isEnabled:function(){return this._enabled},isActive:function(){return this._active},enable:function(){this.isEnabled()||(this._el.addEventListener("mousedown",this._onDown),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("mousedown",this._onDown),this._enabled=!1)},_onDown:function(t){if(!this._ignoreEvent(t)&&!this.isActive()){document.addEventListener("mousemove",this._onMove),document.addEventListener("mouseup",this._onUp),this._active=!1,this._inertia=[[Date.now(),this._map.getBearing()]],this._startPos=this._pos=i.mousePos(this._el,t),this._center=this._map.transform.centerPoint;var e=this._startPos.sub(this._center);e.mag()<200&&(this._center=this._startPos.add(new a(-200,0)._rotate(e.angle()))),t.preventDefault()}},_onMove:function(t){if(!this._ignoreEvent(t)){this.isActive()||(this._active=!0,this._fireEvent("rotatestart",t),this._fireEvent("movestart",t));var e=this._map;e.stop();var r=this._pos,n=i.mousePos(this._el,t),a=this._center,o=r.sub(a).angleWith(n.sub(a))/Math.PI*180,s=e.getBearing()-o,l=this._inertia,c=l[l.length-1];this._drainInertiaBuffer(),l.push([Date.now(),e._normalizeBearing(s,c[1])]),e.transform.bearing=s,this._fireEvent("rotate",t),this._fireEvent("move",t),this._pos=n}},_onUp:function(t){if(!this._ignoreEvent(t)&&(document.removeEventListener("mousemove",this._onMove),document.removeEventListener("mouseup",this._onUp),this.isActive())){this._active=!1,this._fireEvent("rotateend",t),this._drainInertiaBuffer();var e=this._map,r=e.getBearing(),n=this._inertia,i=function(){Math.abs(r)180&&(d=180);var p=d/180;c+=f*d*(p/2),Math.abs(e._normalizeBearing(c,0))1;var r=t.ctrlKey?1:2,n=t.ctrlKey?0:2;return"mousemove"===t.type?t.buttons&0===r:t.button!==n},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>0&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433,"point-geometry":477}],408:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),this._onKeyDown=this._onKeyDown.bind(this)}e.exports=n;n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("keydown",this._onKeyDown,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("keydown",this._onKeyDown),this._enabled=!1)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e=this._map,r={originalEvent:t};if(!e.isEasing())switch(t.keyCode){case 61:case 107:case 171:case 187:e.zoomTo(Math.round(e.getZoom())+(t.shiftKey?2:1),r);break;case 189:case 109:case 173:e.zoomTo(Math.round(e.getZoom())-(t.shiftKey?2:1),r);break;case 37:t.shiftKey?e.easeTo({bearing:e.getBearing()-2},r):(t.preventDefault(),e.panBy([-80,0],r));break;case 39:t.shiftKey?e.easeTo({bearing:e.getBearing()+2},r):(t.preventDefault(),e.panBy([80,0],r));break;case 38:t.shiftKey?e.easeTo({pitch:e.getPitch()+5},r):(t.preventDefault(),e.panBy([0,-80],r));break;case 40:t.shiftKey?e.easeTo({pitch:Math.max(e.getPitch()-5,0)},r):(t.preventDefault(),e.panBy([0,80],r))}}}}},{}],409:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),o.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/browser"),o=t("../../util/util");e.exports=n;var s="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",l=-1!==s.indexOf("firefox"),c=-1!==s.indexOf("safari")&&-1===s.indexOf("chrom");n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("wheel",this._onWheel,!1),this._el.addEventListener("mousewheel",this._onWheel,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("wheel",this._onWheel),this._el.removeEventListener("mousewheel",this._onWheel),this._enabled=!1)},_onWheel:function(t){var e;"wheel"===t.type?(e=t.deltaY,l&&t.deltaMode===window.WheelEvent.DOM_DELTA_PIXEL&&(e/=a.devicePixelRatio),t.deltaMode===window.WheelEvent.DOM_DELTA_LINE&&(e*=40)):"mousewheel"===t.type&&(e=-t.wheelDeltaY,c&&(e/=3));var r=a.now(),n=r-(this._time||0);this._pos=i.mousePos(this._el,t),this._time=r,0!==e&&e%4.000244140625==0?(this._type="wheel",e=Math.floor(e/4)):0!==e&&Math.abs(e)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40)):this._type||(this._type=Math.abs(n*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&this._zoom(-e,t),t.preventDefault()},_onTimeout:function(){this._type="wheel",this._zoom(-this._lastValue)},_zoom:function(t,e){if(0!==t){var r=this._map,n=2/(1+Math.exp(-Math.abs(t/100)));t<0&&0!==n&&(n=1/n);var i=r.ease?r.ease.to:r.transform.scale,a=r.transform.scaleZoom(i*n);r.zoomTo(a,{duration:0,around:r.unproject(this._pos),delayEndEvents:200},{originalEvent:e})}}}},{"../../util/browser":417,"../../util/dom":419,"../../util/util":433}],410:[function(t,e,r){"use strict";function n(t){this._map=t,this._el=t.getCanvasContainer(),a.bindHandlers(this)}var i=t("../../util/dom"),a=t("../../util/util");e.exports=n;var o=a.bezier(0,0,.15,1);n.prototype={_enabled:!1,isEnabled:function(){return this._enabled},enable:function(){this.isEnabled()||(this._el.addEventListener("touchstart",this._onStart,!1),this._enabled=!0)},disable:function(){this.isEnabled()&&(this._el.removeEventListener("touchstart",this._onStart),this._enabled=!1)},disableRotation:function(){this._rotationDisabled=!0},enableRotation:function(){this._rotationDisabled=!1},_onStart:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]);this._startVec=e.sub(r),this._startScale=this._map.transform.scale,this._startBearing=this._map.transform.bearing,this._gestureIntent=void 0,this._inertia=[],document.addEventListener("touchmove",this._onMove,!1),document.addEventListener("touchend",this._onEnd,!1)}},_onMove:function(t){if(2===t.touches.length){var e=i.mousePos(this._el,t.touches[0]),r=i.mousePos(this._el,t.touches[1]),n=e.add(r).div(2),a=e.sub(r),o=a.mag()/this._startVec.mag(),s=this._rotationDisabled?0:180*a.angleWith(this._startVec)/Math.PI,l=this._map;if(this._gestureIntent){var c={duration:0,around:l.unproject(n)};"rotate"===this._gestureIntent&&(c.bearing=this._startBearing+s),"zoom"!==this._gestureIntent&&"rotate"!==this._gestureIntent||(c.zoom=l.transform.scaleZoom(this._startScale*o)),l.stop(),this._drainInertiaBuffer(),this._inertia.push([Date.now(),o,n]),l.easeTo(c,{originalEvent:t})}else{var u=Math.abs(1-o)>.15;Math.abs(s)>4?this._gestureIntent="rotate":u&&(this._gestureIntent="zoom"),this._gestureIntent&&(this._startVec=a,this._startScale=l.transform.scale,this._startBearing=l.transform.bearing)}t.preventDefault()}},_onEnd:function(t){document.removeEventListener("touchmove",this._onMove),document.removeEventListener("touchend",this._onEnd),this._drainInertiaBuffer();var e=this._inertia,r=this._map;if(e.length<2)r.snapToNorth({},{originalEvent:t});else{var n=e[e.length-1],i=e[0],a=r.transform.scaleZoom(this._startScale*n[1]),s=r.transform.scaleZoom(this._startScale*i[1]),l=a-s,c=(n[0]-i[0])/1e3,u=n[2];if(0!==c&&a!==s){var f=.15*l/c;Math.abs(f)>2.5&&(f=f>0?2.5:-2.5);var h=1e3*Math.abs(f/(12*.15)),d=a+f*h/2e3;d<0&&(d=0),r.easeTo({zoom:d,duration:h,easing:o,around:r.unproject(u)},{originalEvent:t})}else r.snapToNorth({},{originalEvent:t})}},_drainInertiaBuffer:function(){for(var t=this._inertia,e=Date.now();t.length>2&&e-t[0][0]>160;)t.shift()}}},{"../../util/dom":419,"../../util/util":433}],411:[function(t,e,r){"use strict";function n(){i.bindAll(["_onHashChange","_updateHash"],this)}e.exports=n;var i=t("../util/util");n.prototype={addTo:function(t){return this._map=t,window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},remove:function(){return window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),delete this._map,this},_onHashChange:function(){var t=location.hash.replace("#","").split("/");return t.length>=3&&(this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:+(t[3]||0)}),!0)},_updateHash:function(){var t=this._map.getCenter(),e=this._map.getZoom(),r=this._map.getBearing(),n=Math.max(0,Math.ceil(Math.log(e)/Math.LN2)),i="#"+Math.round(100*e)/100+"/"+t.lat.toFixed(n)+"/"+t.lng.toFixed(n)+(r?"/"+Math.round(10*r)/10:"");window.history.replaceState("","",i)}}},{"../util/util":433}],412:[function(t,e,r){"use strict";function n(t){t.parentNode&&t.parentNode.removeChild(t)}var i=t("../util/canvas"),a=t("../util/util"),o=t("../util/browser"),s=t("../util/browser").window,l=t("../util/evented"),c=t("../util/dom"),u=t("../style/style"),f=t("../style/animation_loop"),h=t("../render/painter"),d=t("../geo/transform"),p=t("./hash"),m=t("./bind_handlers"),g=t("./camera"),v=t("../geo/lng_lat"),y=t("../geo/lng_lat_bounds"),x=t("point-geometry"),b=t("./control/attribution"),_={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:0,maxZoom:20,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,bearingSnap:7,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,workerCount:Math.max(o.hardwareConcurrency-1,1)},w=e.exports=function(t){if((t=a.extend({},_,t)).workerCount<1)throw new Error("workerCount must an integer greater than or equal to 1.");this._interactive=t.interactive,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._trackResize=t.trackResize,this._workerCount=t.workerCount,this._bearingSnap=t.bearingSnap,"string"==typeof t.container?this._container=document.getElementById(t.container):this._container=t.container,this.animationLoop=new f,this.transform=new d(t.minZoom,t.maxZoom),t.maxBounds&&this.setMaxBounds(t.maxBounds),a.bindAll(["_forwardStyleEvent","_forwardSourceEvent","_forwardLayerEvent","_forwardTileEvent","_onStyleLoad","_onStyleChange","_onSourceAdd","_onSourceRemove","_onSourceUpdate","_onWindowOnline","_onWindowResize","_update","_render"],this),this._setupContainer(),this._setupPainter(),this.on("move",this._update.bind(this,!1)),this.on("zoom",this._update.bind(this,!0)),this.on("moveend",function(){this.animationLoop.set(300),this._rerender()}.bind(this)),void 0!==s&&(s.addEventListener("online",this._onWindowOnline,!1),s.addEventListener("resize",this._onWindowResize,!1)),m(this,t),this._hash=t.hash&&(new p).addTo(this),this._hash&&this._hash._onHashChange()||this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),this.stacks={},this._classes=[],this.resize(),t.classes&&this.setClasses(t.classes),t.style&&this.setStyle(t.style),t.attributionControl&&this.addControl(new b(t.attributionControl));var e=this.fire.bind(this,"error");this.on("style.error",e),this.on("source.error",e),this.on("tile.error",e),this.on("layer.error",e)};a.extend(w.prototype,l),a.extend(w.prototype,g.prototype),a.extend(w.prototype,{addControl:function(t){return t.addTo(this),this},addClass:function(t,e){return this._classes.indexOf(t)>=0||""===t?this:(this._classes.push(t),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},removeClass:function(t,e){var r=this._classes.indexOf(t);return r<0||""===t?this:(this._classes.splice(r,1),this._classOptions=e,this.style&&this.style.updateClasses(),this._update(!0))},setClasses:function(t,e){for(var r={},n=0;n=0},getClasses:function(){return this._classes},resize:function(){var t=0,e=0;return this._container&&(t=this._container.offsetWidth||400,e=this._container.offsetHeight||300),this._canvas.resize(t,e),this.transform.resize(t,e),this.painter.resize(t,e),this.fire("movestart").fire("move").fire("resize").fire("moveend")},getBounds:function(){var t=new y(this.transform.pointLocation(new x(0,0)),this.transform.pointLocation(this.transform.size));return(this.transform.angle||this.transform.pitch)&&(t.extend(this.transform.pointLocation(new x(this.transform.size.x,0))),t.extend(this.transform.pointLocation(new x(0,this.transform.size.y)))),t},setMaxBounds:function(t){if(t){var e=y.convert(t);this.transform.lngRange=[e.getWest(),e.getEast()],this.transform.latRange=[e.getSouth(),e.getNorth()],this.transform._constrain(),this._update()}else null!==t&&void 0!==t||(this.transform.lngRange=[],this.transform.latRange=[],this._update());return this},setMinZoom:function(t){if((t=null===t||void 0===t?0:t)>=0&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()=this.transform.minZoom&&t<=20)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be between the current minZoom and 20, inclusive")},project:function(t){return this.transform.locationPoint(v.convert(t))},unproject:function(t){return this.transform.pointLocation(x.convert(t))},queryRenderedFeatures:function(){var t,e={};return 2===arguments.length?(t=arguments[0],e=arguments[1]):1===arguments.length&&function(t){return t instanceof x||Array.isArray(t)}(arguments[0])?t=arguments[0]:1===arguments.length&&(e=arguments[0]),this.style.queryRenderedFeatures(this._makeQueryGeometry(t),e,this.transform.zoom,this.transform.angle)},_makeQueryGeometry:function(t){void 0===t&&(t=[x.convert([0,0]),x.convert([this.transform.width,this.transform.height])]);var e;if(t instanceof x||"number"==typeof t[0]){e=[x.convert(t)]}else{var r=[x.convert(t[0]),x.convert(t[1])];e=[r[0],new x(r[1].x,r[0].y),r[1],new x(r[0].x,r[1].y),r[0]]}return e=e.map(function(t){return this.transform.pointCoordinate(t)}.bind(this))},querySourceFeatures:function(t,e){return this.style.querySourceFeatures(t,e)},setStyle:function(t){return this.style&&(this.style.off("load",this._onStyleLoad).off("error",this._forwardStyleEvent).off("change",this._onStyleChange).off("source.add",this._onSourceAdd).off("source.remove",this._onSourceRemove).off("source.load",this._onSourceUpdate).off("source.error",this._forwardSourceEvent).off("source.change",this._onSourceUpdate).off("layer.add",this._forwardLayerEvent).off("layer.remove",this._forwardLayerEvent).off("layer.error",this._forwardLayerEvent).off("tile.add",this._forwardTileEvent).off("tile.remove",this._forwardTileEvent).off("tile.load",this._update).off("tile.error",this._forwardTileEvent).off("tile.stats",this._forwardTileEvent)._remove(),this.off("rotate",this.style._redoPlacement),this.off("pitch",this.style._redoPlacement)),t?(this.style=t instanceof u?t:new u(t,this.animationLoop,this._workerCount),this.style.on("load",this._onStyleLoad).on("error",this._forwardStyleEvent).on("change",this._onStyleChange).on("source.add",this._onSourceAdd).on("source.remove",this._onSourceRemove).on("source.load",this._onSourceUpdate).on("source.error",this._forwardSourceEvent).on("source.change",this._onSourceUpdate).on("layer.add",this._forwardLayerEvent).on("layer.remove",this._forwardLayerEvent).on("layer.error",this._forwardLayerEvent).on("tile.add",this._forwardTileEvent).on("tile.remove",this._forwardTileEvent).on("tile.load",this._update).on("tile.error",this._forwardTileEvent).on("tile.stats",this._forwardTileEvent),this.on("rotate",this.style._redoPlacement),this.on("pitch",this.style._redoPlacement),this):(this.style=null,this)},getStyle:function(){if(this.style)return this.style.serialize()},addSource:function(t,e){return this.style.addSource(t,e),this._update(!0),this},addSourceType:function(t,e,r){return this.style.addSourceType(t,e,r)},removeSource:function(t){return this.style.removeSource(t),this._update(!0),this},getSource:function(t){return this.style.getSource(t)},addLayer:function(t,e){return this.style.addLayer(t,e),this._update(!0),this},removeLayer:function(t){return this.style.removeLayer(t),this._update(!0),this},getLayer:function(t){return this.style.getLayer(t)},setFilter:function(t,e){return this.style.setFilter(t,e),this._update(!0),this},setLayerZoomRange:function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0),this},getFilter:function(t){return this.style.getFilter(t)},setPaintProperty:function(t,e,r,n){return this.style.setPaintProperty(t,e,r,n),this._update(!0),this},getPaintProperty:function(t,e,r){return this.style.getPaintProperty(t,e,r)},setLayoutProperty:function(t,e,r){return this.style.setLayoutProperty(t,e,r),this._update(!0),this},getLayoutProperty:function(t,e){return this.style.getLayoutProperty(t,e)},getContainer:function(){return this._container},getCanvasContainer:function(){return this._canvasContainer},getCanvas:function(){return this._canvas.getElement()},_setupContainer:function(){var t=this._container;t.classList.add("mapboxgl-map");var e=this._canvasContainer=c.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=new i(this,e);var r=this._controlContainer=c.create("div","mapboxgl-control-container",t),n=this._controlCorners={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(t){n[t]=c.create("div","mapboxgl-ctrl-"+t,r)})},_setupPainter:function(){var t=this._canvas.getWebGLContext({failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer});t?this.painter=new h(t,this.transform):this.fire("error",{error:new Error("Failed to initialize WebGL")})},_contextLost:function(t){t.preventDefault(),this._frameId&&o.cancelFrame(this._frameId),this.fire("webglcontextlost",{originalEvent:t})},_contextRestored:function(t){this._setupPainter(),this.resize(),this._update(),this.fire("webglcontextrestored",{originalEvent:t})},loaded:function(){return!this._styleDirty&&!this._sourcesDirty&&!(!this.style||!this.style.loaded())},_update:function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this._rerender(),this):this},_render:function(){try{this.style&&this._styleDirty&&(this._styleDirty=!1,this.style.update(this._classes,this._classOptions),this._classOptions=null,this.style._recalculate(this.transform.zoom)),this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.painter.render(this.style,{debug:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,vertices:this.vertices,rotating:this.rotating,zooming:this.zooming}),this.fire("render"),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire("load")),this._frameId=null,this.animationLoop.stopped()||(this._styleDirty=!0),(this._sourcesDirty||this._repaint||this._styleDirty)&&this._rerender()}catch(t){this.fire("error",{error:t})}return this},remove:function(){this._hash&&this._hash.remove(),o.cancelFrame(this._frameId),this.setStyle(null),void 0!==s&&s.removeEventListener("resize",this._onWindowResize,!1);var t=this.painter.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),n(this._canvasContainer),n(this._controlContainer),this._container.classList.remove("mapboxgl-map")},_rerender:function(){this.style&&!this._frameId&&(this._frameId=o.frame(this._render))},_forwardStyleEvent:function(t){this.fire("style."+t.type,a.extend({style:t.target},t))},_forwardSourceEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardLayerEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_forwardTileEvent:function(t){this.fire(t.type,a.extend({style:t.target},t))},_onStyleLoad:function(t){this.transform.unmodified&&this.jumpTo(this.style.stylesheet),this.style.update(this._classes,{transition:!1}),this._forwardStyleEvent(t)},_onStyleChange:function(t){this._update(!0),this._forwardStyleEvent(t)},_onSourceAdd:function(t){var e=t.source;e.onAdd&&e.onAdd(this),this._forwardSourceEvent(t)},_onSourceRemove:function(t){var e=t.source;e.onRemove&&e.onRemove(this),this._forwardSourceEvent(t)},_onSourceUpdate:function(t){this._update(),this._forwardSourceEvent(t)},_onWindowOnline:function(){this._update()},_onWindowResize:function(){this._trackResize&&this.stop().resize()._update()}}),a.extendAll(w.prototype,{_showTileBoundaries:!1,get showTileBoundaries(){return this._showTileBoundaries},set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},_showCollisionBoxes:!1,get showCollisionBoxes(){return this._showCollisionBoxes},set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,this.style._redoPlacement())},_showOverdrawInspector:!1,get showOverdrawInspector(){return this._showOverdrawInspector},set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},_repaint:!1,get repaint(){return this._repaint},set repaint(t){this._repaint=t,this._update()},_vertices:!1,get vertices(){return this._vertices},set vertices(t){this._vertices=t,this._update()}})},{"../geo/lng_lat":330,"../geo/lng_lat_bounds":331,"../geo/transform":332,"../render/painter":346,"../style/animation_loop":366,"../style/style":369,"../util/browser":417,"../util/canvas":418,"../util/dom":419,"../util/evented":425,"../util/util":433,"./bind_handlers":398,"./camera":399,"./control/attribution":400,"./hash":411,"point-geometry":477}],413:[function(t,e,r){"use strict";function n(t,e){t||(t=i.create("div")),t.classList.add("mapboxgl-marker"),this._el=t,this._offset=o.convert(e&&e.offset||[0,0]),this._update=this._update.bind(this)}e.exports=n;var i=t("../util/dom"),a=t("../geo/lng_lat"),o=t("point-geometry");n.prototype={addTo:function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._el),t.on("move",this._update),this._update(),this},remove:function(){this._map&&(this._map.off("move",this._update),this._map=null);var t=this._el.parentNode;return t&&t.removeChild(this._el),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=a.convert(t),this._update(),this},getElement:function(){return this._el},_update:function(){if(this._map){var t=this._map.project(this._lngLat)._add(this._offset);i.setTransform(this._el,"translate("+t.x+"px,"+t.y+"px)")}}}},{"../geo/lng_lat":330,"../util/dom":419,"point-geometry":477}],414:[function(t,e,r){"use strict";function n(t){i.setOptions(this,t),i.bindAll(["_update","_onClickClose"],this)}e.exports=n;var i=t("../util/util"),a=t("../util/evented"),o=t("../util/dom"),s=t("../geo/lng_lat");n.prototype=i.inherit(a,{options:{closeButton:!0,closeOnClick:!0},addTo:function(t){return this._map=t,this._map.on("move",this._update),this.options.closeOnClick&&this._map.on("click",this._onClickClose),this._update(),this},remove:function(){return this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._container&&(this._container.parentNode.removeChild(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("click",this._onClickClose),delete this._map),this.fire("close"),this},getLngLat:function(){return this._lngLat},setLngLat:function(t){return this._lngLat=s.convert(t),this._update(),this},setText:function(t){return this.setDOMContent(document.createTextNode(t))},setHTML:function(t){var e,r=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)r.appendChild(e);return this.setDOMContent(r)},setDOMContent:function(t){return this._createContent(),this._content.appendChild(t),this._update(),this},_createContent:function(){this._content&&this._content.parentNode&&this._content.parentNode.removeChild(this._content),this._content=o.create("div","mapboxgl-popup-content",this._container),this.options.closeButton&&(this._closeButton=o.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClickClose))},_update:function(){if(this._map&&this._lngLat&&this._content){this._container||(this._container=o.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content));var t=this._map.project(this._lngLat).round(),e=this.options.anchor;if(!e){var r=this._container.offsetWidth,n=this._container.offsetHeight;e=t.ythis._map.transform.height-n?["bottom"]:[],t.xthis._map.transform.width-r/2&&e.push("right"),e=0===e.length?"bottom":e.join("-")}var i={top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"},a=this._container.classList;for(var s in i)a.remove("mapboxgl-popup-anchor-"+s);a.add("mapboxgl-popup-anchor-"+e),o.setTransform(this._container,i[e]+" translate("+t.x+"px,"+t.y+"px)")}},_onClickClose:function(){this.remove()}})},{"../geo/lng_lat":330,"../util/dom":419,"../util/evented":425,"../util/util":433}],415:[function(t,e,r){"use strict";function n(t,e){this.target=t,this.parent=e,this.callbacks={},this.callbackID=0,this.receive=this.receive.bind(this),this.target.addEventListener("message",this.receive,!1)}e.exports=n,n.prototype.receive=function(t){function e(t,e,r){this.postMessage({type:"",id:String(i),error:t?String(t):null,data:e},r)}var r,n=t.data,i=n.id;if(""===n.type)r=this.callbacks[n.id],delete this.callbacks[n.id],r&&r(n.error||null,n.data);else if(void 0!==n.id&&this.parent[n.type])this.parent[n.type](n.data,e.bind(this));else if(void 0!==n.id&&this.parent.workerSources){var a=n.type.split(".");this.parent.workerSources[a[0]][a[1]](n.data,e.bind(this))}else this.parent[n.type](n.data)},n.prototype.send=function(t,e,r,n){var i=null;r&&(this.callbacks[i=this.callbackID++]=r),this.postMessage({type:t,id:String(i),data:e},n)},n.prototype.postMessage=function(t,e){this.target.postMessage(t,e)}},{}],416:[function(t,e,r){"use strict";function n(t){var e=document.createElement("a");return e.href=t,e.protocol===document.location.protocol&&e.host===document.location.host}r.getJSON=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.setRequestHeader("Accept","application/json"),r.onerror=function(t){e(t)},r.onload=function(){if(r.status>=200&&r.status<300&&r.response){var t;try{t=JSON.parse(r.response)}catch(t){return e(t)}e(null,t)}else e(new Error(r.statusText))},r.send(),r},r.getArrayBuffer=function(t,e){var r=new XMLHttpRequest;return r.open("GET",t,!0),r.responseType="arraybuffer",r.onerror=function(t){e(t)},r.onload=function(){r.status>=200&&r.status<300&&r.response?e(null,r.response):e(new Error(r.statusText))},r.send(),r},r.getImage=function(t,e){return r.getArrayBuffer(t,function(t,r){if(t)return e(t);var n=new Image;n.onload=function(){e(null,n),(window.URL||window.webkitURL).revokeObjectURL(n.src)};var i=new Blob([new Uint8Array(r)],{type:"image/png"});return n.src=(window.URL||window.webkitURL).createObjectURL(i),n.getData=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return t.width=n.width,t.height=n.height,e.drawImage(n,0,0),e.getImageData(0,0,n.width,n.height).data},n})},r.getVideo=function(t,e){var r=document.createElement("video");r.onloadstart=function(){e(null,r)};for(var i=0;i=s+n?t.call(i,1):(t.call(i,(l-s)/n),r.frame(a)))}if(!n)return t.call(i,1),null;var o=!1,s=e.exports.now();return r.frame(a),function(){o=!0}},r.supported=t("mapbox-gl-supported"),r.hardwareConcurrency=navigator.hardwareConcurrency||4,Object.defineProperty(r,"devicePixelRatio",{get:function(){return window.devicePixelRatio}}),r.supportsWebp=!1;var a=document.createElement("img");a.onload=function(){r.supportsWebp=!0},a.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=",r.supportsGeolocation=!!navigator.geolocation},{"mapbox-gl-supported":318}],418:[function(t,e,r){"use strict";function n(t,e){this.canvas=document.createElement("canvas"),t&&e&&(this.canvas.style.position="absolute",this.canvas.classList.add("mapboxgl-canvas"),this.canvas.addEventListener("webglcontextlost",t._contextLost.bind(t),!1),this.canvas.addEventListener("webglcontextrestored",t._contextRestored.bind(t),!1),this.canvas.setAttribute("tabindex",0),e.appendChild(this.canvas))}var i=t("../util"),a=t("mapbox-gl-supported");e.exports=n,n.prototype.resize=function(t,e){var r=window.devicePixelRatio||1;this.canvas.width=r*t,this.canvas.height=r*e,this.canvas.style.width=t+"px",this.canvas.style.height=e+"px"},n.prototype.getWebGLContext=function(t){return t=i.extend({},t,a.webGLContextAttributes),this.canvas.getContext("webgl",t)||this.canvas.getContext("experimental-webgl",t)},n.prototype.getElement=function(){return this.canvas}},{"../util":433,"mapbox-gl-supported":318}],419:[function(t,e,r){"use strict";function n(t){for(var e=0;e1)for(var u=0;u=0&&this._events[t].splice(r,1),this._events[t].length||delete this._events[t]}else delete this._events[t];return this},once:function(t,e){var r=function(n){this.off(t,r),e.call(this,n)}.bind(this);return this.on(t,r),this},fire:function(t,e){if(!this.listens(t))return n.endsWith(t,"error")&&console.error(e&&e.error||e||"Empty error event"),this;e=n.extend({},e),n.extend(e,{type:t,target:this});for(var r=this._events[t].slice(),i=0;i(e.y-t.y)*(r.x-t.x)}function a(t,e,r){var n=r*r;if(1===e.length)return t.distSqr(e[0])1?t.distSqr(r):t.distSqr(r.sub(e)._mult(i)._add(e))}(t,e[i-1],e[i])e.y!=i.y>e.y&&e.x<(i.x-n.x)*(e.y-n.y)/(i.y-n.y)+n.x&&(a=!a);return a}function s(t,e){for(var r=!1,n=0,i=t.length-1;ne.y!=o.y>e.y&&e.x<(o.x-a.x)*(e.y-a.y)/(o.y-a.y)+a.x&&(r=!r)}return r}e.exports={multiPolygonIntersectsBufferedMultiPoint:function(t,e,r){for(var n=0;n=3)for(var u=0;u1){if(n(t,e))return!0;for(var i=0;ithis.max){var r=this.get(this.order[0]);r&&this.onRemove(r)}return this},n.prototype.has=function(t){return t in this.data},n.prototype.keys=function(){return this.order},n.prototype.get=function(t){if(!this.has(t))return null;var e=this.data[t];return delete this.data[t],this.order.splice(this.order.indexOf(t),1),e},n.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this.get(this.order[0]);e&&this.onRemove(e)}return this}},{}],430:[function(t,e,r){"use strict";function n(t,e,r){if(!(r=r||a.ACCESS_TOKEN)&&a.REQUIRE_ACCESS_TOKEN)throw new Error("An API access token is required to use Mapbox GL. See https://www.mapbox.com/developers/api/#access-tokens");if(t=t.replace(/^mapbox:\/\//,a.API_URL+e),t+=-1!==t.indexOf("?")?"&access_token=":"?access_token=",a.REQUIRE_ACCESS_TOKEN){if("s"===r[0])throw new Error("Use a public access token (pk.*) with Mapbox GL JS, not a secret access token (sk.*). See https://www.mapbox.com/developers/api/#access-tokens");t+=r}return t}function i(t){return t?"?"+t:""}var a=t("./config"),o=t("./browser"),s=t("url"),l=t("./util");e.exports.normalizeStyleURL=function(t,e){var r=s.parse(t);return"mapbox:"!==r.protocol?t:n("mapbox:/"+r.pathname+i(r.query),"/styles/v1/",e)},e.exports.normalizeSourceURL=function(t,e){return"mapbox:"!==s.parse(t).protocol?t:n(t+".json","/v4/",e)+"&secure"},e.exports.normalizeGlyphsURL=function(t,e){var r=s.parse(t);if("mapbox:"!==r.protocol)return t;return n("mapbox://"+r.pathname.split("/")[1]+"/{fontstack}/{range}.pbf"+i(r.query),"/fonts/v1/",e)},e.exports.normalizeSpriteURL=function(t,e,r,a){var o=s.parse(t);return"mapbox:"!==o.protocol?(o.pathname+=e+r,s.format(o)):n("mapbox:/"+o.pathname+"/sprite"+e+r+i(o.query),"/styles/v1/",a)},e.exports.normalizeTileURL=function(t,e,r){var n=s.parse(t,!0);if(!e)return t;if("mapbox:"!==s.parse(e).protocol)return t;var i=o.supportsWebp?".webp":"$1",c=o.devicePixelRatio>=2||512===r?"@2x":"";return s.format({protocol:n.protocol,hostname:n.hostname,pathname:n.pathname.replace(/(\.(?:png|jpg)\d*)/,c+i),query:function(t){return t.access_token&&"tk."===t.access_token.slice(0,3)?l.extend({},t,{access_token:a.ACCESS_TOKEN}):t}(n.query)})}},{"./browser":417,"./config":422,"./util":433,url:559}],431:[function(t,e,r){"use strict";function n(){return{members:this.prototype.StructType.prototype.members,alignment:this.prototype.StructType.prototype.alignment,bytesPerElement:this.prototype.bytesPerElement}}function i(t,e){return Math.ceil(t/e)*e}function a(t){return f[t].BYTES_PER_ELEMENT}function o(t){return t.toLowerCase()}function s(t,e){var r="this._pos"+a(t.type).toFixed(0)+" + "+(t.offset/a(t.type)+e).toFixed(0);return"this._structArray."+o(t.type)+"["+r+"]"}function l(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}function c(t){void 0!==t?(this.arrayBuffer=t.arrayBuffer,this.length=t.length,this.capacity=this.arrayBuffer.byteLength/this.bytesPerElement,this._refreshViews()):(this.capacity=-1,this.resize(0))}var u=t("assert");e.exports=function(t){function e(){l.apply(this,arguments)}function r(){c.apply(this,arguments),this.members=e.prototype.members}var d=JSON.stringify(t);if(h[d])return h[d];void 0===t.alignment&&(t.alignment=1);var p=0,m=0,g=["Uint8"];return(e.prototype=Object.create(l.prototype)).members=t.members.map(function(r){r={name:r.name,type:r.type,components:r.components||1},u(r.name.length),u(r.type in f),g.indexOf(r.type)<0&&g.push(r.type);var n=a(r.type);m=Math.max(m,n),r.offset=p=i(p,Math.max(t.alignment,n));for(var o=0;othis.capacity){this.capacity=Math.max(t,Math.floor(this.capacity*this.RESIZE_MULTIPLIER),this.DEFAULT_CAPACITY),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},c.prototype._refreshViews=function(){for(var t=0;t=1)return 1;var e=t*t,r=e*t;return 4*(t<.5?r:3*(t-e)+r-.75)},r.bezier=function(t,e,r,i){var a=new n(t,e,r,i);return function(t){return a.solve(t)}},r.ease=r.bezier(.25,.1,.25,1),r.clamp=function(t,e,r){return Math.min(r,Math.max(e,t))},r.wrap=function(t,e,r){var n=r-e,i=((t-e)%n+n)%n+e;return i===e?r:i},r.coalesce=function(){for(var t=0;t=0)return!0;return!1};var o={};r.warnOnce=function(t){o[t]||("undefined"!=typeof console&&console.warn(t),o[t]=!0)}},{"../geo/coordinate":329,unitbezier:557}],434:[function(t,e,r){"use strict";function n(t,e,r,n){this._vectorTileFeature=t,t._z=e,t._x=r,t._y=n,this.properties=t.properties,null!=t.id&&(this.id=t.id)}e.exports=n,n.prototype={type:"Feature",get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},set geometry(t){this._geometry=t},toJSON:function(){var t={};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&"toJSON"!==e&&(t[e]=this[e]);return t}}},{}],435:[function(t,e,r){e.exports={_args:[["mapbox-gl@0.22.1","/Users/alex/plotly/plotly.js"]],_from:"mapbox-gl@0.22.1",_id:"mapbox-gl@0.22.1",_inBundle:!1,_integrity:"sha1-kqllVH1MLyTCLLxIfu2khpTLYno=",_location:"/mapbox-gl",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"mapbox-gl@0.22.1",name:"mapbox-gl",escapedName:"mapbox-gl",rawSpec:"0.22.1",saveSpec:null,fetchSpec:"0.22.1"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/mapbox-gl/-/mapbox-gl-0.22.1.tgz",_spec:"0.22.1",_where:"/Users/alex/plotly/plotly.js",browser:{"./js/util/ajax.js":"./js/util/browser/ajax.js","./js/util/browser.js":"./js/util/browser/browser.js","./js/util/canvas.js":"./js/util/browser/canvas.js","./js/util/dom.js":"./js/util/browser/dom.js","./js/util/web_worker.js":"./js/util/browser/web_worker.js"},bugs:{url:"https://github.com/mapbox/mapbox-gl-js/issues"},dependencies:{csscolorparser:"^1.0.2",earcut:"^2.0.3","feature-filter":"^2.2.0","geojson-rewind":"^0.1.0","geojson-vt":"^2.4.0","gl-matrix":"^2.3.1","grid-index":"^1.0.0","mapbox-gl-function":"^1.2.1","mapbox-gl-shaders":"github:mapbox/mapbox-gl-shaders#de2ab007455aa2587c552694c68583f94c9f2747","mapbox-gl-style-spec":"github:mapbox/mapbox-gl-style-spec#83b1a3e5837d785af582efd5ed1a212f2df6a4ae","mapbox-gl-supported":"^1.2.0",pbf:"^1.3.2",pngjs:"^2.2.0","point-geometry":"^0.0.0",quickselect:"^1.0.0",request:"^2.39.0","resolve-url":"^0.2.1","shelf-pack":"^1.0.0",supercluster:"^2.0.1",unassertify:"^2.0.0",unitbezier:"^0.0.0","vector-tile":"^1.3.0","vt-pbf":"^2.0.2",webworkify:"^1.3.0","whoots-js":"^2.0.0"},description:"A WebGL interactive maps library",devDependencies:{"babel-preset-react":"^6.11.1",babelify:"^7.3.0",benchmark:"~2.1.0",browserify:"^13.0.0",clipboard:"^1.5.12","concat-stream":"1.5.1",coveralls:"^2.11.8",doctrine:"^1.2.1",documentation:"https://github.com/documentationjs/documentation/archive/bb41619c734e59ef3fbc3648610032efcfdaaace.tar.gz","documentation-theme-utils":"3.0.0",envify:"^3.4.0",eslint:"^2.5.3","eslint-config-mourner":"^2.0.0","eslint-plugin-html":"^1.5.1",gl:"^4.0.1",handlebars:"4.0.5","highlight.js":"9.3.0",istanbul:"^0.4.2","json-loader":"^0.5.4",lodash:"^4.13.1","mapbox-gl-test-suite":"github:mapbox/mapbox-gl-test-suite#7babab52fb02788ebbc38384139bf350e8e38552","memory-fs":"^0.3.0",minifyify:"^7.0.1","npm-run-all":"^3.0.0",nyc:"6.4.0",proxyquire:"^1.7.9",remark:"4.2.2","remark-html":"3.0.0",sinon:"^1.15.4",st:"^1.2.0",tap:"^5.7.0","transform-loader":"^0.2.3","unist-util-visit":"1.1.0",vinyl:"1.1.1","vinyl-fs":"2.4.3",watchify:"^3.7.0",webpack:"^1.13.1","webworkify-webpack":"^1.1.3"},engines:{node:">=4.0.0"},homepage:"https://github.com/mapbox/mapbox-gl-js#readme",license:"BSD-3-Clause",main:"js/mapbox-gl.js",name:"mapbox-gl",repository:{type:"git",url:"git://github.com/mapbox/mapbox-gl-js.git"},scripts:{build:"npm run build-docs # invoked by publisher when publishing docs on the mb-pages branch","build-dev":"browserify js/mapbox-gl.js --debug --standalone mapboxgl > dist/mapbox-gl-dev.js && tap --no-coverage test/build/dev.test.js","build-docs":"documentation build --github --format html -c documentation.yml --theme ./docs/_theme --output docs/api/","build-min":"browserify js/mapbox-gl.js --debug -t unassertify --plugin [minifyify --map mapbox-gl.js.map --output dist/mapbox-gl.js.map] --standalone mapboxgl > dist/mapbox-gl.js && tap --no-coverage test/build/min.test.js","build-token":"browserify debug/access-token-src.js --debug -t envify > debug/access-token.js",lint:"eslint --ignore-path .gitignore js test bench docs/_posts/examples/*.html","open-changed-examples":"git diff --name-only mb-pages HEAD -- docs/_posts/examples/*.html | awk '{print \"http://127.0.0.1:4000/mapbox-gl-js/example/\" substr($0,33,length($0)-37)}' | xargs open",start:"run-p build-token watch-dev watch-bench start-server","start-bench":"run-p build-token watch-bench start-server","start-debug":"run-p build-token watch-dev start-server","start-docs":"npm run build-min && npm run build-docs && jekyll serve -w","start-server":"st --no-cache --localhost --port 9966 --index index.html .",test:"npm run lint && tap --reporter dot test/js/*/*.js test/build/webpack.test.js","test-suite":"node test/render.test.js && node test/query.test.js","watch-bench":"node bench/download-data.js && watchify bench/index.js --plugin [minifyify --no-map] -t [babelify --presets react] -t unassertify -t envify -o bench/bench.js -v","watch-dev":"watchify js/mapbox-gl.js --debug --standalone mapboxgl -o dist/mapbox-gl-dev.js -v"},version:"0.22.1"}},{}],436:[function(t,e,r){"use strict";function n(t,e,r){for(var n=new Array(t),i=0;ip[1][2]&&(v[0]=-v[0]),p[0][2]>p[2][0]&&(v[1]=-v[1]),p[1][0]>p[0][1]&&(v[2]=-v[2]),!0}},{"./normalize":438,"gl-mat4/clone":180,"gl-mat4/create":181,"gl-mat4/determinant":182,"gl-mat4/invert":186,"gl-mat4/transpose":196,"gl-vec3/cross":260,"gl-vec3/dot":261,"gl-vec3/length":262,"gl-vec3/normalize":264}],438:[function(t,e,r){e.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}},{}],439:[function(t,e,r){function n(){return{translate:i(),scale:i(1),skew:i(),perspective:[0,0,0,1],quaternion:[0,0,0,1]}}function i(t){return[t||0,t||0,t||0]}var a=t("gl-vec3/lerp"),o=t("mat4-recompose"),s=t("mat4-decompose"),l=t("gl-mat4/determinant"),c=t("quat-slerp"),u=n(),f=n(),h=n();e.exports=function(t,e,r,n){if(0===l(e)||0===l(r))return!1;var i=s(e,u.translate,u.scale,u.skew,u.perspective,u.quaternion),d=s(r,f.translate,f.scale,f.skew,f.perspective,f.quaternion);return!(!i||!d||(a(h.translate,u.translate,f.translate,n),a(h.skew,u.skew,f.skew,n),a(h.scale,u.scale,f.scale,n),a(h.perspective,u.perspective,f.perspective,n),c(h.quaternion,u.quaternion,f.quaternion,n),o(t,h.translate,h.scale,h.skew,h.perspective,h.quaternion),0))}},{"gl-mat4/determinant":182,"gl-vec3/lerp":263,"mat4-decompose":437,"mat4-recompose":440,"quat-slerp":490}],440:[function(t,e,r){var n={identity:t("gl-mat4/identity"),translate:t("gl-mat4/translate"),multiply:t("gl-mat4/multiply"),create:t("gl-mat4/create"),scale:t("gl-mat4/scale"),fromRotationTranslation:t("gl-mat4/fromRotationTranslation")},i=(n.create(),n.create());e.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}},{"gl-mat4/create":181,"gl-mat4/fromRotationTranslation":184,"gl-mat4/identity":185,"gl-mat4/multiply":188,"gl-mat4/scale":194,"gl-mat4/translate":195}],441:[function(t,e,r){"use strict";function n(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]}var i=t("binary-search-bounds"),a=t("mat4-interpolate"),o=t("gl-mat4/invert"),s=t("gl-mat4/rotateX"),l=t("gl-mat4/rotateY"),c=t("gl-mat4/rotateZ"),u=t("gl-mat4/lookAt"),f=t("gl-mat4/translate"),h=(t("gl-mat4/scale"),t("gl-vec3/normalize")),d=[0,0,0];e.exports=function(t){return new n((t=t||{}).matrix||[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])};var p=n.prototype;p.recalcMatrix=function(t){var e=this._time,r=i.le(e,t),n=this.computedMatrix;if(!(r<0)){var s=this._components;if(r===e.length-1)for(var l=16*r,c=0;c<16;++c)n[c]=s[l++];else{var u=e[r+1]-e[r],f=(l=16*r,this.prevMatrix),d=!0;for(c=0;c<16;++c)f[c]=s[l++];var p=this.nextMatrix;for(c=0;c<16;++c)p[c]=s[l++],d=d&&f[c]===p[c];if(u<1e-6||d)for(c=0;c<16;++c)n[c]=f[c];else a(n,f,p,(t-e[r])/u)}var m=this.computedUp;m[0]=n[1],m[1]=n[5],m[2]=n[9],h(m,m);var g=this.computedInverse;o(g,n);var v=this.computedEye,y=g[15];v[0]=g[12]/y,v[1]=g[13]/y,v[2]=g[14]/y;var x=this.computedCenter,b=Math.exp(this.computedRadius[0]);for(c=0;c<3;++c)x[c]=v[c]-n[2+4*c]*b}},p.idle=function(t){if(!(t1&&n(t[o[u-2]],t[o[u-1]],c)<=0;)u-=1,o.pop();for(o.push(l),u=s.length;u>1&&n(t[s[u-2]],t[s[u-1]],c)>=0;)u-=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=t("robust-orientation")[3]},{"robust-orientation":515}],443:[function(t,e,r){"use strict";e.exports=function(t,e){function r(t){var e=!1;return"altKey"in t&&(e=e||t.altKey!==m.alt,m.alt=!!t.altKey),"shiftKey"in t&&(e=e||t.shiftKey!==m.shift,m.shift=!!t.shiftKey),"ctrlKey"in t&&(e=e||t.ctrlKey!==m.control,m.control=!!t.ctrlKey),"metaKey"in t&&(e=e||t.metaKey!==m.meta,m.meta=!!t.metaKey),e}function i(t,i){var a=n.x(i),o=n.y(i);"buttons"in i&&(t=0|i.buttons),(t!==h||a!==d||o!==p||r(i))&&(h=0|t,d=a||0,p=o||0,e&&e(h,d,p,m))}function a(t){i(0,t)}function o(){(h||d||p||m.shift||m.alt||m.meta||m.control)&&(d=p=0,h=0,m.shift=m.alt=m.control=m.meta=!1,e&&e(0,0,0,m))}function s(t){r(t)&&e&&e(h,d,p,m)}function l(t){0===n.buttons(t)?i(0,t):i(h,t)}function c(t){i(h|n.buttons(t),t)}function u(t){i(h&~n.buttons(t),t)}function f(){g||(g=!0,t.addEventListener("mousemove",l),t.addEventListener("mousedown",c),t.addEventListener("mouseup",u),t.addEventListener("mouseleave",a),t.addEventListener("mouseenter",a),t.addEventListener("mouseout",a),t.addEventListener("mouseover",a),t.addEventListener("blur",o),t.addEventListener("keyup",s),t.addEventListener("keydown",s),t.addEventListener("keypress",s),t!==window&&(window.addEventListener("blur",o),window.addEventListener("keyup",s),window.addEventListener("keydown",s),window.addEventListener("keypress",s)))}e||(e=t,t=window);var h=0,d=0,p=0,m={shift:!1,alt:!1,control:!1,meta:!1},g=!1;f();var v={element:t};return Object.defineProperties(v,{enabled:{get:function(){return g},set:function(e){e?f():g&&(g=!1,t.removeEventListener("mousemove",l),t.removeEventListener("mousedown",c),t.removeEventListener("mouseup",u),t.removeEventListener("mouseleave",a),t.removeEventListener("mouseenter",a),t.removeEventListener("mouseout",a),t.removeEventListener("mouseover",a),t.removeEventListener("blur",o),t.removeEventListener("keyup",s),t.removeEventListener("keydown",s),t.removeEventListener("keypress",s),t!==window&&(window.removeEventListener("blur",o),window.removeEventListener("keyup",s),window.removeEventListener("keydown",s),window.removeEventListener("keypress",s)))},enumerable:!0},buttons:{get:function(){return h},enumerable:!0},x:{get:function(){return d},enumerable:!0},y:{get:function(){return p},enumerable:!0},mods:{get:function(){return m},enumerable:!0}}),v};var n=t("mouse-event")},{"mouse-event":445}],444:[function(t,e,r){var n={left:0,top:0};e.exports=function(t,e,r){e=e||t.currentTarget||t.srcElement,Array.isArray(r)||(r=[0,0]);var i=t.clientX||0,a=t.clientY||0,o=function(t){return t===window||t===document||t===document.body?n:t.getBoundingClientRect()}(e);return r[0]=i-o.left,r[1]=a-o.top,r}},{}],445:[function(t,e,r){"use strict";function n(t){return t.target||t.srcElement||window}r.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;k=k-1&m)b.push(_+"["+A+"+"+g(k)+"]");for(b.push(v(0)),k=0;k=0;--e)L(e,0);var r=[];for(e=0;e0){",h(S[t]),"=1;"),D(t-1,e|1<0&&q.push(s(j,S[B-1])+"*"+o(S[B-1])),R.push(d(j,S[B])+"=("+q.join("-")+")|0")}for(j=0;j=0;--j)H.push(o(S[j]));R.push(k+"=("+H.join("*")+")|0",w+"=mallocUint32("+k+")",_+"=mallocUint32("+k+")",A+"=0"),R.push(p(0)+"=0");for(B=1;B<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 a=t.getters||[],o=new Array(n),s=0;s=0?o[s]=!0:o[s]=!1;return x(t.vertex,t.cell,t.phase,i,r,o)};var _="V",w="P",M="N",k="Q",A="X",T="T"},{"typedarray-pool":554}],448:[function(t,e,r){"use strict";var n=t("cwise/lib/wrapper")({args:["index","array","scalar"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{_inline_1_arg1_=_inline_1_arg2_.apply(void 0,_inline_1_arg0_)}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"cwise",blockSize:64});e.exports=function(t,e){return n(t,e),t}},{"cwise/lib/wrapper":119}],449:[function(t,e,r){"use strict";function n(t){if(t in o)return o[t];for(var e=[],r=0;r=0?s.push("0"):e.indexOf(-(l+1))>=0?s.push("s["+l+"]-1"):(s.push("-1"),n.push("1"),o.push("s["+l+"]-2"));var c=".lo("+n.join()+").hi("+o.join()+")";if(0===n.length&&(c=""),r>0){for(a.push("if(1"),l=0;l=0||e.indexOf(-(l+1))>=0||a.push("&&s[",l,"]>2");for(a.push("){grad",r,"(src.pick(",s.join(),")",c),l=0;l=0||e.indexOf(-(l+1))>=0||a.push(",dst.pick(",s.join(),",",l,")",c);a.push(");")}for(l=0;l1){dst.set(",s.join(),",",u,",0.5*(src.get(",h.join(),")-src.get(",d.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>1){diff(",f,",src.pick(",h.join(),")",c,",src.pick(",d.join(),")",c,");}else{zero(",f,");};");break;case"mirror":0===r?a.push("dst.set(",s.join(),",",u,",0);"):a.push("zero(",f,");");break;case"wrap":var p=s.slice(),m=s.slice();e[l]<0?(p[u]="s["+u+"]-2",m[u]="0"):(p[u]="s["+u+"]-1",m[u]="1"),0===r?a.push("if(s[",u,"]>2){dst.set(",s.join(),",",u,",0.5*(src.get(",p.join(),")-src.get(",m.join(),")))}else{dst.set(",s.join(),",",u,",0)};"):a.push("if(s[",u,"]>2){diff(",f,",src.pick(",p.join(),")",c,",src.pick(",m.join(),")",c,");}else{zero(",f,");};");break;default:throw new Error("ndarray-gradient: Invalid boundary condition")}}r>0&&a.push("};")}var r=t.join();if(v=s[r])return v;for(var i=t.length,a=["function gradient(dst,src){var s=src.shape.slice();"],l=0;l<1<>",rrshift:">>>"};!function(){for(var t in s){var e=s[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a"+e+"=b"},rvalue:!0,funcName:t+"eq"}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a"+e+"=s"},rvalue:!0,funcName:t+"seq"})}}();var l={not:"!",bnot:"~",neg:"-",recip:"1.0/"};!function(){for(var t in l){var e=l[t];r[t]=i({args:["array","array"],body:{args:["a","b"],body:"a="+e+"b"},funcName:t}),r[t+"eq"]=i({args:["array"],body:{args:["a"],body:"a="+e+"a"},rvalue:!0,count:2,funcName:t+"eq"})}}();var c={and:"&&",or:"||",eq:"===",neq:"!==",lt:"<",gt:">",leq:"<=",geq:">="};!function(){for(var t in c){var e=c[t];r[t]=i({args:["array","array","array"],body:{args:["a","b","c"],body:"a=b"+e+"c"},funcName:t}),r[t+"s"]=i({args:["array","array","scalar"],body:{args:["a","b","s"],body:"a=b"+e+"s"},funcName:t+"s"}),r[t+"eq"]=i({args:["array","array"],body:{args:["a","b"],body:"a=a"+e+"b"},rvalue:!0,count:2,funcName:t+"eq"}),r[t+"seq"]=i({args:["array","scalar"],body:{args:["a","s"],body:"a=a"+e+"s"},rvalue:!0,count:2,funcName:t+"seq"})}}();var u=["abs","acos","asin","atan","ceil","cos","exp","floor","log","round","sin","sqrt","tan"];!function(){for(var t=0;tthis_s){this_s=-a}else if(a>this_s){this_s=a}",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norminf"}),r.norm1=a({args:["array"],pre:{args:[],localVars:[],thisVars:["this_s"],body:"this_s=0"},body:{args:[{name:"a",lvalue:!1,rvalue:!0,count:3}],body:"this_s+=a<0?-a:a",localVars:[],thisVars:["this_s"]},post:{args:[],localVars:[],thisVars:["this_s"],body:"return this_s"},funcName:"norm1"}),r.sup=a({args:["array"],pre:{body:"this_h=-Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_>this_h)this_h=_inline_1_arg0_",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_h"],localVars:[]},post:{body:"return this_h",args:[],thisVars:["this_h"],localVars:[]}}),r.inf=a({args:["array"],pre:{body:"this_h=Infinity",args:[],thisVars:["this_h"],localVars:[]},body:{body:"if(_inline_1_arg0_this_v){this_v=_inline_1_arg1_;for(var _inline_1_k=0;_inline_1_k<_inline_1_arg0_.length;++_inline_1_k){this_i[_inline_1_k]=_inline_1_arg0_[_inline_1_k]}}}",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:2}],thisVars:["this_i","this_v"],localVars:["_inline_1_k"]},post:{body:"{return this_i}",args:[],thisVars:["this_i"],localVars:[]}}),r.random=i({args:["array"],pre:{args:[],body:"this_f=Math.random",thisVars:["this_f"]},body:{args:["a"],body:"a=this_f()",thisVars:["this_f"]},funcName:"random"}),r.assign=i({args:["array","array"],body:{args:["a","b"],body:"a=b"},funcName:"assign"}),r.assigns=i({args:["array","scalar"],body:{args:["a","b"],body:"a=b"},funcName:"assigns"}),r.equals=a({args:["array","array"],pre:o,body:{args:[{name:"x",lvalue:!1,rvalue:!0,count:1},{name:"y",lvalue:!1,rvalue:!0,count:1}],body:"if(x!==y){return false}",localVars:[],thisVars:[]},post:{args:[],localVars:[],thisVars:[],body:"return true"},funcName:"equals"})},{"cwise-compiler":116}],453:[function(t,e,r){"use strict";var n=t("ndarray"),i=t("./doConvert.js");e.exports=function(t,e){for(var r=[],a=t,o=1;Array.isArray(a);)r.push(a.length),o*=a.length,a=a[0];return 0===r.length?n():(e||(e=n(new Float64Array(o),r)),i(e,t),e)}},{"./doConvert.js":454,ndarray:458}],454:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\nvar _inline_1_v=_inline_1_arg1_,_inline_1_i\nfor(_inline_1_i=0;_inline_1_i<_inline_1_arg2_.length-1;++_inline_1_i) {\n_inline_1_v=_inline_1_v[_inline_1_arg2_[_inline_1_i]]\n}\n_inline_1_arg0_=_inline_1_v[_inline_1_arg2_[_inline_1_arg2_.length-1]]\n}",args:[{name:"_inline_1_arg0_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:4}],thisVars:[],localVars:["_inline_1_i","_inline_1_v"]},post:{body:"{}",args:[],thisVars:[],localVars:[]},funcName:"convert",blockSize:64})},{"cwise-compiler":116}],455:[function(t,e,r){"use strict";function n(t){switch(t){case"uint8":return[a.mallocUint8,a.freeUint8];case"uint16":return[a.mallocUint16,a.freeUint16];case"uint32":return[a.mallocUint32,a.freeUint32];case"int8":return[a.mallocInt8,a.freeInt8];case"int16":return[a.mallocInt16,a.freeInt16];case"int32":return[a.mallocInt32,a.freeInt32];case"float32":return[a.mallocFloat,a.freeFloat];case"float64":return[a.mallocDouble,a.freeDouble];default:return null}}function i(t){for(var e=[],r=0;r0?s.push(["d",d,"=s",d,"-d",f,"*n",f].join("")):s.push(["d",d,"=s",d].join("")),f=d);var p;0!=(p=t.length-1-l)&&(h>0?s.push(["e",p,"=s",p,"-e",h,"*n",h,",f",p,"=",c[p],"-f",h,"*n",h].join("")):s.push(["e",p,"=s",p,",f",p,"=",c[p]].join("")),h=p)}r.push("var "+s.join(","));var m=["0","n0-1","data","offset"].concat(i(t.length));r.push(["if(n0<=",o,"){","insertionSort(",m.join(","),")}else{","quickSort(",m.join(","),")}"].join("")),r.push("}return "+a);var g=new Function("insertionSort","quickSort",r.join("\n")),v=function(t,e){function r(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function a(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}var o=["'use strict'"],s=["ndarrayInsertionSort",t.join("d"),e].join(""),l=["left","right","data","offset"].concat(i(t.length)),c=n(e),u=["i,j,cptr,ptr=left*s0+offset"];if(t.length>1){for(var f=[],h=1;h1){for(o.push("dptr=0;sptr=ptr"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"b){break __l}"].join("")),h=t.length-1;h>=1;--h)o.push("sptr+=e"+h,"dptr+=f"+h,"}");for(o.push("dptr=cptr;sptr=cptr-s0"),h=t.length-1;h>=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"=0;--h)0!==(d=t[h])&&o.push(["for(i",d,"=0;i",d,"scratch)){",a("cptr",r("cptr-s0")),"cptr-=s0","}",a("cptr","scratch"));return o.push("}"),t.length>1&&c&&o.push("free(scratch)"),o.push("} return "+s),c?new Function("malloc","free",o.join("\n"))(c[0],c[1]):new Function(o.join("\n"))()}(t,e);return g(v,function(t,e,r){function a(t){return["(offset+",t,"*s0)"].join("")}function s(t){return"generic"===e?["data.get(",t,")"].join(""):["data[",t,"]"].join("")}function l(t,r){return"generic"===e?["data.set(",t,",",r,")"].join(""):["data[",t,"]=",r].join("")}function c(e,r,n){if(1===e.length)_.push("ptr0="+a(e[0]));else for(var i=0;i=0;--i)0!==(o=t[i])&&_.push(["for(i",o,"=0;i",o,"1)for(i=0;i1?_.push("ptr_shift+=d"+o):_.push("ptr0+=d"+o),_.push("}"))}}function u(e,r,n,i){if(1===r.length)_.push("ptr0="+a(r[0]));else{for(var o=0;o1)for(o=0;o=1;--o)n&&_.push("pivot_ptr+=f"+o),r.length>1?_.push("ptr_shift+=e"+o):_.push("ptr0+=e"+o),_.push("}")}function f(){t.length>1&&k&&_.push("free(pivot1)","free(pivot2)")}function h(e,r){var n="el"+e,i="el"+r;if(t.length>1){var o="__l"+ ++A;u(o,[n,i],!1,["comp=",s("ptr0"),"-",s("ptr1"),"\n","if(comp>0){tmp0=",n,";",n,"=",i,";",i,"=tmp0;break ",o,"}\n","if(comp<0){break ",o,"}"].join(""))}else _.push(["if(",s(a(n)),">",s(a(i)),"){tmp0=",n,";",n,"=",i,";",i,"=tmp0}"].join(""))}function d(e,r){t.length>1?c([e,r],!1,l("ptr0",s("ptr1"))):_.push(l(a(e),s(a(r))))}function p(e,r,n){if(t.length>1){var i="__l"+ ++A;u(i,[r],!0,[e,"=",s("ptr0"),"-pivot",n,"[pivot_ptr]\n","if(",e,"!==0){break ",i,"}"].join(""))}else _.push([e,"=",s(a(r)),"-pivot",n].join(""))}function m(e,r){t.length>1?c([e,r],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join("")):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1","tmp")].join(""))}function g(e,r,n){t.length>1?(c([e,r,n],!1,["tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join("")),_.push("++"+r,"--"+n)):_.push(["ptr0=",a(e),"\n","ptr1=",a(r),"\n","ptr2=",a(n),"\n","++",r,"\n","--",n,"\n","tmp=",s("ptr0"),"\n",l("ptr0",s("ptr1")),"\n",l("ptr1",s("ptr2")),"\n",l("ptr2","tmp")].join(""))}function v(t,e){m(t,e),_.push("--"+e)}function y(e,r,n){t.length>1?c([e,r],!0,[l("ptr0",s("ptr1")),"\n",l("ptr1",["pivot",n,"[pivot_ptr]"].join(""))].join("")):_.push(l(a(e),s(a(r))),l(a(r),"pivot"+n))}function x(e,r){_.push(["if((",r,"-",e,")<=",o,"){\n","insertionSort(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}else{\n",w,"(",e,",",r,",data,offset,",i(t.length).join(","),")\n","}"].join(""))}function b(e,r,n){t.length>1?(_.push(["__l",++A,":while(true){"].join("")),c([e],!0,["if(",s("ptr0"),"!==pivot",r,"[pivot_ptr]){break __l",A,"}"].join("")),_.push(n,"}")):_.push(["while(",s(a(e)),"===pivot",r,"){",n,"}"].join(""))}var _=["'use strict'"],w=["ndarrayQuickSort",t.join("d"),e].join(""),M=["left","right","data","offset"].concat(i(t.length)),k=n(e),A=0;_.push(["function ",w,"(",M.join(","),"){"].join(""));var T=["sixth=((right-left+1)/6)|0","index1=left+sixth","index5=right-sixth","index3=(left+right)>>1","index2=index3-sixth","index4=index3+sixth","el1=index1","el2=index2","el3=index3","el4=index4","el5=index5","less=left+1","great=right-1","pivots_are_equal=true","tmp","tmp0","x","y","z","k","ptr0","ptr1","ptr2","comp_pivot1=0","comp_pivot2=0","comp=0"];if(t.length>1){for(var S=[],E=1;E1?c(["el1","el2","el3","el4","el5","index1","index3","index5"],!0,["pivot1[pivot_ptr]=",s("ptr1"),"\n","pivot2[pivot_ptr]=",s("ptr3"),"\n","pivots_are_equal=pivots_are_equal&&(pivot1[pivot_ptr]===pivot2[pivot_ptr])\n","x=",s("ptr0"),"\n","y=",s("ptr2"),"\n","z=",s("ptr4"),"\n",l("ptr5","x"),"\n",l("ptr6","y"),"\n",l("ptr7","z")].join("")):_.push(["pivot1=",s(a("el2")),"\n","pivot2=",s(a("el4")),"\n","pivots_are_equal=pivot1===pivot2\n","x=",s(a("el1")),"\n","y=",s(a("el3")),"\n","z=",s(a("el5")),"\n",l(a("index1"),"x"),"\n",l(a("index3"),"y"),"\n",l(a("index5"),"z")].join("")),d("index2","left"),d("index4","right"),_.push("if(pivots_are_equal){"),_.push("for(k=less;k<=great;++k){"),p("comp","k",1),_.push("if(comp===0){continue}"),_.push("if(comp<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),_.push("while(true){"),p("comp","great",1),_.push("if(comp>0){"),_.push("great--"),_.push("}else if(comp<0){"),g("k","less","great"),_.push("break"),_.push("}else{"),v("k","great"),_.push("break"),_.push("}"),_.push("}"),_.push("}"),_.push("}"),_.push("}else{"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1<0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2>0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp>0){"),_.push("if(--greatindex5){"),b("less",1,"++less"),b("great",2,"--great"),_.push("for(k=less;k<=great;++k){"),p("comp_pivot1","k",1),_.push("if(comp_pivot1===0){"),_.push("if(k!==less){"),m("k","less"),_.push("}"),_.push("++less"),_.push("}else{"),p("comp_pivot2","k",2),_.push("if(comp_pivot2===0){"),_.push("while(true){"),p("comp","great",2),_.push("if(comp===0){"),_.push("if(--great1&&k?new Function("insertionSort","malloc","free",_.join("\n"))(r,k[0],k[1]):new Function("insertionSort",_.join("\n"))(r)}(t,e,v))}},{"typedarray-pool":554}],456:[function(t,e,r){"use strict";var n=t("./lib/compile_sort.js"),i={};e.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}},{"./lib/compile_sort.js":455}],457:[function(t,e,r){"use strict";var n=t("ndarray-linear-interpolate"),i=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=new Array(_inline_9_arg4_)}",args:[{name:"_inline_9_arg0_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg1_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg2_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg3_",lvalue:!1,rvalue:!1,count:0},{name:"_inline_9_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_10_arg2_(this_warped,_inline_10_arg0_),_inline_10_arg1_=_inline_10_arg3_.apply(void 0,this_warped)}",args:[{name:"_inline_10_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_10_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_10_arg4_",lvalue:!1,rvalue:!1,count:0}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warpND",blockSize:64}),a=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_13_arg2_(this_warped,_inline_13_arg0_),_inline_13_arg1_=_inline_13_arg3_(_inline_13_arg4_,this_warped[0])}",args:[{name:"_inline_13_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_13_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_13_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp1D",blockSize:64}),o=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_16_arg2_(this_warped,_inline_16_arg0_),_inline_16_arg1_=_inline_16_arg3_(_inline_16_arg4_,this_warped[0],this_warped[1])}",args:[{name:"_inline_16_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_16_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_16_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp2D",blockSize:64}),s=t("cwise/lib/wrapper")({args:["index","array","scalar","scalar","scalar"],pre:{body:"{this_warped=[0,0,0]}",args:[],thisVars:["this_warped"],localVars:[]},body:{body:"{_inline_19_arg2_(this_warped,_inline_19_arg0_),_inline_19_arg1_=_inline_19_arg3_(_inline_19_arg4_,this_warped[0],this_warped[1],this_warped[2])}",args:[{name:"_inline_19_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg1_",lvalue:!0,rvalue:!1,count:1},{name:"_inline_19_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg3_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_19_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:["this_warped"],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},debug:!1,funcName:"warp3D",blockSize:64});e.exports=function(t,e,r){switch(e.shape.length){case 1:a(t,r,n.d1,e);break;case 2:o(t,r,n.d2,e);break;case 3:s(t,r,n.d3,e);break;default:i(t,r,n.bind(void 0,e),e.shape.length)}return t}},{"cwise/lib/wrapper":119,"ndarray-linear-interpolate":451}],458:[function(t,e,r){function n(t,e){return t[0]-e[0]}function i(){var t,e=this.stride,r=new Array(e.length);for(t=0;tMath.abs(this.stride[1]))?[1,0]:[0,1]}})"):3===e&&a.push("var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})")):a.push("ORDER})")),a.push("proto.set=function "+r+"_set("+l.join(",")+",v){"),n?a.push("return this.data.set("+u+",v)}"):a.push("return this.data["+u+"]=v}"),a.push("proto.get=function "+r+"_get("+l.join(",")+"){"),n?a.push("return this.data.get("+u+")}"):a.push("return this.data["+u+"]}"),a.push("proto.index=function "+r+"_index(",l.join(),"){return "+u+"}"),a.push("proto.hi=function "+r+"_hi("+l.join(",")+"){return new "+r+"(this.data,"+s.map(function(t){return["(typeof i",t,"!=='number'||i",t,"<0)?this.shape[",t,"]:i",t,"|0"].join("")}).join(",")+","+s.map(function(t){return"this.stride["+t+"]"}).join(",")+",this.offset)}");var d=s.map(function(t){return"a"+t+"=this.shape["+t+"]"}),p=s.map(function(t){return"c"+t+"=this.stride["+t+"]"});a.push("proto.lo=function "+r+"_lo("+l.join(",")+"){var b=this.offset,d=0,"+d.join(",")+","+p.join(","));for(var m=0;m=0){d=i"+m+"|0;b+=c"+m+"*d;a"+m+"-=d}");a.push("return new "+r+"(this.data,"+s.map(function(t){return"a"+t}).join(",")+","+s.map(function(t){return"c"+t}).join(",")+",b)}"),a.push("proto.step=function "+r+"_step("+l.join(",")+"){var "+s.map(function(t){return"a"+t+"=this.shape["+t+"]"}).join(",")+","+s.map(function(t){return"b"+t+"=this.stride["+t+"]"}).join(",")+",c=this.offset,d=0,ceil=Math.ceil");for(m=0;m=0){c=(c+this.stride["+m+"]*i"+m+")|0}else{a.push(this.shape["+m+"]);b.push(this.stride["+m+"])}");a.push("var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}"),a.push("return function construct_"+r+"(data,shape,stride,offset){return new "+r+"(data,"+s.map(function(t){return"shape["+t+"]"}).join(",")+","+s.map(function(t){return"stride["+t+"]"}).join(",")+",offset)}");return new Function("CTOR_LIST","ORDER",a.join("\n"))(c[t],i)}var o=t("iota-array"),s=t("is-buffer"),l="undefined"!=typeof Float64Array,c={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],buffer:[],generic:[]};e.exports=function(t,e,r,n){if(void 0===t)return(0,c.array[0])([]);"number"==typeof t&&(t=[t]),void 0===e&&(e=[t.length]);var i=e.length;if(void 0===r){r=new Array(i);for(var o=i-1,u=1;o>=0;--o)r[o]=u,u*=e[o]}if(void 0===n)for(n=0,o=0;o>>0;e.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)}},{"double-bits":131}],460:[function(t,e,r){function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}function a(t,e,r,n,i,s,u,f,h,d){if(d)M=d[0],k=d[1],_=d[2],w=d[3];else{var p=o(t,e,-i);t=p.x,e=p.y;var m=(t-(f=(p=o(f,h,-i)).x))/2,g=(e-(h=p.y))/2,v=m*m/(r*r)+g*g/(n*n);v>1&&(r*=v=Math.sqrt(v),n*=v);var y=r*r,x=n*n,b=(s==u?-1:1)*Math.sqrt(Math.abs((y*x-y*g*g-x*m*m)/(y*g*g+x*m*m)));b==1/0&&(b=1);var _=b*r*g/n+(t+f)/2,w=b*-n*m/r+(e+h)/2,M=Math.asin(((e-w)/n).toFixed(9)),k=Math.asin(((h-w)/n).toFixed(9));M=t<_?l-M:M,k=f<_?l-k:k,M<0&&(M=2*l+M),k<0&&(k=2*l+k),u&&M>k&&(M-=2*l),!u&&k>M&&(k-=2*l)}if(Math.abs(k-M)>c){var A=k,T=f,S=h;k=M+c*(u&&k>M?1:-1);var E=a(f=_+r*Math.cos(k),h=w+n*Math.sin(k),r,n,i,0,u,T,S,[k,A,_,w])}var L=Math.tan((k-M)/4),C=4/3*r*L,z=4/3*n*L,D=[2*t-(t+C*Math.sin(M)),2*e-(e-z*Math.cos(M)),f+C*Math.sin(k),h-z*Math.cos(k),f,h];if(d)return D;E&&(D=D.concat(E));for(var I=0;I7&&(r.push(v.splice(0,7)),v.unshift("C"));break;case"S":var x=d,b=p;"C"!=e&&"S"!=e||(x+=x-o,b+=b-l),v=["C",x,b,v[1],v[2],v[3],v[4]];break;case"T":"Q"==e||"T"==e?(f=2*d-f,h=2*p-h):(f=d,h=p),v=i(d,p,f,h,v[1],v[2]);break;case"Q":f=v[1],h=v[2],v=i(d,p,v[1],v[2],v[3],v[4]);break;case"L":v=n(d,p,v[1],v[2]);break;case"H":v=n(d,p,v[1],p);break;case"V":v=n(d,p,d,v[1]);break;case"Z":v=n(d,p,c,u)}e=y,d=v[v.length-2],p=v[v.length-1],v.length>4?(o=v[v.length-4],l=v[v.length-3]):(o=d,l=p),r.push(v)}return r}},{}],461:[function(t,e,r){r.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[c],_=1/Math.sqrt(g*y);for(x=0;x<3;++x){var w=(x+1)%3,M=(x+2)%3;b[x]+=_*(v[w]*m[M]-v[M]*m[w])}}}for(o=0;oa)for(_=1/Math.sqrt(k),x=0;x<3;++x)b[x]*=_;else for(x=0;x<3;++x)b[x]=0}return i},r.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;for(c=0;c<3;++c)h[c]*=d;i[o]=h}return i}},{}],462:[function(t,e,r){"use strict";var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var r,o,s=function(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),l=1;l0){var f=Math.sqrt(u+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,c);f=Math.sqrt(2*h-u+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}},{}],464:[function(t,e,r){"use strict";function n(t,e,r){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2))}function i(t,e,r,n){return Math.sqrt(Math.pow(t,2)+Math.pow(e,2)+Math.pow(r,2)+Math.pow(n,2))}function a(t,e){var r=e[0],n=e[1],a=e[2],o=e[3],s=i(r,n,a,o);s>1e-6?(t[0]=r/s,t[1]=n/s,t[2]=a/s,t[3]=o/s):(t[0]=t[1]=t[2]=0,t[3]=1)}function o(t,e,r){this.radius=s([r]),this.center=s(e),this.rotation=s(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)}e.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),a(r=[].slice.call(r,0,4),r);var i=new o(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 s=t("filtered-vector"),l=t("gl-mat4/lookAt"),c=t("gl-mat4/fromQuat"),u=t("gl-mat4/invert"),f=t("./lib/quatFromFrame"),h=o.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;a(e,e);var r=this.computedMatrix;c(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,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=a[1],s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d);u/=p,f/=p,h/=p;var m=a[2],g=a[6],v=a[10],y=m*o+g*s+v*l,x=m*u+g*f+v*h,b=n(m-=y*o+x*u,g-=y*s+x*f,v-=y*l+x*h);m/=b,g/=b,v/=b;var _=u*e+o*r,w=f*e+s*r,M=h*e+l*r;this.center.move(t,_,w,M);var k=Math.exp(this.computedRadius[0]);k=Math.max(1e-4,k+i),this.radius.set(t,Math.log(k))},h.rotate=function(t,e,r,a){this.recalcMatrix(t),e=e||0,r=r||0;var o=this.computedMatrix,s=o[0],l=o[4],c=o[8],u=o[1],f=o[5],h=o[9],d=o[2],p=o[6],m=o[10],g=e*s+r*u,v=e*l+r*f,y=e*c+r*h,x=-(p*y-m*v),b=-(m*g-d*y),_=-(d*v-p*g),w=Math.sqrt(Math.max(0,1-Math.pow(x,2)-Math.pow(b,2)-Math.pow(_,2))),M=i(x,b,_,w);M>1e-6?(x/=M,b/=M,_/=M,w/=M):(x=b=_=0,w=1);var k=this.computedRotation,A=k[0],T=k[1],S=k[2],E=k[3],L=A*w+E*x+T*_-S*b,C=T*w+E*b+S*x-A*_,z=S*w+E*_+A*b-T*x,D=E*w-A*x-T*b-S*_;if(a){x=d,b=p,_=m;var I=Math.sin(a)/n(x,b,_);x*=I,b*=I,_*=I,D=D*(w=Math.cos(e))-(L=L*w+D*x+C*_-z*b)*x-(C=C*w+D*b+z*x-L*_)*b-(z=z*w+D*_+L*b-C*x)*_}var P=i(L,C,z,D);P>1e-6?(L/=P,C/=P,z/=P,D/=P):(L=C=z=0,D=1),this.rotation.set(t,L,C,z,D)},h.lookAt=function(t,e,r,n){this.recalcMatrix(t),r=r||this.computedCenter,e=e||this.computedEye,n=n||this.computedUp;var i=this.computedMatrix;l(i,e,r,n);var o=this.computedRotation;f(o,i[0],i[1],i[2],i[4],i[5],i[6],i[8],i[9],i[10]),a(o,o),this.rotation.set(t,o[0],o[1],o[2],o[3]);for(var s=0,c=0;c<3;++c)s+=Math.pow(r[c]-e[c],2);this.radius.set(t,.5*Math.log(Math.max(s,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;f(r,e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10]),a(r,r),this.rotation.set(t,r[0],r[1],r[2],r[3]);var n=this.computedMatrix;u(n,e);var i=n[15];if(Math.abs(i)>1e-6){var o=n[12]/i,s=n[13]/i,l=n[14]/i;this.recalcMatrix(t);var c=Math.exp(this.computedRadius[0]);this.center.set(t,o-n[2]*c,s-n[6]*c,l-n[10]*c),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)}},{"./lib/quatFromFrame":463,"filtered-vector":142,"gl-mat4/fromQuat":183,"gl-mat4/invert":186,"gl-mat4/lookAt":187}],465:[function(t,e,r){"use strict";var n=t("repeat-string");e.exports=function(t,e,r){return r=void 0!==r?r+"":" ",n(r,e)+t}},{"repeat-string":507}],466:[function(t,e,r){e.exports=function(t){var e=[];return t.replace(i,function(t,r,i){var o=r.toLowerCase();for(i=function(t){var e=t.match(a);return e?e.map(Number):[]}(i),"m"==o&&i.length>2&&(e.push([r].concat(i.splice(0,2))),o="l",r="m"==r?"l":"L");;){if(i.length==n[o])return i.unshift(r),e.push(i);if(i.length=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-1&&!i;a--){var o=a>=0?arguments[a]:t.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(r=o+"/"+r,i="/"===o.charAt(0))}return r=e(n(r.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+r||"."},r.normalize=function(t){var i=r.isAbsolute(t),a="/"===o(t,-1);return(t=e(n(t.split("/"),function(t){return!!t}),!i).join("/"))||i||(t="."),t&&a&&(t+="/"),(i?"/":"")+t},r.isAbsolute=function(t){return"/"===t.charAt(0)},r.join=function(){var t=Array.prototype.slice.call(arguments,0);return r.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},r.relative=function(t,e){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=r.resolve(t).substr(1),e=r.resolve(e).substr(1);for(var i=n(t.split("/")),a=n(e.split("/")),o=Math.min(i.length,a.length),s=o,l=0;l55295&&e<57344){if(!r){e>56319||a+1===n?i.push(239,191,189):r=e;continue}if(e<56320){i.push(239,191,189),r=e;continue}e=r-55296<<10|e-56320|65536,r=null}else r&&(i.push(239,191,189),r=null);e<128?i.push(e):e<2048?i.push(e>>6|192,63&e|128):e<65536?i.push(e>>12|224,e>>6&63|128,63&e|128):i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}return i}e.exports=n;var a,o,s,l=t("ieee754");(a={readUInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},writeUInt32LE:function(t,e){this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24},readInt32LE:function(t){return(this[t]|this[t+1]<<8|this[t+2]<<16)+(this[t+3]<<24)},readFloatLE:function(t){return l.read(this,t,!0,23,4)},readDoubleLE:function(t){return l.read(this,t,!0,52,8)},writeFloatLE:function(t,e){return l.write(this,t,e,!0,23,4)},writeDoubleLE:function(t,e){return l.write(this,t,e,!0,52,8)},toString:function(t,e,r){var n="",i="";e=e||0,r=Math.min(this.length,r||this.length);for(var a=e;a>3,a=this.pos;t(i,e,this),this.pos===a&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=this.buf.readUInt32LE(this.pos);return this.pos+=4,t},readSFixed32:function(){var t=this.buf.readInt32LE(this.pos);return this.pos+=4,t},readFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readUInt32LE(this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=this.buf.readUInt32LE(this.pos)+4294967296*this.buf.readInt32LE(this.pos+4);return this.pos+=8,t},readFloat:function(){var t=this.buf.readFloatLE(this.pos);return this.pos+=4,t},readDouble:function(){var t=this.buf.readDoubleLE(this.pos);return this.pos+=8,t},readVarint:function(){var t,e,r=this.buf;return e=r[this.pos++],t=127&e,e<128?t:(e=r[this.pos++],t|=(127&e)<<7,e<128?t:(e=r[this.pos++],t|=(127&e)<<14,e<128?t:(e=r[this.pos++],t|=(127&e)<<21,e<128?t:function(t,e){var r,n=e.buf;if(r=n[e.pos++],t+=268435456*(127&r),r<128)return t;if(r=n[e.pos++],t+=34359738368*(127&r),r<128)return t;if(r=n[e.pos++],t+=4398046511104*(127&r),r<128)return t;if(r=n[e.pos++],t+=562949953421312*(127&r),r<128)return t;if(r=n[e.pos++],t+=72057594037927940*(127&r),r<128)return t;if(r=n[e.pos++],t+=0x8000000000000000*(127&r),r<128)return t;throw new Error("Expected varint not more than 10 bytes")}(t,this))))},readVarint64:function(){var t=this.pos,e=this.readVarint();if(e127;);else if(e===n.Bytes)this.pos=this.readVarint()+this.pos;else if(e===n.Fixed32)this.pos+=4;else{if(e!==n.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e268435455?function(t,e){e.realloc(10);for(var r=e.pos+10;t>=1;){if(e.pos>=r)throw new Error("Given varint doesn't fit into 10 bytes");var n=255&t;e.buf[e.pos++]=n|(t>=128?128:0),t/=128}}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t);var e=d.byteLength(t);this.writeVarint(e),this.realloc(e),this.buf.write(t,this.pos),this.pos+=e},writeFloat:function(t){this.realloc(4),this.buf.writeFloatLE(t,this.pos),this.pos+=4},writeDouble:function(t){this.realloc(8),this.buf.writeDoubleLE(t,this.pos),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r=128&&function(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.ceil(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,n.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){this.writeMessage(t,i,e)},writePackedSVarint:function(t,e){this.writeMessage(t,a,e)},writePackedBoolean:function(t,e){this.writeMessage(t,l,e)},writePackedFloat:function(t,e){this.writeMessage(t,o,e)},writePackedDouble:function(t,e){this.writeMessage(t,s,e)},writePackedFixed32:function(t,e){this.writeMessage(t,c,e)},writePackedSFixed32:function(t,e){this.writeMessage(t,u,e)},writePackedFixed64:function(t,e){this.writeMessage(t,f,e)},writePackedSFixed64:function(t,e){this.writeMessage(t,h,e)},writeBytesField:function(t,e){this.writeTag(t,n.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,n.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,n.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,n.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,n.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,n.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,n.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./buffer":469}],471:[function(t,e,r){"use strict";e.exports=function(t){var e=t.length;if(e0;--o)a=l[o],r=s[o],s[o]=s[a],s[a]=r,l[o]=l[r],l[r]=a,c=(c+r)*o;return n.freeUint32(l),n.freeUint32(s),c},r.unrank=function(t,e,r){switch(t){case 0:return r||[];case 1:return r?(r[0]=0,r):[0];case 2:return r?(e?(r[0]=0,r[1]=1):(r[0]=1,r[1]=0),r):e?[0,1]:[1,0]}var n,i,a,o=1;for((r=r||new Array(t))[0]=0,a=1;a0;--a)e=e-(n=e/o|0)*o|0,o=o/a|0,i=0|r[a],r[a]=0|r[n],r[n]=0|i;return r}},{"invert-permutation":280,"typedarray-pool":554}],473:[function(t,e,r){"use strict";function n(t){return i[t]?i[t]:("string"==typeof t&&(t=i[t]=t.split(/\s*,\s*|\s+/)),t)}e.exports=function(t,e,r){var i,a,o={};if("string"==typeof e&&(e=n(e)),Array.isArray(e)){var s={};for(a=0;a0){o=c[u][i][0],l=u;break}s=o[1^l];for(var f=0;f<2;++f)for(var h=c[f][i],d=0;d0&&(o=p,s=m,l=f)}return a?s:(o&&r(o,l),s)}function a(t,a){var o=c[a][t][0],s=[t];r(o,a);for(var l=o[1^a];;){for(;l!==t;)s.push(l),l=i(s[s.length-2],l,!1);if(c[0][t].length+c[1][t].length===0)break;var u=s[s.length-1],f=t,h=s[1],d=i(u,f,!0);if(n(e[u],e[f],e[h],e[d])<0)break;s.push(t),l=i(u,f)}return s}function o(t,e){return e[1]===e[e.length-1]}for(var s=0|e.length,l=t.length,c=[new Array(s),new Array(s)],u=0;u0;){c[0][u].length;var m=a(u,d);o(0,m)?p.push.apply(p,m):(p.length>0&&h.push(p),p=m)}p.length>0&&h.push(p)}return h};var n=t("compare-angle")},{"compare-angle":106}],475:[function(t,e,r){"use strict";e.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 c=r[d];for(s=0;s0})).length,g=new Array(m),v=new Array(m);for(d=0;d0;){var N=O.pop(),j=E[N];c(j,function(t,e){return t-e});var B,U=j.length,V=F[N];for(0===V&&(B=[H=p[N]]),d=0;d=0)&&(F[q]=1^V,O.push(q),0===V)){var H;r(H=p[q])||(H.reverse(),B.push(H))}}0===V&&R.push(B)}return R};var i=t("edges-to-adjacency-list"),a=t("planar-dual"),o=t("point-in-big-polygon"),s=t("two-product"),l=t("robust-sum"),c=t("uniq"),u=t("./lib/trim-leaves")},{"./lib/trim-leaves":475,"edges-to-adjacency-list":136,"planar-dual":474,"point-in-big-polygon":478,"robust-sum":520,"two-product":552,uniq:556}],477:[function(t,e,r){"use strict";function n(t,e){this.x=t,this.y=e}e.exports=n,n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,r=t.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,r=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=r,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t),n=e*this.x-r*this.y,i=r*this.x+e*this.y;return this.x=n,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t}},{}],478:[function(t,e,r){function n(){return!0}function i(t){for(var e={},r=0;r0&&e[n]===r[0]))return 1;i=t[n-1]}for(var a=1;i;){var s=i.key,l=o(r,s[0],s[1]);if(s[0][0]0))return 0;a=-1,i=i.right}else if(l>0)i=i.left;else{if(!(l<0))return 0;a=1,i=i.right}}return a}}(g.slabs,g.coordinates);return 0===n.length?v:function(t,e){return function(r){return t(r[0],r[1])?0:e(r)}}(i(n),v)};var o=t("robust-orientation")[3],s=t("slab-decomposition"),l=t("interval-tree-1d"),c=t("binary-search-bounds")},{"binary-search-bounds":70,"interval-tree-1d":279,"robust-orientation":515,"slab-decomposition":532}],479:[function(t,e,r){function n(t,e,r){var n=i.segments(t),a=i.segments(e),o=r(i.combine(n,a));return i.polygon(o)}var i,a=t("./lib/build-log"),o=t("./lib/epsilon"),s=t("./lib/intersecter"),l=t("./lib/segment-chainer"),c=t("./lib/segment-selector"),u=t("./lib/geojson"),f=!1,h=o();i={buildLog:function(t){return!0===t?f=a():!1===t&&(f=!1),!1!==f&&f.list},epsilon:function(t){return h.epsilon(t)},segments:function(t){var e=s(!0,h,f);return t.regions.forEach(e.addRegion),{segments:e.calculate(t.inverted),inverted:t.inverted}},combine:function(t,e){return{combined:s(!1,h,f).calculate(t.segments,t.inverted,e.segments,e.inverted),inverted1:t.inverted,inverted2:e.inverted}},selectUnion:function(t){return{segments:c.union(t.combined,f),inverted:t.inverted1||t.inverted2}},selectIntersect:function(t){return{segments:c.intersect(t.combined,f),inverted:t.inverted1&&t.inverted2}},selectDifference:function(t){return{segments:c.difference(t.combined,f),inverted:t.inverted1&&!t.inverted2}},selectDifferenceRev:function(t){return{segments:c.differenceRev(t.combined,f),inverted:!t.inverted1&&t.inverted2}},selectXor:function(t){return{segments:c.xor(t.combined,f),inverted:t.inverted1!==t.inverted2}},polygon:function(t){return{regions:l(t.segments,h,f),inverted:t.inverted}},polygonFromGeoJSON:function(t){return u.toPolygon(i,t)},polygonToGeoJSON:function(t){return u.fromPolygon(i,h,t)},union:function(t,e){return n(t,e,i.selectUnion)},intersect:function(t,e){return n(t,e,i.selectIntersect)},difference:function(t,e){return n(t,e,i.selectDifference)},differenceRev:function(t,e){return n(t,e,i.selectDifferenceRev)},xor:function(t,e){return n(t,e,i.selectXor)}},"object"==typeof window&&(window.PolyBool=i),e.exports=i},{"./lib/build-log":480,"./lib/epsilon":481,"./lib/geojson":482,"./lib/intersecter":483,"./lib/segment-chainer":485,"./lib/segment-selector":486}],480:[function(t,e,r){e.exports=function(){function t(t,r){return e.list.push({type:t,data:r?JSON.parse(JSON.stringify(r)):void 0}),e}var e,r=0,n=!1;return e={list:[],segmentId:function(){return r++},checkIntersection:function(e,r){return t("check",{seg1:e,seg2:r})},segmentChop:function(e,r){return t("div_seg",{seg:e,pt:r}),t("chop",{seg:e,pt:r})},statusRemove:function(e){return t("pop_seg",{seg:e})},segmentUpdate:function(e){return t("seg_update",{seg:e})},segmentNew:function(e,r){return t("new_seg",{seg:e,primary:r})},segmentRemove:function(e){return t("rem_seg",{seg:e})},tempStatus:function(e,r,n){return t("temp_status",{seg:e,above:r,below:n})},rewind:function(e){return t("rewind",{seg:e})},status:function(e,r,n){return t("status",{seg:e,above:r,below:n})},vert:function(r){return r===n?e:(n=r,t("vert",{x:r}))},log:function(e){return"string"!=typeof e&&(e=JSON.stringify(e,!1," ")),t("log",{txt:e})},reset:function(){return t("reset")},selected:function(e){return t("selected",{segs:e})},chainStart:function(e){return t("chain_start",{seg:e})},chainRemoveHead:function(e,r){return t("chain_rem_head",{index:e,pt:r})},chainRemoveTail:function(e,r){return t("chain_rem_tail",{index:e,pt:r})},chainNew:function(e,r){return t("chain_new",{pt1:e,pt2:r})},chainMatch:function(e){return t("chain_match",{index:e})},chainClose:function(e){return t("chain_close",{index:e})},chainAddHead:function(e,r){return t("chain_add_head",{index:e,pt:r})},chainAddTail:function(e,r){return t("chain_add_tail",{index:e,pt:r})},chainConnect:function(e,r){return t("chain_con",{index1:e,index2:r})},chainReverse:function(e){return t("chain_rev",{index:e})},chainJoin:function(e,r){return t("chain_join",{index1:e,index2:r})},done:function(){return t("done")}}}},{}],481:[function(t,e,r){e.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-c)*(i-u)/(o-u)+c-n>t&&(s=!s),a=c,o=u}return s}};return e}},{}],482:[function(t,e,r){var n={toPolygon:function(t,e){function r(e){function r(e){var r=e.slice(0,e.length-1);return t.segments({inverted:!1,regions:[r]})}if(e.length<=0)return t.segments({inverted:!1,regions:[]});for(var n=r(e[0]),i=1;i0})}function s(t,n){var i=t.seg,a=n.seg,o=i.start,s=i.end,c=a.start,u=a.end;r&&r.checkIntersection(i,a);var f=e.linesIntersect(o,s,c,u);if(!1===f){if(!e.pointsCollinear(o,s,c))return!1;if(e.pointsSame(o,u)||e.pointsSame(s,c))return!1;var h=e.pointsSame(o,c),d=e.pointsSame(s,u);if(h&&d)return n;var p=!h&&e.pointBetween(o,c,u),m=!d&&e.pointBetween(s,c,u);if(h)return m?l(n,s):l(t,u),n;p&&(d||(m?l(n,s):l(t,u)),l(n,o))}else 0===f.alongA&&(-1===f.alongB?l(t,c):0===f.alongB?l(t,f.pt):1===f.alongB&&l(t,u)),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 c=n.create(),f=[];!u.isEmpty();){var h=u.getHead();if(r&&r.vert(h.pt[0]),h.isStart){r&&r.segmentNew(h.seg,h.primary);var d=o(h),p=d.before?d.before.ev:null,m=d.after?d.after.ev:null;r&&r.tempStatus(h.seg,!!p&&p.seg,!!m&&m.seg);var g=function(){if(p){var t=s(h,p);if(t)return t}return!!m&&s(h,m)}();if(g&&(t?(v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below)&&(g.seg.myFill.above=!g.seg.myFill.above):g.seg.otherFill=h.seg.myFill,r&&r.segmentUpdate(g.seg),h.other.remove(),h.remove()),u.getHead()!==h){r&&r.rewind(h.seg);continue}if(t){var v;v=null===h.seg.myFill.below||h.seg.myFill.above!==h.seg.myFill.below,h.seg.myFill.below=m?m.seg.myFill.above:i,h.seg.myFill.above=v?!h.seg.myFill.below:h.seg.myFill.below}else if(null===h.seg.otherFill){var y;y=m?h.primary===m.primary?m.seg.otherFill.above:m.seg.myFill.above:h.primary?a:i,h.seg.otherFill={above:y,below:y}}r&&r.status(h.seg,!!p&&p.seg,!!m&&m.seg),h.other.status=d.insert(n.node({ev:h}))}else{var x=h.status;if(null===x)throw new Error("PolyBool: Zero-length segment detected; your epsilon is probably too small or too large");if(c.exists(x.prev)&&c.exists(x.next)&&s(x.prev.ev,x.next.ev),r&&r.statusRemove(x.ev.seg),x.remove(),!h.primary){var b=h.seg.myFill;h.seg.myFill=h.seg.otherFill,h.seg.otherFill=b}f.push(h.seg)}u.getHead().remove()}return r&&r.done(),f}var u=n.create();return t?{addRegion:function(t){for(var r,n=t[t.length-1],a=0;a=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p):(b=0,d>=0?(_=0,y=p):-d>=f?(_=1,y=f+2*d+p):y=d*(_=-d/f)+p);else if(_<0)_=0,h>=0?(b=0,y=p):-h>=c?(b=1,y=c+2*h+p):y=h*(b=-h/c)+p;else{var w=1/x;y=(b*=w)*(c*b+u*(_*=w)+2*h)+_*(u*b+f*_+2*d)+p}else{var M,k,A,T;b<0?(k=f+d)>(M=u+h)?(A=k-M)>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p:(b=0,k<=0?(_=1,y=f+2*d+p):d>=0?(_=0,y=p):y=d*(_=-d/f)+p):_<0?(k=c+h)>(M=u+d)?(A=k-M)>=(T=c-2*u+f)?(_=1,b=0,y=f+2*d+p):y=(b=1-(_=A/T))*(c*b+u*_+2*h)+_*(u*b+f*_+2*d)+p:(_=0,k<=0?(b=1,y=c+2*h+p):h>=0?(b=0,y=p):y=h*(b=-h/c)+p):(A=f+d-u-h)<=0?(b=0,_=1,y=f+2*d+p):A>=(T=c-2*u+f)?(b=1,_=0,y=c+2*h+p):y=(b=A/T)*(c*b+u*(_=1-b)+2*h)+_*(u*b+f*_+2*d)+p}var S=1-b-_;for(l=0;l1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]);return n+a((t=t.replace(C,".")).split("."),e).join(".")}function s(t){for(var e,r,n=[],i=0,a=t.length;i=55296&&e<=56319&&i65535&&(e+=P((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=P(t)}).join("")}function c(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:b}function u(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function f(t,e,r){var n=0;for(t=r?I(t/k):t>>1,t+=I(t/e);t>D*w>>1;n+=b)t=I(t/D);return I(n+(D+1)*t/(t+M))}function h(t){var e,r,n,a,o,s,u,h,d,p,m=[],g=t.length,v=0,y=T,M=A;for((r=t.lastIndexOf(S))<0&&(r=0),n=0;n=128&&i("not-basic"),m.push(t.charCodeAt(n));for(a=r>0?r+1:0;a=g&&i("invalid-input"),((h=c(t.charCodeAt(a++)))>=b||h>I((x-v)/s))&&i("overflow"),v+=h*s,d=u<=M?_:u>=M+w?w:u-M,!(hI(x/(p=b-d))&&i("overflow"),s*=p;M=f(v-o,e=m.length+1,0==o),I(v/e)>x-y&&i("overflow"),y+=I(v/e),v%=e,m.splice(v++,0,y)}return l(m)}function d(t){var e,r,n,a,o,l,c,h,d,p,m,g,v,y,M,k=[];for(g=(t=s(t)).length,e=T,r=0,o=A,l=0;l=e&&mI((x-r)/(v=n+1))&&i("overflow"),r+=(c-e)*v,e=c,l=0;lx&&i("overflow"),m==e){for(h=r,d=b;p=d<=o?_:d>=o+w?w:d-o,!(h= 0x80 (not a basic code point)","invalid-input":"Invalid input"},D=b-_,I=Math.floor,P=String.fromCharCode;if(v={version:"1.4.1",ucs2:{decode:s,encode:l},decode:h,encode:d,toASCII:function(t){return o(t,function(t){return L.test(t)?"xn--"+d(t):t})},toUnicode:function(t){return o(t,function(t){return E.test(t)?h(t.slice(4).toLowerCase()):t})}},p&&m)if(e.exports==p)m.exports=v;else for(y in v)v.hasOwnProperty(y)&&(p[y]=v[y]);else n.punycode=v}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],490:[function(t,e,r){e.exports=t("gl-quat/slerp")},{"gl-quat/slerp":236}],491:[function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,a){e=e||"&",r=r||"=";var o={};if("string"!=typeof t||0===t.length)return o;var s=/\+/g;t=t.split(e);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=t.length;l>0&&c>l&&(c=l);for(var u=0;u=0?(f=m.substr(0,g),h=m.substr(g+1)):(f=m,h=""),d=decodeURIComponent(f),p=decodeURIComponent(h),n(o,d)?i(o[d])?o[d].push(p):o[d]=[o[d],p]:o[d]=p}return o};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],492:[function(t,e,r){"use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;ne?1:0};a>r;){if(a-r>600){var s=a-r+1,l=e-r+1,c=Math.log(s),u=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*u*(s-u)/s)*(l-s/2<0?-1:1);n(t,e,Math.max(r,Math.floor(e-l*u/s+f)),Math.min(a,Math.floor(e+(s-l)*u/s+f)),o)}var h=t[e],d=r,p=a;for(i(t,r,e),o(t[a],h)>0&&i(t,r,a);d0;)p--}0===o(t[r],h)?i(t,r,p):i(t,++p,a),p<=e&&(r=p+1),e<=p&&(a=p-1)}}function i(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}e.exports=n},{}],495:[function(t,e,r){"use strict";var n=t("big-rat/add");e.exports=function(t,e){for(var r=t.length,i=new Array(r),a=0;a0){var c=t[r-1];if(0===n(s,c)&&a(c)!==l){r-=1;continue}}t[r++]=s}}return t.length=r,t}},{"cell-orientation":90,"compare-cell":107,"compare-oriented-cell":108}],500:[function(t,e,r){"use strict";var n=t("array-bounds"),i=t("color-normalize"),a=t("update-diff"),o=t("pick-by-alias"),s=t("object-assign"),l=t("flatten-vertex-data"),c=t("to-float32"),u=c.float32,f=c.fract32;e.exports=function(t,e){function r(t){t?p(t):null===t&&m(),c()}function c(e){if("number"==typeof e)return d(e);e&&!Array.isArray(e)&&(e=[e]),t._refresh(),k.forEach(function(t,r){t&&(e&&(e[r]?t.draw=!0:t.draw=!1),t.draw?d(r):t.draw=!0)})}function d(t){"number"==typeof t&&(t=k[t]),null!=t&&t&&t.count&&t.color&&t.opacity&&t.positions&&t.positions.length>1&&(t.scaleRatio=[t.scale[0]*t.viewport.width,t.scale[1]*t.viewport.height],g(t),t.after&&t.after(t))}function p(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0,r=0;if(k=t.map(function(t,c){var u=k[c];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=o(t,{color:"color colors fill",capSize:"capSize cap capsize cap-size",lineWidth:"lineWidth line-width width line thickness",opacity:"opacity alpha",range:"range dataBox",viewport:"viewport viewBox",errors:"errors error",positions:"positions position data points"}),u||(k[c]=u={id:c,scale:null,translate:null,scaleFract:null,translateFract:null,draw:!0},t=s({},M,t)),a(u,t,[{lineWidth:function(t){return.5*+t},capSize:function(t){return.5*+t},opacity:parseFloat,errors:function(t){return t=l(t),r+=t.length,t},positions:function(t,r){return t=l(t,"float64"),r.count=Math.floor(t.length/2),r.bounds=n(t,2),r.offset=e,e+=r.count,t}},{color:function(t,e){var r=e.count;if(t||(t="transparent"),!Array.isArray(t)||"number"==typeof t[0]){var n=t;t=Array(r);for(var a=0;a2&&(t._refresh(),e.fill&&e.triangles&&e.triangles.length>2&&x(e),e.thickness&&e.color&&(e.scaleRatio=[e.scale[0]*e.viewport.width,e.scale[1]*e.viewport.height],e.scaleRatio[0]>L||e.scaleRatio[1]>L?y(e):"rect"===e.join||!e.join&&(e.thickness<=2||e.positions.length>=C)?y(e):v(e),e.after&&e.after(e)))}function m(t){if(t){null!=t.length?"number"==typeof t[0]&&(t=[{positions:t}]):Array.isArray(t)||(t=[t]);var e=0;if(S=t.map(function(t,r){var s=S[r];return t?("function"==typeof t?t={after:t}:"number"==typeof t[0]&&(t={positions:t}),t=l(t,{positions:"positions points data coords",thickness:"thickness lineWidth lineWidths line-width linewidth width stroke-width strokewidth strokeWidth",join:"lineJoin linejoin join type mode",miterLimit:"miterlimit miterLimit",dashes:"dash dashes dasharray dash-array dashArray",color:"color stroke colors stroke-color strokeColor",fill:"fill fill-color fillColor",opacity:"alpha opacity",overlay:"overlay crease overlap intersect",close:"closed close closed-path closePath",range:"range dataBox",viewport:"viewport viewBox",hole:"holes hole hollow",after:"after callback done pass"}),s||(S[r]=s={id:r,scale:null,scaleFract:null,translate:null,translateFract:null,count:0,offset:0,dashLength:0,hole:!0},t=o({},T,t)),c(s,t,[{thickness:parseFloat,opacity:parseFloat,miterLimit:parseFloat,overlay:Boolean,join:function(t){return t},after:function(t){return t},hole:function(t){return t||[]},positions:function(t,r,n){t=u(t,"float64");var i=Math.floor(t.length/2),o=a(t,2);return r.range||n.range||(n.range=o),r.count=i,r.bounds=o,e+=i,t},fill:function(t){return t?i(t,"uint8"):null},dashes:function(t,e,r){var n,i=e.dashLength;if(!t||t.length<2)i=1,n=new Uint8Array([255,255,255,255,255,255,255,255]);else{i=0;for(var a=0;a=4&&e.positions[0]===e.positions[e.positions.length-2]&&e.positions[1]===e.positions[e.positions.length-1]},positions:function(t,e,r){if(e.fill&&t.length){for(var n=[],i={},a=0,o=0,s=0,l=e.count;o 0. && baClipping < length(normalWidth * endBotJoin)) {\n\t\t//handle miter clipping\n\t\tbTopCoord -= normalWidth * endTopJoin;\n\t\tbTopCoord += normalize(endTopJoin * normalWidth) * baClipping;\n\t}\n\n\tif (nextReverse) {\n\t\t//make join rectangular\n\t\tvec2 miterShift = normalWidth * endJoinDirection * miterLimit * .5;\n\t\tfloat normalAdjust = 1. - min(miterLimit / endMiterRatio, 1.);\n\t\tbBotCoord = bCoord + miterShift - normalAdjust * normalWidth * currNormal * .5;\n\t\tbTopCoord = bCoord + miterShift + normalAdjust * normalWidth * currNormal * .5;\n\t}\n\telse if (!prevReverse && abClipping > 0. && abClipping < length(normalWidth * startBotJoin)) {\n\t\t//handle miter clipping\n\t\taBotCoord -= normalWidth * startBotJoin;\n\t\taBotCoord += normalize(startBotJoin * normalWidth) * abClipping;\n\t}\n\n\tvec2 aTopPosition = (aTopCoord + translate) * scale;\n\tvec2 aBotPosition = (aBotCoord + translate) * scale;\n\n\tvec2 bTopPosition = (bTopCoord + translate) * scale;\n\tvec2 bBotPosition = (bBotCoord + translate) * scale;\n\n\t//position is normalized 0..1 coord on the screen\n\tvec2 position = (aTopPosition * lineTop + aBotPosition * lineBot) * lineStart + (bTopPosition * lineTop + bBotPosition * lineBot) * lineEnd;\n\n\tstartCoord = (aCoord + translate) * scaleRatio + viewport.xy;\n\tendCoord = (bCoord + translate) * scaleRatio + viewport.xy;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tenableStartMiter = step(dot(currTangent, prevTangent), .5);\n\tenableEndMiter = step(dot(currTangent, nextTangent), .5);\n\n\t//bevel miter cutoffs\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * miterLimit * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * miterLimit * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n\n\t//round miter cutoffs\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tvec2 startMiterWidth = vec2(startJoinDirection) * thickness * abs(dot(startJoinDirection, currNormal)) * .5;\n\t\t\tstartCutoff = vec4(aCoord, aCoord);\n\t\t\tstartCutoff.zw += vec2(-startJoinDirection.y, startJoinDirection.x) / scaleRatio;\n\t\t\tstartCutoff = (startCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tstartCutoff += viewport.xyxy;\n\t\t\tstartCutoff += startMiterWidth.xyxy;\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tvec2 endMiterWidth = vec2(endJoinDirection) * thickness * abs(dot(endJoinDirection, currNormal)) * .5;\n\t\t\tendCutoff = vec4(bCoord, bCoord);\n\t\t\tendCutoff.zw += vec2(-endJoinDirection.y, endJoinDirection.x) / scaleRatio;\n\t\t\tendCutoff = (endCutoff + translate.xyxy) * scaleRatio.xyxy;\n\t\t\tendCutoff += viewport.xyxy;\n\t\t\tendCutoff += endMiterWidth.xyxy;\n\t\t}\n\t}\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id, miterMode;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\nvarying vec4 startCutoff, endCutoff;\nvarying vec2 startCoord, endCoord;\nvarying float enableStartMiter, enableEndMiter;\n\nfloat distToLine(vec2 p, vec2 a, vec2 b) {\n\tvec2 diff = b - a;\n\tvec2 perp = normalize(vec2(-diff.y, diff.x));\n\treturn dot(p - a, perp);\n}\n\nvoid main() {\n\tfloat alpha = 1., distToStart, distToEnd;\n\tfloat cutoff = thickness * .5;\n\n\t//bevel miter\n\tif (miterMode == 1.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToStart + 1., 0.), 1.);\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < -1.) {\n\t\t\t\tdiscard;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\talpha *= min(max(distToEnd + 1., 0.), 1.);\n\t\t}\n\t}\n\n\t// round miter\n\telse if (miterMode == 2.) {\n\t\tif (enableStartMiter == 1.) {\n\t\t\tdistToStart = distToLine(gl_FragCoord.xy, startCutoff.xy, startCutoff.zw);\n\t\t\tif (distToStart < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - startCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\n\t\tif (enableEndMiter == 1.) {\n\t\t\tdistToEnd = distToLine(gl_FragCoord.xy, endCutoff.xy, endCutoff.zw);\n\t\t\tif (distToEnd < 0.) {\n\t\t\t\tfloat radius = length(gl_FragCoord.xy - endCoord);\n\n\t\t\t\tif(radius > cutoff + .5) {\n\t\t\t\t\tdiscard;\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\talpha -= smoothstep(cutoff - .5, cutoff + .5, radius);\n\t\t\t}\n\t\t}\n\t}\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1},bColor:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset+4},divisor:1},prevCoord:{buffer:w,stride:8,offset:function(t,e){return 8*e.offset},divisor:1},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},nextCoord:{buffer:w,stride:8,offset:function(t,e){return 24+8*e.offset},divisor:1}}},z)),y=t(o({vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 aCoord, bCoord, aCoordFract, bCoordFract;\nattribute vec4 color;\nattribute float lineEnd, lineTop;\n\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float thickness, pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nconst float MAX_LINES = 256.;\n\nvec2 project(vec2 position, vec2 positionFract, vec2 scale, vec2 scaleFract, vec2 translate, vec2 translateFract) {\n return (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n}\n\nvoid main() {\n\t// vec2 scaleRatio = scale * viewport.zw;\n\tvec2 normalWidth = thickness / scaleRatio;\n\n\tfloat lineStart = 1. - lineEnd;\n\tfloat lineOffset = lineTop * 2. - 1.;\n\tfloat depth = (MAX_LINES - 1. - id) / (MAX_LINES);\n\n\tvec2 diff = (bCoord + bCoordFract - aCoord - aCoordFract);\n\ttangent = normalize(diff * scaleRatio);\n\tvec2 normal = vec2(-tangent.y, tangent.x);\n\n\tvec2 position = project(aCoord, aCoordFract, scale, scaleFract, translate, translateFract) * lineStart\n\t\t+ project(bCoord, bCoordFract, scale, scaleFract, translate, translateFract) * lineEnd\n\n\t\t+ thickness * normal * .5 * lineOffset / viewport.zw;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D dashPattern;\nuniform vec2 dashShape;\nuniform float dashLength, pixelRatio, thickness, opacity, id;\n\nvarying vec4 fragColor;\nvarying vec2 tangent;\n\nvoid main() {\n\tfloat alpha = 1.;\n\n\tfloat t = fract(dot(tangent, gl_FragCoord.xy) / dashLength) * .5 + .25;\n\tfloat dash = texture2D(dashPattern, vec2(t * dashLength * 2. / dashShape.x, (id + .5) / dashShape.y)).r;\n\n\tgl_FragColor = fragColor * dash;\n\tgl_FragColor.a *= alpha * opacity * dash;\n}\n"]),attributes:{lineEnd:{buffer:_,divisor:0,stride:8,offset:0},lineTop:{buffer:_,divisor:0,stride:8,offset:4},aCoord:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoord:{buffer:w,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},aCoordFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset},divisor:1},bCoordFract:{buffer:M,stride:8,offset:function(t,e){return 16+8*e.offset},divisor:1},color:{buffer:b,stride:4,offset:function(t,e){return 4*e.offset},divisor:1}}},z)),x=t({primitive:"triangle",elements:function(t,e){return e.triangles},offset:0,vert:s(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\n\nuniform vec4 color;\nuniform vec2 scale, scaleFract, translate, translateFract, scaleRatio;\nuniform float pixelRatio, id;\nuniform vec4 viewport;\n\nvarying vec4 fragColor;\n\nconst float MAX_LINES = 256.;\n\nvoid main() {\n\tfloat depth = (MAX_LINES - 4. - id) / (MAX_LINES);\n\n\tvec2 position = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n\tgl_Position = vec4(position * 2.0 - 1.0, depth, 1);\n\n\tfragColor = color / 255.;\n}\n"]),frag:s(["precision highp float;\n#define GLSLIFY 1\n\nuniform float opacity;\n\nvarying vec4 fragColor;\n\nvoid main() {\n\tgl_FragColor = fragColor;\n\tgl_FragColor.a *= opacity;\n}\n"]),uniforms:{scale:t.prop("scale"),color:t.prop("fill"),scaleFract:t.prop("scaleFract"),translateFract:t.prop("translateFract"),translate:t.prop("translate"),opacity:t.prop("opacity"),pixelRatio:t.context("pixelRatio"),id:t.prop("id"),viewport:function(t,e){return[e.viewport.x,e.viewport.y,t.viewportWidth,t.viewportHeight]}},attributes:{position:{buffer:w,stride:8,offset:function(t,e){return 8+8*e.offset}},positionFract:{buffer:M,stride:8,offset:function(t,e){return 8+8*e.offset}}},blend:z.blend,depth:{enable:!1},scissor:z.scissor,stencil:z.stencil,viewport:z.viewport}),o(r,{update:m,draw:d,destroy:g,regl:t,gl:A,canvas:A.canvas,lines:S}),r}},{"array-bounds":48,"array-normalize":49,"color-normalize":99,earcut:135,"flatten-vertex-data":143,glslify:502,"object-assign":462,"pick-by-alias":473,"update-diff":558}],502:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],503:[function(t,e,r){"use strict";var n=t("color-normalize"),i=t("array-bounds"),a=t("color-id"),o=t("snap-points-2d"),s=t("object-assign"),l=t("glslify"),c=t("binary-search-bounds"),u=t("pick-by-alias"),f=t("update-diff"),h=t("flatten-vertex-data"),d=t("is-iexplorer"),p=t("to-float32"),m=p.float32,g=p.fract32;e.exports=function(t,e){function r(t){t?x(t):null===t&&M(),p()}function p(t){if("number"==typeof t)return v(t);Array.isArray(t)?t.forEach(function(t,e){if(null!=t)return t.length?v(t,e):v(t)}):O.forEach(function(t,e){t&&v(e)})}function v(e,r){"number"==typeof e&&(e=O[e]);var n;if(Array.isArray(e)&&(n=e,e=O[r]),e&&e.count&&e.opacity){var i;if(n){i=Array(e.count);for(var a=0;a1)){var g=m.offset,v=m.count+g,y=c.ge(f,i[0],g,v-1),x=c.lt(f,i[2],y,v-1)+1;if(!(x<=y))if(r){var b=n(t.data.subarray(y,x),r);l.push(s({},e,{elements:b,marker:F[h],offset:0,count:b.length}))}else l.push(s({},e,{elements:t.elements,marker:F[h],offset:y,count:x-y}))}}return l}function x(e){if(e){null!=e.length?"number"==typeof e[0]&&(e=[{positions:e}]):Array.isArray(e)||(e=[e]);var r=0,n=0,a=0;O=e.map(function(e,l){var c=O[l];return e?("function"==typeof e?e={after:e}:"number"==typeof e[0]&&(e={positions:e}),e=u(e,{positions:"positions data points",snap:"snap cluster",size:"sizes size radius",borderSize:"borderSizes borderSize stroke-width strokeWidth outline",color:"colors color fill fill-color fillColor",borderColor:"borderColors borderColor stroke stroke-color strokeColor",palette:"palette swatch",marker:"markers marker shape",range:"range dataBox",viewport:"viewport viewBox",opacity:"opacity alpha"}),c||(O[l]=c={id:l,scale:null,translate:null,scaleFract:null,translateFract:null,markerIds:[]},e=s({},P,e)),!e.positions||"marker"in e||(e.marker=c.marker,delete c.marker),f(c,e,[{snap:!0,size:function(t){return n+=t.length?1:0,t},borderSize:function(t){return n+=t.length?1:0,t},opacity:parseFloat,color:function(t){return t=w(t),a++,t},borderColor:function(t){return t=w(t),a++,t},positions:function(t,e,n){t=h(t,"float64");var a=e.count=Math.floor(t.length/2),o=e.bounds=a?i(t,2):null;return n.range||e.range||(delete e.range,n.range=o),e.offset=r,r+=a,n.marker||e.marker||(delete e.marker,n.marker=null),t}},{marker:function(t,e,r){if(e.markerIds.length=0,t&&"number"!=typeof t[0])for(var n=0,i=t.length;ni)){c.snap=!0;var h=c.x=Array(u),d=c.w=Array(u),p=void 0;if(n.length>1){p=Array(2*u);for(var m=0;m=0)return r;var n;if(e instanceof Uint8Array||e instanceof Uint8ClampedArray)n=e;else{n=new Uint8Array(e.length);for(var i=0,a=e.length;i 1.0) {\n discard;\n }\n\n float centerFraction = fragBorderSize == 0. ? 2. : fragSize / (fragSize + fragBorderSize + 1.25);\n\n vec4 baseColor = mix(borderColor, color, smoothStep(radius, centerFraction));\n float alpha = 1.0 - pow(1.0 - baseColor.a, 1.);\n gl_FragColor = vec4(baseColor.rgb * alpha, alpha);\n}\n"]),vert:l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth, fragBorderSize, fragSize;\n\nvoid main() {\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n fragBorderSize = borderSize;\n fragSize = size;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragWidth = 1. / gl_PointSize;\n}\n"]),uniforms:{color:function(t,e){var r=e.color.length?e.color[0]:e.color;return D.slice(4*r,4*r+4).map(function(t){return t/255})},borderColor:function(t,e){var r=e.borderColor.length?e.borderColor[0]:e.borderColor;return D.slice(4*r,4*r+4).map(function(t){return t/255})},pixelRatio:t.context("pixelRatio"),palette:C,scale:t.prop("scale"),scaleFract:t.prop("scaleFract"),translate:t.prop("translate"),translateFract:t.prop("translateFract"),opacity:t.prop("opacity"),marker:t.prop("marker")},attributes:{position:S,positionFract:E,size:B.attributes.size,borderSize:B.attributes.borderSize}}));else{var U=s({},B);U.frag=l(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragWidth, fragBorderColorLevel, fragColorLevel;\n\nuniform sampler2D marker;\nuniform float pixelRatio, opacity;\n\nfloat smoothStep(float x, float y) {\n return 1.0 / (1.0 + exp(50.0*(x - y)));\n}\n\nvoid main() {\n float dist = texture2D(marker, gl_PointCoord).r, delta = fragWidth;\n\n //max-distance alpha\n if (dist < 0.003) discard;\n\n //null-border case\n if (fragBorderColorLevel == fragColorLevel || fragBorderColor.a == 0.) {\n float colorAmt = smoothstep(.5 - delta, .5 + delta, dist);\n gl_FragColor = vec4(fragColor.rgb, colorAmt * fragColor.a);\n return;\n }\n\n float borderColorAmt = smoothstep(fragBorderColorLevel - delta, fragBorderColorLevel + delta, dist);\n float colorAmt = smoothstep(fragColorLevel - delta, fragColorLevel + delta, dist);\n\n vec4 color = fragBorderColor;\n color.a *= borderColorAmt;\n color = mix(color, fragColor, colorAmt);\n color.a *= opacity;\n\n gl_FragColor = color;\n}\n"]),U.vert=l(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\nconst float borderLevel = .5;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragPointSize, fragBorderRadius,\n\t\tfragWidth, fragBorderColorLevel, fragColorLevel;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = 2. * size * pixelRatio;\n fragPointSize = size * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n + (positionFract + translateFract) * scale\n + (position + translate) * scaleFract\n + (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n\n fragBorderColorLevel = clamp(borderLevel - borderLevel * borderSize / size, 0., 1.);\n fragColorLevel = clamp(borderLevel + (1. - borderLevel) * borderSize / size, 0., 1.);\n}\n"]),k=t(U);var V=s({},B);V.frag=l(["precision highp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor, fragBorderColor;\n\nuniform float opacity;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n\tfloat radius, alpha = 1.0, delta = fragWidth;\n\n\tradius = length(2.0 * gl_PointCoord.xy - 1.0);\n\n\tif(radius > 1.0 + delta) {\n\t\tdiscard;\n\t\treturn;\n\t}\n\n\talpha -= smoothstep(1.0 - delta, 1.0 + delta, radius);\n\n\tfloat borderRadius = fragBorderRadius;\n\tfloat ratio = smoothstep(borderRadius - delta, borderRadius + delta, radius);\n\tvec4 color = mix(fragColor, fragBorderColor, ratio);\n\tcolor.a *= alpha * opacity;\n\tgl_FragColor = color;\n}\n"]),V.vert=l(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec2 position, positionFract;\nattribute float size, borderSize;\nattribute float colorId, borderColorId;\n\nuniform vec2 scale, scaleFract, translate, translateFract;\nuniform float pixelRatio;\nuniform sampler2D palette;\n\nconst float paletteSize = 4096., maxSize = 100.;\n\nvarying vec4 fragColor, fragBorderColor;\nvarying float fragBorderRadius, fragWidth;\n\nvoid main() {\n vec4 color = texture2D(palette, vec2((colorId + .5) / paletteSize, 0));\n vec4 borderColor = texture2D(palette, vec2((borderColorId + .5) / paletteSize, 0));\n\n float size = size * maxSize / 255.;\n float borderSize = borderSize * maxSize / 255.;\n\n gl_PointSize = (size + borderSize) * pixelRatio;\n\n vec2 pos = (position + translate) * scale\n\t\t\t+ (positionFract + translateFract) * scale\n\t\t\t+ (position + translate) * scaleFract\n\t\t\t+ (positionFract + translateFract) * scaleFract;\n\n gl_Position = vec4(pos * 2. - 1., 0, 1);\n\n fragBorderRadius = borderSize == 0. ? 2. : 1. - 2. * borderSize / (size + borderSize);\n fragColor = color;\n fragBorderColor = borderColor;\n fragWidth = 1. / gl_PointSize;\n}\n"]),A=t(V)}return s(r,{update:x,draw:p,destroy:M,regl:t,gl:z,canvas:z.canvas,groups:O,markers:R}),r}},{"array-bounds":48,"binary-search-bounds":504,"color-id":97,"color-normalize":99,"flatten-vertex-data":143,glslify:505,"is-iexplorer":284,"object-assign":462,"pick-by-alias":473,"snap-points-2d":534,"to-float32":547,"update-diff":558}],504:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=["function ",t,"(a,l,h,",n.join(","),"){",i?"":"var i=",r?"l-1":"h+1",";while(l<=h){var m=(l+h)>>>1,x=a[m]"];return i?e.indexOf("c")<0?a.push(";if(x===y){return m}else if(x<=y){"):a.push(";var p=c(x,y);if(p===0){return m}else if(p<=0){"):a.push(";if(",e,"){i=m;"),r?a.push("l=m+1}else{h=m-1}"):a.push("h=m-1}else{l=m+1}"),a.push("}"),i?a.push("return -1};"):a.push("return i};"),a.join("")}function i(t,e,r,i){return new Function([n("A","x"+t+"y",e,["y"],i),n("P","c(x,y)"+t+"0",e,["y","c"],i),"function dispatchBsearch",r,"(a,y,c,l,h){if(typeof(c)==='function'){return P(a,(l===void 0)?0:l|0,(h===void 0)?a.length-1:h|0,y,c)}else{return A(a,(c===void 0)?0:c|0,(l===void 0)?a.length-1:l|0,y)}}return dispatchBsearch",r].join(""))()}e.exports={ge:i(">=",!1,"GE"),gt:i(">",!1,"GT"),lt:i("<",!0,"LT"),le:i("<=",!0,"LE"),eq:i("-",!0,"EQ",!0)}},{}],505:[function(t,e,r){arguments[4][169][0].apply(r,arguments)},{dup:169}],506:[function(t,e,r){!function(t,n){"object"==typeof r&&void 0!==e?e.exports=n():t.createREGL=n()}(this,function(){function t(t,e){this.id=j++,this.type=t,this.data=e}function e(t){if(0===t.length)return[];var r=t.charAt(0),n=t.charAt(t.length-1);if(1>>=e,r=(255>>=r,e|=r,r=(15>>=r,e|=r,r=(3>>r>>1}function c(t){t:{for(var e=16;268435456>=e;e*=16)if(t<=e){t=e;break t}t=0}return 0<(e=G[l(t)>>2]).length?e.pop():new ArrayBuffer(t)}function u(t){G[l(t.byteLength)>>2].push(t)}function f(t,e,r,n,i,a){for(var o=0;o>>31<<15,i=(a<<1>>>24)-127,a=a>>13&1023;e[r]=-24>i?n:-14>i?n+(a+1024>>-14-i):15>=i,r.height>>=i,d(r,n[i]),t.mipmask|=1<e;++e)t.images[e]=null;return t}function L(t){for(var e=t.images,r=0;re){for(var r=0;r=--this.refCount&&F(this)}}),s.profile&&(a.getTotalTextureSize=function(){var t=0;return Object.keys(ft).forEach(function(e){t+=ft[e].stats.size}),t}),{create2D:function(e,r){function n(t,e){var r=i.texInfo;C.call(r);var a=E();return"number"==typeof t?"number"==typeof e?A(a,0|t,0|e):A(a,0|t,0|t):t?(z(r,t),T(a,t)):A(a,1,1),r.genMipmaps&&(a.mipmask=(a.width<<1)-1),i.mipmask=a.mipmask,c(i,a),i.internalformat=a.internalformat,n.width=a.width,n.height=a.height,P(i),S(a,3553),D(r,3553),O(),L(a),s.profile&&(i.stats.size=M(i.internalformat,i.type,a.width,a.height,r.genMipmaps,!1)),n.format=$[i.internalformat],n.type=tt[i.type],n.mag=et[r.magFilter],n.min=rt[r.minFilter],n.wrapS=ot[r.wrapS],n.wrapT=ot[r.wrapT],n}var i=new I(3553);return ft[i.id]=i,a.textureCount++,n(e,r),n.subimage=function(t,e,r,a){e|=0,r|=0,a|=0;var o=m();return c(o,i),o.width=0,o.height=0,d(o,t),o.width=o.width||(i.width>>a)-e,o.height=o.height||(i.height>>a)-r,P(i),p(o,3553,e,r,a),O(),k(o),n},n.resize=function(e,r){var a=0|e,o=0|r||a;if(a===i.width&&o===i.height)return n;n.width=i.width=a,n.height=i.height=o,P(i);for(var l=0;i.mipmask>>l;++l)t.texImage2D(3553,l,i.format,a>>l,o>>l,0,i.format,i.type,null);return O(),s.profile&&(i.stats.size=M(i.internalformat,i.type,a,o,!1,!1)),n},n._reglType="texture2d",n._texture=i,s.profile&&(n.stats=i.stats),n.destroy=function(){i.decRef()},n},createCube:function(e,r,n,i,o,l){function f(t,e,r,n,i,a){var o,l=h.texInfo;for(C.call(l),o=0;6>o;++o)g[o]=E();if("number"!=typeof t&&t){if("object"==typeof t)if(e)T(g[0],t),T(g[1],e),T(g[2],r),T(g[3],n),T(g[4],i),T(g[5],a);else if(z(l,t),u(h,t),"faces"in t)for(t=t.faces,o=0;6>o;++o)c(g[o],h),T(g[o],t[o]);else for(o=0;6>o;++o)T(g[o],t)}else for(t=0|t||1,o=0;6>o;++o)A(g[o],t,t);for(c(h,g[0]),h.mipmask=l.genMipmaps?(g[0].width<<1)-1:g[0].mipmask,h.internalformat=g[0].internalformat,f.width=g[0].width,f.height=g[0].height,P(h),o=0;6>o;++o)S(g[o],34069+o);for(D(l,34067),O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,l.genMipmaps,!0)),f.format=$[h.internalformat],f.type=tt[h.type],f.mag=et[l.magFilter],f.min=rt[l.minFilter],f.wrapS=ot[l.wrapS],f.wrapT=ot[l.wrapT],o=0;6>o;++o)L(g[o]);return f}var h=new I(34067);ft[h.id]=h,a.cubeCount++;var g=Array(6);return f(e,r,n,i,o,l),f.subimage=function(t,e,r,n,i){r|=0,n|=0,i|=0;var a=m();return c(a,h),a.width=0,a.height=0,d(a,e),a.width=a.width||(h.width>>i)-r,a.height=a.height||(h.height>>i)-n,P(h),p(a,34069+t,r,n,i),O(),k(a),f},f.resize=function(e){if((e|=0)!==h.width){f.width=h.width=e,f.height=h.height=e,P(h);for(var r=0;6>r;++r)for(var n=0;h.mipmask>>n;++n)t.texImage2D(34069+r,n,h.format,e>>n,e>>n,0,h.format,h.type,null);return O(),s.profile&&(h.stats.size=M(h.internalformat,h.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=h,s.profile&&(f.stats=h.stats),f.destroy=function(){h.decRef()},f},clear:function(){for(var e=0;er;++r)if(0!=(e.mipmask&1<>r,e.height>>r,0,e.internalformat,e.type,null);else for(var n=0;6>n;++n)t.texImage2D(34069+n,r,e.internalformat,e.width>>r,e.height>>r,0,e.internalformat,e.type,null);D(e.texInfo,e.target)})}}}function A(){this.w=this.z=this.y=this.x=this.state=0,this.buffer=null,this.size=0,this.normalized=!1,this.type=5126,this.divisor=this.stride=this.offset=0}function T(t,e,r,n){function i(t,e,r,n){this.name=t,this.id=e,this.location=r,this.info=n}function a(t,e){for(var r=0;rt&&(t=e.stats.uniformsCount)}),t},r.getMaxAttributesCount=function(){var t=0;return f.forEach(function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)}),t}),{clear:function(){var e=t.deleteShader.bind(t);H(l).forEach(e),l={},H(c).forEach(e),c={},f.forEach(function(e){t.deleteProgram(e.program)}),f.length=0,u={},r.shaderCount=0},program:function(t,e,i){var a=u[e];a||(a=u[e]={});var o=a[t];return o||(o=new function(t,e){this.id=h++,this.fragId=t,this.vertId=e,this.program=null,this.uniforms=[],this.attributes=[],n.profile&&(this.stats={uniformsCount:0,attributesCount:0})}(e,t),r.shaderCount++,s(o),a[t]=o,f.push(o)),o},restore:function(){l={},c={};for(var t=0;t="+e+"?"+i+".constant["+e+"]:0;"}).join(""),"}}else{","if(",o,"(",i,".buffer)){",u,"=",s,".createStream(",34962,",",i,".buffer);","}else{",u,"=",s,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",u,".dtype;",l.normalized,"=!!",i,".normalized;"),n("size"),n("offset"),n("stride"),n("divisor"),r("}}"),r.exit("if(",l.isStream,"){",s,".destroyStream(",u,");","}"),l})}),o}(r),u.context=function(t){var e=t.static,r=t.dynamic,n={};return Object.keys(e).forEach(function(t){var r=e[t];n[t]=P(function(t,e){return"number"==typeof r||"boolean"==typeof r?""+r:t.link(r)})}),Object.keys(r).forEach(function(t){var e=r[t];n[t]=O(e,function(t,r){return t.invoke(r,e)})}),n}(o),u}function w(t,e,r){var n=t.shared.context,i=t.scope();Object.keys(r).forEach(function(a){e.save(n,"."+a),i(n,".",a,"=",r[a].append(t,e),";")}),e(i)}function M(t,e,r,n){var i,a=(s=t.shared).gl,o=s.framebuffer;J&&(i=e.def(s.extensions,".webgl_draw_buffers"));var s=(l=t.constants).drawBuffer,l=l.backBuffer;t=r?r.append(t,e):e.def(o,".next"),n||e("if(",t,"!==",o,".cur){"),e("if(",t,"){",a,".bindFramebuffer(",36160,",",t,".framebuffer);"),J&&e(i,".drawBuffersWEBGL(",s,"[",t,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),J&&e(i,".drawBuffersWEBGL(",l,");"),e("}",o,".cur=",t,";"),n||e("}")}function k(t,e,r){var n=t.shared,i=n.gl,a=t.current,o=t.next,l=n.current,c=n.next,u=t.cond(l,".dirty");$.forEach(function(e){if(!((e=g(e))in r.state)){var n,f;if(e in o){n=o[e],f=a[e];var h=s(K[e].length,function(t){return u.def(n,"[",t,"]")});u(t.cond(h.map(function(t,e){return t+"!=="+f+"["+e+"]"}).join("||")).then(i,".",rt[e],"(",h,");",h.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";"))}else n=u.def(c,".",e),h=t.cond(n,"!==",l,".",e),u(h),e in et?h(t.cond(n).then(i,".enable(",et[e],");").else(i,".disable(",et[e],");"),l,".",e,"=",n,";"):h(i,".",rt[e],"(",n,");",l,".",e,"=",n,";")}}),0===Object.keys(r.state).length&&u(l,".dirty=false;"),e(u)}function A(t,e,r,n){var i=t.shared,a=t.current,o=i.current,s=i.gl;z(Object.keys(r)).forEach(function(i){var l=r[i];if(!n||n(l)){var c=l.append(t,e);if(et[i]){var u=et[i];I(l)?c?e(s,".enable(",u,");"):e(s,".disable(",u,");"):e(t.cond(c).then(s,".enable(",u,");").else(s,".disable(",u,");")),e(o,".",i,"=",c,";")}else if(v(c)){var f=a[i];e(s,".",rt[i],"(",c,");",c.map(function(t,e){return f+"["+e+"]="+t}).join(";"),";")}else e(s,".",rt[i],"(",c,");",o,".",i,"=",c,";")}})}function T(t,e){X&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function S(t,e,r,n,i){function a(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function o(t){t(c=e.def(),"=",a(),";"),"string"==typeof i?t(h,".count+=",i,";"):t(h,".count++;"),p&&(n?(u=e.def(),t(u,"=",m,".getNumPendingQueries();")):t(m,".beginQuery(",h,");"))}function s(t){t(h,".cpuTime+=",a(),"-",c,";"),p&&(n?t(m,".pushScopeStats(",u,",",m,".getNumPendingQueries(),",h,");"):t(m,".endQuery();"))}function l(t){var r=e.def(d,".profile");e(d,".profile=",t,";"),e.exit(d,".profile=",r,";")}var c,u,f=t.shared,h=t.stats,d=f.current,m=f.timer;if(r=r.profile){if(I(r))return void(r.enable?(o(e),s(e.exit),l("true")):l("false"));l(r=r.append(t,e))}else r=e.def(d,".profile");o(f=t.block()),e("if(",r,"){",f,"}"),s(t=t.block()),e.exit("if(",r,"){",t,"}")}function F(t,e,r,n,i){var a=t.shared;n.forEach(function(n){var o,s=n.name,l=r.attributes[s];if(l){if(!i(l))return;o=l.append(t,e)}else{if(!i(yt))return;var c=t.scopeAttrib(s);o={},Object.keys(new Y).forEach(function(t){o[t]=e.def(c,".",t)})}!function(r,n,i){function o(){e("if(!",u,".buffer){",l,".enableVertexAttribArray(",c,");}");var r,a=i.type;r=i.size?e.def(i.size,"||",n):n,e("if(",u,".type!==",a,"||",u,".size!==",r,"||",d.map(function(t){return u+"."+t+"!=="+i[t]}).join("||"),"){",l,".bindBuffer(",34962,",",f,".buffer);",l,".vertexAttribPointer(",[c,r,a,i.normalized,i.stride,i.offset],");",u,".type=",a,";",u,".size=",r,";",d.map(function(t){return u+"."+t+"="+i[t]+";"}).join(""),"}"),X&&(a=i.divisor,e("if(",u,".divisor!==",a,"){",t.instancing,".vertexAttribDivisorANGLE(",[c,a],");",u,".divisor=",a,";}"))}function s(){e("if(",u,".buffer){",l,".disableVertexAttribArray(",c,");","}if(",ht.map(function(t,e){return u+"."+t+"!=="+h[e]}).join("||"),"){",l,".vertexAttrib4f(",c,",",h,");",ht.map(function(t,e){return u+"."+t+"="+h[e]+";"}).join(""),"}")}var l=a.gl,c=e.def(r,".location"),u=e.def(a.attributes,"[",c,"]");r=i.state;var f=i.buffer,h=[i.x,i.y,i.z,i.w],d=["buffer","normalized","offset","stride"];1===r?o():2===r?s():(e("if(",r,"===",1,"){"),o(),e("}else{"),s(),e("}"))}(t.link(n),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(n.info.type),o)})}function R(t,r,n,i,a){for(var o,l=t.shared,c=l.gl,u=0;u>1)",m],");")}function e(){r(g,".drawArraysInstancedANGLE(",[h,d,p,m],");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}function o(){function t(){r(l+".drawElements("+[h,p,v,d+"<<(("+v+"-5121)>>1)"]+");")}function e(){r(l+".drawArrays("+[h,d,p]+");")}f?y?t():(r("if(",f,"){"),t(),r("}else{"),e(),r("}")):e()}var s=t.shared,l=s.gl,c=s.draw,u=n.draw,f=function(){var i=u.elements,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","elements"),i&&a("if("+i+")"+l+".bindBuffer(34963,"+i+".buffer.buffer);"),i}(),h=i("primitive"),d=i("offset"),p=function(){var i=u.count,a=e;return i?((i.contextDep&&n.contextDynamic||i.propDep)&&(a=r),i=i.append(t,a)):i=a.def(c,".","count"),i}();if("number"==typeof p){if(0===p)return}else r("if(",p,"){"),r.exit("}");var m,g;X&&(m=i("instances"),g=t.instancing);var v=f+".type",y=u.elements&&I(u.elements);X&&("number"!=typeof m||0<=m)?"string"==typeof m?(r("if(",m,">0){"),a(),r("}else if(",m,"<0){"),o(),r("}")):a():o()}function U(t,e,r,n,i){return e=b(),i=e.proc("body",i),X&&(e.instancing=i.def(e.shared.extensions,".angle_instanced_arrays")),t(e,i,r,n),e.compile().body}function V(t,e,r,n){T(t,e),F(t,e,r,n.attributes,function(){return!0}),R(t,e,r,n.uniforms,function(){return!0}),j(t,e,e,r)}function q(t,e,r,n){function i(){return!0}t.batchId="a1",T(t,e),F(t,e,r,n.attributes,i),R(t,e,r,n.uniforms,i),j(t,e,e,r)}function H(t,e,r,n){function i(t){return t.contextDep&&o||t.propDep}function a(t){return!i(t)}T(t,e);var o=r.contextDep,s=e.def(),l=e.def();t.shared.props=l,t.batchId=s;var c=t.scope(),u=t.scope();e(c.entry,"for(",s,"=0;",s,"<","a1",";++",s,"){",l,"=","a0","[",s,"];",u,"}",c.exit),r.needsContext&&w(t,u,r.context),r.needsFramebuffer&&M(t,u,r.framebuffer),A(t,u,r.state,i),r.profile&&i(r.profile)&&S(t,u,r,!1,!0),n?(F(t,c,r,n.attributes,a),F(t,u,r,n.attributes,i),R(t,c,r,n.uniforms,a),R(t,u,r,n.uniforms,i),j(t,c,u,r)):(e=t.global.def("{}"),n=r.shader.progVar.append(t,u),l=u.def(n,".id"),c=u.def(e,"[",l,"]"),u(t.shared.gl,".useProgram(",n,".program);","if(!",c,"){",c,"=",e,"[",l,"]=",t.link(function(e){return U(q,t,r,e,2)}),"(",n,");}",c,".call(this,a0[",s,"],",s,");"))}function G(t,e,r){function n(t,e){o.forEach(function(r){var n=i[r];B.isDynamic(n)&&(n=t.invoke(e,n),e(u,".",r,"=",n,";"))})}var i=e.static[r];if(i&&function(t){if("object"==typeof t&&!v(t)){for(var e=Object.keys(t),r=0;r":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},gt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},vt={cw:2304,ccw:2305},yt=new D(!1,!1,!1,function(){});return function(t){function e(){if(0===it.length)E&&E.update(),lt=null;else{lt=U.next(e),h();for(var t=it.length-1;0<=t;--t){var r=it[t];r&&r(D,null,0)}y.flush(),E&&E.update()}}function r(){!lt&&0=it.length&&n()}var r=R(it,t);it[r]=e}}}function f(){var t=rt.viewport,e=rt.scissor_box;t[0]=t[1]=e[0]=e[1]=0,D.viewportWidth=D.framebufferWidth=D.drawingBufferWidth=t[2]=e[2]=y.drawingBufferWidth,D.viewportHeight=D.framebufferHeight=D.drawingBufferHeight=t[3]=e[3]=y.drawingBufferHeight}function h(){D.tick+=1,D.time=v(),f(),et.procs.poll()}function g(){f(),et.procs.refresh(),E&&E.update()}function v(){return(V()-L)/1e3}if(!(t=a(t)))return null;var y=t.gl,x=y.getContextAttributes();y.isContextLost();var b=function(t,e){function r(e){e=e.toLowerCase();var r;try{r=n[e]=t.getExtension(e)}catch(t){}return!!r}for(var n={},i=0;i(i=l)&&(i=n.buffer.byteLength,5123===f?i>>=1:5125===f&&(i>>=2)),n.vertCount=i,i=s,0>s&&(i=4,1===(s=n.buffer.dimension)&&(i=0),2===s&&(i=1),3===s&&(i=4)),n.primType=i}function s(t){n.elementsCount--,delete l[t.id],t.buffer.destroy(),t.buffer=null}var l={},c=0,u={uint8:5121,uint16:5123};e.oes_element_index_uint&&(u.uint32=5125),i.prototype.bind=function(){this.buffer.bind()};var f=[];return{create:function(t,e){function l(t){if(t)if("number"==typeof t)c(t),f.primType=4,f.vertCount=0|t,f.type=5121;else{var e=null,r=35044,n=-1,i=-1,s=0,h=0;Array.isArray(t)||q(t)||o(t)?e=t:("data"in t&&(e=t.data),"usage"in t&&(r=J[t.usage]),"primitive"in t&&(n=tt[t.primitive]),"count"in t&&(i=0|t.count),"type"in t&&(h=u[t.type]),"length"in t?s=0|t.length:(s=i,5123===h||5122===h?s*=2:5125!==h&&5124!==h||(s*=4))),a(f,e,r,n,i,s,h)}else c(),f.primType=4,f.vertCount=0,f.type=5121;return l}var c=r.create(null,34963,!0),f=new i(c._buffer);return n.elementsCount++,l(t),l._reglType="elements",l._elements=f,l.subdata=function(t,e){return c.subdata(t,e),l},l.destroy=function(){s(f)},l},createStream:function(t){var e=f.pop();return e||(e=new i(r.create(null,34963,!0,!1)._buffer)),a(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){f.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof i?t._elements:null},clear:function(){H(l).forEach(s)}}}(y,M,P,w),j=(C=function(t,e,r,n,i){for(t=r.maxAttributes,e=Array(t),r=0;r=--this.refCount&&o(this)},i.profile&&(n.getTotalRenderbufferSize=function(){var t=0;return Object.keys(u).forEach(function(e){t+=u[e].stats.size}),t}),{create:function(e,r){function o(e,r){var n=0,a=0,u=32854;if("object"==typeof e&&e?("shape"in e?(a=e.shape,n=0|a[0],a=0|a[1]):("radius"in e&&(n=a=0|e.radius),"width"in e&&(n=0|e.width),"height"in e&&(a=0|e.height)),"format"in e&&(u=s[e.format])):"number"==typeof e?(n=0|e,a="number"==typeof r?0|r:n):e||(n=a=1),n!==c.width||a!==c.height||u!==c.format)return o.width=c.width=n,o.height=c.height=a,c.format=u,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,u,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o.format=l[c.format],o}var c=new a(t.createRenderbuffer());return u[c.id]=c,n.renderbufferCount++,o(e,r),o.resize=function(e,r){var n=0|e,a=0|r||n;return n===c.width&&a===c.height?o:(o.width=c.width=n,o.height=c.height=a,t.bindRenderbuffer(36161,c.renderbuffer),t.renderbufferStorage(36161,c.format,n,a),i.profile&&(c.stats.size=ct[c.format]*c.width*c.height),o)},o._reglType="renderbuffer",o._renderbuffer=c,i.profile&&(o.stats=c.stats),o.destroy=function(){c.decRef()},o},clear:function(){H(u).forEach(o)},restore:function(){H(u).forEach(function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)}),t.bindRenderbuffer(36161,null)}}}(y,M,0,w,t),X=function(t,e,r,n,i,a){function o(t,e,r){this.target=t,this.texture=e,this.renderbuffer=r;var n=t=0;e?(t=e.width,n=e.height):r&&(t=r.width,n=r.height),this.width=t,this.height=n}function s(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function l(t,e,r){t&&(t.texture?t.texture._texture.refCount+=1:t.renderbuffer._renderbuffer.refCount+=1)}function c(e,r){r&&(r.texture?t.framebufferTexture2D(36160,e,r.target,r.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,r.renderbuffer._renderbuffer.renderbuffer))}function u(t){var e=3553,r=null,n=null,i=t;return"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),"texture2d"===(t=i._reglType)?r=i:"textureCube"===t?r=i:"renderbuffer"===t&&(n=i,e=36161),new o(e,r,n)}function f(t,e,r,a,s){return r?(t=n.create2D({width:t,height:e,format:a,type:s}),t._texture.refCount=0,new o(3553,t,null)):(t=i.create({width:t,height:e,format:a}),t._renderbuffer.refCount=0,new o(36161,null,t))}function h(t){return t&&(t.texture||t.renderbuffer)}function d(t,e,r){t&&(t.texture?t.texture.resize(e,r):t.renderbuffer&&t.renderbuffer.resize(e,r))}function p(){this.id=M++,k[this.id]=this,this.framebuffer=t.createFramebuffer(),this.height=this.width=0,this.colorAttachments=[],this.depthStencilAttachment=this.stencilAttachment=this.depthAttachment=null}function m(t){t.colorAttachments.forEach(s),s(t.depthAttachment),s(t.stencilAttachment),s(t.depthStencilAttachment)}function g(e){t.deleteFramebuffer(e.framebuffer),e.framebuffer=null,a.framebufferCount--,delete k[e.id]}function v(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;ni;++i){for(c=0;ct;++t)r[t].resize(n);return e.width=e.height=n,e},_reglType:"framebufferCube",destroy:function(){r.forEach(function(t){t.destroy()})}})},clear:function(){H(k).forEach(g)},restore:function(){H(k).forEach(function(e){e.framebuffer=t.createFramebuffer(),v(e)})}})}(y,M,I,G,W,w),et=F(y,_,M,I,P,O,0,X,{},C,j,{elements:null,primitive:4,count:-1,offset:0,instances:-1},D,E,t),rt=(_=S(y,X,et.procs.poll,D),et.next),nt=y.canvas,it=[],at=[],ot=[],st=[t.onDestroy],lt=null;nt&&(nt.addEventListener("webglcontextlost",i,!1),nt.addEventListener("webglcontextrestored",s,!1));var ht=X.setFBO=l({framebuffer:B.define.call(null,1,"framebuffer")});return g(),x=N(l,{clear:function(t){if("framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var e=0;6>e;++e)ht(N({framebuffer:t.framebuffer.faces[e]},t),c);else ht(t,c);else c(0,t)},prop:B.define.bind(null,1),context:B.define.bind(null,2),this:B.define.bind(null,3),draw:l({}),buffer:function(t){return P.create(t,34962,!1,!1)},elements:function(t){return O.create(t,!1)},texture:G.create2D,cube:G.createCube,renderbuffer:W.create,framebuffer:X.create,framebufferCube:X.createCube,attributes:x,frame:u,on:function(t,e){var r;switch(t){case"frame":return u(e);case"lost":r=at;break;case"restore":r=ot;break;case"destroy":r=st}return r.push(e),{cancel:function(){for(var t=0;t=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i+=t,i=i.substr(0,r)}},{}],508:[function(t,e,r){!function(t,n){"object"==typeof r?e.exports=n():t.resolveUrl=n()}(this,function(){return function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var e=document.createElement("base");if(e.href=arguments[0],1===t)return e.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(e,r.firstChild);for(var n,i=document.createElement("a"),a=1;a=0;--i){var a=r;(l=(s=t[i])-((r=a+s)-a))&&(t[--n]=r,r=l)}var o=0;for(i=n;i>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("");for(var e=[],r=0;r>1;return["sum(",i(t.slice(0,e)),",",i(t.slice(e)),")"].join("")}function a(t,e){if("m"===t.charAt(0)){if("w"===e.charAt(0)){var r=t.split("[");return["w",e.substr(1),"m",r[0].substr(1)].join("")}return["prod(",t,",",e,")"].join("")}return a(e,t)}function o(t){return!0&t?"-":""}function s(t){if(2===t.length)return[["diff(",a(t[0][0],t[1][1]),",",a(t[1][0],t[0][1]),")"].join("")];for(var e=[],r=0;r0&&r.push(","),r.push("[");for(var o=0;o0&&r.push(","),o===n?r.push("+b[",a,"]"):r.push("+A[",a,"][",o,"]");r.push("]")}r.push("]),")}r.push("det(A)]}return ",e);var s=new Function("det",r.join(""));return s(t<6?i[t]:i)}var i=t("robust-determinant"),a=6,o=[function(){return[0]},function(t,e){return[[e[0]],[t[0][0]]]}];!function(){for(;o.length>1;return["sum(",a(t.slice(0,e)),",",a(t.slice(e)),")"].join("")}function o(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],r=0;r0){if(a<=0)return o;n=i+a}else{if(!(i<0))return o;if(a>=0)return o;n=-(i+a)}var s=3.3306690738754716e-16*n;return o>=s||o<=-s?o:d(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],c=r[1]-n[1],u=t[2]-n[2],f=e[2]-n[2],h=r[2]-n[2],d=a*c,m=o*l,g=o*s,v=i*c,y=i*l,x=a*s,b=u*(d-m)+f*(g-v)+h*(y-x),_=7.771561172376103e-16*((Math.abs(d)+Math.abs(m))*Math.abs(u)+(Math.abs(g)+Math.abs(v))*Math.abs(f)+(Math.abs(y)+Math.abs(x))*Math.abs(h));return b>_||-b>_?b:p(t,e,r,n)}];!function(){for(;m.length<=h;)m.push(s(m.length));for(var t=[],r=["slow"],n=0;n<=h;++n)t.push("a"+n),r.push("o"+n);var i=["function getOrientation(",t.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(n=2;n<=h;++n)i.push("case ",n,":return o",n,"(",t.slice(0,n).join(),");");i.push("}var s=new Array(arguments.length);for(var i=0;i0&&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),c=r[i],u=n[i],f=Math.min(c,u);if(Math.max(c,u)=n?(i=h,(c+=1)=n?(i=h,(c+=1)0){for(var s=0,l=0,c=0;cn.h||t>n.free||ru)&&(f=2*Math.max(t,u)),(ll)&&(c=2*Math.max(r,l)),this.resize(f,c),this.packOne(t,r)}return null},t.prototype.clear=function(){this.shelves=[],this.stats={}},t.prototype.resize=function(t,e){this.w=t,this.h=e;for(var r=0;rthis.free||e>this.h)return null;var r=this.x;return this.x+=t,this.free-=t,{x:r,y:this.y,w:t,h:e,width:t,height:e}},e.prototype.resize=function(t){return this.free+=t-this.w,this.w=t,!0},t})},{}],522:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],523:[function(t,e,r){"use strict";e.exports=function(t){return i(n(t))};var n=t("boundary-cells"),i=t("reduce-simplicial-complex")},{"boundary-cells":74,"reduce-simplicial-complex":499}],524:[function(t,e,r){"use strict";e.exports=function(t,e,r,s){if(r=r||0,void 0===s&&(s=function(t){for(var e=t.length,r=0,n=0;n0&&c.push(","),c.push("[");for(var n=0;n0&&c.push(","),c.push("B(C,E,c[",i[0],"],c[",i[1],"])")}c.push("]")}c.push(");")}}var r=0,a=new Array(t+1);a[0]=[[]];for(var o=1;o<=t;++o)for(var s=a[o]=i(o),l=0;l>1,v=E[2*m+1];","if(v===b){return m}","if(b1;--o){o>1,s=n(t[o],e);s<=0?(0===s&&(a=o),r=o+1):s>0&&(i=o-1)}return a}function l(t,e){for(var r=new Array(t.length),i=0,a=r.length;i=t.length||0!==n(t[g],o)););}return r}function c(t,e){if(e<0)return[];for(var r=[],n=(1<>>u&1&&c.push(i[u]);e.push(c)}return a(e)},r.skeleton=c,r.boundary=function(t){for(var e=[],r=0,n=t.length;r>1:(t>>1)-1}function c(t){for(var e=s(t);;){var r=e,n=2*t+1,i=2*(t+1),a=t;if(n0;){var r=l(t);if(!(r>=0&&e0){var t=A[0];return o(0,S-1),S-=1,c(0),t}return-1}function h(t,e){var r=A[t];return x[r]===e?t:(x[r]=-1/0,u(t),f(),x[r]=e,S+=1,u(S-1))}function d(t){if(!b[t]){b[t]=!0;var e=v[t],r=y[t];v[r]>=0&&(v[r]=e),y[e]>=0&&(y[e]=r),T[e]>=0&&h(T[e],a(e)),T[r]>=0&&h(T[r],a(r))}}function p(t,e){if(t[e]<0)return e;var r=e,n=e;do{var i=t[n];if(!b[n]||i<0||i===n)break;if(n=i,i=t[n],!b[n]||i<0||i===n)break;n=i,r=t[r]}while(r!==n);for(var a=e;a!==n;a=t[a])t[a]=n;return n}for(var m=e.length,g=t.length,v=new Array(m),y=new Array(m),x=new Array(m),b=new Array(m),_=0;_>1;_>=0;--_)c(_);for(;;){var E=f();if(E<0||x[E]>r)break;d(E)}var L=[];for(_=0;_=0&&r>=0&&e!==r){var n=T[e],i=T[r];n!==i&&C.push([n,i])}}),i.unique(i.normalize(C)),{positions:L,edges:C}};var n=t("robust-orientation"),i=t("simplicial-complex")},{"robust-orientation":515,"simplicial-complex":528}],531:[function(t,e,r){"use strict";function n(t,e){var r,n;if(e[0][0]e[1][0])){var a=Math.min(t[0][1],t[1][1]),o=Math.max(t[0][1],t[1][1]),s=Math.min(e[0][1],e[1][1]),l=Math.max(e[0][1],e[1][1]);return ol?a-l:o-l}r=e[1],n=e[0]}var c,u;t[0][1]e[1][0]))return n(e,t);r=e[1],a=e[0]}var o,s;if(t[0][0]t[1][0]))return-n(t,e);o=t[1],s=t[0]}var l=i(r,a,s),c=i(r,a,o);if(l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;if(l=i(s,o,a),c=i(s,o,r),l<0){if(c<=0)return l}else if(l>0){if(c>=0)return l}else if(c)return c;return a[0]-s[0]};var i=t("robust-orientation")},{"robust-orientation":515}],532:[function(t,e,r){"use strict";function n(t,e,r){this.slabs=t,this.coordinates=e,this.horizontal=r}function i(t,e){return t.y-e}function a(t,e){for(var r=null;t;){var n,i,o=t.key;o[0][0]0)if(e[0]!==o[1][0])r=t,t=t.right;else{if(l=a(t.right,e))return l;t=t.left}else{if(e[0]!==o[1][0])return t;var l;if(l=a(t.right,e))return l;t=t.left}}return r}function o(t,e,r,n){this.y=t,this.index=e,this.start=r,this.closed=n}function s(t,e,r,n){this.x=t,this.segment=e,this.create=r,this.index=n}e.exports=function(t){for(var e=t.length,r=2*e,i=new Array(r),a=0;a0){var s=a(this.slabs[e-1],t);s&&(o?f(s.key,o)>0&&(o=s.key,n=s.value):(n=s.value,o=s.key))}var c=this.horizontal[e];if(c.length>0){var h=l.ge(c,t[1],i);if(h=c.length)return n;d=c[h]}}if(d.start)if(o){var p=u(o[0],o[1],[t[0],d.y]);o[0][0]>o[1][0]&&(p=-p),p>0&&(n=d.index)}else n=d.index;else d.y!==t[1]&&(n=d.index)}}}return n}},{"./lib/order-segments":531,"binary-search-bounds":70,"functional-red-black-tree":144,"robust-orientation":515}],533:[function(t,e,r){"use strict";function n(t,e,r,n,i,a){for(var o=t+1;o<=e;++o){for(var s=r[o],l=n[2*o],c=n[2*o+1],u=i[o],f=a[o],h=o;h>t;){var d=r[h-1],p=n[2*(h-1)];if((d-s||l-p)>=0)break;r[h]=d,n[2*h]=p,n[2*h+1]=n[2*h-1],i[h]=i[h-1],a[h]=a[h-1],h-=1}r[h]=s,n[2*h]=l,n[2*h+1]=c,i[h]=u,a[h]=f}}function i(t,e,r,n,i,a){var o=r[t],s=n[2*t],l=n[2*t+1],c=i[t],u=a[t];r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e],r[e]=o,n[2*e]=s,n[2*e+1]=l,i[e]=c,a[e]=u}function a(t,e,r,n,i,a){r[t]=r[e],n[2*t]=n[2*e],n[2*t+1]=n[2*e+1],i[t]=i[e],a[t]=a[e]}function o(t,e,r,n,i,a,o){var s=n[t],l=i[2*t],c=i[2*t+1],u=a[t],f=o[t];n[t]=n[e],i[2*t]=i[2*e],i[2*t+1]=i[2*e+1],a[t]=a[e],o[t]=o[e],n[e]=n[r],i[2*e]=i[2*r],i[2*e+1]=i[2*r+1],a[e]=a[r],o[e]=o[r],n[r]=s,i[2*r]=l,i[2*r+1]=c,a[r]=u,o[r]=f}function s(t,e,r,n,i,a,o,s,l,c,u){s[t]=s[e],l[2*t]=l[2*e],l[2*t+1]=l[2*e+1],c[t]=c[e],u[t]=u[e],s[e]=r,l[2*e]=n,l[2*e+1]=i,c[e]=a,u[e]=o}function l(t,e,r,n,i){return(r[t]-r[e]||n[2*e]-n[2*t]||i[t]-i[e])<0}function c(t,e,r,n,i,a,o,s){return(e-a[t]||o[2*t]-r||i-s[t])<0}function u(t,e,r,h,d,p){var m=(e-t+1)/6|0,g=t+m,v=e-m,y=t+e>>1,x=y-m,b=y+m,_=g,w=x,M=y,k=b,A=v,T=t+1,S=e-1,E=0;l(_,w,r,h,d)&&(E=_,_=w,w=E),l(k,A,r,h,d)&&(E=k,k=A,A=E),l(_,M,r,h,d)&&(E=_,_=M,M=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(_,k,r,h,d)&&(E=_,_=k,k=E),l(M,k,r,h,d)&&(E=M,M=k,k=E),l(w,A,r,h,d)&&(E=w,w=A,A=E),l(w,M,r,h,d)&&(E=w,w=M,M=E),l(k,A,r,h,d)&&(E=k,k=A,A=E);var L=r[w],C=h[2*w],z=h[2*w+1],D=d[w],I=p[w],P=r[k],O=h[2*k],F=h[2*k+1],R=d[k],N=p[k],j=_,B=M,U=A,V=g,q=y,H=v,G=r[j],Y=r[B],W=r[U];r[V]=G,r[q]=Y,r[H]=W;for(var X=0;X<2;++X){var Z=h[2*j+X],J=h[2*B+X],K=h[2*U+X];h[2*V+X]=Z,h[2*q+X]=J,h[2*H+X]=K}var Q=d[j],$=d[B],tt=d[U];d[V]=Q,d[q]=$,d[H]=tt;var et=p[j],rt=p[B],nt=p[U];p[V]=et,p[q]=rt,p[H]=nt,a(x,t,r,h,d,p),a(b,e,r,h,d,p);for(var it=T;it<=S;++it)if(c(it,L,C,0,D,r,h,d))it!==T&&i(it,T,r,h,d,p),++T;else if(!c(it,P,O,0,R,r,h,d))for(;;){if(c(S,P,O,0,R,r,h,d)){c(S,L,C,0,D,r,h,d)?(o(it,T,S,r,h,d,p),++T,--S):(i(it,S,r,h,d,p),--S);break}if(--S=Math.max(.9*d,32)){var _=c+s>>>1;l(g,v,f,h,_,u+1),h=_}l(g,v,f,h,y,u+1),h=y}}}var c=t.length>>>1;if(c<1)return[];e||(e=Array(c)),r||(r=Array(c)),s||(s=[]);for(var u=0;u=s[2]||s[1]>=s[3]){var f=o(t,2);f[0]===f[2]&&(f[2]+=1),f[1]===f[3]&&(f[3]+=1),s[0]=f[0],s[1]=f[1],s[2]=f[2],s[3]=f[3]}var h=s[0],d=s[1],p=s[2],m=s[3],g=1/(p-h),v=1/(m-d),y=Math.max(p-h,m-d),x=new Int32Array(c),b=0;l(h,d,y,0,c,0),a(x,t,e,r,c);var _=[],w=0,M=c;for(b=c-1;b>=0;--b){t[2*b]=(t[2*b]-h)*g,t[2*b+1]=(t[2*b+1]-d)*v;var k=x[b];k!==w&&(_.push(new i(y*Math.pow(.5,k),b+1,M-(b+1))),M=b+1,w=k)}return _.push(new i(y*Math.pow(.5,k+1),0,M)),_}},{"./lib/sort":533,"array-bounds":48}],535:[function(t,e,r){"use strict";function n(t,e){var r=o(a(t,e),[e[e.length-1]]);return r[r.length-1]}function i(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||o>0&&u<0){var f=i(s,u,l,o);r.push(f),a.push(f.slice())}u<0?a.push(l.slice()):u>0?r.push(l.slice()):(r.push(l.slice()),a.push(l.slice())),o=u}return{positive:r,negative:a}},e.exports.positive=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c>=0&&r.push(s.slice()),a=c}return r},e.exports.negative=function(t,e){for(var r=[],a=n(t[t.length-1],e),o=t[t.length-1],s=t[0],l=0;l0||a>0&&c<0)&&r.push(i(o,c,s,a)),c<=0&&r.push(s.slice()),a=c}return r}},{"robust-dot-product":512,"robust-sum":520}],536:[function(t,e,r){!function(t){function e(){var t=arguments[0],r=e.cache;return r[t]&&r.hasOwnProperty(t)||(r[t]=e.parse(t)),e.format.call(null,r[t],arguments)}function n(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}var i={not_string:/[^s]/,number:/[diefg]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijosuxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};e.format=function(t,r){var a,o,s,l,c,u,f,h=1,d=t.length,p="",m=[],g=!0,v="";for(o=0;o=0),l[8]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":case"i":a=parseInt(a,10);break;case"j":a=JSON.stringify(a,null,l[6]?parseInt(l[6]):0);break;case"e":a=l[7]?a.toExponential(l[7]):a.toExponential();break;case"f":a=l[7]?parseFloat(a).toFixed(l[7]):parseFloat(a);break;case"g":a=l[7]?parseFloat(a).toPrecision(l[7]):parseFloat(a);break;case"o":a=a.toString(8);break;case"s":a=(a=String(a))&&l[7]?a.substring(0,l[7]):a;break;case"u":a>>>=0;break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}i.json.test(l[8])?m[m.length]=a:(!i.number.test(l[8])||g&&!l[3]?v="":(v=g?"+":"-",a=a.toString().replace(i.sign,"")),u=l[4]?"0"===l[4]?"0":l[4].charAt(1):" ",f=l[6]-(v+a).length,c=l[6]&&f>0?function(t,e){return Array(e+1).join(t)}(u,f):"",m[m.length]=l[5]?v+a+c:"0"===u?v+c+a:c+v+a)}return m.join("")},e.cache={},e.parse=function(t){for(var e=t,r=[],n=[],a=0;e;){if(null!==(r=i.text.exec(e)))n[n.length]=r[0];else if(null!==(r=i.modulo.exec(e)))n[n.length]="%";else{if(null===(r=i.placeholder.exec(e)))throw new SyntaxError("[sprintf] unexpected placeholder");if(r[2]){a|=1;var o=[],s=r[2],l=[];if(null===(l=i.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o[o.length]=l[1];""!==(s=s.substring(l[0].length));)if(null!==(l=i.key_access.exec(s)))o[o.length]=l[1];else{if(null===(l=i.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=l[1]}r[2]=o}else a|=2;if(3===a)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");n[n.length]=r}e=e.substring(r[0].length)}return n};var a=function(t,r,n){return(n=(r||[]).slice(0)).splice(0,0,t),e.apply(null,n)};void 0!==r?(r.sprintf=e,r.vsprintf=a):(t.sprintf=e,t.vsprintf=a)}("undefined"==typeof window?this:window)},{}],537:[function(t,e,r){"use strict";e.exports=function(t){function e(e){var r=[e],c=[e];for(n[e]=i[e]=u,a[e]=!0,u+=1;c.length>0;){e=c[c.length-1];var d=t[e];if(o[e]=0&&l[e].push(s[m])}o[e]=p}else{if(i[e]===n[e]){var g=[],v=[],y=0;for(p=r.length-1;p>=0;--p){var x=r[p];if(a[x]=!1,g.push(x),v.push(l[x]),y+=l[x].length,s[x]=f.length,x===e){r.length=p;break}}f.push(g);var b=new Array(y);for(p=0;p=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return c(c({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function s(t){return t/360+.5}function l(t){var e=Math.sin(t*Math.PI/180),r=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return r<0?0:r>1?1:r}function c(t,e){for(var r in e)t[r]=e[r];return t}function u(t){return t.x}function f(t){return t.y}var h=t("kdbush");e.exports=function(t){return new n(t)},n.prototype={options:{minZoom:0,maxZoom:16,radius:40,extent:512,nodeSize:64,log:!1,reduce:null,initial:function(){return{}},map:function(t){return t}},load:function(t){var e=this.options.log;e&&console.time("total time");var r="prepare "+t.length+" points";e&&console.time(r),this.points=t;var n=t.map(i);e&&console.timeEnd(r);for(var a=this.options.maxZoom;a>=this.options.minZoom;a--){var o=+Date.now();this.trees[a+1]=h(n,u,f,this.options.nodeSize,Float32Array),n=this._cluster(n,a),e&&console.log("z%d: %d clusters in %dms",a,n.length,+Date.now()-o)}return this.trees[this.options.minZoom]=h(n,u,f,this.options.nodeSize,Float32Array),e&&console.timeEnd("total time"),this},getClusters:function(t,e){for(var r=this.trees[this._limitZoom(e)],n=r.range(s(t[0]),l(t[3]),s(t[2]),l(t[1])),i=[],o=0;o c)|0 },"),"generic"===e&&a.push("getters:[0],");for(var s=[],l=[],c=0;c>>7){"),c=0;c<1<<(1<128&&c%128==0){f.length>0&&h.push("}}");var d="vExtra"+f.length;a.push("case ",c>>>7,":",d,"(m&0x7f,",l.join(),");break;"),h=["function ",d,"(m,",l.join(),"){switch(m){"],f.push(h)}h.push("case ",127&c,":");for(var p=new Array(r),m=new Array(r),g=new Array(r),v=new Array(r),y=0,x=0;xx)&&!(c&1<<_)!=!(c&1<0&&(A="+"+g[b]+"*c");var T=p[b].length/y*.5,S=.5+v[b]/y*.5;k.push("d"+b+"-"+S+"-"+T+"*("+p[b].join("+")+A+")/("+m[b].join("+")+")")}h.push("a.push([",k.join(),"]);","break;")}a.push("}},"),f.length>0&&h.push("}}");var E=[];for(c=0;c<1<1&&(a=1),a<-1&&(a=-1),i*Math.acos(a)};r.default=function(t){var e=t.px,r=t.py,l=t.cx,c=t.cy,u=t.rx,f=t.ry,h=t.xAxisRotation,d=void 0===h?0:h,p=t.largeArcFlag,m=void 0===p?0:p,g=t.sweepFlag,v=void 0===g?0:g,y=[];if(0===u||0===f)return[];var x=Math.sin(d*i/360),b=Math.cos(d*i/360),_=b*(e-l)/2+x*(r-c)/2,w=-x*(e-l)/2+b*(r-c)/2;if(0===_&&0===w)return[];u=Math.abs(u),f=Math.abs(f);var M=Math.pow(_,2)/Math.pow(u,2)+Math.pow(w,2)/Math.pow(f,2);M>1&&(u*=Math.sqrt(M),f*=Math.sqrt(M));var k=function(t,e,r,n,a,o,l,c,u,f,h,d){var p=Math.pow(a,2),m=Math.pow(o,2),g=Math.pow(h,2),v=Math.pow(d,2),y=p*m-p*v-m*g;y<0&&(y=0),y/=p*v+m*g;var x=(y=Math.sqrt(y)*(l===c?-1:1))*a/o*d,b=y*-o/a*h,_=f*x-u*b+(t+r)/2,w=u*x+f*b+(e+n)/2,M=(h-x)/a,k=(d-b)/o,A=(-h-x)/a,T=(-d-b)/o,S=s(1,0,M,k),E=s(M,k,A,T);return 0===c&&E>0&&(E-=i),1===c&&E<0&&(E+=i),[_,w,S,E]}(e,r,l,c,u,f,m,v,x,b,_,w),A=n(k,4),T=A[0],S=A[1],E=A[2],L=A[3],C=Math.max(Math.ceil(Math.abs(L)/(i/4)),1);L/=C;for(var z=0;ze[2]&&(e[2]=c[u+0]),c[u+1]>e[3]&&(e[3]=c[u+1]);return e}},{"abs-svg-path":43,assert:51,"is-svg-path":287,"normalize-svg-path":543,"parse-svg-path":466}],543:[function(t,e,r){"use strict";function n(t,e,r,n){return["C",t,e,r,n,r,n]}function i(t,e,r,n,i,a){return["C",t/3+2/3*r,e/3+2/3*n,i/3+2/3*r,a/3+2/3*n,i,a]}e.exports=function(t){for(var e,r=[],o=0,s=0,l=0,c=0,u=null,f=null,h=0,d=0,p=0,m=t.length;p4?(o=g[g.length-4],s=g[g.length-3]):(o=h,s=d),r.push(g)}return r};var a=t("svg-arc-to-cubic-bezier")},{"svg-arc-to-cubic-bezier":541}],544:[function(t,e,r){(function(r){"use strict";var n=t("svg-path-bounds"),i=t("parse-svg-path"),a=t("draw-svg-path"),o=t("is-svg-path"),s=t("bitmap-sdf"),l=document.createElement("canvas"),c=l.getContext("2d");e.exports=function(t,e){if(!o(t))throw Error("Argument should be valid svg path string");e||(e={});var u,f;e.shape?(u=e.shape[0],f=e.shape[1]):(u=l.width=e.w||e.width||200,f=l.height=e.h||e.height||200);var h=Math.min(u,f),d=e.stroke||0,p=e.viewbox||e.viewBox||n(t),m=[u/(p[2]-p[0]),f/(p[3]-p[1])],g=Math.min(m[0]||0,m[1]||0)/2;if(c.fillStyle="black",c.fillRect(0,0,u,f),c.fillStyle="white",d&&("number"!=typeof d&&(d=1),c.strokeStyle=d>0?"white":"black",c.lineWidth=Math.abs(d)),c.translate(.5*u,.5*f),c.scale(g,g),r.Path2D){var v=new Path2D(t);c.fill(v),d&&c.stroke(v)}else{var y=i(t);a(c,y),c.fill(),d&&c.stroke()}return c.setTransform(1,0,0,1,0,0),s(c,{cutoff:null!=e.cutoff?e.cutoff:.5,radius:null!=e.radius?e.radius:.5*h})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"bitmap-sdf":72,"draw-svg-path":132,"is-svg-path":287,"parse-svg-path":466,"svg-path-bounds":542}],545:[function(t,e,r){(function(r){"use strict";function n(t,e,r){r=r||{};var a=o[t];a||(a=o[t]={" ":{data:new Float32Array(0),shape:.2}});var s=a[e];if(!s)if(e.length<=1||!/\d/.test(e))s=a[e]=function(t){for(var e=t.cells,r=t.positions,n=new Float32Array(6*e.length),i=0,a=0,o=0;o0&&(f+=.02);var d=new Float32Array(u),p=0,m=-.5*f;for(h=0;h1&&(r-=1),r<1/6?t+6*(e-t)*r:r<.5?e:r<2/3?t+(e-t)*(2/3-r)*6:t}var i,a,o;t=_(t,360),e=_(e,100),r=_(r,100);if(0===e)i=a=o=r;else{var s=r<.5?r*(1+e):r+e-r*e,l=2*r-s;i=n(l,s,t+1/3),a=n(l,s,t),o=n(l,s,t-1/3)}return{r:255*i,g:255*a,b:255*o}}(e.h,i,o),s=!0,l="hsl"),e.hasOwnProperty("a")&&(n=e.a));return n=b(n),{ok:s,format:e.format||l,r:I(255,P(r.r,0)),g:I(255,P(r.g,0)),b:I(255,P(r.b,0)),a:n}}(e);this._originalInput=e,this._r=i.r,this._g=i.g,this._b=i.b,this._a=i.a,this._roundA=D(100*this._a)/100,this._format=n.format||i.format,this._gradientType=n.gradientType,this._r<1&&(this._r=D(this._r)),this._g<1&&(this._g=D(this._g)),this._b<1&&(this._b=D(this._b)),this._ok=i.ok,this._tc_id=z++}function n(t,e,r){t=_(t,255),e=_(e,255),r=_(r,255);var n,i,a=P(t,e,r),o=I(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;)i.h=(i.h+a)%360,o.push(r(i));return o}function x(t,e){e=e||6;for(var n=r(t).toHsv(),i=n.h,a=n.s,o=n.v,s=[],l=1/e;e--;)s.push(r({h:i,s:a,v:o})),o=(o+l)%1;return s}function b(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function _(e,r){(function(t){return"string"==typeof t&&-1!=t.indexOf(".")&&1===parseFloat(t)})(e)&&(e="100%");var n=function(t){return"string"==typeof t&&-1!=t.indexOf("%")}(e);return e=I(r,P(0,parseFloat(e))),n&&(e=parseInt(e*r,10)/100),t.abs(e-r)<1e-6?1:e%r/parseFloat(r)}function w(t){return I(1,P(0,t))}function M(t){return parseInt(t,16)}function k(t){return 1==t.length?"0"+t:""+t}function A(t){return t<=1&&(t=100*t+"%"),t}function T(e){return t.round(255*parseFloat(e)).toString(16)}function S(t){return M(t)/255}function E(t){return!!N.CSS_UNIT.exec(t)}var L=/^\s+/,C=/\s+$/,z=0,D=t.round,I=t.min,P=t.max,O=t.random;r.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 e,r,n,i,a,o,s=this.toRgb();return e=s.r/255,r=s.g/255,n=s.b/255,i=e<=.03928?e/12.92:t.pow((e+.055)/1.055,2.4),a=r<=.03928?r/12.92:t.pow((r+.055)/1.055,2.4),o=n<=.03928?n/12.92:t.pow((n+.055)/1.055,2.4),.2126*i+.7152*a+.0722*o},setAlpha:function(t){return this._a=b(t),this._roundA=D(100*this._a)/100,this},toHsv:function(){var t=i(this._r,this._g,this._b);return{h:360*t.h,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=i(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),n=D(100*t.v);return 1==this._a?"hsv("+e+", "+r+"%, "+n+"%)":"hsva("+e+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var t=n(this._r,this._g,this._b);return{h:360*t.h,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=n(this._r,this._g,this._b),e=D(360*t.h),r=D(100*t.s),i=D(100*t.l);return 1==this._a?"hsl("+e+", "+r+"%, "+i+"%)":"hsla("+e+", "+r+"%, "+i+"%, "+this._roundA+")"},toHex:function(t){return a(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=[k(D(t).toString(16)),k(D(e).toString(16)),k(D(r).toString(16)),k(T(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:D(this._r),g:D(this._g),b:D(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+D(this._r)+", "+D(this._g)+", "+D(this._b)+")":"rgba("+D(this._r)+", "+D(this._g)+", "+D(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:D(100*_(this._r,255))+"%",g:D(100*_(this._g,255))+"%",b:D(100*_(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%)":"rgba("+D(100*_(this._r,255))+"%, "+D(100*_(this._g,255))+"%, "+D(100*_(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(R[a(this._r,this._g,this._b,!0)]||!1)},toFilter:function(t){var e="#"+o(this._r,this._g,this._b,this._a),n=e,i=this._gradientType?"GradientType = 1, ":"";if(t){var a=r(t);n="#"+o(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+e+",endColorstr="+n+")"},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 r(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(u,arguments)},brighten:function(){return this._applyModification(f,arguments)},darken:function(){return this._applyModification(h,arguments)},desaturate:function(){return this._applyModification(s,arguments)},saturate:function(){return this._applyModification(l,arguments)},greyscale:function(){return this._applyModification(c,arguments)},spin:function(){return this._applyModification(d,arguments)},_applyCombination:function(t,e){return t.apply(null,[this].concat([].slice.call(e)))},analogous:function(){return this._applyCombination(y,arguments)},complement:function(){return this._applyCombination(p,arguments)},monochromatic:function(){return this._applyCombination(x,arguments)},splitcomplement:function(){return this._applyCombination(v,arguments)},triad:function(){return this._applyCombination(m,arguments)},tetrad:function(){return this._applyCombination(g,arguments)}},r.fromRatio=function(t,e){if("object"==typeof t){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]="a"===i?t[i]:A(t[i]));t=n}return r(t,e)},r.equals=function(t,e){return!(!t||!e)&&r(t).toRgbString()==r(e).toRgbString()},r.random=function(){return r.fromRatio({r:O(),g:O(),b:O()})},r.mix=function(t,e,n){n=0===n?0:n||50;var i=r(t).toRgb(),a=r(e).toRgb(),o=n/100;return r({r:(a.r-i.r)*o+i.r,g:(a.g-i.g)*o+i.g,b:(a.b-i.b)*o+i.b,a:(a.a-i.a)*o+i.a})},r.readability=function(e,n){var i=r(e),a=r(n);return(t.max(i.getLuminance(),a.getLuminance())+.05)/(t.min(i.getLuminance(),a.getLuminance())+.05)},r.isReadable=function(t,e,n){var i,a,o=r.readability(t,e);switch(a=!1,(i=function(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),"AA"!==e&&"AAA"!==e&&(e="AA"),"small"!==r&&"large"!==r&&(r="small"),{level:e,size:r}}(n)).level+i.size){case"AAsmall":case"AAAlarge":a=o>=4.5;break;case"AAlarge":a=o>=3;break;case"AAAsmall":a=o>=7}return a},r.mostReadable=function(t,e,n){var i,a,o,s,l=null,c=0;a=(n=n||{}).includeFallbackColors,o=n.level,s=n.size;for(var u=0;uc&&(c=i,l=r(e[u]));return r.isReadable(t,l,{level:o,size:s})||!a?l:(n.includeFallbackColors=!1,r.mostReadable(t,["#fff","#000"],n))};var F=r.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"},R=r.hexNames=function(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}(F),N=function(){var t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",e="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?";return{CSS_UNIT:new RegExp(t),rgb:new RegExp("rgb"+e),rgba:new RegExp("rgba"+r),hsl:new RegExp("hsl"+e),hsla:new RegExp("hsla"+r),hsv:new RegExp("hsv"+e),hsva:new RegExp("hsva"+r),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})$/}}();void 0!==e&&e.exports?e.exports=r:window.tinycolor=r}(Math)},{}],547:[function(t,e,r){"use strict";function n(t){if(t instanceof Float32Array)return t;if("number"==typeof t)return new Float32Array([t])[0];var e=new Float32Array(t);return e.set(t),e}e.exports=n,e.exports.float32=e.exports.float=n,e.exports.fract32=e.exports.fract=function(t){if("number"==typeof t)return n(t-n(t));for(var e=n(t),r=0,i=e.length;r1)n=function(t,e,r){function n(t){var e=t<0?~t:t;(c[e]||(c[e]=[])).push({i:t,g:s})}function i(t){t.forEach(n)}function a(t){t.forEach(i)}function o(t){switch(s=t,t.type){case"GeometryCollection":t.geometries.forEach(o);break;case"LineString":i(t.arcs);break;case"MultiLineString":case"Polygon":a(t.arcs);break;case"MultiPolygon":!function(t){t.forEach(a)}(t.arcs)}}var s,l=[],c=[];return o(e),c.forEach(null==r?function(t){l.push(t[0].i)}:function(t){r(t[0].g,t[t.length-1].g)&&l.push(t[0].i)}),l}(0,e,r);else for(i=0,n=new Array(a=t.arcs.length);i1)for(var i,s,l=1,u=a(n[0]);lu&&(s=n[0],n[0]=n[l],n[l]=s,u=i);return n})}}var a=function(t){return t},o=function(t){if(null==(e=t.transform))return a;var e,r,n,i=e.scale[0],o=e.scale[1],s=e.translate[0],l=e.translate[1];return function(t,e){return e||(r=n=0),t[0]=(r+=t[0])*i+s,t[1]=(n+=t[1])*o+l,t}},s=function(t){function e(t){l[0]=t[0],l[1]=t[1],s(l),l[0]f&&(f=l[0]),l[1]h&&(h=l[1])}function r(t){switch(t.type){case"GeometryCollection":t.geometries.forEach(r);break;case"Point":e(t.coordinates);break;case"MultiPoint":t.coordinates.forEach(e)}}var n=t.bbox;if(!n){var i,a,s=o(t),l=new Array(2),c=1/0,u=c,f=-c,h=-c;t.arcs.forEach(function(t){for(var e=-1,r=t.length;++ef&&(f=l[0]),l[1]h&&(h=l[1])});for(a in t.objects)r(t.objects[a]);n=t.bbox=[c,u,f,h]}return n},l=function(t,e){for(var r,n=t.length,i=n-e;i<--n;)r=t[i],t[i++]=t[n],t[n]=r},c=function(t,e){function r(t,e){for(var r in t){var i=t[r];delete e[i.start],delete i.start,delete i.end,i.forEach(function(t){n[t<0?~t:t]=1}),o.push(i)}}var n={},i={},a={},o=[],s=-1;return e.forEach(function(r,n){var i,a=t.arcs[r<0?~r:r];a.length<3&&!a[1][0]&&!a[1][1]&&(i=e[++s],e[s]=r,e[n]=i)}),e.forEach(function(e){var r,n,o=function(e){var r,n=t.arcs[e<0?~e:e],i=n[0];return t.transform?(r=[0,0],n.forEach(function(t){r[0]+=t[0],r[1]+=t[1]})):r=n[n.length-1],e<0?[r,i]:[i,r]}(e),s=o[0],l=o[1];if(r=a[s])if(delete a[r.end],r.push(e),r.end=l,n=i[l]){delete i[n.start];var c=n===r?r:r.concat(n);i[c.start=r.start]=a[c.end=n.end]=c}else i[r.start]=a[r.end]=r;else if(r=i[l])if(delete i[r.start],r.unshift(e),r.start=s,n=a[s]){delete a[n.end];var u=n===r?r:n.concat(r);i[u.start=n.start]=a[u.end=r.end]=u}else i[r.start]=a[r.end]=r;else i[(r=[e]).start=s]=a[r.end=l]=r}),r(a,i),r(i,a),e.forEach(function(t){n[t<0?~t:t]||o.push([t])}),o},u=function(t,e){for(var r=0,n=t.length;r>>1;t[i]=2))throw new Error("n must be \u22652");if(t.transform)throw new Error("already quantized");var i,a=s(t),o=a[0],l=(a[2]-o)/(e-1)||1,c=a[1],u=(a[3]-c)/(e-1)||1;t.arcs.forEach(function(t){for(var e,r,n,i=1,a=1,s=t.length,f=t[0],h=f[0]=Math.round((f[0]-o)/l),d=f[1]=Math.round((f[1]-c)/u);iMath.max(r,n)?i[2]=1:r>Math.max(e,n)?i[0]=1:i[1]=1;for(var a=0,o=0,s=0;s<3;++s)a+=t[s]*t[s],o+=i[s]*t[s];for(s=0;s<3;++s)i[s]-=o/a*t[s];return f(i,i),i}function o(t,e,r,n,i,a,o,l){this.center=s(r),this.up=s(n),this.right=s(i),this.radius=s([a]),this.angle=s([o,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 c=0;c<16;++c)this.computedMatrix[c]=.5;this.recalcMatrix(0)}e.exports=function(t){var e=(t=t||{}).center||[0,0,0],r=t.up||[0,1,0],i=t.right||a(r),s=t.radius||1,l=t.theta||0,c=t.phi||0;if(e=[].slice.call(e,0,3),r=[].slice.call(r,0,3),f(r,r),i=[].slice.call(i,0,3),f(i,i),"eye"in t){var d=t.eye,p=[d[0]-e[0],d[1]-e[1],d[2]-e[2]];u(i,p,r),n(i[0],i[1],i[2])<1e-6?i=a(r):f(i,i),s=n(p[0],p[1],p[2]);var m=h(r,p)/s,g=h(i,p)/s;c=Math.acos(m),l=Math.acos(g)}return s=Math.log(s),new o(t.zoomMin,t.zoomMax,e,r,i,s,l,c)};var s=t("filtered-vector"),l=t("gl-mat4/invert"),c=t("gl-mat4/rotate"),u=t("gl-vec3/cross"),f=t("gl-vec3/normalize"),h=t("gl-vec3/dot"),d=o.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,i=0,a=0,o=0;o<3;++o)a+=e[o]*r[o],i+=e[o]*e[o];var s=Math.sqrt(i),l=0;for(o=0;o<3;++o)r[o]-=e[o]*a/i,l+=r[o]*r[o],e[o]/=s;var c=Math.sqrt(l);for(o=0;o<3;++o)r[o]/=c;var h=this.computedToward;u(h,e,r),f(h,h);var d=Math.exp(this.computedRadius[0]),p=this.computedAngle[0],m=this.computedAngle[1],g=Math.cos(p),v=Math.sin(p),y=Math.cos(m),x=Math.sin(m),b=this.computedCenter,_=g*y,w=v*y,M=x,k=-g*x,A=-v*x,T=y,S=this.computedEye,E=this.computedMatrix;for(o=0;o<3;++o){var L=_*r[o]+w*h[o]+M*e[o];E[4*o+1]=k*r[o]+A*h[o]+T*e[o],E[4*o+2]=L,E[4*o+3]=0}var C=E[1],z=E[5],D=E[9],I=E[2],P=E[6],O=E[10],F=z*O-D*P,R=D*I-C*O,N=C*P-z*I,j=n(F,R,N);F/=j,R/=j,N/=j,E[0]=F,E[4]=R,E[8]=N;for(o=0;o<3;++o)S[o]=b[o]+E[2+4*o]*d;for(o=0;o<3;++o){l=0;for(var B=0;B<3;++B)l+=E[o+4*B]*S[B];E[12+o]=-l}E[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 a=this.computedUp,o=this.computedRight,s=this.computedToward,l=0;l<3;++l)i[4*l]=a[l],i[4*l+1]=o[l],i[4*l+2]=s[l];c(i,i,n,p);for(l=0;l<3;++l)a[l]=i[4*l],o[l]=i[4*l+1];this.up.set(t,a[0],a[1],a[2]),this.right.set(t,o[0],o[1],o[2])}},d.pan=function(t,e,r,i){e=e||0,r=r||0,i=i||0,this.recalcMatrix(t);var a=this.computedMatrix,o=(Math.exp(this.computedRadius[0]),a[1]),s=a[5],l=a[9],c=n(o,s,l);o/=c,s/=c,l/=c;var u=a[0],f=a[4],h=a[8],d=u*o+f*s+h*l,p=n(u-=o*d,f-=s*d,h-=l*d),m=(u/=p)*e+o*r,g=(f/=p)*e+s*r,v=(h/=p)*e+l*r;this.center.move(t,m,g,v);var y=Math.exp(this.computedRadius[0]);y=Math.max(1e-4,y+i),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,a){var o=1;"number"==typeof r&&(o=0|r),(o<0||o>3)&&(o=1);var s=(o+2)%3;e||(this.recalcMatrix(t),e=this.computedMatrix);var c=e[o],u=e[o+4],f=e[o+8];if(a){var h=Math.abs(c),d=Math.abs(u),p=Math.abs(f),m=Math.max(h,d,p);h===m?(c=c<0?-1:1,u=f=0):p===m?(f=f<0?-1:1,c=u=0):(u=u<0?-1:1,c=f=0)}else{var g=n(c,u,f);c/=g,u/=g,f/=g}var v=e[s],y=e[s+4],x=e[s+8],b=v*c+y*u+x*f,_=n(v-=c*b,y-=u*b,x-=f*b),w=u*(x/=_)-f*(y/=_),M=f*(v/=_)-c*x,k=c*y-u*v,A=n(w,M,k);w/=A,M/=A,k/=A,this.center.jump(t,H,G,Y),this.radius.idle(t),this.up.jump(t,c,u,f),this.right.jump(t,v,y,x);var T,S;if(2===o){var E=e[1],L=e[5],C=e[9],z=E*v+L*y+C*x,D=E*w+L*M+C*k;T=F<0?-Math.PI/2:Math.PI/2,S=Math.atan2(D,z)}else{var I=e[2],P=e[6],O=e[10],F=I*c+P*u+O*f,R=I*v+P*y+O*x,N=I*w+P*M+O*k;T=Math.asin(i(F)),S=Math.atan2(N,R)}this.angle.jump(t,S,T),this.recalcMatrix(t);var j=e[2],B=e[6],U=e[10],V=this.computedMatrix;l(V,e);var q=V[15],H=V[12]/q,G=V[13]/q,Y=V[14]/q,W=Math.exp(this.computedRadius[0]);this.center.jump(t,H-j*W,G-B*W,Y-U*W)},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,a){this.recalcMatrix(t),e=e||this.computedEye,r=r||this.computedCenter;var o=(a=a||this.computedUp)[0],s=a[1],l=a[2],c=n(o,s,l);if(!(c<1e-6)){o/=c,s/=c,l/=c;var u=e[0]-r[0],f=e[1]-r[1],h=e[2]-r[2],d=n(u,f,h);if(!(d<1e-6)){u/=d,f/=d,h/=d;var p=this.computedRight,m=p[0],g=p[1],v=p[2],y=o*m+s*g+l*v,x=n(m-=y*o,g-=y*s,v-=y*l);if(!(x<.01&&(m=s*h-l*f,g=l*u-o*h,v=o*f-s*u,(x=n(m,g,v))<1e-6))){m/=x,g/=x,v/=x,this.up.set(t,o,s,l),this.right.set(t,m,g,v),this.center.set(t,r[0],r[1],r[2]),this.radius.set(t,Math.log(d));var b=s*v-l*g,_=l*m-o*v,w=o*g-s*m,M=n(b,_,w),k=o*u+s*f+l*h,A=m*u+g*f+v*h,T=(b/=M)*u+(_/=M)*f+(w/=M)*h,S=Math.asin(i(k)),E=Math.atan2(T,A),L=this.angle._state,C=L[L.length-1],z=L[L.length-2];C%=2*Math.PI;var D=Math.abs(C+2*Math.PI-E),I=Math.abs(C-E),P=Math.abs(C-2*Math.PI-E);D0?r.pop():new ArrayBuffer(t)}function o(t){return new Uint8Array(a(t),0,t)}function s(t){return new Uint16Array(a(2*t),0,t)}function l(t){return new Uint32Array(a(4*t),0,t)}function c(t){return new Int8Array(a(t),0,t)}function u(t){return new Int16Array(a(2*t),0,t)}function f(t){return new Int32Array(a(4*t),0,t)}function h(t){return new Float32Array(a(4*t),0,t)}function d(t){return new Float64Array(a(8*t),0,t)}function p(t){return x?new Uint8ClampedArray(a(t),0,t):o(t)}function m(t){return new DataView(a(t),0,t)}function g(t){t=v.nextPow2(t);var e=v.log2(t),r=w[e];return r.length>0?r.pop():new n(t)}var v=t("bit-twiddle"),y=t("dup");e.__TYPEDARRAY_POOL||(e.__TYPEDARRAY_POOL={UINT8:y([32,0]),UINT16:y([32,0]),UINT32:y([32,0]),INT8:y([32,0]),INT16:y([32,0]),INT32:y([32,0]),FLOAT:y([32,0]),DOUBLE:y([32,0]),DATA:y([32,0]),UINT8C:y([32,0]),BUFFER:y([32,0])});var x="undefined"!=typeof Uint8ClampedArray,b=e.__TYPEDARRAY_POOL;b.UINT8C||(b.UINT8C=y([32,0])),b.BUFFER||(b.BUFFER=y([32,0]));var _=b.DATA,w=b.BUFFER;r.free=function(t){if(n.isBuffer(t))w[v.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|v.log2(e);_[r].push(t)}},r.freeUint8=r.freeUint16=r.freeUint32=r.freeInt8=r.freeInt16=r.freeInt32=r.freeFloat32=r.freeFloat=r.freeFloat64=r.freeDouble=r.freeUint8Clamped=r.freeDataView=function(t){i(t.buffer)},r.freeArrayBuffer=i,r.freeBuffer=function(t){w[v.log2(t.length)].push(t)},r.malloc=function(t,e){if(void 0===e||"arraybuffer"===e)return a(t);switch(e){case"uint8":return o(t);case"uint16":return s(t);case"uint32":return l(t);case"int8":return c(t);case"int16":return u(t);case"int32":return f(t);case"float":case"float32":return h(t);case"double":case"float64":return d(t);case"uint8_clamped":return p(t);case"buffer":return g(t);case"data":case"dataview":return m(t);default:return null}return null},r.mallocArrayBuffer=a,r.mallocUint8=o,r.mallocUint16=s,r.mallocUint32=l,r.mallocInt8=c,r.mallocInt16=u,r.mallocInt32=f,r.mallocFloat32=r.mallocFloat=h,r.mallocFloat64=r.mallocDouble=d,r.mallocUint8Clamped=p,r.mallocDataView=m,r.mallocBuffer=g,r.clearCache=function(){for(var t=0;t<32;++t)b.UINT8[t].length=0,b.UINT16[t].length=0,b.UINT32[t].length=0,b.INT8[t].length=0,b.INT16[t].length=0,b.INT32[t].length=0,b.FLOAT[t].length=0,b.DOUBLE[t].length=0,b.UINT8C[t].length=0,_[t].length=0,w[t].length=0}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t("buffer").Buffer)},{"bit-twiddle":71,buffer:82,dup:134}],555:[function(t,e,r){"use strict";"use restrict";function n(t){this.roots=new Array(t),this.ranks=new Array(t);for(var e=0;en)return n;for(;ra?r=i:n=i,i=.5*(n-r)+r}return i},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},{}],558:[function(t,e,r){"use strict";e.exports=function(t,e,r){Array.isArray(r)||(r=[].slice.call(arguments,2));for(var n=0,i=r.length;n",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(u),h=["%","/","?",";","#"].concat(f),d=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,g={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},x=t("querystring");n.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=-1!==n&&n127?I+="x":I+=D[P];if(!I.match(p)){var F=C.slice(0,A),R=C.slice(A+1),N=D.match(m);N&&(F.push(N[1]),R.unshift(N[2])),R.length&&(u="/"+R.join(".")+u),this.hostname=F.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),L||(this.hostname=a.toASCII(this.hostname));var j=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+j,this.href+=this.host,L&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==u[0]&&(u="/"+u))}if(!g[w])for(A=0,z=f.length;A0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=M.slice(-1)[0],T=(r.host||t.host||M.length>1)&&("."===A||".."===A)||""===A,S=0,E=M.length;E>=0;E--)"."===(A=M[E])?M.splice(E,1):".."===A?(M.splice(E,1),S++):S&&(M.splice(E,1),S--);if(!_&&!w)for(;S--;S)M.unshift("..");!_||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),T&&"/"!==M.join("/").substr(-1)&&M.push("");var L=""===M[0]||M[0]&&"/"===M[0].charAt(0);if(k){r.hostname=r.host=L?"":M.length?M.shift():"";var C;(C=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=C.shift(),r.host=r.hostname=C.shift())}return(_=_||r.host&&M.length)&&!L&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=l.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":560,punycode:489,querystring:493}],560:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],561:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],562:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],563:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:o};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),f(e)?n.showHidden=e:e&&r._extend(n,e),m(n.showHidden)&&(n.showHidden=!1),m(n.depth)&&(n.depth=2),m(n.colors)&&(n.colors=!1),m(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),s(n,t,n.depth)}function a(t,e){var r=i.styles[e];return r?"\x1b["+i.colors[r][0]+"m"+t+"\x1b["+i.colors[r][1]+"m":t}function o(t,e){return t}function s(t,e,n){if(t.customInspect&&e&&b(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return p(i)||(i=s(t,i,n)),i}var a=function(t,e){if(m(e))return t.stylize("undefined","undefined");if(p(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(d(e))return t.stylize(""+e,"number");if(f(e))return t.stylize(""+e,"boolean");if(h(e))return t.stylize("null","null")}(t,e);if(a)return a;var o=Object.keys(e),v=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),x(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return l(e);if(0===o.length){if(b(e)){var _=e.name?": "+e.name:"";return t.stylize("[Function"+_+"]","special")}if(g(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(y(e))return t.stylize(Date.prototype.toString.call(e),"date");if(x(e))return l(e)}var w="",k=!1,A=["{","}"];if(u(e)&&(k=!0,A=["[","]"]),b(e)){w=" [Function"+(e.name?": "+e.name:"")+"]"}if(g(e)&&(w=" "+RegExp.prototype.toString.call(e)),y(e)&&(w=" "+Date.prototype.toUTCString.call(e)),x(e)&&(w=" "+l(e)),0===o.length&&(!k||0==e.length))return A[0]+w+A[1];if(n<0)return g(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var T;return T=k?function(t,e,r,n,i){for(var a=[],o=0,s=e.length;o=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(T,w,A)}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function c(t,e,r,n,i,a){var o,l,c;if((c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?l=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(l=t.stylize("[Setter]","special")),M(n,i)||(o="["+i+"]"),l||(t.seen.indexOf(c.value)<0?(l=h(r)?s(t,c.value,null):s(t,c.value,r-1)).indexOf("\n")>-1&&(l=a?l.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+l.split("\n").map(function(t){return" "+t}).join("\n")):l=t.stylize("[Circular]","special")),m(o)){if(a&&i.match(/^\d+$/))return l;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+l}function u(t){return Array.isArray(t)}function f(t){return"boolean"==typeof t}function h(t){return null===t}function d(t){return"number"==typeof t}function p(t){return"string"==typeof t}function m(t){return void 0===t}function g(t){return v(t)&&"[object RegExp]"===_(t)}function v(t){return"object"==typeof t&&null!==t}function y(t){return v(t)&&"[object Date]"===_(t)}function x(t){return v(t)&&("[object Error]"===_(t)||t instanceof Error)}function b(t){return"function"==typeof t}function _(t){return Object.prototype.toString.call(t)}function w(t){return t<10?"0"+t.toString(10):t.toString(10)}function M(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;r.format=function(t){if(!p(t)){for(var e=[],r=0;r=a)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r>3}if(i--,1===n||2===n)o+=t.readSVarint(),s+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new a(o,s));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},n.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,r=1,n=0,i=0,a=0,o=1/0,s=-1/0,l=1/0,c=-1/0;t.pos>3}if(n--,1===r||2===r)i+=t.readSVarint(),a+=t.readSVarint(),is&&(s=i),ac&&(c=a);else if(7!==r)throw new Error("unknown command "+r)}return[o,l,s,c]},n.prototype.toGeoJSON=function(t,e,r){function i(t){for(var e=0;e>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(r))}var a=t("./vectortilefeature.js");e.exports=n,n.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new a(this._pbf,e,this.extent,this._keys,this._values)}},{"./vectortilefeature.js":566}],568:[function(t,e,r){"use strict";e.exports=function(t,e){return"object"==typeof e&&null!==e||(e={}),n(t,e.canvas||i,e.context||a,e)};var n=t("./lib/vtext"),i=null,a=null;"undefined"!=typeof document&&((i=document.createElement("canvas")).width=8192,i.height=1024,a=i.getContext("2d"))},{"./lib/vtext":569}],569:[function(t,e,r){"use strict";function n(t,e,r,n){var i=function(t,e){var r=a(t,128);return e?s(r.cells,r.positions,.25):{edges:r.cells,positions:r.positions}}(t,n),o=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;l8192)throw new Error("vectorize-text: String too long (sorry, this will get fixed later)");var a=3*n;t.height>31}var o=t("pbf"),s=t("./vector-tile-pb"),l=t("./lib/geojson_wrapper");e.exports=n,e.exports.fromVectorTileJs=n,e.exports.fromGeojsonVt=function(t){var e={};for(var r in t)e[r]=new l(t[r].features),e[r].name=r;return n({layers:e})},e.exports.GeoJSONWrapper=l},{"./lib/geojson_wrapper":571,"./vector-tile-pb":572,pbf:470}],571:[function(t,e,r){"use strict";function n(t){this.features=t,this.length=t.length}function i(t){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=4096}var a=t("point-geometry"),o=t("vector-tile").VectorTileFeature;e.exports=n,n.prototype.feature=function(t){return new i(this.features[t])},i.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e=0?e[o]:a})},has___:{value:i(function(e){var i=n(e);return i?r in i:t.indexOf(e)>=0})},set___:{value:i(function(i,a){var o,s=n(i);return s?s[r]=a:(o=t.indexOf(i))>=0?e[o]=a:(o=t.length,e[o]=a,t[o]=i),this})},delete___:{value:i(function(i){var a,o,s=n(i);return s?r in s&&delete s[r]:!((a=t.indexOf(i))<0||(o=t.length-1,t[a]=void 0,e[a]=e[o],t[a]=t[o],t.length=o,e.length=o,0))})}})};b.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 s?function(){function r(){this instanceof b||a();var e,r=new s,n=void 0,l=!1;return e=o?function(t,e){return r.set(t,e),r.has(t)||(n||(n=new b),n.set(t,e)),this}:function(t,e){if(l)try{r.set(t,e)}catch(r){n||(n=new b),n.set___(t,e)}else r.set(t,e);return this},Object.create(b.prototype,{get___:{value:i(function(t,e){return n?r.has(t)?r.get(t):n.get___(t,e):r.get(t,e)})},has___:{value:i(function(t){return r.has(t)||!!n&&n.has___(t)})},set___:{value:i(e)},delete___:{value:i(function(t){var e=!!r.delete(t);return n?n.delete___(t)||e:e})},permitHostObjects___:{value:i(function(e){if(e!==t)throw new Error("bogus call to permitHostObjects___");l=!0})}})}o&&"undefined"!=typeof Proxy&&(Proxy=void 0),r.prototype=b.prototype,e.exports=r,Object.defineProperty(WeakMap.prototype,"constructor",{value:WeakMap,enumerable:!1,configurable:!0,writable:!0})}():("undefined"!=typeof Proxy&&(Proxy=void 0),e.exports=b)}}()},{}],574:[function(t,e,r){var n=t("./hidden-store.js");e.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)}}},{"./hidden-store.js":575}],575:[function(t,e,r){e.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}},{}],576:[function(t,e,r){var n=t("./create-store.js");e.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}}}},{"./create-store.js":574}],577:[function(t,e,r){var n=t("get-canvas-context");e.exports=function(t){return n("webgl",t)}},{"get-canvas-context":156}],578:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){function r(t){g[t]=!0;for(var e in i[t][1]){var n=i[t][1][e];g[n]||r(n)}}for(var s,l=Object.keys(a),c=0,u=l.length;c2111)throw e.replace(/\{0\}/,this.local.name);return t},toMonthIndex:function(t,e,r){var n=this.intercalaryMonth(t);if(r&&e!==n||e<1||e>12)throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return n?!r&&e<=n?e-1:e:e-1},toChineseMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);if(e<0||e>(r?12:11))throw i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r?e>13},isIntercalaryMonth:function(t,e){t.year&&(e=(t=t.year()).month());var r=this.intercalaryMonth(t);return!!r&&r===e},leapYear:function(t){return 0!==this.intercalaryMonth(t)},weekOfYear:function(t,e,r){var n,a=this._validateYear(t,i.local.invalidyear),s=h[a-h[0]],l=s>>9&4095,c=s>>5&15,u=31&s;(n=o.newDate(l,c,u)).add(4-(n.dayOfWeek()||7),"d");var f=this.toJD(t,e,r)-n.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 i.local.invalidMonth.replace(/\{0\}/,this.local.name);return r&1<<12-e?30:29},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,s,r,i.local.invalidDate);t=this._validateYear(n.year()),e=n.month(),r=n.day();var a=this.isIntercalaryMonth(t,e),s=this.toChineseMonth(t,e),l=function(t,e,r,n,i){var a,o;if("object"==typeof t)o=t,a=e||{};else{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");var s;"object"==typeof n?(s=!1,a=n):(s=!!n,a=i||{}),o={year:t,month:e,day:r,isIntercalary:s}}var l;l=o.day-1;var c,u=f[o.year-f[0]],d=u>>13;c=d?o.month>d?o.month:o.isIntercalary?o.month:o.month-1:o.month-1;for(var p=0;p>9&4095,v=m>>5&15,y=31&m,x=new Date(g,v-1,y+l);return a.year=x.getFullYear(),a.month=1+x.getMonth(),a.day=x.getDate(),a}(t,s,r,a);return o.toJD(l.year,l.month,l.day)},fromJD:function(t){var e=o.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=n||{}}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;var l,c=(o=h[a.year-h[0]])>>9&4095,u=o>>5&15,d=31&o,p=new Date(c,u-1,d),m=new Date(i.year,i.month-1,i.day);l=Math.round((m-p)/864e5);var g,v=f[a.year-f[0]];for(g=0;g<13;g++){var y=v&1<<12-g?30:29;if(l>13;return!x||g=2&&n<=6},extraInfo:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return{century:a[Math.floor((n.year()-1)/100)+1]||""}},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year()+(n.year()<0?1:0),e=n.month(),(r=n.day())+(e>1?16:0)+(e>2?32*(e-2):0)+400*(t-1)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t+.5)-Math.floor(this.jdEpoch)-1;var e=Math.floor(t/400)+1;t-=400*(e-1),t+=t>15?16:0;var r=Math.floor(t/32)+1,n=t-32*(r-1)+1;return this.newDate(e<=0?e-1:e,r,n)}});var a={20:"Fruitbat",21:"Anchovy"};i.calendars.discworld=n},{"../main":595,"object-assign":462}],584:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(13===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return(t=n.year())<0&&t++,n.day()+30*(n.month()-1)+365*(t-1)+Math.floor(t/4)+this.jdEpoch-1},fromJD:function(t){var e=Math.floor(t)+.5-this.jdEpoch,r=Math.floor((e-Math.floor((e+366)/1461))/365)+1;r<=0&&r--,e=Math.floor(t)+.5-this.newDate(r,1,1).toJD();var n=Math.floor(e/30)+1,i=e-30*(n-1)+1;return this.newDate(r,n,i)}}),i.calendars.ethiopian=n},{"../main":595,"object-assign":462}],585:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}var a=t("../main");t("object-assign")(n.prototype=new a.baseCalendar,{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,a.local.invalidYear);return this._leapYear(e.year())},_leapYear:function(t){return t=t<0?t+1:t,i(7*t+1,19)<7},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,a.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,a.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,a.local.invalidMonth),12===e&&this.leapYear(t)?30:8===e&&5===i(this.daysInYear(t),10)?30:9===e&&3===i(this.daysInYear(t),10)?29:this.daysPerMonth[e-1]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},extraInfo:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);return{yearType:(this.leapYear(n)?"embolismic":"common")+" "+["deficient","regular","complete"][this.daysInYear(n)%10-3]}},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var i=t<=0?t+1:t,o=this.jdEpoch+this._delay1(i)+this._delay2(i)+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)}}),a.calendars.hebrew=n},{"../main":595,"object-assign":462}],586:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"Islamic",jdEpoch:1948439.5,daysPerMonth:[30,29,30,29,30,29,30,29,30,29,30,29],hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Islamic",epochs:["BH","AH"],monthNames:["Muharram","Safar","Rabi' al-awwal","Rabi' al-thani","Jumada al-awwal","Jumada al-thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-ahad","Yawm al-ithnayn","Yawm ath-thulaathaa'","Yawm al-arbi'aa'","Yawm al-kham\u012bs","Yawm al-jum'a","Yawm as-sabt"],dayNamesShort:["Aha","Ith","Thu","Arb","Kha","Jum","Sab"],dayNamesMin:["Ah","It","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!1}},leapYear:function(t){return(11*this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t=t<=0?t+1:t,r+Math.ceil(29.5*(e-1))+354*(t-1)+Math.floor((3+11*t)/30)+this.jdEpoch-1},fromJD:function(t){t=Math.floor(t)+.5;var e=Math.floor((30*(t-this.jdEpoch)+10646)/10631);e=e<=0?e-1:e;var r=Math.min(12,Math.ceil((t-29-this.toJD(e,1,1))/29.5)+1),n=t-this.toJD(e,r,1)+1;return this.newDate(e,r,n)}}),i.calendars.islamic=n},{"../main":595,"object-assign":462}],587:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);return t=n.year(),e=n.month(),r=n.day(),t<0&&t++,e<=2&&(t--,e+=12),Math.floor(365.25*(t+4716))+Math.floor(30.6001*(e+1))+r-1524.5},fromJD:function(t){var e=Math.floor(t+.5)+1524,r=Math.floor((e-122.1)/365.25),n=Math.floor(365.25*r),i=Math.floor((e-n)/30.6001),a=i-Math.floor(i<14?1:13),o=r-Math.floor(a>2?4716:4715),s=e-n-Math.floor(30.6001*i);return o<=0&&o--,this.newDate(o,a,s)}}),i.calendars.julian=n},{"../main":595,"object-assign":462}],588:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}function i(t,e){return t-e*Math.floor(t/e)}function a(t,e){return i(t-1,e)+1}var o=t("../main");t("object-assign")(n.prototype=new o.baseCalendar,{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,o.local.invalidYear),!1},formatYear:function(t){t=this._validate(t,this.minMonth,this.minDay,o.local.invalidYear).year();var e=Math.floor(t/400);t%=400,t+=t<0?400:0;return 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,o.local.invalidYear),18},weekOfYear:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),0},daysInYear:function(t){return this._validate(t,this.minMonth,this.minDay,o.local.invalidYear),360},daysInMonth:function(t,e){return this._validate(t,e,this.minDay,o.local.invalidMonth),20},daysInWeek:function(){return 5},dayOfWeek:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate).day()},weekDay:function(t,e,r){return this._validate(t,e,r,o.local.invalidDate),!0},extraInfo:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate).toJD(),i=this._toHaab(n),a=this._toTzolkin(n);return{haabMonthName:this.local.haabMonths[i[0]-1],haabMonth:i[0],haabDay:i[1],tzolkinDayName:this.local.tzolkinMonths[a[0]-1],tzolkinDay:a[0],tzolkinTrecena:a[1]}},_toHaab:function(t){var e=i((t-=this.jdEpoch)+8+340,365);return[Math.floor(e/20)+1,i(e,20)]},_toTzolkin:function(t){return t-=this.jdEpoch,[a(t+20,20),a(t+4,13)]},toJD:function(t,e,r){var n=this._validate(t,e,r,o.local.invalidDate);return n.day()+20*n.month()+360*n.year()+this.jdEpoch},fromJD:function(t){t=Math.floor(t)+.5-this.jdEpoch;var e=Math.floor(t/360);t%=360,t+=t<0?360:0;var r=Math.floor(t/20),n=t%20;return this.newDate(e,r,n)}}),o.calendars.mayan=n},{"../main":595,"object-assign":462}],589:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign");n.prototype=new i.baseCalendar;var o=i.instance("gregorian");a(n.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,i.local.invalidYear||i.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,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidMonth);(t=n.year())<0&&t++;for(var a=n.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)}}),i.calendars.nanakshahi=n},{"../main":595,"object-assign":462}],590:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{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,i.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,i.local.invalidMonth),void 0===this.NEPALI_CALENDAR_DATA[t]?this.daysPerMonth[e-1]:this.NEPALI_CALENDAR_DATA[t][e]},weekDay:function(t,e,r){return 6!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var a=i.instance(),o=0,s=e,l=t;this._createMissingCalendarData(t);var c=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(c)):o+=this.NEPALI_CALENDAR_DATA[l][9]-this.NEPALI_CALENDAR_DATA[l][0],a.newDate(c,1,1).add(o,"d").toJD()},fromJD:function(t){var e=i.instance().fromJD(t),r=e.year(),n=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;n>l;)++o>12&&(o=1,a++),l+=this.NEPALI_CALENDAR_DATA[a][o];var c=this.NEPALI_CALENDAR_DATA[a][o]-(l-n);return this.newDate(a,o,c)},_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,a.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(12===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,a.local.invalidDate);t=n.year(),e=n.month(),r=n.day();var o=t-(t>=0?474:473),s=474+i(o,2820);return r+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*s-110)/2816)+365*(s-1)+1029983*Math.floor(o/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=i(e,1029983),a=2820;if(1029982!==n){var o=Math.floor(n/366),s=i(n,366);a=Math.floor((2134*o+2816*s+2815)/1028522)+o+1}var l=a+2820*r+474;l=l<=0?l-1:l;var c=t-this.toJD(l,1,1)+1,u=c<=186?Math.ceil(c/31):Math.ceil((c-6)/30),f=t-this.toJD(l,u,1)+1;return this.newDate(l,u,f)}}),a.calendars.persian=n,a.calendars.jalali=n},{"../main":595,"object-assign":462}],592:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.taiwan=n},{"../main":595,"object-assign":462}],593:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main"),a=t("object-assign"),o=i.instance();a(n.prototype=new i.baseCalendar,{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,i.local.invalidYear);t=this._t2gYear(e.year());return o.leapYear(t)},weekOfYear:function(t,e,r){var n=this._validate(t,this.minMonth,this.minDay,i.local.invalidYear);t=this._t2gYear(n.year());return o.weekOfYear(t,n.month(),n.day())},daysInMonth:function(t,e){var r=this._validate(t,e,this.minDay,i.local.invalidMonth);return this.daysPerMonth[r.month()-1]+(2===r.month()&&this.leapYear(r.year())?1:0)},weekDay:function(t,e,r){return(this.dayOfWeek(t,e,r)||7)<6},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate);t=this._t2gYear(n.year());return o.toJD(t,n.month(),n.day())},fromJD:function(t){var e=o.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)}}),i.calendars.thai=n},{"../main":595,"object-assign":462}],594:[function(t,e,r){function n(t){this.local=this.regionalOptions[t||""]||this.regionalOptions[""]}var i=t("../main");t("object-assign")(n.prototype=new i.baseCalendar,{name:"UmmAlQura",hasYearZero:!1,minMonth:1,firstMonth:1,minDay:1,regionalOptions:{"":{name:"Umm al-Qura",epochs:["BH","AH"],monthNames:["Al-Muharram","Safar","Rabi' al-awwal","Rabi' Al-Thani","Jumada Al-Awwal","Jumada Al-Thani","Rajab","Sha'aban","Ramadan","Shawwal","Dhu al-Qi'dah","Dhu al-Hijjah"],monthNamesShort:["Muh","Saf","Rab1","Rab2","Jum1","Jum2","Raj","Sha'","Ram","Shaw","DhuQ","DhuH"],dayNames:["Yawm al-Ahad","Yawm al-Ithnain","Yawm al-Thal\u0101th\u0101\u2019","Yawm al-Arba\u2018\u0101\u2019","Yawm al-Kham\u012bs","Yawm al-Jum\u2018a","Yawm al-Sabt"],dayNamesMin:["Ah","Ith","Th","Ar","Kh","Ju","Sa"],digits:null,dateFormat:"yyyy/mm/dd",firstDay:6,isRTL:!0}},leapYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,i.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,i.local.invalidMonth).toJD()-24e5+.5,n=0,o=0;or)return a[n]-a[n-1];n++}return 30},weekDay:function(t,e,r){return 5!==this.dayOfWeek(t,e,r)},toJD:function(t,e,r){var n=this._validate(t,e,r,i.local.invalidDate),o=12*(n.year()-1)+n.month()-15292;return n.day()+a[o-1]-1+24e5-.5},fromJD:function(t){for(var e=t-24e5+.5,r=0,n=0;ne);n++)r++;var i=r+15292,o=Math.floor((i-1)/12),s=o+1,l=i-12*o,c=e-a[r-1]+1;return this.newDate(s,l,c)},isValid:function(t,e,r){var n=i.baseCalendar.prototype.isValid.apply(this,arguments);return n&&(n=(t=null!=t.year?t.year:t)>=1276&&t<=1500),n},_validate:function(t,e,r,n){var a=i.baseCalendar.prototype._validate.apply(this,arguments);if(a.year<1276||a.year>1500)throw n.replace(/\{0\}/,this.local.name);return a}}),i.calendars.ummalqura=n;var a=[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]},{"../main":595,"object-assign":462}],595:[function(t,e,r){function n(){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 i(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(c.local.invalidDate||c.regionalOptions[""].invalidDate).replace(/\{0\}/,this._calendar.local.name)}function a(t,e){return t=""+t,"000000".substring(0,e-t.length)+t}function o(){this.shortYearCutoff="+10"}function s(t){this.local=this.regionalOptions[t]||this.regionalOptions[""]}var l=t("object-assign");l(n.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]}}}),l(i.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(c.local.invalidDate||c.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(c.local.differentCalendars||c.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?"-":"")+a(Math.abs(this.year()),4)+"-"+a(this.month(),2)+"-"+a(this.day(),2)}}),l(o.prototype,{_validateLevel:0,newDate:function(t,e,r){return null==t?this.today():(t.year&&(this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),r=t.day(),e=t.month(),t=t.year()),new i(this,t,e,r))},today:function(){return this.fromJSDate(new Date)},epoch:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear).year()<0?this.local.epochs[0]:this.local.epochs[1]},formatYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return(e.year()<0?"-":"")+a(Math.abs(e.year()),4)},monthsInYear:function(t){return this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear),12},monthOfYear:function(t,e){var r=this._validate(t,e,this.minDay,c.local.invalidMonth||c.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,c.local.invalidMonth||c.regionalOptions[""].invalidMonth),r},daysInYear:function(t){var e=this._validate(t,this.minMonth,this.minDay,c.local.invalidYear||c.regionalOptions[""].invalidYear);return this.leapYear(e)?366:365},dayOfYear:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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,c.local.invalidDate||c.regionalOptions[""].invalidDate);return(Math.floor(this.toJD(n))+2)%this.daysInWeek()},extraInfo:function(t,e,r){return this._validate(t,e,r,c.local.invalidDate||c.regionalOptions[""].invalidDate),{}},add:function(t,e,r){return this._validate(t,this.minMonth,this.minDay,c.local.invalidDate||c.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,c.local.invalidDate||c.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),c=i-(l>2.5?4716:4715);return c<=0&&c--,this.newDate(c,l,s)},toJSDate:function(t,e,r){var n=this._validate(t,e,r,c.local.invalidDate||c.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 c=e.exports=new n;c.cdate=i,c.baseCalendar=o,c.calendars.gregorian=s},{"object-assign":462}],596:[function(t,e,r){var n=t("object-assign"),i=t("./main");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=(r=r||{}).dayNamesShort||this.local.dayNamesShort,a=r.dayNames||this.local.dayNames,o=r.monthNumbers||this.local.monthNumbers,s=r.monthNamesShort||this.local.monthNamesShort,l=r.monthNames||this.local.monthNames,c=(r.calculateWeek||this.local.calculateWeek,function(e,r){for(var n=1;x+n1}),u=function(t,e,r,n){var i=""+e;if(c(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=m;for(var E=this.daysInMonth(h,d);p>E;E=this.daysInMonth(h,d))d++,p-=E}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,t=null==t?e:"string"==typeof t?function(t){try{return a.parseDate(n,t,i)}catch(t){}for(var e=((t=t.toLowerCase()).match(/^c/)&&r?r.newDate():null)||a.today(),o=/([+-]?[0-9]+)\s*(d|w|m|y)?/g,s=o.exec(t);s;)e.add(parseInt(s[1],10),s[2]||"d"),s=o.exec(t);return e}(t):"number"==typeof t?isNaN(t)||t===1/0||t===-1/0?e:a.today().add(t,"d"):a.newDate(t)}})},{"./main":595,"object-assign":462}],597:[function(t,e,r){e.exports=t("cwise-compiler")({args:["array",{offset:[1],array:0},"scalar","scalar","index"],pre:{body:"{}",args:[],thisVars:[],localVars:[]},post:{body:"{}",args:[],thisVars:[],localVars:[]},body:{body:"{\n var _inline_1_da = _inline_1_arg0_ - _inline_1_arg3_\n var _inline_1_db = _inline_1_arg1_ - _inline_1_arg3_\n if((_inline_1_da >= 0) !== (_inline_1_db >= 0)) {\n _inline_1_arg2_.push(_inline_1_arg4_[0] + 0.5 + 0.5 * (_inline_1_da + _inline_1_db) / (_inline_1_da - _inline_1_db))\n }\n }",args:[{name:"_inline_1_arg0_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg1_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg2_",lvalue:!1,rvalue:!0,count:1},{name:"_inline_1_arg3_",lvalue:!1,rvalue:!0,count:2},{name:"_inline_1_arg4_",lvalue:!1,rvalue:!0,count:1}],thisVars:[],localVars:["_inline_1_da","_inline_1_db"]},funcName:"zeroCrossings"})},{"cwise-compiler":116}],598:[function(t,e,r){"use strict";e.exports=function(t,e){var r=[];return e=+e||0,n(t.hi(t.shape[0]-1),r,e),r};var n=t("./lib/zc-core")},{"./lib/zc-core":597}],599:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../plots/cartesian/axes"),a=t("./common_defaults"),o=t("./attributes");e.exports=function(t,e,r,s,l){function c(r,i){return n.coerce(t,e,o,r,i)}s=s||{};var u=c("visible",!(l=l||{}).itemIsNotPlainObject),f=c("clicktoshow");if(!u&&!f)return e;a(t,e,r,c);for(var h=e.showarrow,d=["x","y"],p=[-10,-30],m={_fullLayout:r},g=0;g<2;g++){var v=d[g],y=i.coerceRef(t,e,m,v,"","paper");if(i.coercePosition(e,m,c,y,v,.5),h){var x="a"+v,b=i.coerceRef(t,e,m,x,"pixel");"pixel"!==b&&b!==y&&(b=e[x]="pixel");var _="pixel"===b?p[g]:.4;i.coercePosition(e,m,c,b,x,_)}c(v+"anchor"),c(v+"shift")}if(n.noneOrAll(t,e,["x","y"]),h&&n.noneOrAll(t,e,["ax","ay"]),f){var w=c("xclick"),M=c("yclick");e._xclick=void 0===w?e.x:i.cleanPosition(w,m,e.xref),e._yclick=void 0===M?e.y:i.cleanPosition(M,m,e.yref)}return e}},{"../../lib":743,"../../plots/cartesian/axes":789,"./attributes":601,"./common_defaults":604}],600:[function(t,e,r){"use strict";e.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}]},{}],601:[function(t,e,r){"use strict";var n=t("./arrow_paths"),i=t("../../plots/font_attributes"),a=t("../../plots/cartesian/constants");e.exports={_isLinkedToArray:"annotation",visible:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},text:{valType:"string",editType:"calcIfAutorange"},textangle:{valType:"angle",dflt:0,editType:"calcIfAutorange"},font:i({editType:"calcIfAutorange",colorEditType:"arraydraw"}),width:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},height:{valType:"number",min:1,dflt:null,editType:"calcIfAutorange"},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:"calcIfAutorange"},borderwidth:{valType:"number",min:0,dflt:1,editType:"calcIfAutorange"},showarrow:{valType:"boolean",dflt:!0,editType:"calcIfAutorange"},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:"calcIfAutorange"},startarrowsize:{valType:"number",min:.3,dflt:1,editType:"calcIfAutorange"},arrowwidth:{valType:"number",min:.1,editType:"calcIfAutorange"},standoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},startstandoff:{valType:"number",min:0,dflt:0,editType:"calcIfAutorange"},ax:{valType:"any",editType:"calcIfAutorange"},ay:{valType:"any",editType:"calcIfAutorange"},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:"calcIfAutorange"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"auto",editType:"calcIfAutorange"},xshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},yref:{valType:"enumerated",values:["paper",a.idRegex.y.toString()],editType:"calc"},y:{valType:"any",editType:"calcIfAutorange"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"calcIfAutorange"},yshift:{valType:"number",dflt:0,editType:"calcIfAutorange"},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"}}}},{"../../plots/cartesian/constants":794,"../../plots/font_attributes":816,"./arrow_paths":600}],602:[function(t,e,r){"use strict";function n(t){var e=t._fullLayout;i.filterVisible(e.annotations).forEach(function(e){var r,n,i,o,s=a.getFromId(t,e.xref),l=a.getFromId(t,e.yref),c=3*e.arrowsize*e.arrowwidth||0,u=3*e.startarrowsize*e.arrowwidth||0;s&&s.autorange&&(r=c+e.xshift,n=c-e.xshift,i=u+e.xshift,o=u-e.xshift,e.axref===e.xref?(a.expand(s,[s.r2c(e.x)],{ppadplus:r,ppadminus:n}),a.expand(s,[s.r2c(e.ax)],{ppadplus:Math.max(e._xpadplus,i),ppadminus:Math.max(e._xpadminus,o)})):(i=e.ax?i+e.ax:i,o=e.ax?o-e.ax:o,a.expand(s,[s.r2c(e.x)],{ppadplus:Math.max(e._xpadplus,r,i),ppadminus:Math.max(e._xpadminus,n,o)}))),l&&l.autorange&&(r=c-e.yshift,n=c+e.yshift,i=u-e.yshift,o=u+e.yshift,e.ayref===e.yref?(a.expand(l,[l.r2c(e.y)],{ppadplus:r,ppadminus:n}),a.expand(l,[l.r2c(e.ay)],{ppadplus:Math.max(e._ypadplus,i),ppadminus:Math.max(e._ypadminus,o)})):(i=e.ay?i+e.ay:i,o=e.ay?o-e.ay:o,a.expand(l,[l.r2c(e.y)],{ppadplus:Math.max(e._ypadplus,r,i),ppadminus:Math.max(e._ypadminus,n,o)})))})}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./draw").draw;e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.annotations);if(r.length&&t._fullData.length){var s={};r.forEach(function(t){s[t.xref]=1,s[t.yref]=1});for(var l in s){var c=a.getFromId(t,l);if(c&&c.autorange)return i.syncOrAsync([o,n],t)}}}},{"../../lib":743,"../../plots/cartesian/axes":789,"./draw":607}],603:[function(t,e,r){"use strict";function n(t,e){var r,n,a,o,s,l,c,u=t._fullLayout.annotations,f=[],h=[],d=[],p=(e||[]).length;for(r=0;r0||r.explicitOff.length>0},onClick:function(t,e){var r,i=n(t,e),o=i.on,s=i.off.concat(i.explicitOff),l={};if(o.length||s.length){for(r=0;r2/3?"right":"center"),{center:0,middle:0,left:.5,bottom:-.5,right:-.5,top:.5}[e]}var a=N.selectAll("a");if(1===a.size()&&a.text()===N.text()){C.insert("a",":first-child").attr({"xlink:xlink:href":a.attr("xlink:href"),"xlink:xlink:show":a.attr("xlink:show")}).style({cursor:"pointer"}).node().appendChild(P.node())}var c=C.select(".annotation-text-math-group"),h=!c.empty(),v=f.bBox((h?c:N).node()),y=v.width,L=v.height,D=e.width||y,R=e.height||L,j=Math.round(D+2*I),B=Math.round(R+2*I);e._w=D,e._h=R;for(var U=!1,V=["x","y"],q=0;q1)&&(K===J?((ot=Q.r2fraction(e["a"+Z]))<0||ot>1)&&(U=!0):U=!0,U))continue;H=Q._offset+Q.r2p(e[Z]),W=.5}else"x"===Z?(Y=e[Z],H=_.l+_.w*Y):(Y=1-e[Z],H=_.t+_.h*Y),W=e.showarrow?.5:Y;if(e.showarrow){at.head=H;var st=e["a"+Z];X=tt*r(.5,e.xanchor)-et*r(.5,e.yanchor),K===J?(at.tail=Q._offset+Q.r2p(st),G=X):(at.tail=H+st,G=X+st),at.text=at.tail+X;var lt=b["x"===Z?"width":"height"];if("paper"===J&&(at.head=l.constrain(at.head,1,lt-1)),"pixel"===K){var ct=-Math.max(at.tail-3,at.text),ut=Math.min(at.tail+3,at.text)-lt;ct>0?(at.tail+=ct,at.text+=ct):ut>0&&(at.tail-=ut,at.text-=ut)}at.tail+=it,at.head+=it}else G=X=rt*r(W,nt),at.text=H+X;at.text+=it,X+=it,G+=it,e["_"+Z+"padplus"]=rt/2+G,e["_"+Z+"padminus"]=rt/2-G,e["_"+Z+"size"]=rt,e["_"+Z+"shift"]=X}if(U)C.remove();else{var ft=0,ht=0;if("left"!==e.align&&(ft=(D-y)*("center"===e.align?.5:1)),"top"!==e.valign&&(ht=(R-L)*("middle"===e.valign?.5:1)),h)c.select("svg").attr({x:I+ft-1,y:I+ht}).call(f.setClipUrl,O?M:null);else{var dt=I+ht-v.top,pt=I+ft-v.left;N.call(d.positionText,pt,dt).call(f.setClipUrl,O?M:null)}F.select("rect").call(f.setRect,I,I,D,R),P.call(f.setRect,z/2,z/2,j-z,B-z),C.call(f.setTranslate,Math.round(k.x.text-j/2),Math.round(k.y.text-B/2)),S.attr({transform:"rotate("+A+","+k.x.text+","+k.y.text+")"});var mt=function(r,a){T.selectAll(".annotation-arrow-g").remove();var c=k.x.head,h=k.y.head,d=k.x.tail+r,p=k.y.tail+a,v=k.x.text+r,y=k.y.text+a,b=l.rotationXYMatrix(A,v,y),M=l.apply2DTransform(b),E=l.apply2DTransform2(b),L=+P.attr("width"),z=+P.attr("height"),D=v-.5*L,I=D+L,O=y-.5*z,F=O+z,R=[[D,O,D,F],[D,F,I,F],[I,F,I,O],[I,O,D,O]].map(E);if(!R.reduce(function(t,e){return t^!!l.segmentsIntersect(c,h,c+1e6,h+1e6,e[0],e[1],e[2],e[3])},!1)){R.forEach(function(t){var e=l.segmentsIntersect(d,p,c,h,t[0],t[1],t[2],t[3]);e&&(d=e.x,p=e.y)});var N=e.arrowwidth,j=e.arrowcolor,B=e.arrowside,U=T.append("g").style({opacity:u.opacity(j)}).classed("annotation-arrow-g",!0),V=U.append("path").attr("d","M"+d+","+p+"L"+c+","+h).style("stroke-width",N+"px").call(u.stroke,u.rgb(j));if(g(V,B,e),w.annotationPosition&&V.node().parentNode&&!n){var q=c,H=h;if(e.standoff){var G=Math.sqrt(Math.pow(c-d,2)+Math.pow(h-p,2));q+=e.standoff*(d-c)/G,H+=e.standoff*(p-h)/G}var Y,W,X,Z=U.append("path").classed("annotation-arrow",!0).classed("anndrag",!0).attr({d:"M3,3H-3V-3H3ZM0,0L"+(d-q)+","+(p-H),transform:"translate("+q+","+H+")"}).style("stroke-width",N+6+"px").call(u.stroke,"rgba(0,0,0,0)").call(u.fill,"rgba(0,0,0,0)");m.init({element:Z.node(),gd:t,prepFn:function(){var t=f.getTranslate(C);W=t.x,X=t.y,Y={},i&&i.autorange&&(Y[i._name+".autorange"]=!0),s&&s.autorange&&(Y[s._name+".autorange"]=!0)},moveFn:function(t,r){var n=M(W,X),a=n[0]+t,o=n[1]+r;C.call(f.setTranslate,a,o),Y[x+".x"]=i?i.p2r(i.r2p(e.x)+t):e.x+t/_.w,Y[x+".y"]=s?s.p2r(s.r2p(e.y)+r):e.y-r/_.h,e.axref===e.xref&&(Y[x+".ax"]=i.p2r(i.r2p(e.ax)+t)),e.ayref===e.yref&&(Y[x+".ay"]=s.p2r(s.r2p(e.ay)+r)),U.attr("transform","translate("+t+","+r+")"),S.attr({transform:"rotate("+A+","+a+","+o+")"})},doneFn:function(){o.relayout(t,Y);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}};if(e.showarrow&&mt(0,0),E){var gt,vt;m.init({element:C.node(),gd:t,prepFn:function(){vt=S.attr("transform"),gt={}},moveFn:function(t,r){var a="pointer";if(e.showarrow)e.axref===e.xref?gt[x+".ax"]=i.p2r(i.r2p(e.ax)+t):gt[x+".ax"]=e.ax+t,e.ayref===e.yref?gt[x+".ay"]=s.p2r(s.r2p(e.ay)+r):gt[x+".ay"]=e.ay+r,mt(t,r);else{if(n)return;if(i)gt[x+".x"]=e.x+t/i._m;else{var o=e._xsize/_.w,l=e.x+(e._xshift-e.xshift)/_.w-o/2;gt[x+".x"]=m.align(l+t/_.w,o,0,1,e.xanchor)}if(s)gt[x+".y"]=e.y+r/s._m;else{var c=e._ysize/_.h,u=e.y-(e._yshift+e.yshift)/_.h-c/2;gt[x+".y"]=m.align(u-r/_.h,c,0,1,e.yanchor)}i&&s||(a=m.getCursor(i?.5:gt[x+".x"],s?.5:gt[x+".y"],e.xanchor,e.yanchor))}S.attr({transform:"translate("+t+","+r+")"+vt}),p(C,a)},doneFn:function(){p(C),o.relayout(t,gt);var e=document.querySelector(".js-notes-box-panel");e&&e.redraw(e.selectedObj)}})}}}var y,x,b=t._fullLayout,_=t._fullLayout._size,w=t._context.edits;n?(y="annotation-"+n,x=n+".annotations["+r+"]"):(y="annotation",x="annotations["+r+"]"),b._infolayer.selectAll("."+y+'[data-index="'+r+'"]').remove();var M="clip"+b._uid+"_ann"+r;if(e._input&&!1!==e.visible){var k={x:{},y:{}},A=+e.textangle||0,T=b._infolayer.append("g").classed(y,!0).attr("data-index",String(r)).style("opacity",e.opacity),S=T.append("g").classed("annotation-text-g",!0),E=w[e.showarrow?"annotationTail":"annotationPosition"],L=e.captureevents||w.annotationText||E,C=S.append("g").style("pointer-events",L?"all":null).call(p,"default").on("click",function(){t._dragging=!1;var i={index:r,annotation:e._input,fullAnnotation:e,event:a.event};n&&(i.subplotId=n),t.emit("plotly_clickannotation",i)});e.hovertext&&C.on("mouseover",function(){var r=e.hoverlabel,n=r.font,i=this.getBoundingClientRect(),a=t.getBoundingClientRect();h.loneHover({x0:i.left-a.left,x1:i.right-a.left,y:(i.top+i.bottom)/2-a.top,text:e.hovertext,color:r.bgcolor,borderColor:r.bordercolor,fontFamily:n.family,fontSize:n.size,fontColor:n.color},{container:b._hoverlayer.node(),outerContainer:b._paper.node(),gd:t})}).on("mouseout",function(){h.loneUnhover(b._hoverlayer.node())});var z=e.borderwidth,D=e.borderpad,I=z+D,P=C.append("rect").attr("class","bg").style("stroke-width",z+"px").call(u.stroke,e.bordercolor).call(u.fill,e.bgcolor),O=e.width||e.height,F=b._topclips.selectAll("#"+M).data(O?[0]:[]);F.enter().append("clipPath").classed("annclip",!0).attr("id",M).append("rect"),F.exit().remove();var R=e.font,N=C.append("text").classed("annotation-text",!0).text(e.text);w.annotationText?N.call(d.makeEditable,{delegate:C,gd:t}).call(c).on("edit",function(r){e.text=r,this.call(c);var n={};n[x+".text"]=e.text,i&&i.autorange&&(n[i._name+".autorange"]=!0),s&&s.autorange&&(n[s._name+".autorange"]=!0),o.relayout(t,n)}):N.call(c)}else a.selectAll("#"+M).remove()}var a=t("d3"),o=t("../../plotly"),s=t("../../plots/plots"),l=t("../../lib"),c=t("../../plots/cartesian/axes"),u=t("../color"),f=t("../drawing"),h=t("../fx"),d=t("../../lib/svg_text_utils"),p=t("../../lib/setcursor"),m=t("../dragelement"),g=t("./draw_arrow_head");e.exports={draw:function(t){var e=t._fullLayout;e._infolayer.selectAll(".annotation").remove();for(var r=0;r=0,y=e.indexOf("end")>=0,x=d.backoff*m+r.standoff,b=p.backoff*g+r.startstandoff;if("line"===h.nodeName){l={x:+t.attr("x1"),y:+t.attr("y1")},c={x:+t.attr("x2"),y:+t.attr("y2")};var _=l.x-c.x,w=l.y-c.y;if(u=Math.atan2(w,_),f=u+Math.PI,x&&b&&x+b>Math.sqrt(_*_+w*w))return void o();if(x){if(x*x>_*_+w*w)return void o();var M=x*Math.cos(u),k=x*Math.sin(u);c.x+=M,c.y+=k,t.attr({x2:c.x,y2:c.y})}if(b){if(b*b>_*_+w*w)return void o();var A=b*Math.cos(u),T=b*Math.sin(u);l.x-=A,l.y-=T,t.attr({x1:l.x,y1:l.y})}}else if("path"===h.nodeName){var S=h.getTotalLength(),E="";if(S1){c=!0;break}}c?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))}}},{"../../plots/gl3d/project":841,"../annotations/draw":607}],614:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib");e.exports={moduleType:"component",name:"annotations3d",schema:{subplots:{scene:{annotations:t("./attributes")}}},layoutAttributes:t("./attributes"),handleDefaults:t("./defaults"),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 i?"rgba("+s+", "+n[3]+")":"rgb("+s+")"}var i=t("tinycolor2"),a=t("fast-isnumeric"),o=e.exports={},s=t("./attributes");o.defaults=s.defaults;var l=o.defaultLine=s.defaultLine;o.lightLine=s.lightLine;var c=o.background=s.background;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(i(t))},o.opacity=function(t){return t?i(t).getAlpha():0},o.addOpacity=function(t,e){var r=i(t).toRgb();return"rgba("+Math.round(r.r)+", "+Math.round(r.g)+", "+Math.round(r.b)+", "+e+")"},o.combine=function(t,e){var r=i(t).toRgb();if(1===r.a)return i(t).toRgbString();var n=i(e||c).toRgb(),a=1===n.a?n:{r:255*(1-n.a)+n.r*n.a,g:255*(1-n.a)+n.g*n.a,b:255*(1-n.a)+n.b*n.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 i(o).toRgbString()},o.contrast=function(t,e,r){var n=i(t);1!==n.getAlpha()&&(n=i(o.combine(t,c)));return(n.isDark()?e?n.lighten(e):c:r?n.darken(r):l).toString()},o.stroke=function(t,e){var r=i(e);t.style({stroke:o.tinyRGB(r),"stroke-opacity":r.getAlpha()})},o.fill=function(t,e){var r=i(e);t.style({fill:o.tinyRGB(r),"fill-opacity":r.getAlpha()})},o.clean=function(t){if(t&&"object"==typeof t){var e,r,i,a,s=Object.keys(t);for(e=0;e0?E>=O:E<=O));L++)E>R&&E0?E>=O:E<=O));L++)E>C[0]&&E1){var ot=Math.pow(10,Math.floor(Math.log(at)/Math.LN10));nt*=ot*u.roundUp(at/ot,[2,5,10]),(Math.abs(k.levels.start)/k.levels.size+1e-6)%1<2e-6&&(et.tick0=0)}et.dtick=nt}et.domain=[K+X,K+G-X],et.setScale();var st=T._infolayer.selectAll("g."+e).data([0]);st.enter().append("g").classed(e,!0).classed(w.colorbar,!0).each(function(){var t=n.select(this);t.append("rect").classed(w.cbbg,!0),t.append("g").classed(w.cbfills,!0),t.append("g").classed(w.cblines,!0),t.append("g").classed(w.cbaxis,!0).classed(w.crisp,!0),t.append("g").classed(w.cbtitleunshift,!0).append("g").classed(w.cbtitle,!0),t.append("rect").classed(w.cboutline,!0),t.select(".cbtitle").datum(0)}),st.attr("transform","translate("+Math.round(S.l)+","+Math.round(S.t)+")");var lt=st.select(".cbtitleunshift").attr("transform","translate(-"+Math.round(S.l)+",-"+Math.round(S.t)+")");et._axislayer=st.select(".cbaxis");var ct=0;if(-1!==["top","bottom"].indexOf(k.titleside)){var ut,ft=S.l+(k.x+Y)*S.w,ht=et.titlefont.size;ut="top"===k.titleside?(1-(K+G-X))*S.h+S.t+3+.75*ht:(1-(K+X))*S.h+S.t-3-.25*ht,A(et._id+"title",{attributes:{x:ft,y:ut,"text-anchor":"start"}})}var dt=u.syncOrAsync([o.previousPromises,function(){if(-1!==["top","bottom"].indexOf(k.titleside)){var e=st.select(".cbtitle"),r=e.select("text"),a=[-k.outlinewidth/2,k.outlinewidth/2],o=e.select(".h"+et._id+"title-math-group").node(),s=15.6;if(r.node()&&(s=parseInt(r.node().style.fontSize,10)*v),o?(ct=d.bBox(o).height)>s&&(a[1]-=(ct-s)/2):r.node()&&!r.classed(w.jsPlaceholder)&&(ct=d.bBox(r.node()).height),ct){if(ct+=5,"top"===k.titleside)et.domain[1]-=ct/S.h,a[1]*=-1;else{et.domain[0]+=ct/S.h;var c=g.lineCount(r);a[1]+=(1-c)*s}e.attr("transform","translate("+a+")"),et.setScale()}}st.selectAll(".cbfills,.cblines").attr("transform","translate(0,"+Math.round(S.h*(1-et.domain[1]))+")"),et._axislayer.attr("transform","translate(0,"+Math.round(-S.t)+")");var f=st.select(".cbfills").selectAll("rect.cbfill").data(D);f.enter().append("rect").classed(w.cbfill,!0).style("stroke","none"),f.exit().remove(),f.each(function(t,e){var r=[0===e?C[0]:(D[e]+D[e-1])/2,e===D.length-1?C[1]:(D[e]+D[e+1])/2].map(et.c2p).map(Math.round);e!==D.length-1&&(r[1]+=r[1]>r[0]?1:-1);var a=P(t).replace("e-",""),o=i(a).toHexString();n.select(this).attr({x:Z,width:Math.max(V,2),y:n.min(r),height:Math.max(n.max(r)-n.min(r),2),fill:o})});var h=st.select(".cblines").selectAll("path.cbline").data(k.line.color&&k.line.width?z:[]);return h.enter().append("path").classed(w.cbline,!0),h.exit().remove(),h.each(function(t){n.select(this).attr("d","M"+Z+","+(Math.round(et.c2p(t))+k.line.width/2%1)+"h"+V).call(d.lineGroupStyle,k.line.width,I(t),k.line.dash)}),et._axislayer.selectAll("g."+et._id+"tick,path").remove(),et._pos=Z+V+(k.outlinewidth||0)/2-("outside"===k.ticks?1:0),et.side="right",u.syncOrAsync([function(){return l.doTicks(t,et,!0)},function(){if(-1===["top","bottom"].indexOf(k.titleside)){var e=et.titlefont.size,r=et._offset+et._length/2,i=S.l+(et.position||0)*S.w+("right"===et.side?10+e*(et.showticklabels?1:.5):-10-e*(et.showticklabels?.5:0));A("h"+et._id+"title",{avoid:{selection:n.select(t).selectAll("g."+et._id+"tick"),side:k.titleside,offsetLeft:S.l,offsetTop:0,maxShift:T.width},attributes:{x:i,y:r,"text-anchor":"middle"},transform:{rotate:"-90",offset:0}})}}])},o.previousPromises,function(){var r=V+k.outlinewidth/2+d.bBox(et._axislayer.node()).width;if((j=lt.select("text")).node()&&!j.classed(w.jsPlaceholder)){var n,i=lt.select(".h"+et._id+"title-math-group").node();n=i&&-1!==["top","bottom"].indexOf(k.titleside)?d.bBox(i).width:d.bBox(lt.node()).right-Z-S.l,r=Math.max(r,n)}var a=2*k.xpad+r+k.borderwidth+k.outlinewidth/2,s=Q-$;st.select(".cbbg").attr({x:Z-k.xpad-(k.borderwidth+k.outlinewidth)/2,y:$-W,width:Math.max(a,2),height:Math.max(s+2*W,2)}).call(p.fill,k.bgcolor).call(p.stroke,k.bordercolor).style({"stroke-width":k.borderwidth}),st.selectAll(".cboutline").attr({x:Z,y:$+k.ypad+("top"===k.titleside?ct:0),width:Math.max(V,2),height:Math.max(s-2*k.ypad-ct,2)}).call(p.stroke,k.outlinecolor).style({fill:"None","stroke-width":k.outlinewidth});var l=({center:.5,right:1}[k.xanchor]||0)*a;st.attr("transform","translate("+(S.l-l)+","+S.t+")"),o.autoMargin(t,e,{x:k.x,y:k.y,l:a*({right:1,center:.5}[k.xanchor]||0),r:a*({left:1,center:.5}[k.xanchor]||0),t:s*({bottom:1,middle:.5}[k.yanchor]||0),b:s*({top:1,middle:.5}[k.yanchor]||0)})}],t);if(dt&&dt.then&&(t._promises||[]).push(dt),t._context.edits.colorbarPosition){var pt,mt,gt;c.init({element:st.node(),gd:t,prepFn:function(){pt=st.attr("transform"),h(st)},moveFn:function(t,e){st.attr("transform",pt+" translate("+t+","+e+")"),mt=c.align(J+t/S.w,q,0,1,k.xanchor),gt=c.align(K-e/S.h,G,0,1,k.yanchor);var r=c.getCursor(mt,gt,k.xanchor,k.yanchor);h(st,r)},doneFn:function(){h(st),void 0!==mt&&void 0!==gt&&a.restyle(t,{"colorbar.x":mt,"colorbar.y":gt},M().index)}})}return dt}T._infolayer.selectAll("g."+e).remove()}function M(){var r,n,i=e.substr(2);for(r=0;r=0?i.Reds:i.Blues,l.colorscale=m,s.reversescale&&(m=a(m)),s.colorscale=m)}},{"../../lib":743,"./flip_scale":630,"./scales":637}],626:[function(t,e,r){"use strict";var n=t("./attributes"),i=t("../../lib/extend").extendFlat;t("./scales.js");e.exports=function(t,e,r){return{color:{valType:"color",arrayOk:!0,editType:e||"style"},colorscale:i({},n.colorscale,{}),cauto:i({},n.zauto,{impliedEdits:{cmin:void 0,cmax:void 0}}),cmax:i({},n.zmax,{editType:e||n.zmax.editType,impliedEdits:{cauto:!1}}),cmin:i({},n.zmin,{editType:e||n.zmin.editType,impliedEdits:{cauto:!1}}),autocolorscale:i({},n.autocolorscale,{dflt:!1===r?r:n.autocolorscale.dflt}),reversescale:i({},n.reversescale,{})}}},{"../../lib/extend":732,"./attributes":624,"./scales.js":637}],627:[function(t,e,r){"use strict";var n=t("./scales");e.exports=n.RdBu},{"./scales":637}],628:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../colorbar/has_colorbar"),o=t("../colorbar/defaults"),s=t("./is_valid_scale"),l=t("./flip_scale");e.exports=function(t,e,r,c,u){var f=u.prefix,h=u.cLetter,d=f.slice(0,f.length-1),p=f?i.nestedProperty(t,d).get()||{}:t,m=f?i.nestedProperty(e,d).get()||{}:e,g=p[h+"min"],v=p[h+"max"],y=p.colorscale;c(f+h+"auto",!(n(g)&&n(v)&&g=0;i--,a++)e=t[i],n[a]=[1-e[0],e[1]];return n}},{}],631:[function(t,e,r){"use strict";var n=t("./scales"),i=t("./default_scale"),a=t("./is_valid_scale_array");e.exports=function(t,e){function r(){try{t=n[t]||JSON.parse(t)}catch(r){t=e}}return e||(e=i),t?("string"==typeof t&&(r(),"string"==typeof t&&r()),a(t)?t:e):e}},{"./default_scale":627,"./is_valid_scale_array":635,"./scales":637}],632:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("./is_valid_scale");e.exports=function(t,e){var r=e?i.nestedProperty(t,e).get()||{}:t,o=r.color,s=!1;if(Array.isArray(o))for(var l=0;l4/3-s?o:s}},{}],639:[function(t,e,r){"use strict";var n=t("../../lib"),i=[["sw-resize","s-resize","se-resize"],["w-resize","move","e-resize"],["nw-resize","n-resize","ne-resize"]];e.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]}},{"../../lib":743}],640:[function(t,e,r){"use strict";function n(){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 i(t){return a(t.changedTouches?t.changedTouches[0]:t,document.body)}var a=t("mouse-event-offset"),o=t("has-hover"),s=t("../../plotly"),l=t("../../lib"),c=t("../../plots/cartesian/constants"),u=t("../../constants/interactions"),f=e.exports={};f.align=t("./align"),f.getCursor=t("./cursor");var h=t("./unhover");f.unhover=h.wrapped,f.unhoverRaw=h.raw;var d=l.eventListenerOptionsSupported();f.init=function(t){function e(e){_._dragged=!1,_._dragging=!0;var s=i(e);return h=s[0],p=s[1],x=e.target,y=e,b=e.buttons&&2===e.buttons||e.ctrlKey,(m=(new Date).getTime())-_._mouseDownTimeM&&(w=Math.max(w-1,1)),_._dragged)t.doneFn&&t.doneFn(e);else if(t.clickFn&&t.clickFn(w,y),!b){var n;try{n=new MouseEvent("click",e)}catch(t){var c=i(e);(n=document.createEvent("MouseEvents")).initMouseEvent("click",e.bubbles,e.cancelable,e.view,e.detail,e.screenX,e.screenY,c[0],c[1],e.ctrlKey,e.altKey,e.shiftKey,e.metaKey,e.button,e.relatedTarget)}x.dispatchEvent(n)}return function(t){t._dragging=!1,t._replotPending&&s.plot(t)}(_),_._dragged=!1,l.pauseEvent(e)}_._dragged=!1}var h,p,m,g,v,y,x,b,_=t.gd,w=1,M=u.DBLCLICKDELAY,k=t.element;_._mouseDownTime||(_._mouseDownTime=0),k.style.pointerEvents="all",k.onmousedown=e,d?(k._ontouchstart&&k.removeEventListener("touchstart",k._ontouchstart),k._ontouchstart=e,k.addEventListener("touchstart",e,{passive:!1})):k.ontouchstart=e;var A=t.clampFn||function(t,e,r){return Math.abs(t)=200?k:"")}function i(t,e,r,n){var i=l.select(t.node().parentNode),a=-1!==e.indexOf("top")?"top":-1!==e.indexOf("bottom")?"bottom":"middle",o=-1!==e.indexOf("left")?"end":-1!==e.indexOf("right")?"start":"middle",s=n?n/.8+1:0,c=(m.lineCount(t)-1)*v+1,u=S[o]*s,f=.75*r+S[a]*s+(S[a]-1)*c*r/2;t.attr("text-anchor",o),i.attr("transform","translate("+u+","+f+")")}function a(t,e){var r=t.ts||e.textfont.size;return c(r)&&r>0?r:0}function o(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],c=Math.pow(i*i+a*a,E/2),u=Math.pow(o*o+s*s,E/2),f=(u*u*i-c*c*o)*n,h=(u*u*a-c*c*s)*n,d=3*u*(c+u),p=3*c*(c+u);return[[l.round(e[0]+(d&&f/d),2),l.round(e[1]+(d&&h/d),2)],[l.round(e[0]-(p&&f/p),2),l.round(e[1]-(p&&h/p),2)]]}function s(t){var e=t.getAttribute("data-unformatted");if(null!==e)return e+t.getAttribute("data-math")+t.getAttribute("text-anchor")+t.getAttribute("style")}var l=t("d3"),c=t("fast-isnumeric"),u=t("tinycolor2"),f=t("../../registry"),h=t("../color"),d=t("../colorscale"),p=t("../../lib"),m=t("../../lib/svg_text_utils"),g=t("../../constants/xmlns_namespaces"),v=t("../../constants/alignment").LINE_SPACING,y=t("../../constants/interactions").DESELECTDIM,x=t("../../traces/scatter/subtypes"),b=t("../../traces/scatter/make_bubble_size_func"),_=e.exports={};_.font=function(t,e,r,n){p.isPlainObject(e)&&(n=e.color,r=e.size,e=e.family),e&&t.style("font-family",e),r+1&&t.style("font-size",r+"px"),n&&t.call(h.fill,n)},_.setPosition=function(t,e,r){t.attr("x",e).attr("y",r)},_.setSize=function(t,e,r){t.attr("width",e).attr("height",r)},_.setRect=function(t,e,r,n,i){t.call(_.setPosition,e,r).call(_.setSize,n,i)},_.translatePoint=function(t,e,r,n){var i=r.c2p(t.x),a=n.c2p(t.y);return!!(c(i)&&c(a)&&e.node())&&("text"===e.node().nodeName?e.attr("x",i).attr("y",a):e.attr("transform","translate("+i+","+a+")"),!0)},_.translatePoints=function(t,e,r){t.each(function(t){var n=l.select(this);_.translatePoint(t,n,e,r)})},_.hideOutsideRangePoint=function(t,e,r,n,i,a){e.attr("display",r.isPtWithinRange(t,i)&&n.isPtWithinRange(t,a)?null:"none")},_.hideOutsideRangePoints=function(t,e){if(e._hasClipOnAxisFalse){var r=e.xaxis,n=e.yaxis;t.each(function(e){var i=e[0].trace,a=i.xcalendar,o=i.ycalendar;t.selectAll(".point,.textpoint").each(function(t){_.hideOutsideRangePoint(t,l.select(this),r,n,a,o)})})}},_.crispRound=function(t,e,r){return e&&c(e)?t._context.staticPlot?e:e<1?1:Math.round(e):r||0},_.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||"";h.stroke(e,n||a.color),_.dashLine(e,s,o)},_.lineGroupStyle=function(t,e,r,n){t.style("fill","none").each(function(t){var i=(((t||[])[0]||{}).trace||{}).line||{},a=e||i.width||0,o=n||i.dash||"";l.select(this).call(h.stroke,r||i.color).call(_.dashLine,o,a)})},_.dashLine=function(t,e,r){r=+r||0,e=_.dashStyle(e,r),t.style({"stroke-dasharray":e,"stroke-width":r+"px"})},_.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},_.singleFillStyle=function(t){var e=(((l.select(t.node()).data()[0]||[])[0]||{}).trace||{}).fillcolor;e&&t.call(h.fill,e)},_.fillGroupStyle=function(t){t.style("stroke-width",0).each(function(e){var r=l.select(this);try{r.call(h.fill,e[0].trace.fillcolor)}catch(e){p.error(e,t),r.remove()}})};var w=t("./symbol_defs");_.symbolNames=[],_.symbolFuncs=[],_.symbolNeedLines={},_.symbolNoDot={},_.symbolNoFill={},_.symbolList=[],Object.keys(w).forEach(function(t){var e=w[t];_.symbolList=_.symbolList.concat([e.n,t,e.n+100,t+"-open"]),_.symbolNames[e.n]=t,_.symbolFuncs[e.n]=e.f,e.needLine&&(_.symbolNeedLines[e.n]=!0),e.noDot?_.symbolNoDot[e.n]=!0:_.symbolList=_.symbolList.concat([e.n+200,t+"-dot",e.n+300,t+"-open-dot"]),e.noFill&&(_.symbolNoFill[e.n]=!0)});var M=_.symbolNames.length,k="M0,0.5L0.5,0L0,-0.5L-0.5,0Z";_.symbolNumber=function(t){if("string"==typeof t){var e=0;t.indexOf("-open")>0&&(e=100,t=t.replace("-open","")),t.indexOf("-dot")>0&&(e+=200,t=t.replace("-dot","")),(t=_.symbolNames.indexOf(t))>=0&&(t+=e)}return t%100>=M||t>=400?0:Math.floor(Math.max(t,0))};var A={x1:1,x2:0,y1:0,y2:0},T={x1:0,x2:0,y1:1,y2:0};_.gradient=function(t,e,r,n,i,a){var o=e._fullLayout._defs.select(".gradients").selectAll("#"+r).data([n+i+a],p.identity);o.exit().remove(),o.enter().append("radial"===n?"radialGradient":"linearGradient").each(function(){var t=l.select(this);"horizontal"===n?t.attr(A):"vertical"===n&&t.attr(T),t.attr("id",r);var e=u(i),o=u(a);t.append("stop").attr({offset:"0%","stop-color":h.tinyRGB(o),"stop-opacity":o.getAlpha()}),t.append("stop").attr({offset:"100%","stop-color":h.tinyRGB(e),"stop-opacity":e.getAlpha()})}),t.style({fill:"url(#"+r+")","fill-opacity":null})},_.initGradients=function(t){var e=t._fullLayout._defs.selectAll(".gradients").data([0]);e.enter().append("g").classed("gradients",!0),e.selectAll("linearGradient,radialGradient").remove()},_.singlePointStyle=function(t,e,r,i,a,o){var s=r.marker;!function(t,e,r,i,a,o,s,l){if(f.traceIs(r,"symbols")){var c=b(r);e.attr("d",function(t){var e;e="various"===t.ms||"various"===o.size?3:x.isBubble(r)?c(t.ms):(o.size||6)/2,t.mrc=e;var i=_.symbolNumber(t.mx||o.symbol)||0;return t.om=i%200>=100,n(i,e)})}e.style("opacity",function(t){return(t.mo+1||o.opacity+1)-1});var u,d,p,m=!1;if(t.so?(p=s.outlierwidth,d=s.outliercolor,u=o.outliercolor):(p=(t.mlw+1||s.width+1||(t.trace?t.trace.marker.line.width:0)+1)-1,d="mlc"in t?t.mlcc=a(t.mlc):Array.isArray(s.color)?h.defaultLine:s.color,Array.isArray(o.color)&&(u=h.defaultLine,m=!0),u="mc"in t?t.mcc=i(t.mc):o.color||"rgba(0,0,0,0)"),t.om)e.call(h.stroke,u).style({"stroke-width":(p||1)+"px",fill:"none"});else{e.style("stroke-width",p+"px");var g=o.gradient,v=t.mgt;if(v?m=!0:v=g&&g.type,v&&"none"!==v){var y=t.mgc;y?m=!0:y=g.color;var w="g"+l._fullLayout._uid+"-"+r.uid;m&&(w+="-"+t.i),e.call(_.gradient,l,w,v,u,y)}else e.call(h.fill,u);p&&e.call(h.stroke,d)}}(t,e,r,i,a,s,s.line,o)},_.pointStyle=function(t,e,r){if(t.size()){var n=e.marker,i=_.tryColorscale(n,""),a=_.tryColorscale(n,"line");t.each(function(t){_.singlePointStyle(t,l.select(this),e,i,a,r)})}},_.selectedPointStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},i=e.unselected||{},a=e.marker||{},o=r.marker||{},s=i.marker||{},c=a.opacity,u=o.opacity,d=s.opacity,p=void 0!==u,m=void 0!==d;t.each(function(t){var e,r=l.select(this),n=t.mo,i=void 0!==n;(i||p||m)&&(t.selected?p&&(e=u):e=m?d:y*(i?n:c)),void 0!==e&&r.style("opacity",e)});var g=o.color,v=s.color;(g||v)&&t.each(function(t){var e,r=l.select(this);t.selected?g&&(e=g):v&&(e=v),e&&h.fill(r,e)});var x=o.size,b=s.size,w=void 0!==x,M=void 0!==b;f.traceIs(e,"symbols")&&(w||M)&&t.each(function(t){var e,r=l.select(this),i=t.mrc,o=t.mx||a.symbol||0;e=t.selected?w?x/2:i:M?b/2:i,r.attr("d",n(_.symbolNumber(o),e)),t.mrc2=e})}},_.tryColorscale=function(t,e){var r=e?p.nestedProperty(t,e).get():t,n=r.colorscale,i=r.color;return n&&Array.isArray(i)?d.makeColorScaleFunc(d.extractScale(n,r.cmin,r.cmax)):p.identity};var S={start:1,end:-1,middle:0,bottom:1,top:-1};_.textPointStyle=function(t,e,r){t.each(function(t){var n=l.select(this),o=p.extractOption(t,e,"tx","text");if(o){var s=t.tp||e.textposition,c=a(t,e);n.call(_.font,t.tf||e.textfont.family,c,t.tc||e.textfont.color).text(o).call(m.convertToTspans,r).call(i,s,c,t.mrc)}else n.remove()})},_.selectedTextStyle=function(t,e){if(t.size()&&e.selectedpoints){var r=e.selected||{},n=e.unselected||{};t.each(function(t){var o,s=l.select(this),c=t.tc||e.textfont.color,u=t.tp||e.textposition,f=a(t,e),d=(r.textfont||{}).color,p=(n.textfont||{}).color;t.selected?d&&(o=d):p?o=p:d||(o=h.addOpacity(c,y)),o&&h.fill(s,o),i(s,u,f,t.mrc2||t.mrc)})}};var E=.5;_.smoothopen=function(t,e){if(t.length<3)return"M"+t.join("L");var r,n="M"+t[0],i=[];for(r=1;r=1e4&&(_.savedBBoxes={},C=0),r&&(_.savedBBoxes[r]=v),C++,p.extendFlat({},v)},_.setClipUrl=function(t,e){if(e){var r="#"+e,n=l.select("base");n.size()&&n.attr("href")&&(r=window.location.href.split("#")[0]+r),t.attr("clip-path","url("+r+")")}else t.attr("clip-path",null)},_.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}},_.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+=" translate("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.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}},_.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+=" scale("+e+", "+r+")",a=a.trim(),t[i]("transform",a),a},_.setPointGroupScale=function(t,e,r){var n,i,a;return e=e||1,r=r||1,i=1===e&&1===r?"":" scale("+e+","+r+")",a=/\s*sc.*/,t.each(function(){n=(this.getAttribute("transform")||"").replace(a,""),n=(n+=i).trim(),this.setAttribute("transform",n)}),i};var z=/translate\([^)]*\)\s*$/;_.setTextPointsScale=function(t,e,r){t.each(function(){var t,n=l.select(this),i=n.select("text");if(i.node()){var a=parseFloat(i.attr("x")||0),o=parseFloat(i.attr("y")||0),s=(n.attr("transform")||"").match(z);t=1===e&&1===r?[]:["translate("+a+","+o+")","scale("+e+","+r+")","translate("+-a+","+-o+")"],s&&t.push(s),n.attr("transform",t.join(" "))}})}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../constants/xmlns_namespaces":723,"../../lib":743,"../../lib/svg_text_utils":766,"../../registry":873,"../../traces/scatter/make_bubble_size_func":1083,"../../traces/scatter/subtypes":1088,"../color":618,"../colorscale":633,"./symbol_defs":644,d3:128,"fast-isnumeric":140,tinycolor2:546}],644:[function(t,e,r){"use strict";var n=t("d3");e.exports={circle:{n:0,f:function(t){var e=n.round(t,2);return"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"}},square:{n:1,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"}},diamond:{n:2,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"Z"}},cross:{n:3,f:function(t){var e=n.round(.4*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H"+e+"V"+r+"H-"+e+"V"+e+"H-"+r+"V-"+e+"H-"+e+"V-"+r+"H"+e+"V-"+e+"H"+r+"Z"}},x:{n:4,f:function(t){var e=n.round(.8*t/Math.sqrt(2),2),r="l"+e+","+e,i="l"+e+",-"+e,a="l-"+e+",-"+e,o="l-"+e+","+e;return"M0,"+e+r+i+a+i+a+o+a+o+r+o+r+"Z"}},"triangle-up":{n:5,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+","+n.round(t/2,2)+"H"+e+"L0,-"+n.round(t,2)+"Z"}},"triangle-down":{n:6,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+e+",-"+n.round(t/2,2)+"H"+e+"L0,"+n.round(t,2)+"Z"}},"triangle-left":{n:7,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M"+n.round(t/2,2)+",-"+e+"V"+e+"L-"+n.round(t,2)+",0Z"}},"triangle-right":{n:8,f:function(t){var e=n.round(2*t/Math.sqrt(3),2);return"M-"+n.round(t/2,2)+",-"+e+"V"+e+"L"+n.round(t,2)+",0Z"}},"triangle-ne":{n:9,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+r+",-"+e+"H"+e+"V"+r+"Z"}},"triangle-se":{n:10,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+e+",-"+r+"V"+e+"H-"+r+"Z"}},"triangle-sw":{n:11,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M"+r+","+e+"H-"+e+"V-"+r+"Z"}},"triangle-nw":{n:12,f:function(t){var e=n.round(.6*t,2),r=n.round(1.2*t,2);return"M-"+e+","+r+"V-"+e+"H"+r+"Z"}},pentagon:{n:13,f:function(t){var e=n.round(.951*t,2),r=n.round(.588*t,2),i=n.round(-t,2),a=n.round(-.309*t,2);return"M"+e+","+a+"L"+r+","+n.round(.809*t,2)+"H-"+r+"L-"+e+","+a+"L0,"+i+"Z"}},hexagon:{n:14,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M"+i+",-"+r+"V"+r+"L0,"+e+"L-"+i+","+r+"V-"+r+"L0,-"+e+"Z"}},hexagon2:{n:15,f:function(t){var e=n.round(t,2),r=n.round(t/2,2),i=n.round(t*Math.sqrt(3)/2,2);return"M-"+r+","+i+"H"+r+"L"+e+",0L"+r+",-"+i+"H-"+r+"L-"+e+",0Z"}},octagon:{n:16,f:function(t){var e=n.round(.924*t,2),r=n.round(.383*t,2);return"M-"+r+",-"+e+"H"+r+"L"+e+",-"+r+"V"+r+"L"+r+","+e+"H-"+r+"L-"+e+","+r+"V-"+r+"Z"}},star:{n:17,f:function(t){var e=1.4*t,r=n.round(.225*e,2),i=n.round(.951*e,2),a=n.round(.363*e,2),o=n.round(.588*e,2),s=n.round(-e,2),l=n.round(-.309*e,2),c=n.round(.118*e,2),u=n.round(.809*e,2);return"M"+r+","+l+"H"+i+"L"+a+","+c+"L"+o+","+u+"L0,"+n.round(.382*e,2)+"L-"+o+","+u+"L-"+a+","+c+"L-"+i+","+l+"H-"+r+"L0,"+s+"Z"}},hexagram:{n:18,f:function(t){var e=n.round(.66*t,2),r=n.round(.38*t,2),i=n.round(.76*t,2);return"M-"+i+",0l-"+r+",-"+e+"h"+i+"l"+r+",-"+e+"l"+r+","+e+"h"+i+"l-"+r+","+e+"l"+r+","+e+"h-"+i+"l-"+r+","+e+"l-"+r+",-"+e+"h-"+i+"Z"}},"star-triangle-up":{n:19,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M-"+e+","+r+o+e+","+r+o+"0,-"+i+o+"-"+e+","+r+"Z"}},"star-triangle-down":{n:20,f:function(t){var e=n.round(t*Math.sqrt(3)*.8,2),r=n.round(.8*t,2),i=n.round(1.6*t,2),a=n.round(4*t,2),o="A "+a+","+a+" 0 0 1 ";return"M"+e+",-"+r+o+"-"+e+",-"+r+o+"0,"+i+o+e+",-"+r+"Z"}},"star-square":{n:21,f:function(t){var e=n.round(1.1*t,2),r=n.round(2*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",-"+e+i+"-"+e+","+e+i+e+","+e+i+e+",-"+e+i+"-"+e+",-"+e+"Z"}},"star-diamond":{n:22,f:function(t){var e=n.round(1.4*t,2),r=n.round(1.9*t,2),i="A "+r+","+r+" 0 0 1 ";return"M-"+e+",0"+i+"0,"+e+i+e+",0"+i+"0,-"+e+i+"-"+e+",0Z"}},"diamond-tall":{n:23,f:function(t){var e=n.round(.7*t,2),r=n.round(1.4*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},"diamond-wide":{n:24,f:function(t){var e=n.round(1.4*t,2),r=n.round(.7*t,2);return"M0,"+r+"L"+e+",0L0,-"+r+"L-"+e+",0Z"}},hourglass:{n:25,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"H-"+e+"L"+e+",-"+e+"H-"+e+"Z"},noDot:!0},bowtie:{n:26,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"V-"+e+"L-"+e+","+e+"V-"+e+"Z"},noDot:!0},"circle-cross":{n:27,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"circle-x":{n:28,f:function(t){var e=n.round(t,2),r=n.round(t/Math.sqrt(2),2);return"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r+"M"+e+",0A"+e+","+e+" 0 1,1 0,-"+e+"A"+e+","+e+" 0 0,1 "+e+",0Z"},needLine:!0,noDot:!0},"square-cross":{n:29,f:function(t){var e=n.round(t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"square-x":{n:30,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e+"M"+e+","+e+"H-"+e+"V-"+e+"H"+e+"Z"},needLine:!0,noDot:!0},"diamond-cross":{n:31,f:function(t){var e=n.round(1.3*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM0,-"+e+"V"+e+"M-"+e+",0H"+e},needLine:!0,noDot:!0},"diamond-x":{n:32,f:function(t){var e=n.round(1.3*t,2),r=n.round(.65*t,2);return"M"+e+",0L0,"+e+"L-"+e+",0L0,-"+e+"ZM-"+r+",-"+r+"L"+r+","+r+"M-"+r+","+r+"L"+r+",-"+r},needLine:!0,noDot:!0},"cross-thin":{n:33,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"x-thin":{n:34,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e+"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},asterisk:{n:35,f:function(t){var e=n.round(1.2*t,2),r=n.round(.85*t,2);return"M0,"+e+"V-"+e+"M"+e+",0H-"+e+"M"+r+","+r+"L-"+r+",-"+r+"M"+r+",-"+r+"L-"+r+","+r},needLine:!0,noDot:!0,noFill:!0},hash:{n:36,f:function(t){var e=n.round(t/2,2),r=n.round(t,2);return"M"+e+","+r+"V-"+r+"m-"+r+",0V"+r+"M"+r+","+e+"H-"+r+"m0,-"+r+"H"+r},needLine:!0,noFill:!0},"y-up":{n:37,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+","+i+"L0,0M"+e+","+i+"L0,0M0,-"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-down":{n:38,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+e+",-"+i+"L0,0M"+e+",-"+i+"L0,0M0,"+r+"L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-left":{n:39,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M"+i+","+e+"L0,0M"+i+",-"+e+"L0,0M-"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"y-right":{n:40,f:function(t){var e=n.round(1.2*t,2),r=n.round(1.6*t,2),i=n.round(.8*t,2);return"M-"+i+","+e+"L0,0M-"+i+",-"+e+"L0,0M"+r+",0L0,0"},needLine:!0,noDot:!0,noFill:!0},"line-ew":{n:41,f:function(t){var e=n.round(1.4*t,2);return"M"+e+",0H-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ns":{n:42,f:function(t){var e=n.round(1.4*t,2);return"M0,"+e+"V-"+e},needLine:!0,noDot:!0,noFill:!0},"line-ne":{n:43,f:function(t){var e=n.round(t,2);return"M"+e+",-"+e+"L-"+e+","+e},needLine:!0,noDot:!0,noFill:!0},"line-nw":{n:44,f:function(t){var e=n.round(t,2);return"M"+e+","+e+"L-"+e+",-"+e},needLine:!0,noDot:!0,noFill:!0}}},{d3:128}],645:[function(t,e,r){"use strict";e.exports={visible:{valType:"boolean",editType:"calc"},type:{valType:"enumerated",values:["percent","constant","sqrt","data"],editType:"calc"},symmetric:{valType:"boolean",editType:"calc"},array:{valType:"data_array",editType:"calc"},arrayminus:{valType:"data_array",editType:"calc"},value:{valType:"number",min:0,dflt:10,editType:"calc"},valueminus:{valType:"number",min:0,dflt:10,editType:"calc"},traceref:{valType:"integer",min:0,dflt:0,editType:"style"},tracerefminus:{valType:"integer",min:0,dflt:0,editType:"style"},copy_ystyle:{valType:"boolean",editType:"plot"},copy_zstyle:{valType:"boolean",editType:"style"},color:{valType:"color",editType:"style"},thickness:{valType:"number",min:0,dflt:2,editType:"style"},width:{valType:"number",min:0,editType:"plot"},editType:"calc",_deprecated:{opacity:{valType:"number",editType:"style"}}}},{}],646:[function(t,e,r){"use strict";function n(t,e,r,n){var a=e["error_"+n]||{},l=[];if(a.visible&&-1!==["linear","log"].indexOf(r.type)){for(var c=s(a),u=0;u0;t.each(function(t){var f,h=t[0].trace,d=h.error_x||{},p=h.error_y||{};h.ids&&(f=function(t){return t.id});var m=o.hasMarkers(h)&&h.marker.maxdisplayed>0;p.visible||d.visible||(t=[]);var g=n.select(this).selectAll("g.errorbar").data(t,f);if(g.exit().remove(),t.length){d.visible||g.selectAll("path.xerror").remove(),p.visible||g.selectAll("path.yerror").remove(),g.style("opacity",1);var v=g.enter().append("g").classed("errorbar",!0);u&&v.style("opacity",0).transition().duration(r.duration).style("opacity",1),a.setClipUrl(g,e.layerClipId),g.each(function(t){var e=n.select(this),a=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,c);if(!m||t.vis){var o;if(p.visible&&i(a.x)&&i(a.yh)&&i(a.ys)){var f=p.width;o="M"+(a.x-f)+","+a.yh+"h"+2*f+"m-"+f+",0V"+a.ys,a.noYS||(o+="m-"+f+",0h"+2*f);var h=e.select("path.yerror");(s=!h.size())?h=e.append("path").style("vector-effect","non-scaling-stroke").classed("yerror",!0):u&&(h=h.transition().duration(r.duration).ease(r.easing)),h.attr("d",o)}if(d.visible&&i(a.y)&&i(a.xh)&&i(a.xs)){var g=(d.copy_ystyle?p:d).width;o="M"+a.xh+","+(a.y-g)+"v"+2*g+"m0,-"+g+"H"+a.xs,a.noXS||(o+="m0,-"+g+"v"+2*g);var v=e.select("path.xerror");(s=!v.size())?v=e.append("path").style("vector-effect","non-scaling-stroke").classed("xerror",!0):u&&(v=v.transition().duration(r.duration).ease(r.easing)),v.attr("d",o)}}})}})}},{"../../traces/scatter/subtypes":1088,"../drawing":643,d3:128,"fast-isnumeric":140}],651:[function(t,e,r){"use strict";var n=t("d3"),i=t("../color");e.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)})}},{"../color":618,d3:128}],652:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes");e.exports={hoverlabel:{bgcolor:{valType:"color",arrayOk:!0,editType:"none"},bordercolor:{valType:"color",arrayOk:!0,editType:"none"},font:n({arrayOk:!0,editType:"none"}),namelength:{valType:"integer",min:-1,arrayOk:!0,editType:"none"},editType:"calc"}}},{"../../plots/font_attributes":816}],653:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../registry");e.exports=function(t){function e(t){return function(e){return n.coerceHoverinfo({hoverinfo:e},{_module:t._module},a)}}for(var r=t.calcdata,a=t._fullLayout,o=0;o=0&&r.indextt.width||$<0||$>tt.height)return v.unhoverRaw(t,e);e.pointerX=e.offsetX,e.pointerY=e.offsetY}if(P="xval"in e?b.flat(m,e.xval):b.p2c(S,Q),O="yval"in e?b.flat(m,e.yval):b.p2c(E,$),!c(P[0])||!c(O[0]))return f.warn("Fx.hover failed",e,t),v.unhoverRaw(t,e)}var et=1/0;for(R=0;RY&&(Z.splice(0,Y),et=Z[0].distance),_._has("cartesian")&&0!==X&&0===Z.length){G.distance=X,G.index=!1;var ot=j._module.hoverPoints(G,q,H,"closest",_._hoverlayer);if(ot){var st,lt=ot.filter(function(t){return t.xa.showspikes});if(lt.length){var ct=lt[0];c(ct.x0)&&c(ct.y0)&&(st=d(ct),(!K.vLinePoint||K.vLinePoint.distance>st.distance)&&(K.vLinePoint=st))}var ut=ot.filter(function(t){return t.ya.showspikes});if(ut.length){var ft=ut[0];c(ft.x0)&&c(ft.y0)&&(st=d(ft),(!K.hLinePoint||K.hLinePoint.distance>st.distance)&&(K.hLinePoint=st))}}}}var ht={fullLayout:_,container:_._hoverlayer,outerContainer:_._paperdiv,event:e},dt=t._spikepoints,pt={vLinePoint:K.vLinePoint,hLinePoint:K.hLinePoint};if(t._spikepoints=pt,_._has("cartesian")&&0!==X&&0!==Z.length){var mt=u(Z.filter(function(t){return t.ya.showspikes}),X);K.hLinePoint=d(mt);var gt=u(Z.filter(function(t){return t.xa.showspikes}),X);K.vLinePoint=d(gt)}if(0===Z.length){var vt=v.unhoverRaw(t,e);return!_._has("cartesian")||null===K.hLinePoint&&null===K.vLinePoint||s(dt)&&o(K,ht),vt}_._has("cartesian")&&s(dt)&&o(K,ht),Z.sort(function(t,e){return t.distance-e.distance});var yt=t._hoverdata,xt=[];for(F=0;F1,wt=i(Z,{hovermode:I,rotateLabels:_t,bgColor:g.combine(_.plot_bgcolor||g.background,_.paper_bgcolor),container:_._hoverlayer,outerContainer:_._paperdiv,commonLabelOpts:_.hoverlabel,hoverdistance:_.hoverdistance},t);if(function(t,e,r){function n(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--)(c=t[s]).pos>e.pmax-1&&(c.del=!0,n--);for(s=0;s=0;l--)t[l].dp-=o;for(s=t.length-1;s>=0&&!(n<=0);s--)(c=t[s]).pos+c.dp+c.size>e.pmax&&(c.del=!0,n--)}}}var i,a,o,s,l,c,u,f=0,h=t.map(function(t,n){var i=t[e];return[{i:n,dp:0,pos:t.pos,posref:t.posref,size:t.by*("x"===i._id.charAt(0)?k:1)/2,pmin:0,pmax:"x"===i._id.charAt(0)?r.width:r.height}]}).sort(function(t,e){return t[0].posref-e[0].posref});for(;!i&&f<=t.length;){for(f++,i=!0,s=0;s.01&&m.pmin===g.pmin&&m.pmax===g.pmax){for(l=p.length-1;l>=0;l--)p[l].dp+=a;for(d.push.apply(d,p),h.splice(s+1,1),u=0,l=d.length-1;l>=0;l--)u+=d[l].dp;for(o=u/d.length,l=d.length-1;l>=0;l--)d[l].dp-=o;i=!1}else s++}h.forEach(n)}for(s=h.length-1;s>=0;s--){var v=h[s];for(l=v.length-1;l>=0;l--){var y=v[l],x=t[y.i];x.offset=y.dp,x.del=y.del}}}(Z,_t?"xa":"ya",_),a(wt,_t),e.target&&e.target.tagName){var Mt=x.getComponentMethod("annotations","hasClickToShow")(t,xt);p(l.select(e.target),Mt?"pointer":"")}e.target&&!n&&function(t,e,r){if(!r||r.length!==t._hoverdata.length)return!0;for(var n=r.length-1;n>=0;n--){var i=r[n],a=t._hoverdata[n];if(i.curveNumber!==a.curveNumber||String(i.pointNumber)!==String(a.pointNumber))return!0}return!1}(t,0,yt)&&(yt&&t.emit("plotly_unhover",{event:e,points:yt}),t.emit("plotly_hover",{event:e,points:t._hoverdata,xaxes:S,yaxes:E,xvals:P,yvals:O}))}function i(t,e,r){var n,i,a=e.hovermode,o=e.rotateLabels,s=e.bgColor,c=e.container,u=e.outerContainer,f=e.commonLabelOpts||{},h=e.fontFamily||_.HOVERFONT,p=e.fontSize||_.HOVERFONTSIZE,v=t[0],y=v.xa,x=v.ya,b="y"===a?"yLabel":"xLabel",M=v[b],k=(String(M)||"").split(" ")[0],A=u.node().getBoundingClientRect(),T=A.top,L=A.width,C=A.height,z=v.distance<=e.hoverdistance&&("x"===a||"y"===a);for(n=0;n-1&&n.length>v&&(n=v>3?n.substr(0,v-3)+"...":n.substr(0,v))}void 0!==t.extraText&&(i+=t.extraText),void 0!==t.zLabel?(void 0!==t.xLabel&&(i+="x: "+t.xLabel+"
"),void 0!==t.yLabel&&(i+="y: "+t.yLabel+"
"),i+=(i?"z: ":"")+t.zLabel):z&&t[a+"Label"]===M?i=t[("x"===a?"y":"x")+"Label"]||"":void 0===t.xLabel?void 0!==t.yLabel&&(i=t.yLabel):i=void 0===t.yLabel?t.xLabel:"("+t.xLabel+", "+t.yLabel+")",t.text&&!Array.isArray(t.text)&&(i+=(i?"
":"")+t.text),""===i&&(""===n&&e.remove(),i=n);var y=e.select("text.nums").call(m.font,t.fontFamily||h,t.fontSize||p,t.fontColor||f).text(i).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),x=e.select("text.name"),b=0;n&&n!==i?(x.call(m.font,t.fontFamily||h,t.fontSize||p,u).text(n).attr("data-notex",1).call(d.positionText,0,0).call(d.convertToTspans,r),b=x.node().getBoundingClientRect().width+2*E):(x.remove(),e.select("rect").remove()),e.select("path").style({fill:u,stroke:f});var _,k,A=y.node().getBoundingClientRect(),D=t.xa._offset+(t.x0+t.x1)/2,I=t.ya._offset+(t.y0+t.y1)/2,P=Math.abs(t.x1-t.x0),O=Math.abs(t.y1-t.y0),F=A.width+S+E+b;t.ty0=T-A.top,t.bx=A.width+2*E,t.by=A.height+2*E,t.anchor="start",t.txwidth=A.width,t.tx2width=b,t.offset=0,o?(t.pos=D,_=I+O/2+F<=C,k=I-O/2-F>=0,"top"!==t.idealAlign&&_||!k?_?(I+=O/2,t.anchor="start"):t.anchor="middle":(I-=O/2,t.anchor="end")):(t.pos=I,_=D+P/2+F<=L,k=D-P/2-F>=0,"left"!==t.idealAlign&&_||!k?_?(D+=P/2,t.anchor="start"):t.anchor="middle":(D-=P/2,t.anchor="end")),y.attr("text-anchor",t.anchor),b&&x.attr("text-anchor",t.anchor),e.attr("transform","translate("+D+","+I+")"+(o?"rotate("+w+")":""))}),P}function a(t,e){t.each(function(t){var r=l.select(this);if(t.del)r.remove();else{var n="end"===t.anchor?-1:1,i=r.select("text.nums"),a={start:1,end:-1,middle:0}[t.anchor],o=a*(S+E),s=o+a*(t.txwidth+E),c=0,u=t.offset;"middle"===t.anchor&&(o-=t.tx2width/2,s-=t.tx2width/2),e&&(u*=-T,c=t.offset*A),r.select("path").attr("d","middle"===t.anchor?"M-"+t.bx/2+",-"+t.by/2+"h"+t.bx+"v"+t.by+"h-"+t.bx+"Z":"M0,0L"+(n*S+c)+","+(S+u)+"v"+(t.by/2-S)+"h"+n*t.bx+"v-"+t.by+"H"+(n*S+c)+"V"+(u-S)+"Z"),i.call(d.positionText,o+c,u+t.ty0-t.by/2+E),t.tx2width&&(r.select("text.name").call(d.positionText,s+a*E+c,u+t.ty0-t.by/2+E),r.select("rect").call(m.setRect,s+(a-1)*t.tx2width/2+c,u-t.by/2-1,t.tx2width,t.by+2))}})}function o(t,e){var r,n,i=e.container,a=e.fullLayout,o=e.event,s=!!t.hLinePoint,l=!!t.vLinePoint;if(i.selectAll(".spikeline").remove(),l||s){var c=g.combine(a.plot_bgcolor,a.paper_bgcolor);if(s){var f,h,d=t.hLinePoint;r=d&&d.xa;"cursor"===(n=d&&d.ya).spikesnap?(f=o.pointerX,h=o.pointerY):(f=r._offset+(d.x0+d.x1)/2,h=n._offset+(d.y0+d.y1)/2);var p,v,y=u.readability(d.color,c)<1.5?g.contrast(c):d.color,x=n.spikemode,b=n.spikethickness,_=n.spikecolor||y,w=n._boundingBox,M=(w.left+w.right)/2=2/3},r.isCenterAnchor=function(t){return"center"===t.xanchor||"auto"===t.xanchor&&t.x>1/3&&t.x<2/3},r.isBottomAnchor=function(t){return"bottom"===t.yanchor||"auto"===t.yanchor&&t.y<=1/3},r.isMiddleAnchor=function(t){return"middle"===t.yanchor||"auto"===t.yanchor&&t.y>1/3&&t.y<2/3}},{}],670:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes");e.exports={bgcolor:{valType:"color",editType:"legend"},bordercolor:{valType:"color",dflt:i.defaultLine,editType:"legend"},borderwidth:{valType:"number",min:0,dflt:0,editType:"legend"},font:n({editType:"legend"}),orientation:{valType:"enumerated",values:["v","h"],dflt:"v",editType:"legend"},traceorder:{valType:"flaglist",flags:["reversed","grouped"],extras:["normal"],editType:"legend"},tracegroupgap:{valType:"number",min:0,dflt:10,editType:"legend"},x:{valType:"number",min:-2,max:3,dflt:1.02,editType:"legend"},xanchor:{valType:"enumerated",values:["auto","left","center","right"],dflt:"left",editType:"legend"},y:{valType:"number",min:-2,max:3,dflt:1,editType:"legend"},yanchor:{valType:"enumerated",values:["auto","top","middle","bottom"],dflt:"auto",editType:"legend"},editType:"legend"}},{"../../plots/font_attributes":816,"../color/attributes":617}],671:[function(t,e,r){"use strict";e.exports={scrollBarWidth:4,scrollBarHeight:20,scrollBarColor:"#808BA4",scrollBarMargin:4}},{}],672:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("./attributes"),o=t("../../plots/layout_attributes"),s=t("./helpers");e.exports=function(t,e,r){function l(t,e){return i.coerce(d,p,a,t,e)}for(var c,u,f,h,d=t.legend||{},p=e.legend={},m=0,g="normal",v=0;v1)){if(l("bgcolor",e.paper_bgcolor),l("bordercolor"),l("borderwidth"),i.coerceFont(l,"font",e.font),l("orientation"),"h"===p.orientation){var x=t.xaxis;x&&x.rangeslider&&x.rangeslider.visible?(c=0,f="left",u=1.1,h="bottom"):(c=0,f="left",u=-.1,h="top")}l("traceorder",g),s.isGrouped(e.legend)&&l("tracegroupgap"),l("x",c),l("xanchor",f),l("y",u),l("yanchor",h),i.noneOrAll(d,p,["x","y"])}}},{"../../lib":743,"../../plots/layout_attributes":843,"../../registry":873,"./attributes":670,"./helpers":676}],673:[function(t,e,r){"use strict";function n(t,e){function r(r){m.convertToTspans(r,e,function(){!function(t,e){var r=t.data()[0][0];if(!r.trace.showlegend)return void t.remove();var n,i,a=t.select("g[class*=math-group]"),o=a.node(),s=e._fullLayout.legend.font.size*x;if(o){var l=d.bBox(o);n=l.height,i=l.width,d.setTranslate(a,0,n/4)}else{var c=t.select(".legendtext"),u=m.lineCount(c),f=c.node();n=s*u,i=f?d.bBox(f).width:0;var h=s*(.3+(1-u)/2);m.positionText(c,40,h)}n=Math.max(n,16)+3,r.height=n,r.width=i}(t,e)})}var n=t.data()[0][0],i=e._fullLayout,a=n.trace,o=f.traceIs(a,"pie"),s=a.index,u=o?n.label:a.name,h=t.selectAll("text.legendtext").data([0]);h.enter().append("text").classed("legendtext",!0),h.attr("text-anchor","start").classed("user-select-none",!0).call(d.font,i.legend.font).text(u),e._context.edits.legendText&&!o?h.call(m.makeEditable,{gd:e}).call(r).on("edit",function(t){this.text(t).call(r);var i=t;this.text()||(t=" ");var a,o=n.trace._fullInput||{},u={};if(-1!==["ohlc","candlestick"].indexOf(o.type))u[(a=n.trace.transforms)[a.length-1].direction+".name"]=t;else if(f.hasTransform(o,"groupby")){var h=f.getTransformIndices(o,"groupby"),d=h[h.length-1],p=c.keyedContainer(o,"transforms["+d+"].styles","target","value.name");""===i?p.remove(n.trace._group):p.set(n.trace._group,t),u=p.constructUpdate()}else u.name=t;return l.restyle(e,u,s)}):h.call(r)}function i(t,e){var r,n=1,i=t.selectAll("rect").data([0]);i.enter().append("rect").classed("legendtoggle",!0).style("cursor","pointer").attr("pointer-events","all").call(p.fill,"rgba(0,0,0,0)"),i.on("mousedown",function(){(r=(new Date).getTime())-e._legendMouseDownTimek&&(n=Math.max(n-1,1)),1===n?r._clickTimeout=setTimeout(function(){g(t,e,n)},k):2===n&&(r._clickTimeout&&clearTimeout(r._clickTimeout),e._legendMouseDownTime=0,g(t,e,n))}})}function a(t,e,r){var n=t._fullLayout,i=n.legend,a=i.borderwidth,o=w.isGrouped(i),l=0;if(i.width=0,i.height=0,w.isVertical(i))o&&e.each(function(t,e){d.setTranslate(this,0,e*i.tracegroupgap)}),r.each(function(t){var e=t[0],r=e.height,n=e.width;d.setTranslate(this,a,5+a+i.height+r/2),i.height+=r,i.width=Math.max(i.width,n)}),i.width+=45+2*a,i.height+=10+2*a,o&&(i.height+=(i._lgroupsLength-1)*i.tracegroupgap),l=40;else if(o){for(var c=[i.width],u=e.data(),f=0,h=u.length;fa+_-M,r.each(function(t){var e=t[0],r=g?40+t[0].width:x;a+b+M+r>n.width-(n.margin.r+n.margin.l)&&(b=0,v+=y,i.height=i.height+y,y=0),d.setTranslate(this,a+b,5+a+e.height/2+v),i.width+=M+r,i.height=Math.max(i.height,e.height),b+=M+r,y=Math.max(e.height,y)}),i.width+=2*a,i.height+=10+2*a}i.width=Math.ceil(i.width),i.height=Math.ceil(i.height),r.each(function(e){var r=e[0];s.select(this).select(".legendtoggle").call(d.setRect,0,-r.height/2,(t._context.edits.legendText?0:i.width)+l,r.height)})}function o(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center");var n="top";M.isBottomAnchor(e)?n="bottom":M.isMiddleAnchor(e)&&(n="middle"),u.autoMargin(t,"legend",{x:e.x,y:e.y,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:e.height*({top:1,middle:.5}[n]||0),t:e.height*({bottom:1,middle:.5}[n]||0)})}var s=t("d3"),l=t("../../plotly"),c=t("../../lib"),u=t("../../plots/plots"),f=t("../../registry"),h=t("../dragelement"),d=t("../drawing"),p=t("../color"),m=t("../../lib/svg_text_utils"),g=t("./handle_click"),v=t("./constants"),y=t("../../constants/interactions"),x=t("../../constants/alignment").LINE_SPACING,b=t("./get_legend_data"),_=t("./style"),w=t("./helpers"),M=t("./anchor_utils"),k=y.DBLCLICKDELAY;e.exports=function(t){function e(t,e){E.attr("data-scroll",e).call(d.setTranslate,0,e),L.call(d.setRect,N,t,v.scrollBarWidth,v.scrollBarHeight),T.select("rect").attr({y:y.borderwidth-e})}var r=t._fullLayout,m="legend"+r._uid;if(r._infolayer&&t.calcdata){t._legendMouseDownTime||(t._legendMouseDownTime=0);var y=r.legend,x=r.showlegend&&b(t.calcdata,y),w=r.hiddenlabels||[];if(!r.showlegend||!x.length)return r._infolayer.selectAll(".legend").remove(),r._topdefs.select("#"+m).remove(),void u.autoMargin(t,"legend");var A=r._infolayer.selectAll("g.legend").data([0]);A.enter().append("g").attr({class:"legend","pointer-events":"all"});var T=r._topdefs.selectAll("#"+m).data([0]);T.enter().append("clipPath").attr("id",m).append("rect");var S=A.selectAll("rect.bg").data([0]);S.enter().append("rect").attr({class:"bg","shape-rendering":"crispEdges"}),S.call(p.stroke,y.bordercolor),S.call(p.fill,y.bgcolor),S.style("stroke-width",y.borderwidth+"px");var E=A.selectAll("g.scrollbox").data([0]);E.enter().append("g").attr("class","scrollbox");var L=A.selectAll("rect.scrollbar").data([0]);L.enter().append("rect").attr({class:"scrollbar",rx:20,ry:2,width:0,height:0}).call(p.fill,"#808BA4");var C=E.selectAll("g.groups").data(x);C.enter().append("g").attr("class","groups"),C.exit().remove();var z=C.selectAll("g.traces").data(c.identity);z.enter().append("g").attr("class","traces"),z.exit().remove(),z.call(_,t).style("opacity",function(t){var e=t[0].trace;return f.traceIs(e,"pie")?-1!==w.indexOf(t[0].label)?.5:1:"legendonly"===e.visible?.5:1}).each(function(){s.select(this).call(n,t).call(i,t)});var D=0!==A.enter().size();D&&(a(t,C,z),o(t));var I=r.width,P=r.height;a(t,C,z),y.height>P?function(t){var e=t._fullLayout.legend,r="left";M.isRightAnchor(e)?r="right":M.isCenterAnchor(e)&&(r="center"),u.autoMargin(t,"legend",{x:e.x,y:.5,l:e.width*({right:1,center:.5}[r]||0),r:e.width*({left:1,center:.5}[r]||0),b:0,t:0})}(t):o(t);var O=r._size,F=O.l+O.w*y.x,R=O.t+O.h*(1-y.y);M.isRightAnchor(y)?F-=y.width:M.isCenterAnchor(y)&&(F-=y.width/2),M.isBottomAnchor(y)?R-=y.height:M.isMiddleAnchor(y)&&(R-=y.height/2);var N=y.width,j=O.w;N>j?(F=O.l,N=j):(F+N>I&&(F=I-N),F<0&&(F=0),N=Math.min(I-F,y.width));var B=y.height,U=O.h;B>U?(R=O.t,B=U):(R+B>P&&(R=P-B),R<0&&(R=0),B=Math.min(P-R,y.height)),d.setTranslate(A,F,R);var V,q,H=B-v.scrollBarHeight-2*v.scrollBarMargin,G=y.height-B;if(y.height<=B||t._context.staticPlot)S.attr({width:N-y.borderwidth,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),d.setTranslate(E,0,0),T.select("rect").attr({width:N-2*y.borderwidth,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth}),E.call(d.setClipUrl,m);else{V=v.scrollBarMargin,q=E.attr("data-scroll")||0,S.attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-y.borderwidth,x:y.borderwidth/2,y:y.borderwidth/2}),T.select("rect").attr({width:N-2*y.borderwidth+v.scrollBarWidth+v.scrollBarMargin,height:B-2*y.borderwidth,x:y.borderwidth,y:y.borderwidth-q}),E.call(d.setClipUrl,m),D&&e(V,q),A.on("wheel",null),A.on("wheel",function(){q=c.constrain(E.attr("data-scroll")-s.event.deltaY/H*G,-G,0),e(V=v.scrollBarMargin-q/G*H,q),0!==q&&q!==-G&&s.event.preventDefault()}),L.on(".drag",null),E.on(".drag",null);var Y=s.behavior.drag().on("drag",function(){V=c.constrain(s.event.y-v.scrollBarHeight/2,v.scrollBarMargin,v.scrollBarMargin+H),q=-(V-v.scrollBarMargin)/H*G,e(V,q)});L.call(Y),E.call(Y)}if(t._context.edits.legendPosition){var W,X,Z,J;A.classed("cursor-move",!0),h.init({element:A.node(),gd:t,prepFn:function(){var t=d.getTranslate(A);Z=t.x,J=t.y},moveFn:function(t,e){var r=Z+t,n=J+e;d.setTranslate(A,r,n),W=h.align(r,0,O.l,O.l+O.w,y.xanchor),X=h.align(n,0,O.t+O.h,O.t,y.yanchor)},doneFn:function(){void 0!==W&&void 0!==X&&l.relayout(t,{"legend.x":W,"legend.y":X})},clickFn:function(e,n){var i=r._infolayer.selectAll("g.traces").filter(function(){var t=this.getBoundingClientRect();return n.clientX>=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom});i.size()>0&&(1===e?A._clickTimeout=setTimeout(function(){g(i,t,e)},k):2===e&&(A._clickTimeout&&clearTimeout(A._clickTimeout),g(i,t,e)))}})}}}},{"../../constants/alignment":716,"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../../registry":873,"../color":618,"../dragelement":640,"../drawing":643,"./anchor_utils":669,"./constants":671,"./get_legend_data":674,"./handle_click":675,"./helpers":676,"./style":678,d3:128}],674:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("./helpers");e.exports=function(t,e){function r(t,r){if(""!==t&&i.isGrouped(e))-1===l.indexOf(t)?(l.push(t),c=!0,s[t]=[[r]]):s[t].push([r]);else{var n="~~i"+f;l.push(n),s[n]=[[r]],f++}}var a,o,s={},l=[],c=!1,u={},f=0;for(a=0;ar[1])return r[1]}return i}function i(t){return t[0]}var s,c,u=t[0],f=u.trace,h=l.hasMarkers(f),d=l.hasText(f),p=l.hasLines(f);if(h||d||p){var m={},g={};h&&(m.mc=r("marker.color",i),m.mo=r("marker.opacity",a.mean,[.2,1]),m.ms=r("marker.size",a.mean,[2,16]),m.mlc=r("marker.line.color",i),m.mlw=r("marker.line.width",a.mean,[0,5]),g.marker={sizeref:1,sizemin:1,sizemode:"diameter"}),p&&(g.line={width:r("line.width",i,[0,10])}),d&&(m.tx="Aa",m.tp=r("textposition",i),m.ts=10,m.tc=r("textfont.color",i),m.tf=r("textfont.family",i)),s=[a.minExtend(u,m)],c=a.minExtend(f,g)}var v=n.select(this).select("g.legendpoints"),y=v.selectAll("path.scatterpts").data(h?s:[]);y.enter().append("path").classed("scatterpts",!0).attr("transform","translate(20,0)"),y.exit().remove(),y.call(o.pointStyle,c,e),h&&(s[0].mrc=3);var x=v.selectAll("g.pointtext").data(d?s:[]);x.enter().append("g").classed("pointtext",!0).append("text").attr("transform","translate(20,0)"),x.exit().remove(),x.selectAll("text").call(o.textPointStyle,c,e)})}},{"../../lib":743,"../../registry":873,"../../traces/pie/style_one":1052,"../../traces/scatter/subtypes":1088,"../color":618,"../drawing":643,d3:128}],679:[function(t,e,r){"use strict";function n(t,e){var r,n,i=e.currentTarget,a=i.getAttribute("data-attr"),o=i.getAttribute("data-val")||!0,s=t._fullLayout,l={},c=h.list(t,null,!0),f="on";if("zoom"===a){var d,p="in"===o?.5:2,m=(1+p)/2,g=(1-p)/2;for(n=0;n1)return n(["resetViews","toggleHover"]),i(x,r);h&&(n(["zoom3d","pan3d","orbitRotation","tableRotation"]),n(["resetCameraDefault3d","resetCameraLastSave3d"]),n(["hoverClosest3d"]));var b=function(t){for(var e=a.list({_fullLayout:t},null,!0),r=0;r0)){var d=function(t,e,r){for(var n=r.filter(function(r){return e[r].anchor===t._id}),i=0,a=0;ad&&(d=f)));return d>=h?[h,d]:void 0}}var i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=t("./constants"),s=t("./helpers");e.exports=function(t){var e=t._fullLayout,r=i.filterVisible(e.shapes);if(r.length&&t._fullData.length)for(var s=0;sV&&n>q&&!t.shiftKey?f.getCursor(i/r,1-a/n):"move";h(e,o),U=o.split("-")[0]}var c,u,d,m,g,v,y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P,O,F,R,N,j,B,U,V=10,q=10,H={element:e.node(),gd:t,prepFn:function(o){O=l.getFromId(t,r.xref),F=l.getFromId(t,r.yref),R=p.getDataToPixel(t,O),N=p.getDataToPixel(t,F,!0),j=p.getPixelToData(t,O),B=p.getPixelToData(t,F,!0);var f="shapes["+n+"]";"path"===r.type?(I=r.path,P=f+".path"):(u=R(r.x0),d=N(r.y0),m=R(r.x1),g=N(r.y1),v=f+".x0",y=f+".y0",x=f+".x1",b=f+".y1");uq&&(c[A]=r[L]=B(u),c[T]=r[C]=B(f)),d-h>V&&(c[S]=r[z]=j(h),c[E]=r[D]=j(d))}e.attr("d",i(t,r))}},doneFn:function(){h(e),o.relayout(t,c)}},G=H.element.getBoundingClientRect();f.init(H),e.node().onmousemove=s}(t,m,s,e)}t._fullLayout._paperdiv.selectAll('.shapelayer [data-index="'+e+'"]').remove();var n=(t.layout.shapes||[])[e],s=t._fullLayout.shapes[e];if(n&&!1!==s.visible)if("below"!==s.layer)r(t._fullLayout._shapeUpperLayer);else if("paper"===s.xref||"paper"===s.yref)r(t._fullLayout._shapeLowerLayer);else{var d=t._fullLayout._plots[s.xref+s.yref];if(d){r((d.mainplotinfo||d).shapelayer)}else r(t._fullLayout._shapeLowerLayer)}}function i(t,e){var r,n,i,a,o=e.type,c=l.getFromId(t,e.xref),u=l.getFromId(t,e.yref),f=t._fullLayout._size;if(c?(r=p.shapePositionToRange(c),n=function(t){return c._offset+c.r2p(r(t,!0))}):n=function(t){return f.l+f.w*t},u?(i=p.shapePositionToRange(u),a=function(t){return u._offset+u.r2p(i(t,!0))}):a=function(t){return f.t+f.h*(1-t)},"path"===o)return c&&"date"===c.type&&(n=p.decodeDate(n)),u&&"date"===u.type&&(a=p.decodeDate(a)),function(t,e,r){return t.replace(d.segmentRE,function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],l=d.numParams[i],c=t.substr(1).replace(d.paramRE,function(t){return a[n]?t=e(t):o[n]&&(t=r(t)),++n>l&&(t="X"),t});return n>l&&(c=c.replace(/[\s,]*X.*/,""),s.log("Ignoring extra params in segment "+t)),i+c})}(e.path,n,a);var h=n(e.x0),m=n(e.x1),g=a(e.y0),v=a(e.y1);if("line"===o)return"M"+h+","+g+"L"+m+","+v;if("rect"===o)return"M"+h+","+g+"H"+m+"V"+v+"H"+h+"Z";var y=(h+m)/2,x=(g+v)/2,b=Math.abs(y-h),_=Math.abs(x-g),w="A"+b+","+_,M=y+b+","+x;return"M"+M+w+" 0 1,1 "+(y+","+(x-_))+w+" 0 0,1 "+M+"Z"}function a(t,e,r){return t.replace(d.segmentRE,function(t){var n=0,i=t.charAt(0),a=d.paramIsX[i],o=d.paramIsY[i],s=d.numParams[i];return i+t.substr(1).replace(d.paramRE,function(t){return n>=s?t:(a[n]?t=e(t):o[n]&&(t=r(t)),n++,t)})})}var o=t("../../plotly"),s=t("../../lib"),l=t("../../plots/cartesian/axes"),c=t("../color"),u=t("../drawing"),f=t("../dragelement"),h=t("../../lib/setcursor"),d=t("./constants"),p=t("./helpers");e.exports={draw:function(t){var e=t._fullLayout;e._shapeUpperLayer.selectAll("path").remove(),e._shapeLowerLayer.selectAll("path").remove(),e._shapeSubplotLayers.selectAll("path").remove();for(var r=0;r0)){n("active"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("len"),n("lenmode"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font);n("currentvalue.visible")&&(n("currentvalue.xanchor"),n("currentvalue.prefix"),n("currentvalue.suffix"),n("currentvalue.offset"),i.coerceFont(n,"currentvalue.font",e.font)),n("transition.duration"),n("transition.easing"),n("bgcolor"),n("activebgcolor"),n("bordercolor"),n("borderwidth"),n("ticklen"),n("tickwidth"),n("tickcolor"),n("minorticklen")}}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.steps;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":704,"./constants":705}],707:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e,r){if(e.currentvalue.visible){var n,i,a=t.selectAll("text").data([0]);switch(e.currentvalue.xanchor){case"right":n=e.inputAreaLength-M.currentValueInset-e.currentValueMaxWidth,i="left";break;case"center":n=.5*e.inputAreaLength,i="middle";break;default:n=M.currentValueInset,i="left"}a.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":i,"data-notex":1});var o=e.currentvalue.prefix?e.currentvalue.prefix:"";if("string"==typeof r)o+=r;else{o+=e.steps[e.active].label}e.currentvalue.suffix&&(o+=e.currentvalue.suffix),a.call(b.font,e.currentvalue.font).text(o).call(_.convertToTspans,e.gd);var s=_.lineCount(a),l=(e.currentValueMaxLines+1-s)*e.currentvalue.font.size*k;return _.positionText(a,n,l),a}}function a(t,e,r){var n=t.selectAll("rect."+M.gripRectClass).data([0]);n.enter().append("rect").classed(M.gripRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:M.gripWidth,height:M.gripHeight,rx:M.gripRadius,ry:M.gripRadius}).call(x.stroke,r.bordercolor).call(x.fill,r.bgcolor).style("stroke-width",r.borderwidth+"px")}function o(t,e,r){var n=t.selectAll("text").data([0]);return n.enter().append("text").classed(M.labelClass,!0).classed("user-select-none",!0).attr({"text-anchor":"middle","data-notex":1}),n.call(b.font,r.font).text(e.step.label).call(_.convertToTspans,r.gd),n}function s(t,e){var r=t.selectAll("g."+M.labelsClass).data([0]);r.enter().append("g").classed(M.labelsClass,!0);var n=r.selectAll("g."+M.labelGroupClass).data(e.labelSteps);n.enter().append("g").classed(M.labelGroupClass,!0),n.exit().remove(),n.each(function(t){var r=v.select(this);r.call(o,t,e),b.setTranslate(r,d(e,t.fraction),M.tickOffset+e.ticklen+e.font.size*k+M.labelOffset+e.currentValueTotalHeight)})}function l(t,e,r,n,i){var a=Math.round(n*(r.steps.length-1));a!==r.active&&c(t,e,r,a,!0,i)}function c(t,e,r,n,a,o){var s=r.active;r._input.active=r.active=n;var l=r.steps[r.active];e.call(h,r,r.active/(r.steps.length-1),o),e.call(i,r),t.emit("plotly_sliderchange",{slider:r,step:r.steps[r.active],interaction:a,previousActive:s}),l&&l.method&&a&&(e._nextMethod?(e._nextMethod.step=l,e._nextMethod.doCallback=a,e._nextMethod.doTransition=o):(e._nextMethod={step:l,doCallback:a,doTransition:o},e._nextMethodRaf=window.requestAnimationFrame(function(){var r=e._nextMethod.step;r.method&&(r.execute&&y.executeAPICommand(t,r.method,r.args),e._nextMethod=null,e._nextMethodRaf=null)})))}function u(t,e,r){function n(){return r.data()[0]}var i=r.node(),a=v.select(e);t.on("mousedown",function(){var t=n();e.emit("plotly_sliderstart",{slider:t});var o=r.select("."+M.gripRectClass);v.event.stopPropagation(),v.event.preventDefault(),o.call(x.fill,t.activebgcolor);var s=p(t,v.mouse(i)[0]);l(e,r,t,s,!0),t._dragging=!0,a.on("mousemove",function(){var t=n(),a=p(t,v.mouse(i)[0]);l(e,r,t,a,!1)}),a.on("mouseup",function(){var t=n();t._dragging=!1,o.call(x.fill,t.bgcolor),a.on("mouseup",null),a.on("mousemove",null),e.emit("plotly_sliderend",{slider:t,step:t.steps[t.active]})})})}function f(t,e){var r=t.selectAll("rect."+M.tickRectClass).data(e.steps);r.enter().append("rect").classed(M.tickRectClass,!0),r.exit().remove(),r.attr({width:e.tickwidth+"px","shape-rendering":"crispEdges"}),r.each(function(t,r){var n=r%e.labelStride==0,i=v.select(this);i.attr({height:n?e.ticklen:e.minorticklen}).call(x.fill,e.tickcolor),b.setTranslate(i,d(e,r/(e.steps.length-1))-.5*e.tickwidth,(n?M.tickOffset:M.minorTickOffset)+e.currentValueTotalHeight)})}function h(t,e,r,n){var i=t.select("rect."+M.gripRectClass),a=d(e,r);if(!e._invokingCommand){var o=i;n&&e.transition.duration>0&&(o=o.transition().duration(e.transition.duration).ease(e.transition.easing)),o.attr("transform","translate("+(a-.5*M.gripWidth)+","+e.currentValueTotalHeight+")")}}function d(t,e){return t.inputAreaStart+M.stepInset+(t.inputAreaLength-2*M.stepInset)*Math.min(1,Math.max(0,e))}function p(t,e){return Math.min(1,Math.max(0,(e-M.stepInset-t.inputAreaStart)/(t.inputAreaLength-2*M.stepInset-2*t.inputAreaStart)))}function m(t,e,r){var n=t.selectAll("rect."+M.railTouchRectClass).data([0]);n.enter().append("rect").classed(M.railTouchRectClass,!0).call(u,e,t,r).style("pointer-events","all"),n.attr({width:r.inputAreaLength,height:Math.max(r.inputAreaWidth,M.tickOffset+r.ticklen+r.labelHeight)}).call(x.fill,r.bgcolor).attr("opacity",0),b.setTranslate(n,0,r.currentValueTotalHeight)}function g(t,e){var r=t.selectAll("rect."+M.railRectClass).data([0]);r.enter().append("rect").classed(M.railRectClass,!0);var n=e.inputAreaLength-2*M.railInset;r.attr({width:n,height:M.railWidth,rx:M.railRadius,ry:M.railRadius,"shape-rendering":"crispEdges"}).call(x.stroke,e.bordercolor).call(x.fill,e.bgcolor).style("stroke-width",e.borderwidth+"px"),b.setTranslate(r,M.railInset,.5*(e.inputAreaWidth-M.railWidth)+e.currentValueTotalHeight)}var v=t("d3"),y=t("../../plots/plots"),x=t("../color"),b=t("../drawing"),_=t("../../lib/svg_text_utils"),w=t("../legend/anchor_utils"),M=t("./constants"),k=t("../../constants/alignment").LINE_SPACING;e.exports=function(t){var e=t._fullLayout,r=function(t,e){for(var r=t[M.name],n=[],i=0;i0?[0]:[]);if(l.enter().append("g").classed(M.containerClassName,!0).style("cursor","ew-resize"),l.exit().remove(),l.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;n=r.steps.length&&(r.active=0),e.call(i,r).call(g,r).call(s,r).call(f,r).call(m,t,r).call(a,t,r),b.setTranslate(e,r.lx+r.pad.l,r.ly+r.pad.t),e.call(h,r,r.active/(r.steps.length-1),!1),e.call(i,r)}(t,v.select(this),e)}})}}},{"../../constants/alignment":716,"../../lib/svg_text_utils":766,"../../plots/plots":852,"../color":618,"../drawing":643,"../legend/anchor_utils":669,"./constants":705,d3:128}],708:[function(t,e,r){"use strict";var n=t("./constants");e.exports={moduleType:"component",name:n.name,layoutAttributes:t("./attributes"),supplyLayoutDefaults:t("./defaults"),draw:t("./draw")}},{"./attributes":704,"./constants":705,"./defaults":706,"./draw":707}],709:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../../plotly"),o=t("../../plots/plots"),s=t("../../lib"),l=t("../drawing"),c=t("../color"),u=t("../../lib/svg_text_utils"),f=t("../../constants/interactions"),h=/ [XY][0-9]* /;(e.exports={}).draw=function(t,e,r){function d(t){s.syncOrAsync([p,m],t)}function p(e){var r;return M?(r="",M.rotate&&(r+="rotate("+[M.rotate,w.x,w.y]+")"),M.offset&&(r+="translate(0, "+M.offset+")")):r=null,e.attr("transform",r),e.style({"font-family":S,"font-size":n.round(E,2)+"px",fill:c.rgb(L),opacity:C*c.opacity(L),"font-weight":o.fontWeight}).attr(w).call(u.convertToTspans,t),o.previousPromises(t)}function m(t){var e=n.select(t.node().parentNode);if(_&&_.selection&&_.side&&D){e.attr("transform",null);var r=0,a={left:"right",right:"left",top:"bottom",bottom:"top"}[_.side],o=-1!==["left","top"].indexOf(_.side)?-1:1,c=i(_.pad)?_.pad:2,u=l.bBox(e.node()),f={left:0,top:0,right:A.width,bottom:A.height},h=_.maxShift||(f[_.side]-u[_.side])*("left"===_.side||"top"===_.side?-1:1);if(h<0)r=h;else{var d=_.offsetLeft||0,p=_.offsetTop||0;u.left-=d,u.right-=d,u.top-=p,u.bottom-=p,_.selection.each(function(){var t=l.bBox(this);s.bBoxIntersect(u,t,c)&&(r=Math.max(r,o*(t[_.side]-u[a])+c))}),r=Math.min(h,r)}if(r>0||h<0){var m={left:[-r,0],right:[r,0],top:[0,-r],bottom:[0,r]}[_.side];e.attr("transform","translate("+m+")")}}}var g,v=r.propContainer,y=r.propName,x=r.placeholder,b=r.traceIndex,_=r.avoid||{},w=r.attributes,M=r.transform,k=r.containerGroup,A=t._fullLayout,T=v.titlefont||{},S=T.family,E=T.size,L=T.color,C=1,z=!1,D=(v.title||"").trim();"title"===y?g="titleText":-1!==y.indexOf("axis")?g="axisTitleText":y.indexOf(!0)&&(g="colorbarTitleText");var I=t._context.edits[g];""===D?C=0:D.replace(h," % ")===x.replace(h," % ")&&(C=.2,z=!0,I||(D=""));var P=D||I;k||(k=A._infolayer.selectAll(".g-"+e).data([0])).enter().append("g").classed("g-"+e,!0);var O=k.selectAll("text").data(P?[0]:[]);return O.enter().append("text"),O.text(D).attr("class",e),O.exit().remove(),P?(O.call(d),I&&(D?O.on(".opacity",null):(C=0,z=!0,O.text(x).on("mouseover.opacity",function(){n.select(this).transition().duration(f.SHOW_PLACEHOLDER).style("opacity",1)}).on("mouseout.opacity",function(){n.select(this).transition().duration(f.HIDE_PLACEHOLDER).style("opacity",0)})),O.call(u.makeEditable,{gd:t}).on("edit",function(e){void 0!==b?a.restyle(t,y,e,b):a.relayout(t,y,e)}).on("cancel",function(){this.text(this.attr("data-unformatted")).call(d)}).on("input",function(t){this.text(t||" ").call(u.positionText,w.x,w.y)})),O.classed("js-placeholder",z),k):k}},{"../../constants/interactions":720,"../../lib":743,"../../lib/svg_text_utils":766,"../../plotly":784,"../../plots/plots":852,"../color":618,"../drawing":643,d3:128,"fast-isnumeric":140}],710:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../color/attributes"),a=t("../../lib/extend").extendFlat,o=t("../../plot_api/edit_types").overrideAll,s=t("../../plots/pad_attributes");e.exports=o({_isLinkedToArray:"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:{_isLinkedToArray:"button",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",dflt:""},execute:{valType:"boolean",dflt:!0}},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,{}),font:n({}),bgcolor:{valType:"color"},bordercolor:{valType:"color",dflt:i.borderLine},borderwidth:{valType:"number",min:0,dflt:1,editType:"arraydraw"}},"arraydraw","from-root")},{"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/font_attributes":816,"../../plots/pad_attributes":851,"../color/attributes":617}],711:[function(t,e,r){"use strict";e.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:"\u25c4",right:"\u25ba",up:"\u25b2",down:"\u25bc"}}},{}],712:[function(t,e,r){"use strict";function n(t,e,r){function n(r,n){return i.coerce(t,e,o,r,n)}n("visible",function(t,e){function r(t,e){return i.coerce(n,a,l,t,e)}var n,a,o=t.buttons||[],s=e.buttons=[];for(var c=0;c0)&&(n("active"),n("direction"),n("type"),n("showactive"),n("x"),n("y"),i.noneOrAll(t,e,["x","y"]),n("xanchor"),n("yanchor"),n("pad.t"),n("pad.r"),n("pad.b"),n("pad.l"),i.coerceFont(n,"font",r.font),n("bgcolor",r.paper_bgcolor),n("bordercolor"),n("borderwidth"))}var i=t("../../lib"),a=t("../../plots/array_container_defaults"),o=t("./attributes"),s=t("./constants").name,l=o.buttons;e.exports=function(t,e){a(t,e,{name:s,handleItemDefaults:n})}},{"../../lib":743,"../../plots/array_container_defaults":786,"./attributes":710,"./constants":711}],713:[function(t,e,r){"use strict";function n(t){return t._index}function i(t,e){return+t.attr(M.menuIndexAttrName)===e._index}function a(t,e,r,n,i,a,l,c){e._input.active=e.active=l,"buttons"===e.type?s(t,n,null,null,e):"dropdown"===e.type&&(i.attr(M.menuIndexAttrName,"-1"),o(t,n,i,a,e),c||s(t,n,i,a,e))}function o(t,e,r,n,a){var o=e.selectAll("g."+M.headerClassName).data([0]);o.enter().append("g").classed(M.headerClassName,!0).style("pointer-events","all");var c=a.active,u=a.buttons[c]||M.blankHeaderOpts,f={y:a.pad.t,yPad:0,x:a.pad.l,xPad:0,index:0},g={width:a.headerWidth,height:a.headerHeight};o.call(l,a,u,t).call(p,a,f,g);var v=e.selectAll("text."+M.headerArrowClassName).data([0]);v.enter().append("text").classed(M.headerArrowClassName,!0).classed("user-select-none",!0).attr("text-anchor","end").call(x.font,a.font).text(M.arrowSymbol[a.direction]),v.attr({x:a.headerWidth-M.arrowOffsetX+a.pad.l,y:a.headerHeight/2+M.textOffsetY+a.pad.t}),o.on("click",function(){r.call(m),r.attr(M.menuIndexAttrName,i(r,a)?-1:String(a._index)),s(t,e,r,n,a)}),o.on("mouseover",function(){o.call(h)}),o.on("mouseout",function(){o.call(d,a)}),x.setTranslate(e,a.lx,a.ly)}function s(t,e,r,n,i){r||(r=e).attr("pointer-events","all");var o=function(t){return-1==+t.attr(M.menuIndexAttrName)}(r)&&"buttons"!==i.type?[]:i.buttons,s="dropdown"===i.type?M.dropdownButtonClassName:M.buttonClassName,c=r.selectAll("g."+s).data(o),u=c.enter().append("g").classed(s,!0),m=c.exit();"dropdown"===i.type?(u.attr("opacity","0").transition().attr("opacity","1"),m.transition().attr("opacity","0").remove()):m.remove();var y=0,x=0,b=-1!==["up","down"].indexOf(i.direction);"dropdown"===i.type&&(b?x=i.headerHeight+M.gapButtonHeader:y=i.headerWidth+M.gapButtonHeader),"dropdown"===i.type&&"up"===i.direction&&(x=-M.gapButtonHeader+M.gapButton-i.openHeight),"dropdown"===i.type&&"left"===i.direction&&(y=-M.gapButtonHeader+M.gapButton-i.openWidth);var _={x:i.lx+y+i.pad.l,y:i.ly+x+i.pad.t,yPad:M.gapButton,xPad:M.gapButton,index:0},w={l:_.x+i.borderwidth,t:_.y+i.borderwidth};c.each(function(o,s){var u=g.select(this);u.call(l,i,o,t).call(p,i,_),u.on("click",function(){g.event.defaultPrevented||(a(t,i,0,e,r,n,s),o.execute&&v.executeAPICommand(t,o.method,o.args),t.emit("plotly_buttonclicked",{menu:i,button:o,active:i.active}))}),u.on("mouseover",function(){u.call(h)}),u.on("mouseout",function(){u.call(d,i),c.call(f,i)})}),c.call(f,i),b?(w.w=Math.max(i.openWidth,i.headerWidth),w.h=_.y-w.t):(w.w=_.x-w.l,w.h=Math.max(i.openHeight,i.headerHeight)),w.direction=i.direction,n&&(c.size()?function(t,e,r,n,i,a){var o,s,l,c=i.direction,u="up"===c||"down"===c,f=i.active;if(u)for(s=0,l=0;l0?[0]:[]);if(c.enter().append("g").classed(M.containerClassName,!0).style("cursor","pointer"),c.exit().remove(),c.exit().size()&&function(t){for(var e=t._fullLayout._pushmargin||{},r=Object.keys(e),n=0;nw,A=n.barLength+2*n.barPad,T=n.barWidth+2*n.barPad,S=p,E=g+v;E+T>c&&(E=c-T);var L=this.container.selectAll("rect.scrollbar-horizontal").data(k?[0]:[]);L.exit().on(".drag",null).remove(),L.enter().append("rect").classed("scrollbar-horizontal",!0).call(a.fill,n.barColor),k?(this.hbar=L.attr({rx:n.barRadius,ry:n.barRadius,x:S,y:E,width:A,height:T}),this._hbarXMin=S+A/2,this._hbarTranslateMax=w-A):(delete this.hbar,delete this._hbarXMin,delete this._hbarTranslateMax);var C=v>M,z=n.barWidth+2*n.barPad,D=n.barLength+2*n.barPad,I=p+m,P=g;I+z>l&&(I=l-z);var O=this.container.selectAll("rect.scrollbar-vertical").data(C?[0]:[]);O.exit().on(".drag",null).remove(),O.enter().append("rect").classed("scrollbar-vertical",!0).call(a.fill,n.barColor),C?(this.vbar=O.attr({rx:n.barRadius,ry:n.barRadius,x:I,y:P,width:z,height:D}),this._vbarYMin=P+D/2,this._vbarTranslateMax=M-D):(delete this.vbar,delete this._vbarYMin,delete this._vbarTranslateMax);var F=this.id,R=u-.5,N=C?f+z+.5:f+.5,j=h-.5,B=k?d+T+.5:d+.5,U=s._topdefs.selectAll("#"+F).data(k||C?[0]:[]);if(U.exit().remove(),U.enter().append("clipPath").attr("id",F).append("rect"),k||C?(this._clipRect=U.select("rect").attr({x:Math.floor(R),y:Math.floor(j),width:Math.ceil(N)-Math.floor(R),height:Math.ceil(B)-Math.floor(j)}),this.container.call(o.setClipUrl,F),this.bg.attr({x:p,y:g,width:m,height:v})):(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.setClipUrl,null),delete this._clipRect),k||C){var V=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault()}).on("drag",this._onBoxDrag.bind(this));this.container.on("wheel",null).on("wheel",this._onBoxWheel.bind(this)).on(".drag",null).call(V);var q=i.behavior.drag().on("dragstart",function(){i.event.sourceEvent.preventDefault(),i.event.sourceEvent.stopPropagation()}).on("drag",this._onBarDrag.bind(this));k&&this.hbar.on(".drag",null).call(q),C&&this.vbar.on(".drag",null).call(q)}this.setTranslate(e,r)},n.prototype.disable=function(){(this.hbar||this.vbar)&&(this.bg.attr({width:0,height:0}),this.container.on("wheel",null).on(".drag",null).call(o.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)},n.prototype._onBoxDrag=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t-=i.event.dx),this.vbar&&(e-=i.event.dy),this.setTranslate(t,e)},n.prototype._onBoxWheel=function(){var t=this.translateX,e=this.translateY;this.hbar&&(t+=i.event.deltaY),this.vbar&&(e+=i.event.deltaY),this.setTranslate(t,e)},n.prototype._onBarDrag=function(){var t=this.translateX,e=this.translateY;if(this.hbar){var r=t+this._hbarXMin,n=r+this._hbarTranslateMax;t=(s.constrain(i.event.x,r,n)-r)/(n-r)*(this.position.w-this._box.w)}if(this.vbar){var a=e+this._vbarYMin,o=a+this._vbarTranslateMax;e=(s.constrain(i.event.y,a,o)-a)/(o-a)*(this.position.h-this._box.h)}this.setTranslate(t,e)},n.prototype.setTranslate=function(t,e){var r=this.position.w-this._box.w,n=this.position.h-this._box.h;if(t=s.constrain(t||0,0,r),e=s.constrain(e||0,0,n),this.translateX=t,this.translateY=e,this.container.call(o.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(o.setTranslate,t+i*this._hbarTranslateMax,e)}if(this.vbar){var a=e/n;this.vbar.call(o.setTranslate,t,e+a*this._vbarTranslateMax)}}},{"../../lib":743,"../color":618,"../drawing":643,d3:128}],716:[function(t,e,r){"use strict";e.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},LINE_SPACING:1.3,MID_SHIFT:.35,OPPOSITE_SIDE:{left:"right",right:"left",top:"bottom",bottom:"top"}}},{}],717:[function(t,e,r){"use strict";e.exports={solid:[1],dot:[1,1],dash:[4,1],longdash:[8,1],dashdot:[4,1,1,1],longdashdot:[8,1,1,1]}},{}],718:[function(t,e,r){"use strict";e.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]}},{}],719:[function(t,e,r){"use strict";e.exports={circle:"\u25cf","circle-open":"\u25cb",square:"\u25a0","square-open":"\u25a1",diamond:"\u25c6","diamond-open":"\u25c7",cross:"+",x:"\u274c"}},{}],720:[function(t,e,r){"use strict";e.exports={SHOW_PLACEHOLDER:100,HIDE_PLACEHOLDER:1e3,DBLCLICKDELAY:300,DESELECTDIM:.2}},{}],721:[function(t,e,r){"use strict";e.exports={BADNUM:void 0,FP_SAFE:Number.MAX_VALUE/1e4,ONEAVGYEAR:315576e5,ONEAVGMONTH:26298e5,ONEDAY:864e5,ONEHOUR:36e5,ONEMIN:6e4,ONESEC:1e3,EPOCHJD:2440587.5,ALMOST_EQUAL:1-1e-6,MINUS_SIGN:"\u2212"}},{}],722:[function(t,e,r){"use strict";e.exports={entityToUnicode:{mu:"\u03bc","#956":"\u03bc",amp:"&","#28":"&",lt:"<","#60":"<",gt:">","#62":">",nbsp:"\xa0","#160":"\xa0",times:"\xd7","#215":"\xd7",plusmn:"\xb1","#177":"\xb1",deg:"\xb0","#176":"\xb0"}}},{}],723:[function(t,e,r){"use strict";r.xmlns="http://www.w3.org/2000/xmlns/",r.svg="http://www.w3.org/2000/svg",r.xlink="http://www.w3.org/1999/xlink",r.svgAttrs={xmlns:r.svg,"xmlns:xlink":r.xlink}},{}],724:[function(t,e,r){"use strict";var n=t("./plotly");r.version="1.33.1",t("es6-promise").polyfill(),t("../build/plotcss"),t("./fonts/mathjax_config"),r.plot=n.plot,r.newPlot=n.newPlot,r.restyle=n.restyle,r.relayout=n.relayout,r.redraw=n.redraw,r.update=n.update,r.extendTraces=n.extendTraces,r.prependTraces=n.prependTraces,r.addTraces=n.addTraces,r.deleteTraces=n.deleteTraces,r.moveTraces=n.moveTraces,r.purge=n.purge,r.setPlotConfig=t("./plot_api/set_plot_config"),r.register=t("./plot_api/register"),r.toImage=t("./plot_api/to_image"),r.downloadImage=t("./snapshot/download"),r.validate=t("./plot_api/validate"),r.addFrames=n.addFrames,r.deleteFrames=n.deleteFrames,r.animate=n.animate,r.register(t("./traces/scatter")),r.register([t("./components/fx"),t("./components/legend"),t("./components/annotations"),t("./components/annotations3d"),t("./components/shapes"),t("./components/images"),t("./components/updatemenus"),t("./components/sliders"),t("./components/rangeslider"),t("./components/rangeselector")]),r.register([t("./locale-en"),t("./locale-en-us")]),r.Icons=t("../build/ploticon"),r.Plots=n.Plots,r.Fx=t("./components/fx"),r.Snapshot=t("./snapshot"),r.PlotSchema=t("./plot_api/plot_schema"),r.Queue=t("./lib/queue"),r.d3=t("d3")},{"../build/plotcss":1,"../build/ploticon":2,"./components/annotations":609,"./components/annotations3d":614,"./components/fx":660,"./components/images":668,"./components/legend":677,"./components/rangeselector":689,"./components/rangeslider":695,"./components/shapes":702,"./components/sliders":708,"./components/updatemenus":714,"./fonts/mathjax_config":725,"./lib/queue":757,"./locale-en":771,"./locale-en-us":770,"./plot_api/plot_schema":778,"./plot_api/register":779,"./plot_api/set_plot_config":780,"./plot_api/to_image":782,"./plot_api/validate":783,"./plotly":784,"./snapshot":878,"./snapshot/download":875,"./traces/scatter":1078,d3:128,"es6-promise":137}],725:[function(t,e,r){"use strict";"undefined"!=typeof MathJax?(r.MathJax=!0,MathJax.Hub.Config({messageStyle:"none",skipStartupTypeset:!0,displayAlign:"left",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]]}}),MathJax.Hub.Configured()):r.MathJax=!1},{}],726:[function(t,e,r){"use strict";var n=Math.PI;r.deg2rad=function(t){return t/180*n},r.rad2deg=function(t){return t/n*180},r.wrap360=function(t){var e=t%360;return e<0?e+360:e},r.wrap180=function(t){return Math.abs(t)>180&&(t-=360*Math.round(t/360)),t}},{}],727:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../constants/numerical").BADNUM,a=/^['"%,$#\s']+|[, ]|['"%,$#\s']+$/g;e.exports=function(t){return"string"==typeof t&&(t=t.replace(a,"")),n(t)?Number(t):i}},{"../constants/numerical":721,"fast-isnumeric":140}],728:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("tinycolor2"),a=t("../plots/attributes"),o=t("../components/colorscale/get_scale"),s=(Object.keys(t("../components/colorscale/scales")),t("./nested_property")),l=t("./regex").counter,c=t("../constants/interactions").DESELECTDIM,u=t("./angles").wrap180;r.valObjectMeta={data_array:{coerceFunction:function(t,e,r){Array.isArray(t)?e.set(t):void 0!==r&&e.set(r)}},enumerated:{coerceFunction:function(t,e,r,n){n.coerceNumber&&(t=+t),-1===n.values.indexOf(t)?e.set(r):e.set(t)},validateFunction:function(t,e){e.coerceNumber&&(t=+t);for(var r=e.values,n=0;ni.max?e.set(r):e.set(+t)}},integer:{coerceFunction:function(t,e,r,i){t%1||!n(t)||void 0!==i.min&&ti.max?e.set(r):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){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(o(t,r))}},angle:{coerceFunction:function(t,e,r){"auto"===t?e.set("auto"):n(t)?e.set(u(+t)):e.set(r)}},subplotid:{coerceFunction:function(t,e,r){"string"==typeof t&&l(r).test(t)?e.set(t):e.set(r)},validateFunction:function(t,e){var r=e.dflt;return t===r||"string"==typeof t&&!!l(r).test(t)}},flaglist:{coerceFunction:function(t,e,r,n){if("string"==typeof t)if(-1===(n.extras||[]).indexOf(t)){for(var i=t.split("+"),a=0;a0&&(a=a.replace(/0+$/,"").replace(/[\.]$/,"")),n+=":"+a}return n}function s(t){return t.formatDate("yyyy")}var l=t("d3"),c=t("fast-isnumeric"),u=t("./loggers"),f=t("./mod"),h=t("../constants/numerical"),d=h.BADNUM,p=h.ONEDAY,m=h.ONEHOUR,g=h.ONEMIN,v=h.ONESEC,y=h.EPOCHJD,x=t("../registry"),b=l.time.format.utc,_=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\d)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,w=/^\s*(-?\d\d\d\d|\d\d)(-(\d?\di?)(-(\d?\d)([ Tt]([01]?\d|2[0-3])(:([0-5]\d)(:([0-5]\d(\.\d+)?))?(Z|z|[+\-]\d\d:?\d\d)?)?)?)?)?\s*$/m,M=(new Date).getFullYear()-70;r.dateTick0=function(t,e){return n(t)?e?x.getComponentMethod("calendars","CANONICAL_SUNDAY")[t]:x.getComponentMethod("calendars","CANONICAL_TICK")[t]:e?"2000-01-02":"2000-01-01"},r.dfltRange=function(t){return n(t)?x.getComponentMethod("calendars","DFLTRANGE")[t]:["2000-01-01","2001-01-01"]},r.isJSDate=function(t){return"object"==typeof t&&null!==t&&"function"==typeof t.getTime};var k,A;r.dateTime2ms=function(t,e){if(r.isJSDate(t))return(t=Number(t)-t.getTimezoneOffset()*g)>=k&&t<=A?t:d;if("string"!=typeof t&&"number"!=typeof t)return d;t=String(t);var i=n(e),a=t.charAt(0);!i||"G"!==a&&"g"!==a||(t=t.substr(1),e="");var o=i&&"chinese"===e.substr(0,7),s=t.match(o?w:_);if(!s)return d;var l=s[1],c=s[3]||"1",u=Number(s[5]||1),f=Number(s[7]||0),h=Number(s[9]||0),b=Number(s[11]||0);if(i){if(2===l.length)return d;l=Number(l);var T;try{var S=x.getComponentMethod("calendars","getCal")(e);if(o){var E="i"===c.charAt(c.length-1);c=parseInt(c,10),T=S.newDate(l,S.toMonthIndex(l,c,E),u)}else T=S.newDate(l,Number(c),u)}catch(t){return d}return T?(T.toJD()-y)*p+f*m+h*g+b*v:d}l=2===l.length?(Number(l)+2e3-M)%100+M:Number(l),c-=1;var L=new Date(Date.UTC(2e3,c,u,f,h));return L.setUTCFullYear(l),L.getUTCMonth()!==c?d:L.getUTCDate()!==u?d:L.getTime()+b*v},k=r.MIN_MS=r.dateTime2ms("-9999"),A=r.MAX_MS=r.dateTime2ms("9999-12-31 23:59:59.9999"),r.isDateTime=function(t,e){return r.dateTime2ms(t,e)!==d};var T=90*p,S=3*m,E=5*g;r.ms2DateTime=function(t,e,r){if("number"!=typeof t||!(t>=k&&t<=A))return d;e||(e=0);var i,o,s,l,c,u,h=Math.floor(10*f(t+.05,1)),_=Math.round(t-h/10);if(n(r)){var w=Math.floor(_/p)+y,M=Math.floor(f(t,p));try{i=x.getComponentMethod("calendars","getCal")(r).fromJD(w).formatDate("yyyy-mm-dd")}catch(t){i=b("G%Y-%m-%d")(new Date(_))}if("-"===i.charAt(0))for(;i.length<11;)i="-0"+i.substr(1);else for(;i.length<10;)i="0"+i;o=e=k+p&&t<=A-p))return d;var e=Math.floor(10*f(t+.05,1)),r=new Date(Math.round(t-e/10));return a(l.time.format("%Y-%m-%d")(r),r.getHours(),r.getMinutes(),r.getSeconds(),10*r.getUTCMilliseconds()+e)},r.cleanDate=function(t,e,i){if(r.isJSDate(t)||"number"==typeof t){if(n(i))return u.error("JS Dates and milliseconds are incompatible with world calendars",t),e;if(!(t=r.ms2DateTimeLocal(+t))&&void 0!==e)return e}else if(!r.isDateTime(t,i))return u.error("unrecognized date",t),e;return t};var L=/%\d?f/g,C=[59,59.9,59.99,59.999,59.9999];r.formatDate=function(t,e,r,i,a){var l,c;if(a=n(a)&&a,e)return function(t,e,r,i){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 a=new Date(Math.floor(e+.05));if(n(i))try{t=x.getComponentMethod("calendars","worldCalFmt")(t,e,i)}catch(t){return"Invalid"}return r(t)(a)}(e,t,i,a);if(a)try{var u=Math.floor((t+.05)/p)+y,f=x.getComponentMethod("calendars","getCal")(a).fromJD(u);"y"===r?c=s(f):"m"===r?c=function(t){return t.formatDate("M yyyy")}(f):"d"===r?(l=s(f),c=function(t){return t.formatDate("M d")}(f)):(l=function(t){return t.formatDate("M d, yyyy")}(f),c=o(t,r))}catch(t){return"Invalid"}else{var h=new Date(Math.floor(t+.05));"y"===r?c=i("%Y")(h):"m"===r?c=i("%b %Y")(h):"d"===r?(l=i("%Y")(h),c=i("%b %-d")(h)):(l=i("%b %-d, %Y")(h),c=o(t,r))}return c+(l?"\n"+l:"")};var z=3*p;r.incrementMonth=function(t,e,r){r=n(r)&&r;var i=f(t,p);if(t=Math.round(t-i),r)try{var a=Math.round(t/p)+y,o=x.getComponentMethod("calendars","getCal")(r),s=o.fromJD(a);return e%12?o.add(s,e,"m"):o.add(s,e/12,"y"),(s.toJD()-y)*p+i}catch(e){u.error("invalid ms "+t+" in calendar "+r)}var l=new Date(t+z);return l.setUTCMonth(l.getUTCMonth()+e)+i-z},r.findExactDates=function(t,e){for(var r,i,a=0,o=0,s=0,l=0,u=n(e)&&x.getComponentMethod("calendars","getCal")(e),f=0;f0&&(r.push(i),i=[])}return i.length>0&&r.push(i),r},r.makeLine=function(t){return 1===t.length?{type:"LineString",coordinates:t[0]}:{type:"MultiLineString",coordinates:t}},r.makePolygon=function(t){if(1===t.length)return{type:"Polygon",coordinates:t};for(var e=new Array(t.length),r=0;r1||m<0||m>1?null:{x:t+l*m,y:e+f*m}}function i(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}var a=t("./mod");r.segmentsIntersect=n,r.segmentDistance=function(t,e,r,a,o,s,l,c){if(n(t,e,r,a,o,s,l,c))return 0;var u=r-t,f=a-e,h=l-o,d=c-s,p=u*u+f*f,m=h*h+d*d,g=Math.min(i(u,f,p,o-t,s-e),i(u,f,p,l-t,c-e),i(h,d,m,t-o,e-s),i(h,d,m,r-o,a-s));return Math.sqrt(g)};var o,s,l;r.getTextLocation=function(t,e,r,n){if(t===s&&n===l||(o={},s=t,l=n),o[r])return o[r];var i=t.getPointAtLength(a(r-n/2,e)),c=t.getPointAtLength(a(r+n/2,e)),u=Math.atan((c.y-i.y)/(c.x-i.x)),f=t.getPointAtLength(a(r,e)),h={x:(4*f.x+i.x+c.x)/6,y:(4*f.y+i.y+c.y)/6,theta:u};return o[r]=h,h},r.clearLocationCache=function(){s=null},r.getVisibleSegment=function(t,e,r){function n(e){var r=t.getPointAtLength(e);0===e?i=r:e===f&&(a=r);var n=r.xs?r.x-s:0,u=r.yc?r.y-c:0;return Math.sqrt(n*n+u*u)}for(var i,a,o=e.left,s=e.right,l=e.top,c=e.bottom,u=0,f=t.getTotalLength(),h=f,d=n(u);d;){if((u+=d+r)>h)return;d=n(u)}for(d=n(h);d;){if(h-=d+r,u>h)return;d=n(h)}return{min:u,max:h,len:h-u,total:f,isClosed:0===u&&h===f&&Math.abs(i.x-a.x)<.1&&Math.abs(i.y-a.y)<.1}},r.findPointOnPath=function(t,e,r,n){for(var i,a,o,s=(n=n||{}).pathLength||t.getTotalLength(),l=n.tolerance||.001,c=n.iterationLimit||30,u=t.getPointAtLength(0)[r]>t.getPointAtLength(s)[r]?-1:1,f=0,h=0,d=s;f0?d=i:h=i,f++}return a}},{"./mod":750}],738:[function(t,e,r){"use strict";e.exports=function(t){var e;if("string"==typeof t){if(null===(e=document.getElementById(t)))throw new Error("No DOM element with id '"+t+"' exists on the page.");return e}if(null===t||void 0===t)throw new Error("DOM element provided is null or undefined");return t}},{}],739:[function(t,e,r){"use strict";function n(t,e){var r=t;return r[3]*=e,r}function i(t){if(o(t))return u;var e=s(t);return e.length?e:u}function a(t){return o(t)?t:f}var o=t("fast-isnumeric"),s=t("color-normalize"),l=t("../components/colorscale"),c=t("../components/color/attributes").defaultLine,u=s(c),f=1;e.exports=function(t,e,r){var o,c,h,d,p,m=t.color,g=Array.isArray(m),v=Array.isArray(e),y=[];if(o=void 0!==t.colorscale?l.makeColorScaleFunc(l.extractScale(t.colorscale,t.cmin,t.cmax)):i,c=g?function(t,e){return void 0===t[e]?u:s(o(t[e]))}:i,h=v?function(t,e){return void 0===t[e]?f:a(t[e])}:a,g||v)for(var x=0;x=0;){var n=t.indexOf(";",r);if(n/g,"")}(function(t){for(var e=0;(e=t.indexOf("",e))>=0;){var r=t.indexOf("",e);if(r/g,"\n")}(t))))}},{"../constants/string_mappings":722,"superscript-text":539}],742:[function(t,e,r){"use strict";e.exports=function(t){return t}},{}],743:[function(t,e,r){"use strict";var n=t("d3"),i=t("fast-isnumeric"),a=t("../constants/numerical"),o=a.FP_SAFE,s=a.BADNUM,l=e.exports={};l.nestedProperty=t("./nested_property"),l.keyedContainer=t("./keyed_container"),l.relativeAttr=t("./relative_attr"),l.isPlainObject=t("./is_plain_object"),l.isArray=t("./is_array"),l.mod=t("./mod"),l.toLogRange=t("./to_log_range"),l.relinkPrivateKeys=t("./relink_private"),l.ensureArray=t("./ensure_array");var c=t("./coerce");l.valObjectMeta=c.valObjectMeta,l.coerce=c.coerce,l.coerce2=c.coerce2,l.coerceFont=c.coerceFont,l.coerceHoverinfo=c.coerceHoverinfo,l.coerceSelectionMarkerOpacity=c.coerceSelectionMarkerOpacity,l.validate=c.validate;var u=t("./dates");l.dateTime2ms=u.dateTime2ms,l.isDateTime=u.isDateTime,l.ms2DateTime=u.ms2DateTime,l.ms2DateTimeLocal=u.ms2DateTimeLocal,l.cleanDate=u.cleanDate,l.isJSDate=u.isJSDate,l.formatDate=u.formatDate,l.incrementMonth=u.incrementMonth,l.dateTick0=u.dateTick0,l.dfltRange=u.dfltRange,l.findExactDates=u.findExactDates,l.MIN_MS=u.MIN_MS,l.MAX_MS=u.MAX_MS;var f=t("./search");l.findBin=f.findBin,l.sorterAsc=f.sorterAsc,l.sorterDes=f.sorterDes,l.distinctVals=f.distinctVals,l.roundUp=f.roundUp;var h=t("./stats");l.aggNums=h.aggNums,l.len=h.len,l.mean=h.mean,l.variance=h.variance,l.stdev=h.stdev,l.interp=h.interp;var d=t("./matrix");l.init2dArray=d.init2dArray,l.transposeRagged=d.transposeRagged,l.dot=d.dot,l.translationMatrix=d.translationMatrix,l.rotationMatrix=d.rotationMatrix,l.rotationXYMatrix=d.rotationXYMatrix,l.apply2DTransform=d.apply2DTransform,l.apply2DTransform2=d.apply2DTransform2;var p=t("./angles");l.deg2rad=p.deg2rad,l.rad2deg=p.rad2deg,l.wrap360=p.wrap360,l.wrap180=p.wrap180;var m=t("./geometry2d");l.segmentsIntersect=m.segmentsIntersect,l.segmentDistance=m.segmentDistance,l.getTextLocation=m.getTextLocation,l.clearLocationCache=m.clearLocationCache,l.getVisibleSegment=m.getVisibleSegment,l.findPointOnPath=m.findPointOnPath;var g=t("./extend");l.extendFlat=g.extendFlat,l.extendDeep=g.extendDeep,l.extendDeepAll=g.extendDeepAll,l.extendDeepNoArrays=g.extendDeepNoArrays;var v=t("./loggers");l.log=v.log,l.warn=v.warn,l.error=v.error;var y=t("./regex");l.counterRegex=y.counter;var x=t("./throttle");l.throttle=x.throttle,l.throttleDone=x.done,l.clearThrottle=x.clear,l.getGraphDiv=t("./get_graph_div"),l._=t("./localize"),l.notifier=t("./notifier"),l.filterUnique=t("./filter_unique"),l.filterVisible=t("./filter_visible"),l.pushUnique=t("./push_unique"),l.cleanNumber=t("./clean_number"),l.ensureNumber=function(t){return i(t)?(t=Number(t))<-o||t>o?s:i(t)?Number(t):s:s},l.noop=t("./noop"),l.identity=t("./identity"),l.swapAttrs=function(t,e,r,n){r||(r="x"),n||(n="y");for(var i=0;ir?Math.max(r,Math.min(e,t)):Math.max(e,Math.min(r,t))},l.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},l.simpleMap=function(t,e,r,n){for(var i=t.length,a=new Array(i),o=0;o-1||c!==1/0&&c>=Math.pow(2,r)?t(e,r,n):s},l.OptionControl=function(t,e){t||(t={}),e||(e="opt");var r={};return r.optionList=[],r._newoption=function(n){n[e]=t,r[n.name]=n,r.optionList.push(n)},r["_"+e]=t,r},l.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,c=new Array(l),u=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]*c[n];u[r]=a}return u},l.syncOrAsync=function(t,e,r){function n(){return l.syncOrAsync(t,e,r)}for(var i,a;t.length;)if(a=t.splice(0,1)[0],(i=a(e))&&i.then)return i.then(n).then(void 0,l.promiseError);return r&&r(e)},l.stripTrailingSlash=function(t){return"/"===t.substr(-1)?t.substr(0,t.length-1):t},l.noneOrAll=function(t,e,r){if(t){var n,i,a=!1,o=!0;for(n=0;n=0&&t%1==0}function a(e){return void 0!==e&&e1?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};var w=/%{([^\s%{}]*)}/g,M=/^\w*$/;l.templateString=function(t,e){var r={};return t.replace(w,function(t,n){return M.test(n)?e[n]||"":(r[n]=r[n]||l.nestedProperty(e,n).get,r[n]()||"")})};l.subplotSort=function(t,e){for(var r=Math.min(t.length,e.length)+1,n=0,i=0,a=0;a=48&&o<=57,c=s>=48&&s<=57;if(l&&(n=10*n+o-48),c&&(i=10*i+s-48),!l||!c){if(n!==i)return n-i;if(o!==s)return o-s}}return i-n},l.eventListenerOptionsSupported=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){t=!1}return t}},{"../constants/numerical":721,"./angles":726,"./clean_number":727,"./coerce":728,"./dates":729,"./ensure_array":730,"./extend":732,"./filter_unique":733,"./filter_visible":734,"./geometry2d":737,"./get_graph_div":738,"./identity":742,"./is_array":744,"./is_plain_object":745,"./keyed_container":746,"./localize":747,"./loggers":748,"./matrix":749,"./mod":750,"./nested_property":751,"./noop":752,"./notifier":753,"./push_unique":756,"./regex":758,"./relative_attr":759,"./relink_private":760,"./search":761,"./stats":764,"./throttle":767,"./to_log_range":768,d3:128,"fast-isnumeric":140}],744:[function(t,e,r){"use strict";var n="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer:{isView:function(){return!1}};e.exports=function(t){return Array.isArray(t)||n.isView(t)}},{}],745:[function(t,e,r){"use strict";e.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)===Object.prototype}},{}],746:[function(t,e,r){"use strict";var n=t("./nested_property"),i=/^\w*$/;e.exports=function(t,e,r,a){r=r||"name",a=a||"value";var o,s,l={};s=e&&e.length?n(t,e).get():t,e=e||"",s=s||[];var c={};for(o=0;o2)return l[e]=2|l[e],f.set(t,null);if(u){for(o=e;o1){for(var t=["LOG:"],e=0;e0){for(var t=["WARN:"],e=0;e0){for(var t=["ERROR:"],e=0;e=0;e--){if(n=t[e][0],a=t[e][1],l=!1,c(n))for(r=n.length-1;r>=0;r--)i(n[r],o(a,r))?l?n[r]=void 0:n.pop():l=!0;else if("object"==typeof n&&null!==n)for(s=Object.keys(n),l=!1,r=s.length-1;r>=0;r--)i(n[s[r]],o(a,s[r]))?delete n[s[r]]:l=!0;if(l)return}}(d)):f[e[u]]=n}}function o(t,e){var r=e;return l(e)?r="["+e+"]":t&&(r="."+e),t+r}function s(t,e,r,n){if(void 0===t[e]){if(n)return!1;t[e]="number"==typeof r?[]:{}}return!0}var l=t("fast-isnumeric"),c=t("./is_array"),u=t("./is_plain_object"),f=t("../plot_api/container_array_match");e.exports=function(t,e){if(l(e))e=String(e);else if("string"!=typeof e||"[-1]"===e.substr(e.length-4))throw"bad property string";for(var r,i,o,s=0,c=e.split(".");s/g),s=0;so||a===i||al||e&&c(t))}:function(t,e){var a=t[0],c=t[1];if(a===i||ao||c===i||cl)return!1;var u,f,h,d,p,m=r.length,g=r[0][0],v=r[0][1],y=0;for(u=1;uMath.max(f,g)||c>Math.max(h,v)))if(cu||Math.abs(n(o,h))>i)return!0;return!1};a.filter=function(t,e){function r(r){t.push(r);var s=n.length,l=i;n.splice(a+1);for(var c=l+1;c1){r(t.pop())}return{addPt:r,raw:t,filtered:n}}},{"../constants/numerical":721,"./matrix":749}],756:[function(t,e,r){"use strict";e.exports=function(t,e){if(e instanceof RegExp){var r,n=e.toString();for(r=0;ri.queueLength&&(t.undoQueue.queue.shift(),t.undoQueue.index--))},a.startSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!0,t.undoQueue.beginSequence=!0},a.stopSequence=function(t){t.undoQueue=t.undoQueue||{index:0,queue:[],sequence:!1},t.undoQueue.sequence=!1,t.undoQueue.beginSequence=!1},a.undo=function(t){var e,r;if(t.framework&&t.framework.isPolar)t.framework.undo();else 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;r1?(e[l-1]-e[0])/(l-1):1;for(o=u>=0?r?function(t,e){return t=e}:function(t,e){return t>e},t+=1e-9*u*(r?-1:1)*(u>=0?1:-1);s90&&i.log("Long binary search..."),s-1},r.sorterAsc=function(t,e){return t-e},r.sorterDes=function(t,e){return e-t},r.distinctVals=function(t){var e=t.slice();e.sort(r.sorterAsc);for(var n=e.length-1,i=e[n]-e[0]||1,a=i/(n||1)/1e4,o=[e[0]],s=0;se[s]+a&&(i=Math.min(i,e[s+1]-e[s]),o.push(e[s+1]));return{vals:o,minDiff:i}},r.roundUp=function(t,e,r){for(var n,i=0,a=e.length-1,o=0,s=r?0:1,l=r?1:0,c=r?Math.ceil:Math.floor;it.length-1)return t[t.length-1];var r=e%1;return r*t[Math.ceil(e)]+(1-r)*t[Math.floor(e)]}},{"fast-isnumeric":140}],765:[function(t,e,r){"use strict";var n=t("color-normalize");e.exports=function(t){return t?n(t):[0,0,0,1]}},{"color-normalize":99}],766:[function(t,e,r){"use strict";function n(t,e){return t.node().getBoundingClientRect()[e]}function i(t,e,r){var n="math-output-"+c.randstr([],64),i=l.select("body").append("div").attr({id:n}).style({visibility:"hidden",position:"absolute"}).style({"font-size":e.fontSize+"px"}).text(function(t){return t.replace(p,"\\lt ").replace(m,"\\gt ")}(t));MathJax.Hub.Queue(["Typeset",MathJax.Hub,i.node()],function(){var e=l.select("body").select("#MathJax_SVG_glyphs");if(i.select(".MathJax_SVG").empty()||!i.select("svg").node())c.log("There was an error in the tex syntax.",t),r();else{var n=i.select("svg").node().getBoundingClientRect();r(i.select(".MathJax_SVG"),e,n)}i.remove()})}function a(t,e){if(!t)return null;var r=t.match(e);return r&&(r[3]||r[4])}function o(t,e){function r(){p++;var e=document.createElementNS(u.svg,"tspan");l.select(e).attr({class:"line",dy:p*h+"em"}),t.appendChild(e),s=e;var r=d;if(d=[{node:e}],r.length>1)for(var i=1;i doesnt match end tag <"+t+">. Pretending it did match.",e),s=d[d.length-1].node}else c.log("Ignoring unexpected end tag .",e)}e=function(t){return function(t,e){if(!t)return"";for(var r=0;r|>|>)/g,g={sup:"font-size:70%",sub:"font-size:70%",b:"font-weight:bold",i:"font-style:italic",a:"cursor:pointer",span:"",em:"font-style:italic;font-weight:bold"},v={sub:"0.3em",sup:"-0.6em"},y={sub:"-0.21em",sup:"0.42em"},x="\u200b",b=["http:","https:","mailto:","",void 0,":"],_=new RegExp("]*)?/?>","g"),w=Object.keys(f.entityToUnicode).map(function(t){return{regExp:new RegExp("&"+t+";","g"),sub:f.entityToUnicode[t]}}),M=/(\r\n?|\n)/g,k=/(<[^<>]*>)/,A=/<(\/?)([^ >]*)(\s+(.*))?>/i,T=//i,S=/(^|[\s"'])style\s*=\s*("([^"]*);?"|'([^']*);?')/i,E=/(^|[\s"'])href\s*=\s*("([^"]*)"|'([^']*)')/i,L=/(^|[\s"'])target\s*=\s*("([^"\s]*)"|'([^'\s]*)')/i,C=/(^|[\s"'])popup\s*=\s*("([\w=,]*)"|'([\w=,]*)')/i,z=/(^|;)\s*color:/;r.plainText=function(t){return(t||"").replace(_," ")},r.lineCount=function(t){return t.selectAll("tspan.line").size()||1},r.positionText=function(t,e,r){return t.each(function(){function t(t,e){return void 0===e?null===(e=n.attr(t))&&(n.attr(t,0),e=0):n.attr(t,e),e}var n=l.select(this),i=t("x",e),a=t("y",r);"text"===this.nodeName&&n.selectAll("tspan.line").attr({x:i,y:a})})},r.makeEditable=function(t,e){function r(){!function(){var r=l.select(i).select(".svg-container"),a=r.append("div"),c=t.node().style,u=parseFloat(c.fontSize||12);a.classed("plugin-editable editable",!0).style({position:"absolute","font-family":c.fontFamily||"Arial","font-size":u,color:e.fill||c.fill||"black",opacity:1,"background-color":e.background||"transparent",outline:"#ffffff33 1px solid",margin:[-u/8+1,0,0,-1].join("px ")+"px",padding:"0","box-sizing":"border-box"}).attr({contenteditable:!0}).text(e.text||t.attr("data-unformatted")).call(s(t,r,e)).on("blur",function(){i._editing=!1,t.text(this.textContent).style({opacity:1});var e,r=l.select(this).attr("class");(e=r?"."+r.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(e).style({opacity:0});var n=this.textContent;l.select(this).transition().duration(0).remove(),l.select(document).on("mouseup",null),o.edit.call(t,n)}).on("focus",function(){var t=this;i._editing=!0,l.select(document).on("mouseup",function(){if(l.event.target===t)return!1;document.activeElement===a.node()&&a.node().blur()})}).on("keyup",function(){27===l.event.which?(i._editing=!1,t.style({opacity:1}),l.select(this).style({opacity:0}).on("blur",function(){return!1}).transition().remove(),o.cancel.call(t,this.textContent)):(o.input.call(t,this.textContent),l.select(this).call(s(t,r,e)))}).on("keydown",function(){13===l.event.which&&this.blur()}).call(n)}(),t.style({opacity:0});var r,a=c.attr("class");(r=a?"."+a.split(" ")[0]+"-math-group":"[class*=-math-group]")&&l.select(t.node().parentNode).select(r).style({opacity:0})}function n(t){var e=t.node(),r=document.createRange();r.selectNodeContents(e);var n=window.getSelection();n.removeAllRanges(),n.addRange(r),e.focus()}var i=e.gd,a=e.delegate,o=l.dispatch("edit","input","cancel"),c=a||t;if(t.style({"pointer-events":a?"none":"all"}),1!==t.size())throw new Error("boo");return e.immediate?r():c.on("click",r),l.rebind(t,o,"on")}},{"../constants/alignment":716,"../constants/string_mappings":722,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],767:[function(t,e,r){"use strict";function n(t){t&&null!==t.timer&&(clearTimeout(t.timer),t.timer=null)}var i={};r.throttle=function(t,e,r){function a(){r(),o.ts=Date.now(),o.onDone&&(o.onDone(),o.onDone=null)}var o=i[t],s=Date.now();if(!o){for(var l in i)i[l].tso.ts+e?a():o.timer=setTimeout(function(){a(),o.timer=null},e)},r.done=function(t){var e=i[t];return e&&e.timer?new Promise(function(t){var r=e.onDone;e.onDone=function(){r&&r(),t(),e.onDone=null}}):Promise.resolve()},r.clear=function(t){if(t)n(i[t]),delete i[t];else for(var e in i)r.clear(e)}},{}],768:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.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}},{"fast-isnumeric":140}],769:[function(t,e,r){"use strict";var n=e.exports={},i=t("../plots/geo/constants").locationmodeToLayer,a=t("topojson-client").feature;n.getTopojsonName=function(t){return[t.scope.replace(/ /g,"-"),"_",t.resolution.toString(),"m"].join("")},n.getTopojsonPath=function(t,e){return t+e+".json"},n.getTopojsonFeatures=function(t,e){var r=i[t.locationmode],n=e.objects[r];return a(e,n).features}},{"../plots/geo/constants":818,"topojson-client":549}],770:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en-US",dictionary:{"Click to enter Colorscale title":"Click to enter Colorscale title"},format:{date:"%m/%d/%Y"}}},{}],771:[function(t,e,r){"use strict";e.exports={moduleType:"locale",name:"en",dictionary:{"Click to enter Colorscale title":"Click to enter Colourscale title"},format:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday"],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:["$",""]}}},{}],772:[function(t,e,r){"use strict";var n=t("../registry");e.exports=function(t){for(var e,r,i=n.layoutArrayContainers,a=n.layoutArrayRegexes,o=t.split("[")[0],s=0;s0)return t.substr(0,e)}var s=t("fast-isnumeric"),l=t("gl-mat4/fromQuat"),c=t("../registry"),u=t("../lib"),f=t("../plots/plots"),h=t("../plots/cartesian/axis_ids"),d=h.cleanId,p=h.getFromTrace,m=t("../components/color");r.clearPromiseQueue=function(t){Array.isArray(t._promises)&&t._promises.length>0&&u.log("Clearing previous rejected promises from queue."),t._promises=[]},r.cleanLayout=function(t){var e,r;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 i=(f.subplotsRegistry.cartesian||{}).attrRegex,o=(f.subplotsRegistry.gl3d||{}).attrRegex,s=Object.keys(t);for(e=0;e3?(T.x=1.02,T.xanchor="left"):T.x<-2&&(T.x=-.02,T.xanchor="right"),T.y>3?(T.y=1.02,T.yanchor="bottom"):T.y<-2&&(T.y=-.02,T.yanchor="top")),"rotate"===t.dragmode&&(t.dragmode="orbit"),m.clean(t),t},r.cleanData=function(t,e){for(var n=[],o=t.concat(Array.isArray(e)?e:[]).filter(function(t){return"uid"in t}).map(function(t){return t.uid}),s=0;s1&&o.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 o.warn("Unrecognized full array edit value",f,y),!0;e.set(y)}return!m&&(h(g,v),d(t),!0)}var x,b,_,w,M,k,A,T=Object.keys(r).map(Number).sort(s),S=e.get(),E=S||[],L=n(v,f).get(),C=[],z=-1,D=E.length;for(x=0;xE.length-(A?0:1))o.warn("index out of range",f,_);else if(void 0!==k)M.length>1&&o.warn("Insertion & removal are incompatible with edits to the same index.",f,_),u(k)?C.push(_):A?("add"===k&&(k={}),E.splice(_,0,k),L&&L.splice(_,0,{})):o.warn("Unrecognized full object edit value",f,_,k),-1===z&&(z=_);else for(b=0;b=0;x--)E.splice(C[x],1),L&&L.splice(C[x],1);if(E.length?S||e.set(E):e.set(null),m)return!1;if(h(g,v),p!==a){var I;if(-1===z)I=T;else{for(D=Math.max(E.length,D),I=[],x=0;x=z);x++)I.push(_);for(x=z;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 s(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]),o(t,e,"currentIndices"),void 0===r||Array.isArray(r)||(r=[r]),void 0!==r&&o(t,r,"newIndices"),void 0!==r&&e.length!==r.length)throw new Error("current and new indices must be of equal length.")}function l(t,e,r,n,i,s){!function(t,e,r,n){var i=v.isPlainObject(n);if(!Array.isArray(t.data))throw new Error("gd.data must be an array");if(!v.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");o(t,r,"indices");for(var a in 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,c,u,f=function(t,e,r,n){var i,o,s,l,c,u=v.isPlainObject(n),f=[];Array.isArray(r)||(r=[r]),r=a(r,t.data.length-1);for(var h in e)for(var d=0;d=0&&uY.range[0]?[1,2]:[2,1]);else{var Z=Y.range[0],J=Y.range[1];W?(Z<=0&&J<=0&&r(j+".autorange",!0),Z<=0?Z=J/1e6:J<=0&&(J=Z/1e6),r(j+".range[0]",Math.log(Z)/Math.LN10),r(j+".range[1]",Math.log(J)/Math.LN10)):(r(j+".range[0]",Math.pow(10,Z)),r(j+".range[1]",Math.pow(10,J)))}else r(j+".autorange",!0);Array.isArray(u._subplots.polar)&&u._subplots.polar.length&&u[E.parts[0]]&&"radialaxis"===E.parts[1]&&delete u[E.parts[0]]._subplot.viewInitial["radialaxis.range"],b.getComponentMethod("annotations","convertCoords")(t,U,L,r),b.getComponentMethod("images","convertCoords")(t,U,L,r)}else r(j+".autorange",!0),r(j+".range",null);v.nestedProperty(u,j+"._inputRange").set(null)}else if(F.match(P.AX_NAME_PATTERN)){var K=v.nestedProperty(u,S).get(),Q=(L||{}).type;Q&&"-"!==Q||(Q="linear"),b.getComponentMethod("annotations","convertCoords")(t,K,Q,r),b.getComponentMethod("images","convertCoords")(t,K,Q,r)}var $=C.containerArrayMatch(S);if($){a=$.array,o=$.index;var tt=$.property,et=(v.nestedProperty(l,a)||[])[o]||{},rt=et,nt=q||{editType:"calc"},it=-1!==nt.editType.indexOf("calcIfAutorange");""===o?(it?M.calc=!0:I.update(M,nt),it=!1):""===tt&&(rt=L,C.isAddVal(L)?A[S]=null:C.isRemoveVal(L)?(A[S]=et,rt=et):v.warn("unrecognized full object value",e)),it&&(n(rt,"x")||n(rt,"y"))?M.calc=!0:I.update(M,nt),d[a]||(d[a]={});var at=d[a][o];at||(at=d[a][o]={}),at[tt]=L,delete e[S]}else"reverse"===F?(B.range?B.range.reverse():(r(j+".autorange",!0),B.range=[1,0]),U.autorange?M.calc=!0:M.plot=!0):((!u._has("gl2d")&&!u._has("regl")||"dragmode"!==S||"lasso"!==L&&"select"!==L||"lasso"===V||"select"===V)&&q?I.update(M,q):M.calc=!0,E.set(L))}}for(a in d){C.applyContainerArrayChanges(t,v.nestedProperty(l,a),d[a],M)||(M.plot=!0)}var ot=u._axisConstraintGroups||[];for(x in T)for(o=0;o=s.length?s[0]:s[t]:s}function i(t){return Array.isArray(l)?t>=l.length?l[0]:l[t]:l}function a(t,e){var r=0;return function(){if(t&&++r===e)return t()}}if(t=v.getGraphDiv(t),!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before animating it. For more details, see https://plot.ly/javascript/animations/");var o=t._transitionData;o._frameQueue||(o._frameQueue=[]);var s=(r=w.supplyAnimationDefaults(r)).transition,l=r.frame;return void 0===o._frameWaitingCnt&&(o._frameWaitingCnt=0),new Promise(function(l,c){function u(e){if(0!==e.length){for(var s=0;so._timeToNext&&function(){o._currentFrame&&o._currentFrame.onComplete&&o._currentFrame.onComplete();var e=o._currentFrame=o._frameQueue.shift();if(e){var r=e.name?e.name.toString():null;t._fullLayout._currentFrame=r,o._lastFrameAt=Date.now(),o._timeToNext=e.frameOpts.duration,w.transition(t,e.frame.data,e.frame.layout,z.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(o._animationRaf),o._animationRaf=null}()};e()}()}}function f(t){return Array.isArray(s)?p>=s.length?t.transitionOpts=s[p]:t.transitionOpts=s[0]:t.transitionOpts=s,p++,t}var h,d,p=0,m=[],g=void 0===e||null===e,y=Array.isArray(e);if(!g&&!y&&v.isPlainObject(e))m.push({type:"object",data:f(v.extendFlat({},e))});else if(g||-1!==["string","number"].indexOf(typeof e))for(h=0;h0&&__)&&M.push(d);m=M}}m.length>0?u(m):(t.emit("plotly_animated"),l())})},g.addFrames=function(t,e,r){t=v.getGraphDiv(t);var n=0;if(null===e||void 0===e)return Promise.resolve();if(!v.isPlotDiv(t))throw new Error("This element is not a Plotly plot: "+t+". It's likely that you've failed to create a plot before adding frames. For more details, see https://plot.ly/javascript/animations/");var i,a,o,s,l=t._transitionData._frames,c=t._transitionData._frameHash;if(!Array.isArray(e))throw new Error("addFrames failure: frameList must be an Array of frame definitions"+e);var u=l.length+2*e.length,f=[];for(i=e.length-1;i>=0;i--)if(v.isPlainObject(e[i])){var h=(c[e[i].name]||{}).name,d=e[i].name;h&&d&&"number"==typeof d&&c[h]&&(n++,v.warn('addFrames: overwriting frame "'+c[h].name+'" with a frame whose name of type "number" also equates to "'+h+'". This is valid but may potentially lead to unexpected behavior since all plotly.js frame names are stored internally as strings.'),n>5&&v.warn("addFrames: This API call has yielded too many warnings. For the rest of this call, further warnings about numeric frame names will be suppressed.")),f.push({frame:w.supplyFrameDefaults(e[i]),index:r&&void 0!==r[i]&&null!==r[i]?r[i]:u+i})}f.sort(function(t,e){return t.index>e.index?-1:t.index=0;i--){if("number"==typeof(a=f[i].frame).name&&v.warn("Warning: addFrames accepts frames with numeric names, but the numbers areimplicitly cast to strings"),!a.name)for(;c[a.name="frame "+t._transitionData._counter++];);if(c[a.name]){for(o=0;o=0;r--)n=e[r],a.push({type:"delete",index:n}),o.unshift({type:"insert",index:n,value:i[n]});var s=w.modifyFrames,l=w.modifyFrames,c=[t,o],u=[t,a];return x&&x.add(t,s,c,l,u),w.modifyFrames(t,a)},g.purge=function(t){var e=(t=v.getGraphDiv(t))._fullLayout||{},r=t._fullData||[];return w.cleanPlot([],{},r,e),w.purge(t),y.purge(t),e._container&&e._container.remove(),delete t._context,t}},{"../components/color":618,"../components/drawing":643,"../components/errorbars":649,"../constants/xmlns_namespaces":723,"../lib":743,"../lib/events":731,"../lib/queue":757,"../lib/svg_text_utils":766,"../plotly":784,"../plots/cartesian/axis_ids":792,"../plots/cartesian/constants":794,"../plots/cartesian/constraints":796,"../plots/cartesian/graph_interact":798,"../plots/plots":852,"../plots/polar/legacy":860,"../registry":873,"./edit_types":773,"./helpers":774,"./manage_arrays":775,"./plot_schema":778,"./subroutines":781,d3:128,"fast-isnumeric":140,"has-hover":276}],777:[function(t,e,r){"use strict";e.exports={staticPlot:!1,editable:!1,edits:{annotationPosition:!1,annotationTail:!1,annotationText:!1,axisTitleText:!1,colorbarPosition:!1,colorbarTitleText:!1,legendPosition:!1,legendText:!1,shapePosition:!1,titleText:!1},autosizable:!1,queueLength:0,fillFrame:!1,frameMargins:0,scrollZoom:!1,doubleClick:"reset+autosize",showTips:!0,showAxisDragHandles:!0,showAxisRangeEntryBoxes:!0,showLink:!1,sendData:!0,linkText:"Edit chart",showSources:!1,displayModeBar:"hover",modeBarButtonsToRemove:[],modeBarButtonsToAdd:[],modeBarButtons:!1,displaylogo:!0,plotGlPixelRatio:2,setBackground:"transparent",topojsonURL:"https://cdn.plot.ly/",mapboxAccessToken:null,logging:1,globalTransforms:[],locale:"en-US",locales:{}}},{}],778:[function(t,e,r){"use strict";function n(t,e,r){if(!t)return!1;if(t._isLinkedToArray)if(i(e[r]))r++;else if(r=t.items.length)return!1;t=t.items[a]}}return t}function i(t){return t===Math.round(t)&&t>=0}function a(){var t,e,r={};x(r,h);for(t in c.subplotsRegistry)if((e=c.subplotsRegistry[t]).layoutAttributes)if("cartesian"===e.name)s(r,e,"xaxis"),s(r,e,"yaxis");else{s(r,e,"subplot"===e.attr?e.name:e.attr)}r=function(t){return y(t,{radialaxis:g.radialaxis,angularaxis:g.angularaxis}),y(t,g.layout),t}(r);for(t in c.componentsRegistry){var n=(e=c.componentsRegistry[t]).schema;if(n&&(n.subplots||n.layout)){var i=n.subplots;if(i&&i.xaxis&&!i.yaxis)for(var a in i.xaxis)delete r.yaxis[a]}else e.layoutAttributes&&l(r,e.layoutAttributes,e.name)}return{layoutAttributes:o(r)}}function o(t){return function(t){r.crawl(t,function(t,e,n){r.isValObject(t)?"data_array"===t.valType?(t.role="data",n[e+"src"]={valType:"string",editType:"none"}):!0===t.arrayOk&&(n[e+"src"]={valType:"string",editType:"none"}):u.isPlainObject(t)&&(t.role="object")})}(t),function(t){r.crawl(t,function(t,e,r){if(!t)return;var n=t[_];if(!n)return;delete t[_],r[e]={items:{}},r[e].items[n]=t,r[e].role="object"})}(t),t}function s(t,e,r){var n=u.nestedProperty(t,r),i=x({},e.layoutAttributes);i[b]=!0,n.set(i)}function l(t,e,r){var n=u.nestedProperty(t,r);n.set(x(n.get()||{},e))}var c=t("../registry"),u=t("../lib"),f=t("../plots/attributes"),h=t("../plots/layout_attributes"),d=t("../plots/frame_attributes"),p=t("../plots/animation_attributes"),m=t("../plots/polar/legacy/area_attributes"),g=t("../plots/polar/legacy/axis_attributes"),v=t("./edit_types"),y=u.extendFlat,x=u.extendDeepAll,b="_isSubplotObj",_="_isLinkedToArray",w=[b,_,"_arrayAttrRegexps","_deprecated"];r.IS_SUBPLOT_OBJ=b,r.IS_LINKED_TO_ARRAY=_,r.DEPRECATED="_deprecated",r.UNDERSCORE_ATTRS=w,r.get=function(){var t={};c.allTypes.concat("area").forEach(function(e){t[e]=function(t){var e,r;"area"===t?(e={attributes:m},r={}):r=(e=c.modules[t]._module).basePlotModule;var n={};n.type=null,x(n,f),x(n,e.attributes),r.attributes&&x(n,r.attributes),n.type=t;var i={meta:e.meta||{},attributes:o(n)};if(e.layoutAttributes){var a={};x(a,e.layoutAttributes),i.layoutAttributes=o(a)}return i}(e)});var e={};return Object.keys(c.transformsRegistry).forEach(function(t){e[t]=function(t){var e=c.transformsRegistry[t],r=x({},e.attributes);return Object.keys(c.componentsRegistry).forEach(function(e){var n=c.componentsRegistry[e];n.schema&&n.schema.transforms&&n.schema.transforms[t]&&Object.keys(n.schema.transforms[t]).forEach(function(e){l(r,n.schema.transforms[t][e],e)})}),{attributes:o(r)}}(t)}),{defs:{valObjects:u.valObjectMeta,metaKeys:w.concat(["description","role","editType","impliedEdits"]),editType:{traces:v.traces,layout:v.layout},impliedEdits:{}},traces:t,layout:a(),transforms:e,frames:function(){var t={frames:u.extendDeepAll({},d)};return o(t),t.frames}(),animation:o(p)}},r.crawl=function(t,e,n,i){var a=n||0;i=i||"",Object.keys(t).forEach(function(n){var o=t[n];if(-1===w.indexOf(n)){var s=(i?i+".":"")+n;e(o,n,t,a,s),r.isValObject(o)||u.isPlainObject(o)&&"impliedEdits"!==n&&r.crawl(o,e,a+1,s)}})},r.isValObject=function(t){return t&&void 0!==t.valType},r.findArrayAttributes=function(t){function e(e,r,a,o){i=i.slice(0,o).concat([r]);if(e&&("data_array"===e.valType||!0===e.arrayOk)&&!("colorbar"===i[o-1]&&("ticktext"===r||"tickvals"===r))){var s=function(t){return t.join(".")}(i),l=u.nestedProperty(t,s).get();Array.isArray(l)&&n.push(s)}}var n=[],i=[];if(r.crawl(f,e),t._module&&t._module.attributes&&r.crawl(t._module.attributes,e),t.transforms)for(var a=t.transforms,o=0;o=t.transforms.length)return!1;a=(r=(c.transformsRegistry[t.transforms[l].type]||{}).attributes)&&r[e[2]],s=3}else if("area"===t.type)a=m[o];else{var u=t._module;if(u||(u=(c.modules[t.type||f.type.dflt]||{})._module),!u)return!1;if(r=u.attributes,!(a=r&&r[o])){var h=u.basePlotModule;h&&h.attributes&&(a=h.attributes[o])}a||(a=f[o])}return n(a,e,s)},r.getLayoutValObject=function(t,e){return n(function(t,e){var r,n,i,a,o=t._basePlotModules;if(o){var s;for(r=0;r=t[1]||i[1]<=t[0])&&a[0]e[0])return!0}return!1}(r,n,w)?(_.push(t),w.push([r,n])):i=[0];var a=e.plotgroup.selectAll(".bg").data(i);a.enter().append("rect").classed("bg",!0),a.exit().remove(),a.each(function(){e.bg=a;var t=e.plotgroup.node();t.insertBefore(this,t.childNodes[0])})});var M=l._bgLayer.selectAll(".bg").data(_);return M.enter().append("rect").classed("bg",!0),M.exit().remove(),M.each(function(t){l._plots[t].bg=o.select(this)}),b.each(function(t){function r(t){return"M"+k+","+t+"H"+A}function o(t){return"M"+y._offset+","+t+"h"+y._length}function s(t){return"M"+t+","+z+"V"+C}function c(t){return"M"+t+","+x._offset+"v"+x._length}function p(e,r,n){if(!e.showline||t!==e._mainSubplot)return"";if(!e._anchorAxis)return n(e._mainLinePosition);var i=r(e._mainLinePosition);return e.mirror&&(i+=r(e._mainMirrorPosition)),i}var v=l._plots[t],y=v.xaxis,x=v.yaxis;v.bg&&m&&v.bg.call(h.setRect,y._offset-u,x._offset-u,y._length+2*u,x._length+2*u).call(f.fill,l.plot_bgcolor).style("stroke-width",0),v.clipId="clip"+l._uid+t+"plot";var b=l._clips.selectAll("#"+v.clipId).data([0]);b.enter().append("clipPath").attr({class:"plotclip",id:v.clipId}).append("rect"),b.selectAll("rect").attr({width:y._length,height:x._length}),h.setTranslate(v.plot,y._offset,x._offset);var _,w;for(v._hasClipOnAxisFalse?(_=null,w=v.clipId):(_=v.clipId,w=null),h.setClipUrl(v.plot,_),i=0;i1&&d.push(a("object","layout"))),l.supplyDefaults(p);for(var m=p._fullData,g=r.length,v=0;v10||"01-01"!==n.substr(5)?t._tickround="d":t._tickround=+e.substr(1)%12==0?"y":"m";else if(e>=T&&i<=10||e>=15*T)t._tickround="d";else if(e>=E&&i<=16||e>=S)t._tickround="M";else if(e>=L&&i<=19||e>=E)t._tickround="S";else{var a=t.l2r(r+e).replace(/^-/,"").length;t._tickround=Math.max(i,a)-20}}else if(m(e)||"L"===e.charAt(0)){var o=t.range.map(t.r2d||Number);m(e)||(e=Number(e.substr(1))),t._tickround=2-Math.floor(Math.log(e)/Math.LN10+.01);var s=Math.max(Math.abs(o[0]),Math.abs(o[1])),l=Math.floor(Math.log(s)/Math.LN10+.01);Math.abs(l)>3&&(c(t.exponentformat)&&!u(l)?t._tickexponent=3*Math.round((l-1)/3):t._tickexponent=l)}else t._tickround=null}function s(t,e,r){var n=t.tickfont||{};return{x:e,dx:0,dy:0,text:r||"",fontSize:n.size,font:n.family,fontColor:n.color}}function l(t,e,r,n,i){if("radians"!==t.thetaunit||r)e.text=f(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}function r(t,n){return e(n,0)?t:r(n,t%n)}var n=function(t){var r=1;for(;!e(Math.round(t*r)/r,t);)r*=10;return r}(t),i=t*n,a=Math.abs(r(i,n));return[Math.round(i/a),Math.round(n/a)]}(a);if(o[1]>=100)e.text=f(v.deg2rad(e.x),t,i,n);else{var s=e.x<0;1===o[1]?1===o[0]?e.text="\u03c0":e.text=o[0]+"\u03c0":e.text=["",o[0],"","\u2044","",o[1],"","\u03c0"].join(""),s&&(e.text=C+e.text)}}}}function c(t){return"SI"===t||"B"===t}function u(t){return t>14||t<-15}function f(t,e,r,n){var i=t<0,a=e._tickround,s=r||e.exponentformat||"B",l=e._tickexponent,f=I.getTickFormat(e),h=e.separatethousands;if(n){var d={exponentformat:e.exponentformat,dtick:"none"===e.showexponent?e.dtick:m(t)?Math.abs(t)||1:1,range:"none"===e.showexponent?e.range.map(e.r2d):[0,t||1]};o(d),a=(Number(d._tickround)||0)+4,l=d._tickexponent,e.hoverformat&&(f=e.hoverformat)}if(f)return e._numFormat(f)(t).replace(/-/g,C);var p=Math.pow(10,-a)/2;if("none"===s&&(l=0),(t=Math.abs(t))"+x+"":"B"===s&&9===l?t+="B":c(s)&&(t+=H[l/3+5])}return i?C+t:t}function h(t,e){for(var r=0;r2e-6||((r-t._forceTick0)/t._minDtick%1+1.000001)%1>2e-6)&&(t._minDtick=0)):t._minDtick=0},I.getAutoRange=function(t){var e,r=[],n=t._min[0].val,i=t._max[0].val;for(e=1;e0&&u>0&&f/u>h&&(l=o,c=s,h=f/u);if(n===i){var m=n-1,g=n+1;r="tozero"===t.rangemode?n<0?[m,0]:[0,g]:"nonnegative"===t.rangemode?[Math.max(0,m),Math.max(0,g)]:[m,g]}else h&&("linear"!==t.type&&"-"!==t.type||("tozero"===t.rangemode?(l.val>=0&&(l={val:0,pad:0}),c.val<=0&&(c={val:0,pad:0})):"nonnegative"===t.rangemode&&(l.val-h*l.pad<0&&(l={val:0,pad:0}),c.val<0&&(c={val:1,pad:0})),h=(c.val-l.val)/(t._length-l.pad-c.pad)),r=[l.val-h*l.pad,c.val+h*c.pad]);return r[0]===r[1]&&("tozero"===t.rangemode?r=r[0]<0?[r[0],0]:r[0]>0?[0,r[0]]:[0,1]:(r=[r[0]-1,r[0]+1],"nonnegative"===t.rangemode&&(r[0]=Math.max(0,r[0])))),d&&r.reverse(),v.simpleMap(r,t.l2r||Number)},I.doAutoRange=function(t){t._length||t.setScale();var e=t._min&&t._max&&t._min.length&&t._max.length;if(t.autorange&&e){t.range=I.getAutoRange(t),t._r=t.range.slice(),t._rl=v.simpleMap(t._r,t.r2l);var r=t._input;r.range=t.range.slice(),r.autorange=t.autorange}},I.saveRangeInitial=function(t,e){for(var r=I.list(t,"",!0),n=!1,i=0;i=h?d=!1:s.val>=c&&s.pad<=h&&(t._min.splice(o,1),o--);d&&t._min.push({val:c,pad:b&&0===c?0:h})}if(n(u)){for(d=!0,o=0;o=u&&s.pad>=f?d=!1:s.val<=u&&s.pad<=f&&(t._max.splice(o,1),o--);d&&t._max.push({val:u,pad:b&&0===u?0:f})}}}if((t.autorange||!!v.nestedProperty(t,"rangeslider.autorange").get())&&e){t._min||(t._min=[]),t._max||(t._max=[]),r||(r={}),t._m||t.setScale();var a,o,s,l,c,u,f,h,d,p,g,y=e.length,x=r.padded?.05*t._length:0,b=r.tozero&&("linear"===t.type||"-"===t.type);x&&"domain"===t.constrain&&t._inputDomain&&(x*=(t._inputDomain[1]-t._inputDomain[0])/(t.domain[1]-t.domain[0]));var _=n((t._m>0?r.ppadplus:r.ppadminus)||r.ppad||0),w=n((t._m>0?r.ppadminus:r.ppadplus)||r.ppad||0),k=n(r.vpadplus||r.vpad),A=n(r.vpadminus||r.vpad);for(a=0;a<6;a++)i(a);for(a=y-1;a>5;a--)i(a)}},I.autoBin=function(t,e,r,n,i){var a=v.aggNums(Math.min,null,t),o=v.aggNums(Math.max,null,t);if(i||(i=e.calendar),"category"===e.type)return{start:a-.5,end:o+.5,size:1,_count:o-a+1};var s;if(r)s=(o-a)/r;else{var l=v.distinctVals(t),c=Math.pow(10,Math.floor(Math.log(l.minDiff)/Math.LN10)),u=c*v.roundUp(l.minDiff/c,[.9,1.9,4.9,9.9],!0);s=Math.max(u,2*v.stdev(t)/Math.pow(t.length,n?.25:.4)),m(s)||(s=1)}var f;f="log"===e.type?{type:"linear",range:[a,o]}:{type:e.type,range:v.simpleMap([a,o],e.c2r,0,i),calendar:i},I.setConvert(f),I.autoTicks(f,s);var h,d,p=I.tickIncrement(I.tickFirst(f),f.dtick,"reverse",i);if("number"==typeof f.dtick)h=(p=function(t,e,r,n,i){function a(e){return(1+100*(e-t)/r.dtick)%100<2}for(var o=0,s=0,l=0,c=0,u=0;u.3*f||a(n)||a(i))){var h=r.dtick/2;t+=t+h.8){var o=Number(r.substr(1));a.exactYears>.8&&o%12==0?t=I.tickIncrement(t,"M6","reverse")+1.5*T:a.exactMonths>.8?t=I.tickIncrement(t,"M1","reverse")+15.5*T:t-=T/2;var s=I.tickIncrement(t,r);if(s<=n)return s}return t}(p,t,f.dtick,a,i)),h=p,d=0;h<=o;)h=I.tickIncrement(h,f.dtick,!1,i),d++;return{start:e.c2r(p,0,i),end:e.c2r(h,0,i),size:f.dtick,_count:d}},I.calcTicks=function(t){var e=v.simpleMap(t.range,t.r2l);if("auto"===t.tickmode||!t.dtick){var r,n=t.nticks;n||("category"===t.type?(r=t.tickfont?1.2*(t.tickfont.size||12):15,n=t._length/r):(r="y"===t._id.charAt(0)?40:80,n=v.constrain(t._length/r,4,9)+1),"radialaxis"===t._name&&(n*=2)),"array"===t.tickmode&&(n*=100),I.autoTicks(t,Math.abs(e[1]-e[0])/n),t._minDtick>0&&t.dtick<2*t._minDtick&&(t.dtick=t._minDtick,t.tick0=t.l2r(t._forceTick0))}if(t.tick0||(t.tick0="date"===t.type?"2000-01-01":0),o(t),"array"===t.tickmode)return function(t){var e,r,n=t.tickvals,i=t.ticktext,a=new Array(n.length),o=v.simpleMap(t.range,t.r2l),l=1.0001*o[0]-1e-4*o[1],c=1.0001*o[1]-1e-4*o[0],u=Math.min(l,c),f=Math.max(l,c),h=0;Array.isArray(i)||(i=[]);var d="category"===t.type?t.d2l_noadd:t.d2l;for("log"===t.type&&"L"!==String(t.dtick).charAt(0)&&(t.dtick="L"+Math.pow(10,Math.floor(Math.min(t.range[0],t.range[1]))-1)),r=0;ru&&e=l:f<=l)&&!(a.length>u||f===c);f=I.tickIncrement(f,t.dtick,i,t.calendar))c=f,a.push(f);"angular"===t._id&&360===Math.abs(e[1]-e[0])&&a.pop(),t._tmax=a[a.length-1],t._prevDateHead="",t._inCalcTicks=!0;for(var h=new Array(a.length),d=0;dk?(e/=k,n=r(10),t.dtick="M"+12*a(e,n,R)):i>A?(e/=A,t.dtick="M"+a(e,1,N)):i>T?(t.dtick=a(e,T,B),t.tick0=v.dateTick0(t.calendar,!0)):i>S?t.dtick=a(e,S,N):i>E?t.dtick=a(e,E,j):i>L?t.dtick=a(e,L,j):(n=r(10),t.dtick=a(e,n,R))}else if("log"===t.type){t.tick0=0;var o=v.simpleMap(t.range,t.r2l);if(e>.7)t.dtick=Math.ceil(e);else if(Math.abs(o[1]-o[0])<1){var s=1.5*Math.abs((o[1]-o[0])/e);e=Math.abs(Math.pow(10,o[1])-Math.pow(10,o[0]))/s,n=r(10),t.dtick="L"+a(e,n,R)}else t.dtick=e>.3?"D2":"D1"}else"category"===t.type?(t.tick0=0,t.dtick=Math.ceil(Math.max(e,1))):"angular"===t._id?(t.tick0=0,n=1,t.dtick=a(e,n,q)):(t.tick0=0,n=r(10),t.dtick=a(e,n,R));if(0===t.dtick&&(t.dtick=1),!m(t.dtick)&&"string"!=typeof t.dtick){var l=t.dtick;throw t.dtick=1,"ax.dtick error: "+String(l)}},I.tickIncrement=function(t,e,r,n){var i=r?-1:1;if(m(e))return t+i*e;var a=e.charAt(0),o=i*Number(e.substr(1));if("M"===a)return v.incrementMonth(t,o,n);if("L"===a)return Math.log(Math.pow(10,t)+o)/Math.LN10;if("D"===a){var s="D2"===e?V:U,l=t+.01*i,c=v.roundUp(v.mod(l,1),s,r);return Math.floor(l)+Math.log(p.round(Math.pow(10,c),1))/Math.LN10}throw"unrecognized dtick "+String(e)},I.tickFirst=function(t){var e=t.r2l||Number,r=v.simpleMap(t.range,e),n=r[1]"+o,t._prevDateHead=o)),e.text=s}(t,o,r,d):"log"===t.type?function(t,e,r,n,i){var a=t.dtick,o=e.x,s=t.tickformat;if("never"===i&&(i=""),!n||"string"==typeof a&&"L"===a.charAt(0)||(a="L3"),s||"string"==typeof a&&"L"===a.charAt(0))e.text=f(Math.pow(10,o),t,i,n);else if(m(a)||"D"===a.charAt(0)&&v.mod(o+.01,1)<.1){var l=Math.round(o);-1!==["e","E","power"].indexOf(t.exponentformat)||c(t.exponentformat)&&u(l)?(e.text=0===l?1:1===l?"10":l>1?"10"+l+"":"10"+C+-l+"",e.fontSize*=1.25):(e.text=f(Math.pow(10,o),t,"","fakehover"),"D1"===a&&"y"===t._id.charAt(0)&&(e.dy-=e.fontSize/6))}else{if("D"!==a.charAt(0))throw"unrecognized dtick "+String(a);e.text=String(Math.round(Math.pow(10,v.mod(o,1)))),e.fontSize*=.75}if("D1"===t.dtick){var h=String(e.text).charAt(0);"0"!==h&&"1"!==h||("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*(o<0?.5:.25)))}}(t,o,0,d,i):"category"===t.type?function(t,e){var r=t._categories[Math.round(e.x)];void 0===r&&(r=""),e.text=String(r)}(t,o):"angular"===t._id?l(t,o,r,d,i):function(t,e,r,n,i){"never"===i?i="":"all"===t.showexponent&&Math.abs(e.x/t.dtick)<1e-6&&(i="hide"),e.text=f(e.x,t,i,n)}(t,o,0,d,i),t.tickprefix&&!n(t.showtickprefix)&&(o.text=t.tickprefix+o.text),t.ticksuffix&&!n(t.showticksuffix)&&(o.text+=t.ticksuffix),o},I.hoverLabelText=function(t,e,r){if(r!==z&&r!==e)return I.hoverLabelText(t,e)+" - "+I.hoverLabelText(t,r);var n="log"===t.type&&e<=0,i=I.tickText(t,t.c2l(n?-e:e),"hover").text;return n?0===e?"0":C+i:i};var H=["f","p","n","\u03bc","m","","k","M","G","T"];I.getTickFormat=function(t){function e(t){return"string"!=typeof t?t:Number(t.replace("M",""))*A}function r(t,e){var r=["L","D"];if(typeof t==typeof e){if("number"==typeof t)return t-e;var n=r.indexOf(t.charAt(0)),i=r.indexOf(e.charAt(0));return n===i?Number(t.replace(/(L|D)/g,""))-Number(e.replace(/(L|D)/g,"")):n-i}return"number"==typeof t?1:-1}function n(t,e,r){var n=r||function(t){return t},i=e[0],a=e[1];return(!i&&"number"!=typeof i||n(i)<=n(t))&&(!a&&"number"!=typeof a||n(a)>=n(t))}function i(t,e){var n=null===e[0],i=null===e[1],a=r(t,e[0])>=0,o=r(t,e[1])<=0;return(n||a)&&(i||o)}var a,o;if(t.tickformatstops&&t.tickformatstops.length>0)switch(t.type){case"date":case"linear":for(a=0;a1&&e1)for(n=1;n2*o}(t,e)?"date":function(t){for(var e,r=Math.max(1,(t.length-1)/1e3),n=0,o=0,s=0;s2*n}(t)?"category":function(t){if(!t)return!1;for(var e=0;en?1:-1:+(t.substr(1)||1)-+(e.substr(1)||1)}},{"../../registry":873,"./constants":794}],793:[function(t,e,r){"use strict";e.exports=function(t,e,r){if("category"===e.type){var n,i=t.categoryarray,a=Array.isArray(i)&&i.length>0;a&&(n="array");var o=r("categoryorder",n);"array"===o&&r("categoryarray"),a||"array"!==o||(e.categoryorder="trace")}}},{}],794:[function(t,e,r){"use strict";var n=t("../../lib").counterRegex;e.exports={idRegex:{x:n("x"),y:n("y")},attrRegex:n("[xy]axis"),xAxisMatch:n("xaxis"),yAxisMatch:n("yaxis"),AX_ID_PATTERN:/^[xyz][0-9]*$/,AX_NAME_PATTERN:/^[xyz]axis[0-9]*$/,SUBPLOT_PATTERN:/^x([0-9]*)y([0-9]*)$/,MINDRAG:8,MINSELECT:12,MINZOOM:20,DRAGGERSIZE:20,BENDPX:1.5,REDRAWDELAY:50,SELECTDELAY:100,SELECTID:"-select",DFLTRANGEX:[-1,6],DFLTRANGEY:[-1,4],traceLayerClasses:["imagelayer","maplayer","barlayer","carpetlayer","violinlayer","boxlayer","scatterlayer"],layerValue2layerClass:{"above traces":"above","below traces":"below"}}},{"../../lib":743}],795:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./axis_ids").id2name;e.exports=function(t,e,r,a,o){var s=o._axisConstraintGroups,l=e._id,c=l.charAt(0);if(!e.fixedrange&&(r("constrain"),n.coerce(t,e,{constraintoward:{valType:"enumerated",values:"x"===c?["left","center","right"]:["bottom","middle","top"],dflt:"x"===c?"center":"middle"}},"constraintoward"),t.scaleanchor)){var u=function(t,e,r,n){var a,o,s,l,c=n[i(e)].type,u=[];for(o=0;oo*v)||_)for(r=0;rz&&IL&&(L=I);f/=(L-E)/(2*C),E=l.l2r(E),L=l.l2r(L),l.range=l._input.range=A.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("transform","translate("+r+", "+n+")").attr("d",i+"Z")}function c(t,e,r){return t.append("path").attr("class","zoombox-corners").style({fill:k.background,stroke:k.defaultLine,"stroke-width":1,opacity:0}).attr("transform","translate("+e+", "+r+")").attr("d","M0,0Z")}function u(t){t.selectAll(".select-outline").remove()}function f(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 d(t){y.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}function p(t){j&&t.data&&t._context.showTips&&(w.notifier(w._(t,"Double-click to zoom back out"),"long"),j=!1)}function m(t){return"lasso"===t||"select"===t}function g(t){var e=Math.floor(Math.min(t.b-t.t,t.r-t.l,R)/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 v(t,e){if(N){var r=void 0!==t.onwheel?"wheel":"mousewheel";t._onwheel&&t.removeEventListener(r,t._onwheel),t._onwheel=e,t.addEventListener(r,e,{passive:!1})}else void 0!==t.onwheel?t.onwheel=e:void 0!==t.onmousewheel&&(t.onmousewheel=e)}var y=t("d3"),x=t("tinycolor2"),b=t("../../plotly"),_=t("../../registry"),w=t("../../lib"),M=t("../../lib/svg_text_utils"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("../../components/fx"),S=t("../../lib/setcursor"),E=t("../../components/dragelement"),L=t("../../constants/alignment").FROM_TL,C=t("../plots"),z=t("./axes").doTicks,D=t("./axis_ids").getFromId,I=t("./select"),P=t("./scale_zoom"),O=t("./constants"),F=O.MINDRAG,R=O.MINZOOM,N=w.eventListenerOptionsSupported(),j=!0;e.exports={makeDragBox:function(t,e,r,n,h,k,S,N){function j(){X=[e.xaxis],Z=[e.yaxis];var r=X[0],n=Z[0];Q=r._length,$=n._length;var i=ot._axisConstraintGroups,o=[r._id],s=[n._id];W=[e].concat(S&&N?e.overlays:[]);for(var l=1;lR||s>R?(xt="xy",o/Q>s/$?(s=o*$/Q,pt>a?mt.t=pt-s:mt.b=pt+s):(o=s*Q/$,dt>i?mt.l=dt-o:mt.r=dt+o),_t.attr("d",g(mt))):n():!et||s10||n.scrollWidth-n.clientWidth>10)){clearTimeout(kt);var i=-e.deltaY;if(isFinite(i)||(i=e.wheelDelta/10),isFinite(i)){var a,o=Math.exp(-Math.min(Math.max(i,-20),20)/200),s=Tt.draglayer.select(".nsewdrag").node().getBoundingClientRect(),l=(e.clientX-s.left)/s.width,c=(s.bottom-e.clientY)/s.height;if(N||nt){for(N||(l=.5),a=0;a=0?Math.min(t,.9):1/(1/Math.max(t,-.3)+3.222))}(r/s._length);var l=s.l2r(i);!1!==l&&void 0!==l&&(s.range[e]=l)}}return n._length*(n._rl[e]-i)/(n._rl[e]-n._rl[a])}if(!t._transitioningWithDuration){if(j(),"ew"===tt||"ns"===et)return tt&&s(X,e),et&&s(Z,r),Y([tt?-e:0,et?-r:0,Q,$]),void H(et,tt);if(nt&&tt&&et){var i="w"===tt==("n"===et)?1:-1,a=(e/Q+i*r/$)/2;e=a*Q,r=i*a*$}"w"===tt?e=n(X,0,e):"e"===tt?e=n(X,1,-e):tt||(e=0),"n"===et?r=n(Z,1,r):"s"===et?r=n(Z,0,-r):et||(r=0);var o="w"===tt?e:0,l="n"===et?r:0;if(nt){var c;if(!tt&&1===et.length){for(c=0;c rect").call(A.setTranslate,s,l).call(A.setScale,a,o);var T=m.plot.selectAll(".scatterlayer .trace, .boxlayer .trace, .violinlayer .trace");m.plot.call(A.setTranslate,M,k).call(A.setScale,1/a,1/o),T.selectAll(".point").call(A.setPointGroupScale,a,o),T.selectAll(".textpoint").call(A.setTextPointsScale,a,o),T.call(A.hideOutsideRangePoints,m)}}}var W,X,Z,J,K,Q,$,tt,et,rt,nt,it,at,ot=t._fullLayout,st=t._fullLayout._zoomlayer,lt=S+N==="nsew",ct=1===(S+N).length;j();var ut=i(e,S+N+"drag",rt,r,n,h,k),ft=!et&&!tt;if(ft&&!lt)return ut.onmousedown=null,ut.style.pointerEvents="none",ut;var ht={element:ut,gd:t,plotinfo:e,prepFn:function(e,r,n){var i=t._fullLayout.dragmode;ft||(lt?e.shiftKey?"pan"===i?i="zoom":m(i)||(i="pan"):e.ctrlKey&&(i="pan"):i="pan"),ht.minDrag="lasso"===i?1:void 0,m(i)?(ht.xaxes=X,ht.yaxes=Z,I(e,r,n,ht,i)):ft?u(st):"zoom"===i?(ht.moveFn=B,ht.doneFn=U,ht.minDrag=1,function(e,r,n){var i=ut.getBoundingClientRect();dt=r-i.left,pt=n-i.top,mt={l:dt,r:dt,w:0,t:pt,b:pt,h:0},gt=t._hmpixcount?t._hmlumcount/t._hmpixcount:x(t._fullLayout.plot_bgcolor).getLuminance(),yt=!1,xt="xy",bt=l(st,gt,J,K,vt="M0,0H"+Q+"V"+$+"H0V0"),_t=c(st,J,K),u(st)}(0,r,n)):"pan"===i&&(ht.moveFn=q,ht.doneFn=G,u(st))},clickFn:function(r,n){if(d(t),2!==r||ct||function(){if(!t._transitioningWithDuration){var e,r,n,i=t._context.doubleClick,a=(tt?X:[]).concat(et?Z:[]),o={};if("reset+autosize"===i)for(i="autosize",r=0;ru[1]-.01&&(e.domain=[0,1]),i.noneOrAll(t.domain,e.domain,[0,1])}return r("layer"),e}},{"../../lib":743,"fast-isnumeric":140}],806:[function(t,e,r){"use strict";var n=t("../../constants/alignment").FROM_BL;e.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)]}},{"../../constants/alignment":716}],807:[function(t,e,r){"use strict";function n(t){return t._id}function i(t,e,r){var n,i,a;if(r){var o=r.points||[];for(n=0;n0)return Math.log(e)/Math.LN10;if(e<=0&&r&&t.range&&2===t.range.length){var n=t.range[0],i=t.range[1];return.5*(n+i-3*M*Math.abs(n-i))}return d}function f(e,r,n){var i=c(e,n||t.calendar);if(i===d){if(!a(e))return d;i=c(new Date(+e))}return i}function g(e,r,n){return l(e,r,n||t.calendar)}function v(e){return t._categories[Math.round(e)]}function y(e){if(null!==e&&void 0!==e){if(void 0===t._categoriesMap&&(t._categoriesMap={}),void 0!==t._categoriesMap[e])return t._categoriesMap[e];t._categories.push(e);var r=t._categories.length-1;return t._categoriesMap[e]=r,r}return d}function x(e){if(t._categoriesMap){var r=t._categoriesMap[e];if(void 0!==r)return r}if(a(e))return+e}function b(e){return a(e)?i.round(t._b+t._m*e,2):d}function _(e){return(e-t._b)/t._m}e=e||{};var w=(t._id||"x").charAt(0),M=10;t.c2l="log"===t.type?r:u,t.l2c="log"===t.type?n:u,t.l2p=b,t.p2l=_,t.c2p="log"===t.type?function(t,e){return b(r(t,e))}:b,t.p2c="log"===t.type?function(t){return n(_(t))}:_,-1!==["linear","-"].indexOf(t.type)?(t.d2r=t.r2d=t.d2c=t.r2c=t.d2l=t.r2l=s,t.c2d=t.c2r=t.l2d=t.l2r=u,t.d2p=t.r2p=function(e){return t.l2p(s(e))},t.p2d=t.p2r=_,t.cleanPos=u):"log"===t.type?(t.d2r=t.d2l=function(t,e){return r(s(t),e)},t.r2d=t.r2c=function(t){return n(s(t))},t.d2c=t.r2l=s,t.c2d=t.l2r=u,t.c2r=r,t.l2d=n,t.d2p=function(e,r){return t.l2p(t.d2r(e,r))},t.p2d=function(t){return n(_(t))},t.r2p=function(e){return t.l2p(s(e))},t.p2r=_,t.cleanPos=u):"date"===t.type?(t.d2r=t.r2d=o.identity,t.d2c=t.r2c=t.d2l=t.r2l=f,t.c2d=t.c2r=t.l2d=t.l2r=g,t.d2p=t.r2p=function(e,r,n){return t.l2p(f(e,0,n))},t.p2d=t.p2r=function(t,e,r){return g(_(t),e,r)},t.cleanPos=function(e){return o.cleanDate(e,d,t.calendar)}):"category"===t.type&&(t.d2c=t.d2l=y,t.r2d=t.c2d=t.l2d=v,t.d2r=t.d2l_noadd=x,t.r2c=function(e){var r=x(e);return void 0!==r?r:t.fraction2r(.5)},t.l2r=t.c2r=u,t.r2l=x,t.d2p=function(e){return t.l2p(t.r2c(e))},t.p2d=function(t){return v(_(t))},t.r2p=t.d2p,t.p2r=_,t.cleanPos=function(t){return"string"==typeof t&&""!==t?t:u(t)}),t.fraction2r=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return t.l2r(r+e*(n-r))},t.r2fraction=function(e){var r=t.r2l(t.range[0]),n=t.r2l(t.range[1]);return(t.r2l(e)-r)/(n-r)},t.cleanRange=function(e,r){r||(r={}),e||(e="range");var n,i,s=o.nestedProperty(t,e).get();if(i="date"===t.type?o.dfltRange(t.calendar):"y"===w?p.DFLTRANGEY:r.dfltRange||p.DFLTRANGEX,i=i.slice(),s&&2===s.length)for("date"===t.type&&(s[0]=o.cleanDate(s[0],d,t.calendar),s[1]=o.cleanDate(s[1],d,t.calendar)),n=0;n<2;n++)if("date"===t.type){if(!o.isDateTime(s[n],t.calendar)){t[e]=i;break}if(t.r2l(s[0])===t.r2l(s[1])){var l=o.constrain(t.r2l(s[0]),o.MIN_MS+1e3,o.MAX_MS-1e3);s[0]=t.l2r(l-1e3),s[1]=t.l2r(l+1e3);break}}else{if(!a(s[n])){if(!a(s[1-n])){t[e]=i;break}s[n]=s[1-n]*(n?10:.1)}if(s[n]<-h?s[n]=-h:s[n]>h&&(s[n]=h),s[0]===s[1]){var c=Math.max(1,Math.abs(1e-6*s[0]));s[0]-=c,s[1]+=c}}else o.nestedProperty(t,e).set(i)},t.setScale=function(r){var n=e._size;if(t._categories||(t._categories=[]),t._categoriesMap||(t._categoriesMap={}),t.overlaying){var i=m.getFromId({_fullLayout:e},t.overlaying);t.domain=i.domain}var a=r&&t._r?"_r":"range",o=t.calendar;t.cleanRange(a);var s=t.r2l(t[a][0],o),l=t.r2l(t[a][1],o);if("y"===w?(t._offset=n.t+(1-t.domain[1])*n.h,t._length=n.h*(t.domain[1]-t.domain[0]),t._m=t._length/(s-l),t._b=-t._m*l):(t._offset=n.l+t.domain[0]*n.w,t._length=n.w*(t.domain[1]-t.domain[0]),t._m=t._length/(l-s),t._b=-t._m*s),!isFinite(t._m)||!isFinite(t._b))throw e._replotting=!1,new Error("Something went wrong with axis scaling")},t.makeCalcdata=function(e,r){var n,i,a,o="date"===t.type&&e[r+"calendar"];if(r in e)for(n=e[r],i=new Array(n.length),a=0;a=t.r2l(t.range[0])&&n<=t.r2l(t.range[1])},t._min=[],t._max=[];var k=e._d3locale;"date"===t.type&&(t._dateFormat=k?k.timeFormat.utc:i.time.format.utc),t._separators=e.separators,t._numFormat=k?k.numberFormat:i.format,delete t._minDtick,delete t._forceTick0}},{"../../constants/numerical":721,"../../lib":743,"./axis_ids":792,"./constants":794,d3:128,"fast-isnumeric":140}],809:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes");e.exports=function(t,e,r,a,o){var s=function(t){var e=["showexponent","showtickprefix","showticksuffix"].filter(function(e){return void 0!==t[e]});if(e.every(function(r){return t[r]===t[e[0]]})||1===e.length)return t[e[0]]}(t);r("tickprefix")&&r("showtickprefix",s);r("ticksuffix",o.tickSuffixDflt)&&r("showticksuffix",s);if(r("showticklabels")){var l=o.font||{},c=e.color===t.color?e.color:l.color;if(n.coerceFont(r,"tickfont",{family:l.family,size:l.size,color:c}),r("tickangle"),"category"!==a){var u=r("tickformat");!function(t,e){function r(t,e){return n.coerce(s,l,i.tickformatstops,t,e)}var a=t.tickformatstops,o=e.tickformatstops=[];if(Array.isArray(a))for(var s,l,c=0;c0?Number(u):c;else if("string"!=typeof u)e.dtick=c;else{var f=u.charAt(0),h=u.substr(1);((h=n(h)?Number(h):0)<=0||!("date"===o&&"M"===f&&h===Math.round(h)||"log"===o&&"L"===f||"log"===o&&"D"===f&&(1===h||2===h)))&&(e.dtick=c)}var d="date"===o?i.dateTick0(e.calendar):0,p=r("tick0",d);"date"===o?e.tick0=i.cleanDate(p,d):n(p)&&"D1"!==u&&"D2"!==u?e.tick0=Number(p):e.tick0=d}else{void 0===r("tickvals")?e.tickmode="auto":r("ticktext")}}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],812:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../plotly"),a=t("../../registry"),o=t("../../components/drawing"),s=t("./axes"),l=t("./constants").attrRegex;e.exports=function(t,e,r,c){function u(t){var e=t.xaxis,r=t.yaxis;d._defs.select("#"+t.clipId+"> 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 f(e,r){var n,i,l,c=m[e.xaxis._id],u=m[e.yaxis._id],f=[];if(c){i=(n=t._fullLayout[c.axisName])._r,l=c.to,f[0]=(i[0]*(1-r)+r*l[0]-i[0])/(i[1]-i[0])*e.xaxis._length;var h=i[1]-i[0],p=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[2]=e.xaxis._length*(1-r+r*p/h)}else f[0]=0,f[2]=e.xaxis._length;if(u){i=(n=t._fullLayout[u.axisName])._r,l=u.to,f[1]=(i[1]*(1-r)+r*l[1]-i[1])/(i[0]-i[1])*e.yaxis._length;var g=i[1]-i[0],v=l[1]-l[0];n.range[0]=i[0]*(1-r)+r*l[0],n.range[1]=i[1]*(1-r)+r*l[1],f[3]=e.yaxis._length*(1-r+r*v/g)}else f[1]=0,f[3]=e.yaxis._length;!function(e,r){function n(e,r,n){for(i=0;i rect").call(o.setTranslate,k,A).call(o.setScale,1/w,1/M),e.plot.call(o.setTranslate,E,L).call(o.setScale,w,M).selectAll(".points").selectAll(".point").call(o.setPointGroupScale,1/w,1/M),e.plot.selectAll(".points").selectAll(".textpoint").call(o.setTextPointsScale,1/w,1/M)}function h(){b=Date.now();for(var e=Math.min(1,(b-x)/r.duration),n=w(e),a=0;ar.duration?(!function(){for(var e={},r=0;r0?".":"")+i;l.isPlainObject(a)?o(a,e,s,n+1):e(s,i,a)}})}var s=t("../plotly"),l=t("../lib");r.manageCommandObserver=function(t,e,i,a){var o={},s=!0;e&&e._commandObserver&&(o=e._commandObserver),o.cache||(o.cache={}),o.lookupTable={};var c=r.hasSimpleAPICommandBindings(t,i,o.lookupTable);if(e&&e._commandObserver){if(c)return o;if(e._commandObserver.remove)return e._commandObserver.remove(),e._commandObserver=null,o}if(c){n(t,c,o.cache),o.check=function(){if(s){var e=n(t,c,o.cache);return e.changed&&a&&void 0!==o.lookupTable[e.value]&&(o.disable(),Promise.resolve(a({value:e.value,type:c.type,prop:c.prop,traces:c.traces,index:o.lookupTable[e.value]})).then(o.enable,o.enable)),e.changed}};for(var u=["plotly_relayout","plotly_redraw","plotly_restyle","plotly_update","plotly_animatingframe","plotly_afterplot"],f=0;fn*Math.PI/180}return!1},r.getPath=function(){return i.geo.path().projection(r)},r.getBounds=function(t){return r.getPath().bounds(t)},r.fitExtent=function(t,e){var n=t[1][0]-t[0][0],i=t[1][1]-t[0][1],a=r.clipExtent&&r.clipExtent();r.scale(150).translate([0,0]),a&&r.clipExtent(null);var o=r.getBounds(e),s=Math.min(n/(o[1][0]-o[0][0]),i/(o[1][1]-o[0][1])),l=+t[0][0]+(n-s*(o[1][0]+o[0][0]))/2,c=+t[0][1]+(i-s*(o[1][1]+o[0][1]))/2;return a&&r.clipExtent(a),r.scale(150*s).translate([l,c])},r.precision(m.precision),n&&r.clipAngle(n-m.clipPad),r}(e);u.center([c.lon-l.lon,c.lat-l.lat]).rotate([-l.lon,-l.lat,l.roll]).parallels(s.parallels);var f=[[r.l+r.w*n.x[0],r.t+r.h*(1-n.y[1])],[r.l+r.w*n.x[1],r.t+r.h*(1-n.y[0])]],h=e.lonaxis,d=e.lataxis,p=function(t,e){var r=m.clipPad,n=t[0]+r,i=t[1]-r,a=e[0]+r,o=e[1]-r;n>0&&i<0&&(i+=360);var s=(i-n)/4;return{type:"Polygon",coordinates:[[[n,a],[n,o],[n+s,o],[n+2*s,o],[n+3*s,o],[i,o],[i,a],[i-s,a],[i-2*s,a],[i-3*s,a],[n,a]]]}}(h.range,d.range);u.fitExtent(f,p);var g=this.bounds=u.getBounds(p),v=this.fitScale=u.scale(),y=u.translate();if(!isFinite(g[0][0])||!isFinite(g[0][1])||!isFinite(g[1][0])||!isFinite(g[1][1])||isNaN(y[0])||isNaN(y[0])){for(var x=this.graphDiv,b=["projection.rotation","center","lonaxis.range","lataxis.range"],_="Invalid geo settings, relayout'ing to default view.",w={},M=0;M0&&w<0&&(w+=360);var M,k=(_+w)/2;if(!c){var A=u?o.projRotate:[k,0,0];M=r("projection.rotation.lon",A[0]),r("projection.rotation.lat",A[1]),r("projection.rotation.roll",A[2]),r("showcoastlines",!u)&&(r("coastlinecolor"),r("coastlinewidth")),r("showocean")&&r("oceancolor")}var T,S;if(c?(T=-96.6,S=38.7):(T=u?k:M,S=(b[0]+b[1])/2),r("center.lon",T),r("center.lat",S),f){r("projection.parallels",o.projParallels||[0,60])}r("projection.scale"),r("showland")&&r("landcolor"),r("showlakes")&&r("lakecolor"),r("showrivers")&&(r("rivercolor"),r("riverwidth")),r("showcountries",u&&"usa"!==i)&&(r("countrycolor"),r("countrywidth")),("usa"===i||"north america"===i&&50===n)&&(r("showsubunits",!0),r("subunitcolor"),r("subunitwidth")),u||r("showframe",!0)&&(r("framecolor"),r("framewidth")),r("bgcolor")}var i=t("../../subplot_defaults"),a=t("../constants"),o=t("./layout_attributes"),s=a.axesNames;e.exports=function(t,e,r){i(t,e,r,{type:"geo",attributes:o,handleDefaults:n,partition:"y"})}},{"../../subplot_defaults":865,"../constants":818,"./layout_attributes":823}],823:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("../constants"),o=t("../../../plot_api/edit_types").overrideAll,s={range:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},showgrid:{valType:"boolean",dflt:!1},tick0:{valType:"number"},dtick:{valType:"number"},gridcolor:{valType:"color",dflt:n.lightLine},gridwidth:{valType:"number",min:0,dflt:1}};e.exports=o({domain:i({name:"geo"},{}),resolution:{valType:"enumerated",values:[110,50],dflt:110,coerceNumber:!0},scope:{valType:"enumerated",values:Object.keys(a.scopeDefaults),dflt:"world"},projection:{type:{valType:"enumerated",values:Object.keys(a.projNames)},rotation:{lon:{valType:"number"},lat:{valType:"number"},roll:{valType:"number"}},parallels:{valType:"info_array",items:[{valType:"number"},{valType:"number"}]},scale:{valType:"number",min:0,dflt:1}},center:{lon:{valType:"number"},lat:{valType:"number"}},showcoastlines:{valType:"boolean"},coastlinecolor:{valType:"color",dflt:n.defaultLine},coastlinewidth:{valType:"number",min:0,dflt:1},showland:{valType:"boolean",dflt:!1},landcolor:{valType:"color",dflt:a.landColor},showocean:{valType:"boolean",dflt:!1},oceancolor:{valType:"color",dflt:a.waterColor},showlakes:{valType:"boolean",dflt:!1},lakecolor:{valType:"color",dflt:a.waterColor},showrivers:{valType:"boolean",dflt:!1},rivercolor:{valType:"color",dflt:a.waterColor},riverwidth:{valType:"number",min:0,dflt:1},showcountries:{valType:"boolean"},countrycolor:{valType:"color",dflt:n.defaultLine},countrywidth:{valType:"number",min:0,dflt:1},showsubunits:{valType:"boolean"},subunitcolor:{valType:"color",dflt:n.defaultLine},subunitwidth:{valType:"number",min:0,dflt:1},showframe:{valType:"boolean"},framecolor:{valType:"color",dflt:n.defaultLine},framewidth:{valType:"number",min:0,dflt:1},bgcolor:{valType:"color",dflt:n.background},lonaxis:s,lataxis:s},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"../constants":818}],824:[function(t,e,r){"use strict";e.exports=function(t){function e(t,e){return{type:"Feature",id:t.id,properties:t.properties,geometry:r(t.geometry,e)}}function r(e,n){if(!e)return null;if("GeometryCollection"===e.type)return{type:"GeometryCollection",geometries:object.geometries.map(function(t){return r(t,n)})};if(!M.hasOwnProperty(e.type))return null;var i=M[e.type];return t.geo.stream(e,n(i)),i.result()}function n(){}function i(t){return t>1?S:t<-1?-S:Math.asin(t)}function a(t){return t>1?0:t<-1?T:Math.acos(t)}function o(t,e){var r=(2+S)*Math.sin(e);e/=2;for(var n=0,i=1/0;n<10&&Math.abs(i)>k;n++){var a=Math.cos(e);e-=i=(e+Math.sin(e)*(a+2)-r)/(2*a*(1+a))}return[2/Math.sqrt(T*(4+T))*t*(1+Math.cos(e)),2*Math.sqrt(T/(4+T))*Math.sin(e)]}function s(t,e){function r(r,n){var i=D(r/e,n);return i[0]*=t,i}return arguments.length<2&&(e=t),1===e?D:e===1/0?l:(r.invert=function(r,n){var i=D.invert(r/t,n);return i[0]*=e,i},r)}function l(t,e){return[t*Math.cos(e)/Math.cos(e/=2),2*Math.sin(e)]}function c(t,e){return[3*t/(2*T)*Math.sqrt(T*T/3-e*e),e]}function u(t,e){return[t,1.25*Math.log(Math.tan(T/4+.4*e))]}function f(t){return function(e){var r,n=t*Math.sin(e),i=30;do{e-=r=(e+Math.sin(e)-n)/(1+Math.cos(e))}while(Math.abs(r)>k&&--i>0);return e/2}}function h(t,e){var r=e*e,n=r*r;return[t*(.8707-.131979*r+n*(n*(.003971*r-.001529*n)-.013791)),e*(1.007226+r*(.015085+n*(.028874*r-.044475-.005916*n)))]}function d(t,e){var r,n=Math.min(18,36*Math.abs(e)/T),i=Math.floor(n),a=n-i,o=(r=P[i])[0],s=r[1],l=(r=P[++i])[0],c=r[1],u=(r=P[Math.min(19,++i)])[0],f=r[1];return[t*(l+a*(u-o)/2+a*a*(u-2*l+o)/2),(e>0?S:-S)*(c+a*(f-s)/2+a*a*(f-2*c+s)/2)]}function p(t,e){return[t*Math.cos(e),e]}function m(t,e){var r=Math.cos(e),n=function(t){return t?t/Math.sin(t):1}(a(r*Math.cos(t/=2)));return[2*r*Math.sin(t)*n,Math.sin(e)*n]}function g(t,e){var r=m(t,e);return[(r[0]+t/S)/2,(r[1]+e)/2]}t.geo.project=function(t,e){var n=e.stream;if(!n)throw new Error("not yet supported");return(t&&v.hasOwnProperty(t.type)?v[t.type]:r)(t,n)};var v={Feature:e,FeatureCollection:function(t,r){return{type:"FeatureCollection",features:t.features.map(function(t){return e(t,r)})}}},y=[],x=[],b={point:function(t,e){y.push([t,e])},result:function(){var t=y.length?y.length<2?{type:"Point",coordinates:y[0]}:{type:"MultiPoint",coordinates:y}:null;return y=[],t}},_={lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){y.length&&(x.push(y),y=[])},result:function(){var t=x.length?x.length<2?{type:"LineString",coordinates:x[0]}:{type:"MultiLineString",coordinates:x}:null;return x=[],t}},w={polygonStart:n,lineStart:n,point:function(t,e){y.push([t,e])},lineEnd:function(){var t=y.length;if(t){do{y.push(y[0].slice())}while(++t<4);x.push(y),y=[]}},polygonEnd:n,result:function(){if(!x.length)return null;var t=[],e=[];return x.forEach(function(r){!function(t){if((e=t.length)<4)return!1;for(var e,r=0,n=t[e-1][1]*t[0][0]-t[e-1][0]*t[0][1];++rn^d>n&&r<(h-c)*(n-u)/(d-u)+c&&(i=!i)}return i}(t[0],r))return t.push(e),!0})||t.push([e])}),x=[],t.length?t.length>1?{type:"MultiPolygon",coordinates:t}:{type:"Polygon",coordinates:t[0]}:null}},M={Point:b,MultiPoint:b,LineString:_,MultiLineString:_,Polygon:w,MultiPolygon:w,Sphere:w},k=1e-6,A=k*k,T=Math.PI,S=T/2,E=(Math.sqrt(T),T/180),L=180/T,C=t.geo.projection,z=t.geo.projectionMutator;t.geo.interrupt=function(e){function r(t,r){for(var n=r<0?-1:1,i=a[+(r<0)],o=0,s=i.length-1;oi[o][2][0];++o);var l=e(t-i[o][1][0],r);return l[0]+=e(i[o][1][0],n*r>n*i[o][0][1]?i[o][0][1]:r)[0],l}function n(t,e){for(var r,n,i,a=-1,o=t.length,s=t[0],l=[];++a=0;--r){var f;o=180*(f=a[1][r])[0][0]/T,s=180*f[0][1]/T,l=180*f[1][1]/T,c=180*f[2][0]/T,u=180*f[2][1]/T,e.push(n([[c-1e-6,u-1e-6],[c-1e-6,l+1e-6],[o+1e-6,l+1e-6],[o+1e-6,s-1e-6]],30))}return{type:"Polygon",coordinates:[t.merge(e)]}}(),l)},i},o.lobes=function(t){return arguments.length?(a=t.map(function(t){return t.map(function(t){return[[t[0][0]*T/180,t[0][1]*T/180],[t[1][0]*T/180,t[1][1]*T/180],[t[2][0]*T/180,t[2][1]*T/180]]})}),i=a.map(function(t){return t.map(function(t){var r,n=e(t[0][0],t[0][1])[0],i=e(t[2][0],t[2][1])[0],a=e(t[1][0],t[0][1])[1],o=e(t[1][0],t[1][1])[1];return a>o&&(r=a,a=o,o=r),[[n,a],[i,o]]})}),o):a.map(function(t){return t.map(function(t){return[[180*t[0][0]/T,180*t[0][1]/T],[180*t[1][0]/T,180*t[1][1]/T],[180*t[2][0]/T,180*t[2][1]/T]]})})},o},o.invert=function(t,e){var r=.5*e*Math.sqrt((4+T)/T),n=i(r),a=Math.cos(n);return[t/(2/Math.sqrt(T*(4+T))*(1+a)),i((n+r*(a+2))/(2+S))]},(t.geo.eckert4=function(){return C(o)}).raw=o;var D=t.geo.azimuthalEqualArea.raw;l.invert=function(t,e){var r=2*i(e/2);return[t*Math.cos(r/2)/Math.cos(r),r]},(t.geo.hammer=function(){var t=2,e=z(s),r=e(t);return r.coefficient=function(r){return arguments.length?e(t=+r):t},r}).raw=s,c.invert=function(t,e){return[2/3*T*t/Math.sqrt(T*T/3-e*e),e]},(t.geo.kavrayskiy7=function(){return C(c)}).raw=c,u.invert=function(t,e){return[t,2.5*Math.atan(Math.exp(.8*e))-.625*T]},(t.geo.miller=function(){return C(u)}).raw=u,f(T);var I=function(t,e,r){function n(r,n){return[t*r*Math.cos(n=a(n)),e*Math.sin(n)]}var a=f(r);return n.invert=function(n,a){var o=i(a/e);return[n/(t*Math.cos(o)),i((2*o+Math.sin(2*o))/r)]},n}(Math.SQRT2/S,Math.SQRT2,T);(t.geo.mollweide=function(){return C(I)}).raw=I,h.invert=function(t,e){var r,n=e,i=25;do{var a=n*n,o=a*a;n-=r=(n*(1.007226+a*(.015085+o*(.028874*a-.044475-.005916*o)))-e)/(1.007226+a*(.045255+o*(.259866*a-.311325-.005916*11*o)))}while(Math.abs(r)>k&&--i>0);return[t/(.8707+(a=n*n)*(a*(a*a*a*(.003971-.001529*a)-.013791)-.131979)),n]},(t.geo.naturalEarth=function(){return C(h)}).raw=h;var P=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];P.forEach(function(t){t[1]*=1.0144}),d.invert=function(t,e){var r=e/S,n=90*r,i=Math.min(18,Math.abs(n/5)),a=Math.max(0,Math.floor(i));do{var o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],c=l-o,u=l-2*s+o,f=2*(Math.abs(r)-s)/c,h=u/c,d=f*(1-h*f*(1-2*h*f));if(d>=0||1===a){n=(e>=0?5:-5)*(d+i);var p,m=50;do{d=(i=Math.min(18,Math.abs(n)/5))-(a=Math.floor(i)),o=P[a][1],s=P[a+1][1],l=P[Math.min(19,a+2)][1],n-=(p=(e>=0?S:-S)*(s+d*(l-o)/2+d*d*(l-2*s+o)/2)-e)*L}while(Math.abs(p)>A&&--m>0);break}}while(--a>=0);var g=P[a][0],v=P[a+1][0],y=P[Math.min(19,a+2)][0];return[t/(v+d*(y-g)/2+d*d*(y-2*v+g)/2),n*E]},(t.geo.robinson=function(){return C(d)}).raw=d,p.invert=function(t,e){return[t/Math.cos(e),e]},(t.geo.sinusoidal=function(){return C(p)}).raw=p,m.invert=function(t,e){if(!(t*t+4*e*e>T*T+k)){var r=t,n=e,i=25;do{var o,s=Math.sin(r),l=Math.sin(r/2),c=Math.cos(r/2),u=Math.sin(n),f=Math.cos(n),h=Math.sin(2*n),d=u*u,p=f*f,m=l*l,g=1-p*c*c,v=g?a(f*c)*Math.sqrt(o=1/g):o=0,y=2*v*f*l-t,x=v*u-e,b=o*(p*m+v*f*c*d),_=o*(.5*s*h-2*v*u*l),w=.25*o*(h*l-v*u*p*s),M=o*(d*c+v*m*f),A=_*w-M*b;if(!A)break;var S=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=S,n-=E}while((Math.abs(S)>k||Math.abs(E)>k)&&--i>0);return[r,n]}},(t.geo.aitoff=function(){return C(m)}).raw=m,g.invert=function(t,e){var r=t,n=e,i=25;do{var o,s=Math.cos(n),l=Math.sin(n),c=Math.sin(2*n),u=l*l,f=s*s,h=Math.sin(r),d=Math.cos(r/2),p=Math.sin(r/2),m=p*p,g=1-f*d*d,v=g?a(s*d)*Math.sqrt(o=1/g):o=0,y=.5*(2*v*s*p+r/S)-t,x=.5*(v*l+n)-e,b=.5*o*(f*m+v*s*d*u)+.5/S,_=o*(h*c/4-v*l*p),w=.125*o*(c*p-v*l*f*h),M=.5*o*(u*d+v*m*s)+.5,A=_*w-M*b,T=(x*_-y*M)/A,E=(y*w-x*b)/A;r-=T,n-=E}while((Math.abs(T)>k||Math.abs(E)>k)&&--i>0);return[r,n]},(t.geo.winkel3=function(){return C(g)}).raw=g}},{}],825:[function(t,e,r){"use strict";function n(t,e){return d.behavior.zoom().translate(e.translate()).scale(e.scale())}function i(t,e,r){function n(t,e){var r=p.nestedProperty(s,t);r.get()!==e&&(r.set(e),p.nestedProperty(o,t).set(e),l[i+"."+t]=e)}var i=t.id,a=t.graphDiv,o=a.layout[i],s=a._fullLayout[i],l={};r(n),n("projection.scale",e.scale()/t.fitScale),a.emit("plotly_relayout",l)}function a(t,e){function r(r){var n=e.invert(t.midPt);r("center.lon",n[0]),r("center.lat",n[1])}var a=n(0,e);return a.on("zoomstart",function(){d.select(this).style(v)}).on("zoom",function(){e.scale(d.event.scale).translate(d.event.translate),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,r)}),a}function o(t,e){function r(t){return e.invert(t)}function a(r){var n=e.rotate(),i=e.invert(t.midPt);r("projection.rotation.lon",-n[0]),r("center.lon",i[0]),r("center.lat",i[1])}var o,s,l,c,u,f,h,p,m=n(0,e),g=2;return m.on("zoomstart",function(){d.select(this).style(v),o=d.mouse(this),s=e.rotate(),l=e.translate(),c=s,u=r(o)}).on("zoom",function(){if(f=d.mouse(this),function(t){var n=e(r(t));return Math.abs(n[0]-t[0])>g||Math.abs(n[1]-t[1])>g}(o))return m.scale(e.scale()),void m.translate(e.translate());e.scale(d.event.scale),e.translate([l[0],d.event.translate[1]]),u?r(f)&&(p=r(f),h=[c[0]+(p[0]-u[0]),s[1],s[2]],e.rotate(h),c=h):u=r(o=f),t.render()}).on("zoomend",function(){d.select(this).style(y),i(t,e,a)}),m}function s(t,e){function r(t){var r=e.rotate();t("projection.rotation.lon",-r[0]),t("projection.rotation.lat",-r[1])}var a,o={r:e.rotate(),k:e.scale()},s=n(0,e),u=function(t){var e=0,r=arguments.length,n=[];for(;++em?(a=(h>0?90:-90)-p,i=0):(a=Math.asin(h/m)*g-p,i=Math.sqrt(m*m-h*h));var v=180-a-2*p,y=(Math.atan2(d,u)-Math.atan2(l,i))*g,x=(Math.atan2(d,u)-Math.atan2(l,-i))*g,b=c(r[0],r[1],a,y),_=c(r[0],r[1],v,x);return b<=_?[a,y,r[2]]:[v,x,r[2]]}(v,a,n);isFinite(x[0])&&isFinite(x[1])&&isFinite(x[2])||(x=n),e.rotate(x),n=x}}else a=l(e,t=s);!function(t){t({type:"zoom"})}(u.of(this,arguments))}),function(t){p++||t({type:"zoomstart"})}(u.of(this,arguments))}).on("zoomend",function(){d.select(this).style(y),x.call(s,"zoom",null),function(t){--p||t({type:"zoomend"})}(u.of(this,arguments)),i(t,e,r)}).on("zoom.redraw",function(){t.render()}),d.rebind(s,u,"on")}function l(t,e){var r=t.invert(e);return r&&isFinite(r[0])&&isFinite(r[1])&&function(t){var e=t[0]*m,r=t[1]*m,n=Math.cos(r);return[n*Math.cos(e),n*Math.sin(e),Math.sin(r)]}(r)}function c(t,e,r,n){var i=u(r-t),a=u(n-e);return Math.sqrt(i*i+a*a)}function u(t){return(t%360+540)%360-180}function f(t,e,r){var n=r*m,i=t.slice(),a=0===e?1:0,o=2===e?1:2,s=Math.cos(n),l=Math.sin(n);return i[a]=t[a]*s-t[o]*l,i[o]=t[o]*s+t[a]*l,i}function h(t,e){for(var r=0,n=0,i=t.length;nMath.abs(u)?(c.boxEnd[1]=c.boxStart[1]+Math.abs(s)*_*(u>=0?1:-1),c.boxEnd[1]f[3]&&(c.boxEnd[1]=f[3],c.boxEnd[0]=c.boxStart[0]+(f[3]-c.boxStart[1])/Math.abs(_))):(c.boxEnd[0]=c.boxStart[0]+Math.abs(u)/_*(s>=0?1:-1),c.boxEnd[0]f[2]&&(c.boxEnd[0]=f[2],c.boxEnd[1]=c.boxStart[1]+(f[2]-c.boxStart[0])*Math.abs(_)))}}else c.boxEnabled?(s=c.boxStart[0]!==c.boxEnd[0],u=c.boxStart[1]!==c.boxEnd[1],s||u?(s&&(a(0,c.boxStart[0],c.boxEnd[0]),t.xaxis.autorange=!1),u&&(a(1,c.boxStart[1],c.boxEnd[1]),t.yaxis.autorange=!1),t.relayoutCallback()):t.glplot.setDirty(),c.boxEnabled=!1,c.boxInited=!1):c.boxInited&&(c.boxInited=!1);break;case"pan":c.boxEnabled=!1,c.boxInited=!1,r?(c.panning||(c.dragStart[0]=n,c.dragStart[1]=i),Math.abs(c.dragStart[0]-n)h[p+2]&&(h[p]=-1,h[p+2]=1),(d=this[b[p]])._length=o.viewBox[p+2]-o.viewBox[p],s.doAutoRange(d),d.setScale();y(l),o.ticks=this.computeTickMarks(),o.dataBox=this.calcDataBox(),o.merge(r),n.update(o),this.glplot.draw()},w.calcDataBox=function(){var t=this.xaxis,e=this.yaxis,r=t.range,n=e.range,i=t.r2l,a=e.r2l;return[i(r[0]),a(n[0]),i(r[1]),a(n[1])]},w.setRanges=function(t){var e=this.xaxis,r=this.yaxis,n=e.l2r,i=r.l2r;e.range=[n(t[0]),n(t[2])],r.range=[i(t[1]),i(t[3])]},w.updateTraces=function(t,e){var r,n,i,a=Object.keys(this.traces);this.fullData=t;t:for(r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*p.rotateSpeed/window.innerWidth);else{var o=-p.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}},!0),p};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset")},{"3d-view":40,"mouse-change":443,"mouse-event-offset":444,"mouse-wheel":446,"right-now":509}],832:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../components/fx/layout_attributes"),a=t("./scene"),o=t("../get_data").getSubplotData,s=t("../../lib"),l=t("../../constants/xmlns_namespaces");r.name="gl3d",r.attr="scene",r.idRoot="scene",r.idRegex=r.attrRegex=s.counterRegex("scene"),r.attributes=t("./layout/attributes"),r.layoutAttributes=t("./layout/layout_attributes"),r.baseLayoutAttrOverrides=n({hoverlabel:i.hoverlabel},"plot","nested"),r.supplyLayoutDefaults=t("./layout/defaults"),r.plot=function(t){for(var e=t._fullLayout,r=t._fullData,n=e._subplots.gl3d,i=0;i1;s(t,e,r,{type:"gl3d",attributes:c,handleDefaults:n,fullLayout:e,font:e.font,fullData:r,getDfltFromLayout:function(e){if(!a)return i.validate(t[e],c[e])?t[e]:void 0},paper_bgcolor:e.paper_bgcolor,calendar:e.calendar})}},{"../../../components/color":618,"../../../lib":743,"../../../registry":873,"../../subplot_defaults":865,"./axis_defaults":835,"./layout_attributes":838}],838:[function(t,e,r){"use strict";function n(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"}}var i=t("./axis_attributes"),a=t("../../domain_attributes"),o=t("../../../lib/extend").extendFlat,s=t("../../../lib").counterRegex;e.exports={_arrayAttrRegexps:[s("scene",".annotations",!0)],bgcolor:{valType:"color",dflt:"rgba(0,0,0,0)",editType:"plot"},camera:{up:o(n(0,0,1),{}),center:o(n(0,0,0),{}),eye:o(n(1.25,1.25,1.25),{}),editType:"camera"},domain:a({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:i,yaxis:i,zaxis:i,dragmode:{valType:"enumerated",values:["orbit","turntable","zoom","pan",!1],dflt:"turntable",editType:"plot"},hovermode:{valType:"enumerated",values:["closest",!1],dflt:"closest",editType:"modebar"},editType:"plot",_deprecated:{cameraposition:{valType:"info_array",editType:"camera"}}}},{"../../../lib":743,"../../../lib/extend":732,"../../domain_attributes":815,"./axis_attributes":834}],839:[function(t,e,r){"use strict";function n(){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]}var i=t("../../../lib/str2rgbarray"),a=["xaxis","yaxis","zaxis"];n.prototype.merge=function(t){for(var e=0;e<3;++e){var r=t[a[e]];r.visible?(this.enabled[e]=r.showspikes,this.colors[e]=i(r.spikecolor),this.drawSides[e]=r.spikesides,this.lineWidth[e]=r.spikethickness):(this.enabled[e]=!1,this.drawSides[e]=!1)}},e.exports=function(t){var e=new n;return e.merge(t),e}},{"../../../lib/str2rgbarray":765}],840:[function(t,e,r){"use strict";e.exports=function(t){for(var e=t.axesOptions,r=t.glplot.axesPixels,l=t.fullSceneLayout,c=[[],[],[]],u=0;u<3;++u){var f=l[o[u]];if(f._length=(r[u].hi-r[u].lo)*r[u].pixelsPerDataUnit/t.dataScale[u],Math.abs(f._length)===1/0)c[u]=[];else{f.range[0]=r[u].lo/t.dataScale[u],f.range[1]=r[u].hi/t.dataScale[u],f._m=1/(t.dataScale[u]*r[u].pixelsPerDataUnit),f.range[0]===f.range[1]&&(f.range[0]-=1,f.range[1]+=1);var h=f.tickmode;if("auto"===f.tickmode){f.tickmode="linear";var d=f.nticks||i.constrain(f._length/40,4,9);n.autoTicks(f,Math.abs(f.range[1]-f.range[0])/d)}for(var p=n.calcTicks(f),m=0;mh[1][s]?d[s]=1:h[1][s]===h[0][s]?d[s]=1:d[s]=1/(h[1][s]-h[0][s]);for(this.dataScale=d,this.convertAnnotations(this),a=0;am[1][a])m[0][a]=-1,m[1][a]=1;else{var T=m[1][a]-m[0][a];m[0][a]-=T/32,m[1][a]+=T/32}}else{var S=l.range;m[0][a]=l.r2l(S[0]),m[1][a]=l.r2l(S[1])}m[0][a]===m[1][a]&&(m[0][a]-=1,m[1][a]+=1),v[a]=m[1][a]-m[0][a],this.glplot.bounds[0][a]=m[0][a]*d[a],this.glplot.bounds[1][a]=m[1][a]*d[a]}var E=[1,1,1];for(a=0;a<3;++a){var L=y[c=(l=u[k[a]]).type];E[a]=Math.pow(L.acc,1/L.count)/d[a]}var C;if("auto"===u.aspectmode)C=Math.max.apply(null,E)/Math.min.apply(null,E)<=4?E:[1,1,1];else if("cube"===u.aspectmode)C=[1,1,1];else if("data"===u.aspectmode)C=E;else{if("manual"!==u.aspectmode)throw new Error("scene.js aspectRatio was not one of the enumerated types");var z=u.aspectratio;C=[z.x,z.y,z.z]}u.aspectratio.x=f.aspectratio.x=C[0],u.aspectratio.y=f.aspectratio.y=C[1],u.aspectratio.z=f.aspectratio.z=C[2],this.glplot.aspect=C;var D=u.domain||null,I=e._size||null;if(D&&I){var P=this.container.style;P.position="absolute",P.left=I.l+D.x[0]*I.w+"px",P.top=I.t+(1-D.y[1])*I.h+"px",P.width=I.w*(D.x[1]-D.x[0])+"px",P.height=I.h*(D.y[1]-D.y[0])+"px"}this.glplot.redraw()}},M.destroy=function(){this.glplot&&(this.camera.mouseListener.enabled=!1,this.container.removeEventListener("wheel",this.camera.wheelListener),this.camera=this.glplot.camera=null,this.glplot.dispose(),this.container.parentNode.removeChild(this.container),this.glplot=null)},M.getCamera=function(){return this.glplot.camera.view.recalcMatrix(this.camera.view.lastT()),s(this.glplot.camera)},M.setCamera=function(t){this.glplot.camera.lookAt.apply(this,function(t){return[[t.eye.x,t.eye.y,t.eye.z],[t.center.x,t.center.y,t.center.z],[t.up.x,t.up.y,t.up.z]]}(t))},M.saveCamera=function(t){function e(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 r=this.getCamera(),n=d.nestedProperty(t,this.id+".camera"),i=n.get(),a=!1;if(void 0===i)a=!0;else for(var o=0;o<3;o++)for(var s=0;s<3;s++)if(!e(r,i,o,s)){a=!0;break}return a&&n.set(r),a},M.updateFx=function(t,e){var r=this.camera;r&&("orbit"===t?(r.mode="orbit",r.keyBindingMode="rotate"):"turntable"===t?(r.up=[0,0,1],r.mode="turntable",r.keyBindingMode="rotate"):r.keyBindingMode=t),this.fullSceneLayout.hovermode=e},M.toImage=function(t){t||(t="png"),this.staticMode&&this.container.appendChild(l),this.glplot.redraw();var e=this.glplot.gl,r=e.drawingBufferWidth,n=e.drawingBufferHeight;e.bindFramebuffer(e.FRAMEBUFFER,null);var i=new Uint8Array(r*n*4);e.readPixels(0,0,r,n,e.RGBA,e.UNSIGNED_BYTE,i);for(var a=0,o=n-1;a0}var a=t("../../lib"),o=t("./convert_text_opts"),s=n.prototype;s.update=function(t){this.visible?this.needsNewSource(t)?(this.updateLayer(t),this.updateSource(t)):this.needsNewLayer(t)&&this.updateLayer(t):(this.updateSource(t),this.updateLayer(t)),this.updateStyle(t),this.visible=i(t)},s.needsNewSource=function(t){return this.sourceType!==t.sourcetype||this.source!==t.source||this.layerType!==t.type},s.needsNewLayer=function(t){return this.layerType!==t.type||this.below!==t.below},s.updateSource=function(t){var e=this.map;if(e.getSource(this.idSource)&&e.removeSource(this.idSource),this.sourceType=t.sourcetype,this.source=t.source,i(t)){var r=function(t){var e,r=t.sourcetype,n=t.source,i={type:r};return"geojson"===r?e="data":"vector"===r&&(e="string"==typeof n?"url":"tiles"),i[e]=n,i}(t);e.addSource(this.idSource,r)}},s.updateLayer=function(t){var e=this.map;if(e.getLayer(this.idLayer)&&e.removeLayer(this.idLayer),this.layerType=t.type,i(t)){e.addLayer({id:this.idLayer,source:this.idSource,"source-layer":t.sourcelayer||"",type:t.type},t.below);this.mapbox.setOptions(this.idLayer,"setLayoutProperty",{visibility:"visible"})}},s.updateStyle=function(t){var e=function(t){var e={},r={};switch(t.type){case"circle":a.extendFlat(r,{"circle-radius":t.circle.radius,"circle-color":t.color,"circle-opacity":t.opacity});break;case"line":a.extendFlat(r,{"line-width":t.line.width,"line-color":t.color,"line-opacity":t.opacity});break;case"fill":a.extendFlat(r,{"fill-color":t.color,"fill-outline-color":t.fill.outlinecolor,"fill-opacity":t.opacity});break;case"symbol":var n=t.symbol,i=o(n.textposition,n.iconsize);a.extendFlat(e,{"icon-image":n.icon+"-15","icon-size":n.iconsize/10,"text-field":n.text,"text-size":n.textfont.size,"text-anchor":i.anchor,"text-offset":i.offset}),a.extendFlat(r,{"icon-color":t.color,"text-color":n.textfont.color,"text-opacity":t.opacity})}return{layout:e,paint:r}}(t);i(t)&&(this.mapbox.setOptions(this.idLayer,"setLayoutProperty",e.layout),this.mapbox.setOptions(this.idLayer,"setPaintProperty",e.paint))},s.dispose=function(){var t=this.map;t.removeLayer(this.idLayer),t.removeSource(this.idSource)},e.exports=function(t,e,r){var i=new n(t,e);return i.update(r),i}},{"../../lib":743,"./convert_text_opts":845}],848:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../../components/color").defaultLine,a=t("../domain_attributes"),o=t("../font_attributes"),s=t("../../traces/scatter/attributes").textposition,l=t("../../plot_api/edit_types").overrideAll,c=o({});c.family.dflt="Open Sans Regular, Arial Unicode MS Regular",e.exports=l({_arrayAttrRegexps:[n.counterRegex("mapbox",".layers",!0)],domain:a({name:"mapbox"}),accesstoken:{valType:"string",noBlank:!0,strict:!0},style:{valType:"any",values:["basic","streets","outdoors","light","dark","satellite","satellite-streets"],dflt:"basic"},center:{lon:{valType:"number",dflt:0},lat:{valType:"number",dflt:0}},zoom:{valType:"number",dflt:1},bearing:{valType:"number",dflt:0},pitch:{valType:"number",dflt:0},layers:{_isLinkedToArray:"layer",sourcetype:{valType:"enumerated",values:["geojson","vector"],dflt:"geojson"},source:{valType:"any"},sourcelayer:{valType:"string",dflt:""},type:{valType:"enumerated",values:["circle","line","fill","symbol"],dflt:"circle"},below:{valType:"string",dflt:""},color:{valType:"color",dflt:i},opacity:{valType:"number",min:0,max:1,dflt:1},circle:{radius:{valType:"number",dflt:15}},line:{width:{valType:"number",dflt:2}},fill:{outlinecolor:{valType:"color",dflt:i}},symbol:{icon:{valType:"string",dflt:"marker"},iconsize:{valType:"number",dflt:10},text:{valType:"string",dflt:""},textfont:c,textposition:n.extendFlat({},s,{arrayOk:!1})}}},"plot","from-root")},{"../../components/color":618,"../../lib":743,"../../plot_api/edit_types":773,"../../traces/scatter/attributes":1066,"../domain_attributes":815,"../font_attributes":816}],849:[function(t,e,r){"use strict";function n(t,e,r){r("accesstoken"),r("style"),r("center.lon"),r("center.lat"),r("zoom"),r("bearing"),r("pitch"),function(t,e){function r(t,e){return i.coerce(n,a,o.layers,t,e)}var n,a,s=t.layers||[],l=e.layers=[];for(var c=0;c=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(){p.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()?" - ":"")}},p.sendDataToCloud=function(t){t.emit("plotly_beforeexport");var e=window.PLOTLYENV&&window.PLOTLYENV.BASE_URL||"https://plot.ly",r=i.select(t).append("div").attr("id","hiddenform").style("display","none"),n=r.append("form").attr({action:e+"/external",method:"post",target:"_blank"});return n.append("input").attr({type:"text",name:"data"}).node().value=p.graphJson(t,!1,"keepdata"),n.node().submit(),r.remove(),t.emit("plotly_afterexport"),!1},p.supplyDefaults=function(t){var e,r=t._fullLayout||{},n=t._fullLayout={},a=t.layout||{},o=t._fullData||[],s=t._fullData=[],h=t.data||[];t._transitionData||p.createTransitionData(t),n._dfltTitle={plot:f(t,"Click to enter Plot title"),x:f(t,"Click to enter X axis title"),y:f(t,"Click to enter Y axis title"),colorbar:f(t,"Click to enter Colorscale title"),annotation:f(t,"new text")},n._traceWord=f(t,"trace");var d=function(t){function e(t){for(var e=!0,r=0;r=0)return!0}return!1},p.cleanPlot=function(t,e,r,n){var i,a,o=n._basePlotModules||[];for(i=0;i0){var c=function(t){var e,r={left:0,right:0,bottom:0,top:0};if(t)for(e in t)t.hasOwnProperty(e)&&(r.left+=t[e].left||0,r.right+=t[e].right||0,r.bottom+=t[e].bottom||0,r.top+=t[e].top||0);return r}(t._boundingBoxMargins),f=c.left+c.right,h=c.bottom+c.top,d=1-2*s,m=r._container&&r._container.node?r._container.node().getBoundingClientRect():{width:r.width,height:r.height};n=Math.round(d*(m.width-f)),i=Math.round(d*(m.height-h))}else{var g=l?window.getComputedStyle(t):{};n=parseFloat(g.width)||r.width,i=parseFloat(g.height)||r.height}var v=p.layoutAttributes.width.min,y=p.layoutAttributes.height.min;n1,b=!e.height&&Math.abs(r.height-i)>1;(b||x)&&(x&&(r.width=n),b&&(r.height=i)),t._initialAutoSize||(t._initialAutoSize={width:n,height:i}),p.sanitizeMargins(r)},p.supplyLayoutModuleDefaults=function(t,e,r,n){var i,a,o,s=l.componentsRegistry,c=e._basePlotModules,u=l.subplotsRegistry.cartesian;for(i in s)(o=s[i]).includeBasePlot&&o.includeBasePlot(t,e);for(c.length||c.push(u),e._has("cartesian")&&u.finalizeSubplots(t,e),a=0;a.5*n.width&&(r.l=r.r=0),r.b+r.t>.5*n.height&&(r.b=r.t=0),n._pushmargin[e]={l:{val:r.x,size:r.l+i},r:{val:r.x,size:r.r+i},b:{val:r.y,size:r.b+i},t:{val:r.y,size:r.t+i}}}else delete n._pushmargin[e];n._replotting||p.doAutoMargin(t)}},p.doAutoMargin=function(t){var e=t._fullLayout;e._size||(e._size={}),e._pushmargin||(e._pushmargin={});var r=e._size,n=JSON.stringify(r),i=Math.max(e.margin.l||0,0),s=Math.max(e.margin.r||0,0),l=Math.max(e.margin.t||0,0),c=Math.max(e.margin.b||0,0),u=e._pushmargin;if(!1!==e.margin.autoexpand){u.base={l:{val:0,size:i},r:{val:1,size:s},t:{val:1,size:l},b:{val:0,size:c}};for(var f in u){var h=u[f].l||{},d=u[f].b||{},p=h.val,m=h.size,g=d.val,v=d.size;for(var y in u){if(a(m)&&u[y].r){var x=u[y].r.val,b=u[y].r.size;if(x>p){var _=(m*x+(b-e.width)*p)/(x-p),w=(b*(1-p)+(m-e.width)*(1-x))/(x-p);_>=0&&w>=0&&_+w>i+s&&(i=_,s=w)}}if(a(v)&&u[y].t){var M=u[y].t.val,k=u[y].t.size;if(M>g){var A=(v*M+(k-e.height)*g)/(M-g),T=(k*(1-g)+(v-e.height)*(1-M))/(M-g);A>=0&&T>=0&&A+T>c+l&&(c=A,l=T)}}}}}if(r.l=Math.round(i),r.r=Math.round(s),r.t=Math.round(l),r.b=Math.round(c),r.p=Math.round(e.margin.pad),r.w=Math.round(e.width)-r.l-r.r,r.h=Math.round(e.height)-r.t-r.b,!e._replotting&&"{}"!==n&&n!==JSON.stringify(e._size))return o.plot(t)},p.graphJson=function(t,e,r,n,i){function a(t){if("function"==typeof t)return null;if(u.isPlainObject(t)){var e,n,i={};for(e in t)if("function"!=typeof t[e]&&-1===["_","["].indexOf(e.charAt(0))){if("keepdata"===r){if("src"===e.substr(e.length-3))continue}else if("keepstream"===r){if("string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0&&!u.isPlainObject(t.stream))continue}else if("keepall"!==r&&"string"==typeof(n=t[e+"src"])&&n.indexOf(":")>0)continue;i[e]=a(t[e])}return i}return Array.isArray(t)?t.map(a):u.isJSDate(t)?u.ms2DateTimeLocal(+t):t}(i&&e&&!t._fullData||i&&!e&&!t._fullLayout)&&p.supplyDefaults(t);var o=i?t._fullData:t.data,s=i?t._fullLayout:t.layout,l=(t._transitionData||{})._frames,c={data:(o||[]).map(function(t){var r=a(t);return e&&delete r.fit,r})};return e||(c.layout=a(s)),t.framework&&t.framework.isPolar&&(c=t.framework.getConfig()),l&&(c.frames=a(l)),"object"===n?c:JSON.stringify(c)},p.modifyFrames=function(t,e){var r,n,i,a=t._transitionData._frames,o=t._transitionData._frameHash;for(r=0;r0&&(t._transitioningWithDuration=!0),t._transitionData._interruptCallbacks.push(function(){d=!0}),i.redraw&&t._transitionData._interruptCallbacks.push(function(){return o.redraw(t)}),t._transitionData._interruptCallbacks.push(function(){t.emit("plotly_transitioninterrupted",[])});var s,l,c=0,f=0,p=t._fullLayout._basePlotModules,m=!1;if(r)for(l=0;l=0;o--)if(_[o].enabled){r._indexToPoints=_[o]._indexToPoints;break}i&&i.calc&&(b=i.calc(t,r))}Array.isArray(b)&&b[0]||(b=[{x:d,y:d}]),b[0].t||(b[0].t={}),b[0].trace=r,p[a]=b}l.getComponentMethod("fx","calc")(t)},p.rehover=function(t){t._fullLayout._rehover&&t._fullLayout._rehover()},p.generalUpdatePerTraceModule=function(t,e,r,n){var i,a=e.traceHash,o={};for(i=0;i=0?h.angularAxis.domain:n.extent(M),E=Math.abs(M[1]-M[0]);A&&!k&&(E=0);var L=S.slice();T&&k&&(L[1]+=E);var C=h.angularAxis.ticksCount||4;C>8&&(C=C/(C/8)+C%8),h.angularAxis.ticksStep&&(C=(L[1]-L[0])/C);var z=h.angularAxis.ticksStep||(L[1]-L[0])/(C*(h.minorTicks+1));w&&(z=Math.max(Math.round(z),1)),L[2]||(L[2]=z);var D=n.range.apply(this,L);if(D=D.map(function(t,e){return parseFloat(t.toPrecision(12))}),s=n.scale.linear().domain(L.slice(0,2)).range("clockwise"===h.direction?[0,360]:[360,0]),u.layout.angularAxis.domain=s.domain(),u.layout.angularAxis.endPadding=T?E:0,void 0===(t=n.select(this).select("svg.chart-root"))||t.empty()){var I=(new DOMParser).parseFromString("' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '' + '","application/xml"),P=this.appendChild(this.ownerDocument.importNode(I.documentElement,!0));t=n.select(P)}t.select(".guides-group").style({"pointer-events":"none"}),t.select(".angular.axis-group").style({"pointer-events":"none"}),t.select(".radial.axis-group").style({"pointer-events":"none"});var O,F=t.select(".chart-group"),R={fill:"none",stroke:h.tickColor},N={"font-size":h.font.size,"font-family":h.font.family,fill:h.font.color,"text-shadow":["-1px 0px","1px -1px","-1px 1px","1px 1px"].map(function(t,e){return" "+t+" 0 "+h.font.outlineColor}).join(",")};if(h.showLegend){O=t.select(".legend-group").attr({transform:"translate("+[x,h.margin.top]+")"}).style({display:"block"});var j=p.map(function(t,e){var r=o.util.cloneJson(t);return r.symbol="DotPlot"===t.geometry?t.dotType||"circle":"LinePlot"!=t.geometry?"square":"line",r.visibleInLegend=void 0===t.visibleInLegend||t.visibleInLegend,r.color="LinePlot"===t.geometry?t.strokeColor:t.color,r});o.Legend().config({data:p.map(function(t,e){return t.name||"Element"+e}),legendConfig:i({},o.Legend.defaultConfig().legendConfig,{container:O,elements:j,reverseOrder:h.legend.reverseOrder})})();var B=O.node().getBBox();x=Math.min(h.width-B.width-h.margin.left-h.margin.right,h.height-h.margin.top-h.margin.bottom)/2,x=Math.max(10,x),_=[h.margin.left+x,h.margin.top+x],r.range([0,x]),u.layout.radialAxis.domain=r.domain(),O.attr("transform","translate("+[_[0]+x,_[1]-x]+")")}else O=t.select(".legend-group").style({display:"none"});t.attr({width:h.width,height:h.height}).style({opacity:h.opacity}),F.attr("transform","translate("+_+")").style({cursor:"crosshair"});var U=[(h.width-(h.margin.left+h.margin.right+2*x+(B?B.width:0)))/2,(h.height-(h.margin.top+h.margin.bottom+2*x))/2];if(U[0]=Math.max(0,U[0]),U[1]=Math.max(0,U[1]),t.select(".outer-group").attr("transform","translate("+U+")"),h.title){var V=t.select("g.title-group text").style(N).text(h.title),q=V.node().getBBox();V.attr({x:_[0]-q.width/2,y:_[1]-x-20})}var H=t.select(".radial.axis-group");if(h.radialAxis.gridLinesVisible){var G=H.selectAll("circle.grid-circle").data(r.ticks(5));G.enter().append("circle").attr({class:"grid-circle"}).style(R),G.attr("r",r),G.exit().remove()}H.select("circle.outside-circle").attr({r:x}).style(R);var Y=t.select("circle.background-circle").attr({r:x}).style({fill:h.backgroundColor,stroke:h.stroke});if(h.radialAxis.visible){var W=n.svg.axis().scale(r).ticks(5).tickSize(5);H.call(W).attr({transform:"rotate("+h.radialAxis.orientation+")"}),H.selectAll(".domain").style(R),H.selectAll("g>text").text(function(t,e){return this.textContent+h.radialAxis.ticksSuffix}).style(N).style({"text-anchor":"start"}).attr({x:0,y:0,dx:0,dy:0,transform:function(t,e){return"horizontal"===h.radialAxis.tickOrientation?"rotate("+-h.radialAxis.orientation+") translate("+[0,N["font-size"]]+")":"translate("+[0,N["font-size"]]+")"}}),H.selectAll("g>line").style({stroke:"black"})}var X=t.select(".angular.axis-group").selectAll("g.angular-tick").data(D),Z=X.enter().append("g").classed("angular-tick",!0);X.attr({transform:function(t,e){return"rotate("+c(t)+")"}}).style({display:h.angularAxis.visible?"block":"none"}),X.exit().remove(),Z.append("line").classed("grid-line",!0).classed("major",function(t,e){return e%(h.minorTicks+1)==0}).classed("minor",function(t,e){return!(e%(h.minorTicks+1)==0)}).style(R),Z.selectAll(".minor").style({stroke:h.minorTickColor}),X.select("line.grid-line").attr({x1:h.tickLength?x-h.tickLength:0,x2:x}).style({display:h.angularAxis.gridLinesVisible?"block":"none"}),Z.append("text").classed("axis-text",!0).style(N);var J=X.select("text.axis-text").attr({x:x+h.labelOffset,dy:a+"em",transform:function(t,e){var r=c(t),n=x+h.labelOffset,i=h.angularAxis.tickOrientation;return"horizontal"==i?"rotate("+-r+" "+n+" 0)":"radial"==i?r<270&&r>90?"rotate(180 "+n+" 0)":null:"rotate("+(r<=180&&r>0?-90:90)+" "+n+" 0)"}}).style({"text-anchor":"middle",display:h.angularAxis.labelsVisible?"block":"none"}).text(function(t,e){return e%(h.minorTicks+1)!=0?"":w?w[t]+h.angularAxis.ticksSuffix:t+h.angularAxis.ticksSuffix}).style(N);h.angularAxis.rewriteTicks&&J.text(function(t,e){return e%(h.minorTicks+1)!=0?"":h.angularAxis.rewriteTicks(this.textContent,e)});var K=n.max(F.selectAll(".angular-tick text")[0].map(function(t,e){return t.getCTM().e+t.getBBox().width}));O.attr({transform:"translate("+[x+K,h.margin.top]+")"});var Q=t.select("g.geometry-group").selectAll("g").size()>0,$=t.select("g.geometry-group").selectAll("g.geometry").data(p);if($.enter().append("g").attr({class:function(t,e){return"geometry geometry"+e}}),$.exit().remove(),p[0]||Q){var tt=[];p.forEach(function(t,e){var n={};n.radialScale=r,n.angularScale=s,n.container=$.filter(function(t,r){return r==e}),n.geometry=t.geometry,n.orientation=h.orientation,n.direction=h.direction,n.index=e,tt.push({data:t,geometryConfig:n})});var et=[];n.nest().key(function(t,e){return void 0!==t.data.groupId||"unstacked"}).entries(tt).forEach(function(t,e){"unstacked"===t.key?et=et.concat(t.values.map(function(t,e){return[t]})):et.push(t.values)}),et.forEach(function(t,e){var r;r=Array.isArray(t)?t[0].geometryConfig.geometry:t.geometryConfig.geometry;var n=t.map(function(t,e){return i(o[r].defaultConfig(),t)});o[r]().config(n)()})}var rt,nt,it=t.select(".guides-group"),at=t.select(".tooltips-group"),ot=o.tooltipPanel().config({container:at,fontSize:8})(),st=o.tooltipPanel().config({container:at,fontSize:8})(),lt=o.tooltipPanel().config({container:at,hasTick:!0})();if(!k){var ct=it.select("line").attr({x1:0,y1:0,y2:0}).style({stroke:"grey","pointer-events":"none"});F.on("mousemove.angular-guide",function(t,e){var r=o.util.getMousePos(Y).angle;ct.attr({x2:-x,transform:"rotate("+r+")"}).style({opacity:.5});var n=(r+180+360-h.orientation)%360;rt=s.invert(n);var i=o.util.convertToCartesian(x+12,r+180);ot.text(o.util.round(rt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.angular-guide",function(t,e){it.select("line").style({opacity:0})})}var ut=it.select("circle").style({stroke:"grey",fill:"none"});F.on("mousemove.radial-guide",function(t,e){var n=o.util.getMousePos(Y).radius;ut.attr({r:n}).style({opacity:.5}),nt=r.invert(o.util.getMousePos(Y).radius);var i=o.util.convertToCartesian(n,h.radialAxis.orientation);st.text(o.util.round(nt)).move([i[0]+_[0],i[1]+_[1]])}).on("mouseout.radial-guide",function(t,e){ut.style({opacity:0}),lt.hide(),ot.hide(),st.hide()}),t.selectAll(".geometry-group .mark").on("mouseover.tooltip",function(e,r){var i=n.select(this),a=this.style.fill,s="black",l=this.style.opacity||1;if(i.attr({"data-opacity":l}),a&&"none"!==a){i.attr({"data-fill":a}),s=n.hsl(a).darker().toString(),i.style({fill:s,opacity:1});var c={t:o.util.round(e[0]),r:o.util.round(e[1])};k&&(c.t=w[e[0]]);var u="t: "+c.t+", r: "+c.r,f=this.getBoundingClientRect(),h=t.node().getBoundingClientRect(),d=[f.left+f.width/2-U[0]-h.left,f.top+f.height/2-U[1]-h.top];lt.config({color:s}).text(u),lt.move(d)}else a=this.style.stroke||"black",i.attr({"data-stroke":a}),s=n.hsl(a).darker().toString(),i.style({stroke:s,opacity:1})}).on("mousemove.tooltip",function(t,e){if(0!=n.event.which)return!1;n.select(this).attr("data-fill")&<.show()}).on("mouseout.tooltip",function(t,e){lt.hide();var r=n.select(this),i=r.attr("data-fill");i?r.style({fill:i,opacity:r.attr("data-opacity")}):r.style({stroke:r.attr("data-stroke"),opacity:r.attr("data-opacity")})})})}(c),this},h.config=function(t){if(!arguments.length)return l;var e=o.util.cloneJson(t);return e.data.forEach(function(t,e){l.data[e]||(l.data[e]={}),i(l.data[e],o.Axis.defaultConfig().data[0]),i(l.data[e],t)}),i(l.layout,o.Axis.defaultConfig().layout),i(l.layout,e.layout),this},h.getLiveConfig=function(){return u},h.getinputConfig=function(){return c},h.radialScale=function(t){return r},h.angularScale=function(t){return s},h.svg=function(){return t},n.rebind(h,f,"on"),h},o.Axis.defaultConfig=function(t,e){return{data:[{t:[1,2,3,4],r:[10,11,12,13],name:"Line1",geometry:"LinePlot",color:null,strokeDash:"solid",strokeColor:null,strokeSize:"1",visibleInLegend:!0,opacity:1}],layout:{defaultColorRange:n.scale.category10().range(),title:null,height:450,width:500,margin:{top:40,right:40,bottom:40,left:40},font:{size:12,color:"gray",outlineColor:"white",family:"Tahoma, sans-serif"},direction:"clockwise",orientation:0,labelOffset:10,radialAxis:{domain:null,orientation:-45,ticksSuffix:"",visible:!0,gridLinesVisible:!0,tickOrientation:"horizontal",rewriteTicks:null},angularAxis:{domain:[0,360],ticksSuffix:"",visible:!0,gridLinesVisible:!0,labelsVisible:!0,tickOrientation:"horizontal",rewriteTicks:null,ticksCount:null,ticksStep:null},minorTicks:0,tickLength:null,tickColor:"silver",minorTickColor:"#eee",backgroundColor:"none",needsEndSpacing:null,showLegend:!0,legend:{reverseOrder:!1},opacity:1}}},o.util={},o.DATAEXTENT="dataExtent",o.AREA="AreaChart",o.LINE="LinePlot",o.DOT="DotPlot",o.BAR="BarChart",o.util._override=function(t,e){for(var r in t)r in e&&(e[r]=t[r])},o.util._extend=function(t,e){for(var r in t)e[r]=t[r]},o.util._rndSnd=function(){return 2*Math.random()-1+(2*Math.random()-1)+(2*Math.random()-1)},o.util.dataFromEquation2=function(t,e){var r=e||6;return n.range(0,360+r,r).map(function(e,r){var n=e*Math.PI/180;return[e,t(n)]})},o.util.dataFromEquation=function(t,e,r){var i=e||6,a=[],o=[];n.range(0,360+i,i).forEach(function(e,r){var n=e*Math.PI/180,i=t(n);a.push(e),o.push(i)});var s={t:a,r:o};return r&&(s.name=r),s},o.util.ensureArray=function(t,e){if(void 0===t)return null;var r=[].concat(t);return n.range(e).map(function(t,e){return r[e]||r[0]})},o.util.fillArrays=function(t,e,r){return e.forEach(function(e,n){t[e]=o.util.ensureArray(t[e],r)}),t},o.util.cloneJson=function(t){return JSON.parse(JSON.stringify(t))},o.util.validateKeys=function(t,e){"string"==typeof e&&(e=e.split("."));var r=e.shift();return t[r]&&(!e.length||objHasKeys(t[r],e))},o.util.sumArrays=function(t,e){return n.zip(t,e).map(function(t,e){return n.sum(t)})},o.util.arrayLast=function(t){return t[t.length-1]},o.util.arrayEqual=function(t,e){for(var r=Math.max(t.length,e.length,1);r-- >=0&&t[r]===e[r];);return-2===r},o.util.flattenArray=function(t){for(var e=[];!o.util.arrayEqual(e,t);)e=t,t=[].concat.apply([],t);return t},o.util.deduplicate=function(t){return t.filter(function(t,e,r){return r.indexOf(t)==e})},o.util.convertToCartesian=function(t,e){var r=e*Math.PI/180;return[t*Math.cos(r),t*Math.sin(r)]},o.util.round=function(t,e){var r=e||2,n=Math.pow(10,r);return Math.round(t*n)/n},o.util.getMousePos=function(t){var e=n.mouse(t.node()),r=e[0],i=e[1],a={};return a.x=r,a.y=i,a.pos=e,a.angle=180*(Math.atan2(i,r)+Math.PI)/Math.PI,a.radius=Math.sqrt(r*r+i*i),a},o.util.duplicatesCount=function(t){for(var e,r={},n={},i=0,a=t.length;i0)){var l=n.select(this.parentNode).selectAll("path.line").data([0]);l.enter().insert("path"),l.attr({class:"line",d:u(s),transform:function(e,r){return"rotate("+(t.orientation+90)+")"},"pointer-events":"none"}).style({fill:function(t,e){return p.fill(r,i,a)},"fill-opacity":0,stroke:function(t,e){return p.stroke(r,i,a)},"stroke-width":function(t,e){return p["stroke-width"](r,i,a)},"stroke-dasharray":function(t,e){return p["stroke-dasharray"](r,i,a)},opacity:function(t,e){return p.opacity(r,i,a)},display:function(t,e){return p.display(r,i,a)}})}};var f=t.angularScale.range(),h=Math.abs(f[1]-f[0])/o[0].length*Math.PI/180,d=n.svg.arc().startAngle(function(t){return-h/2}).endAngle(function(t){return h/2}).innerRadius(function(e){return t.radialScale(l+(e[2]||0))}).outerRadius(function(e){return t.radialScale(l+(e[2]||0))+t.radialScale(e[1])});c.arc=function(e,r,i){n.select(this).attr({class:"mark arc",d:d,transform:function(e,r){return"rotate("+(t.orientation+s(e[0])+90)+")"}})};var p={fill:function(t,r,n){return e[n].data.color},stroke:function(t,r,n){return e[n].data.strokeColor},"stroke-width":function(t,r,n){return e[n].data.strokeSize+"px"},"stroke-dasharray":function(t,r,n){return a[e[n].data.strokeDash]},opacity:function(t,r,n){return e[n].data.opacity},display:function(t,r,n){return void 0===e[n].data.visible||e[n].data.visible?"block":"none"}},m=n.select(this).selectAll("g.layer").data(o);m.enter().append("g").attr({class:"layer"});var g=m.selectAll("path.mark").data(function(t,e){return t});g.enter().append("path").attr({class:"mark"}),g.style(p).each(c[t.geometryType]),g.exit().remove(),m.exit().remove()})}var e=[o.PolyChart.defaultConfig()],r=n.dispatch("hover"),a={solid:"none",dash:[5,2],dot:[2,5]};return t.config=function(t){return arguments.length?(t.forEach(function(t,r){e[r]||(e[r]={}),i(e[r],o.PolyChart.defaultConfig()),i(e[r],t)}),this):e},t.getColorScale=function(){},n.rebind(t,r,"on"),t},o.PolyChart.defaultConfig=function(){return{data:{name:"geom1",t:[[1,2,3,4]],r:[[1,2,3,4]],dotType:"circle",dotSize:64,dotVisible:!1,barWidth:20,color:"#ffa500",strokeSize:1,strokeColor:"silver",strokeDash:"solid",opacity:1,index:0,visible:!0,visibleInLegend:!0},geometryConfig:{geometry:"LinePlot",geometryType:"arc",direction:"clockwise",orientation:0,container:"body",radialScale:null,angularScale:null,colorScale:n.scale.category20()}}},o.BarChart=function(){return o.PolyChart()},o.BarChart.defaultConfig=function(){return{geometryConfig:{geometryType:"bar"}}},o.AreaChart=function(){return o.PolyChart()},o.AreaChart.defaultConfig=function(){return{geometryConfig:{geometryType:"arc"}}},o.DotPlot=function(){return o.PolyChart()},o.DotPlot.defaultConfig=function(){return{geometryConfig:{geometryType:"dot",dotType:"circle"}}},o.LinePlot=function(){return o.PolyChart()},o.LinePlot.defaultConfig=function(){return{geometryConfig:{geometryType:"line"}}},o.Legend=function(){function t(){var r=e.legendConfig,a=e.data.map(function(t,e){return[].concat(t).map(function(t,n){var a=i({},r.elements[e]);return a.name=t,a.color=[].concat(r.elements[e].color)[n],a})}),o=n.merge(a);o=o.filter(function(t,e){return r.elements[e]&&(r.elements[e].visibleInLegend||void 0===r.elements[e].visibleInLegend)}),r.reverseOrder&&(o=o.reverse());var s=r.container;("string"==typeof s||s.nodeName)&&(s=n.select(s));var l=o.map(function(t,e){return t.color}),c=r.fontSize,u=null==r.isContinuous?"number"==typeof o[0]:r.isContinuous,f=u?r.height:c*o.length,h=s.classed("legend-group",!0).selectAll("svg").data([0]),d=h.enter().append("svg").attr({width:300,height:f+c,xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"});d.append("g").classed("legend-axis",!0),d.append("g").classed("legend-marks",!0);var p=n.range(o.length),m=n.scale[u?"linear":"ordinal"]().domain(p).range(l),g=n.scale[u?"linear":"ordinal"]().domain(p)[u?"range":"rangePoints"]([0,f]);if(u){var v=h.select(".legend-marks").append("defs").append("linearGradient").attr({id:"grad1",x1:"0%",y1:"0%",x2:"0%",y2:"100%"}).selectAll("stop").data(l);v.enter().append("stop"),v.attr({offset:function(t,e){return e/(l.length-1)*100+"%"}}).style({"stop-color":function(t,e){return t}}),h.append("rect").classed("legend-mark",!0).attr({height:r.height,width:r.colorBandWidth,fill:"url(#grad1)"})}else{var y=h.select(".legend-marks").selectAll("path.legend-mark").data(o);y.enter().append("path").classed("legend-mark",!0),y.attr({transform:function(t,e){return"translate("+[c/2,g(e)+c/2]+")"},d:function(t,e){return function(t,e){var r=3*e;return"line"===t?"M"+[[-e/2,-e/12],[e/2,-e/12],[e/2,e/12],[-e/2,e/12]]+"Z":-1!=n.svg.symbolTypes.indexOf(t)?n.svg.symbol().type(t).size(r)():n.svg.symbol().type("square").size(r)()}(t.symbol,c)},fill:function(t,e){return m(e)}}),y.exit().remove()}var x=n.svg.axis().scale(g).orient("right"),b=h.select("g.legend-axis").attr({transform:"translate("+[u?r.colorBandWidth:c,c/2]+")"}).call(x);return b.selectAll(".domain").style({fill:"none",stroke:"none"}),b.selectAll("line").style({fill:"none",stroke:u?r.textColor:"none"}),b.selectAll("text").style({fill:r.textColor,"font-size":r.fontSize}).text(function(t,e){return o[e].name}),t}var e=o.Legend.defaultConfig(),r=n.dispatch("hover");return t.config=function(t){return arguments.length?(i(e,t),this):e},n.rebind(t,r,"on"),t},o.Legend.defaultConfig=function(t,e){return{data:["a","b","c"],legendConfig:{elements:[{symbol:"line",color:"red"},{symbol:"square",color:"yellow"},{symbol:"diamond",color:"limegreen"}],height:150,colorBandWidth:30,fontSize:12,container:"body",isContinuous:null,textColor:"grey",reverseOrder:!1}}},o.tooltipPanel=function(){var t,e,r,a={container:null,hasTick:!1,fontSize:12,color:"white",padding:5},s="tooltip-"+o.tooltipPanel.uid++,l=10,c=function(){var n=(t=a.container.selectAll("g."+s).data([0])).enter().append("g").classed(s,!0).style({"pointer-events":"none",display:"none"});return r=n.append("path").style({fill:"white","fill-opacity":.9}).attr({d:"M0 0"}),e=n.append("text").attr({dx:a.padding+l,dy:.3*+a.fontSize}),c};return c.text=function(i){var o=n.hsl(a.color).l,s=o>=.5?"#aaa":"white",u=o>=.5?"black":"white",f=i||"";e.style({fill:u,"font-size":a.fontSize+"px"}).text(f);var h=a.padding,d=e.node().getBBox(),p={fill:a.color,stroke:s,"stroke-width":"2px"},m=d.width+2*h+l,g=d.height+2*h;return r.attr({d:"M"+[[l,-g/2],[l,-g/4],[a.hasTick?0:l,0],[l,g/4],[l,g/2],[m,g/2],[m,-g/2]].join("L")+"Z"}).style(p),t.attr({transform:"translate("+[l,-g/2+2*h]+")"}),t.style({display:"block"}),c},c.move=function(e){if(t)return t.attr({transform:"translate("+[e[0],e[1]]+")"}).style({display:"block"}),c},c.hide=function(){if(t)return t.style({display:"none"}),c},c.show=function(){if(t)return t.style({display:"block"}),c},c.config=function(t){return i(a,t),c},c},o.tooltipPanel.uid=1,o.adapter={},o.adapter.plotly=function(){var t={};return t.convert=function(t,e){var r={};if(t.data&&(r.data=t.data.map(function(t,r){var n=i({},t);return[[n,["marker","color"],["color"]],[n,["marker","opacity"],["opacity"]],[n,["marker","line","color"],["strokeColor"]],[n,["marker","line","dash"],["strokeDash"]],[n,["marker","line","width"],["strokeSize"]],[n,["marker","symbol"],["dotType"]],[n,["marker","size"],["dotSize"]],[n,["marker","barWidth"],["barWidth"]],[n,["line","interpolation"],["lineInterpolation"]],[n,["showlegend"],["visibleInLegend"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e||delete n.marker,e&&delete n.groupId,e?("LinePlot"===n.geometry?(n.type="scatter",!0===n.dotVisible?(delete n.dotVisible,n.mode="lines+markers"):n.mode="lines"):"DotPlot"===n.geometry?(n.type="scatter",n.mode="markers"):"AreaChart"===n.geometry?n.type="area":"BarChart"===n.geometry&&(n.type="bar"),delete n.geometry):("scatter"===n.type?"lines"===n.mode?n.geometry="LinePlot":"markers"===n.mode?n.geometry="DotPlot":"lines+markers"===n.mode&&(n.geometry="LinePlot",n.dotVisible=!0):"area"===n.type?n.geometry="AreaChart":"bar"===n.type&&(n.geometry="BarChart"),delete n.mode,delete n.type),n}),!e&&t.layout&&"stack"===t.layout.barmode)){var a=o.util.duplicates(r.data.map(function(t,e){return t.geometry}));r.data.forEach(function(t,e){var n=a.indexOf(t.geometry);-1!=n&&(r.data[e].groupId=n)})}if(t.layout){var s=i({},t.layout);if([[s,["plot_bgcolor"],["backgroundColor"]],[s,["showlegend"],["showLegend"]],[s,["radialaxis"],["radialAxis"]],[s,["angularaxis"],["angularAxis"]],[s.angularaxis,["showline"],["gridLinesVisible"]],[s.angularaxis,["showticklabels"],["labelsVisible"]],[s.angularaxis,["nticks"],["ticksCount"]],[s.angularaxis,["tickorientation"],["tickOrientation"]],[s.angularaxis,["ticksuffix"],["ticksSuffix"]],[s.angularaxis,["range"],["domain"]],[s.angularaxis,["endpadding"],["endPadding"]],[s.radialaxis,["showline"],["gridLinesVisible"]],[s.radialaxis,["tickorientation"],["tickOrientation"]],[s.radialaxis,["ticksuffix"],["ticksSuffix"]],[s.radialaxis,["range"],["domain"]],[s.angularAxis,["showline"],["gridLinesVisible"]],[s.angularAxis,["showticklabels"],["labelsVisible"]],[s.angularAxis,["nticks"],["ticksCount"]],[s.angularAxis,["tickorientation"],["tickOrientation"]],[s.angularAxis,["ticksuffix"],["ticksSuffix"]],[s.angularAxis,["range"],["domain"]],[s.angularAxis,["endpadding"],["endPadding"]],[s.radialAxis,["showline"],["gridLinesVisible"]],[s.radialAxis,["tickorientation"],["tickOrientation"]],[s.radialAxis,["ticksuffix"],["ticksSuffix"]],[s.radialAxis,["range"],["domain"]],[s.font,["outlinecolor"],["outlineColor"]],[s.legend,["traceorder"],["reverseOrder"]],[s,["labeloffset"],["labelOffset"]],[s,["defaultcolorrange"],["defaultColorRange"]]].forEach(function(t,r){o.util.translator.apply(null,t.concat(e))}),e?(void 0!==s.tickLength&&(s.angularaxis.ticklen=s.tickLength,delete s.tickLength),s.tickColor&&(s.angularaxis.tickcolor=s.tickColor,delete s.tickColor)):(s.angularAxis&&void 0!==s.angularAxis.ticklen&&(s.tickLength=s.angularAxis.ticklen),s.angularAxis&&void 0!==s.angularAxis.tickcolor&&(s.tickColor=s.angularAxis.tickcolor)),s.legend&&"boolean"!=typeof s.legend.reverseOrder&&(s.legend.reverseOrder="normal"!=s.legend.reverseOrder),s.legend&&"boolean"==typeof s.legend.traceorder&&(s.legend.traceorder=s.legend.traceorder?"reversed":"normal",delete s.legend.reverseOrder),s.margin&&void 0!==s.margin.t){var l=["t","r","b","l","pad"],c=["top","right","bottom","left","pad"],u={};n.entries(s.margin).forEach(function(t,e){u[c[l.indexOf(t.key)]]=t.value}),s.margin=u}e&&(delete s.needsEndSpacing,delete s.minorTickColor,delete s.minorTicks,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksCount,delete s.angularaxis.ticksStep,delete s.angularaxis.rewriteTicks,delete s.angularaxis.nticks,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksCount,delete s.radialaxis.ticksStep,delete s.radialaxis.rewriteTicks,delete s.radialaxis.nticks),r.layout=s}return r},t}},{"../../../constants/alignment":716,"../../../lib":743,d3:128}],862:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../../lib"),a=t("../../../components/color"),o=t("./micropolar"),s=t("./undo_manager"),l=i.extendDeepAll,c=e.exports={};c.framework=function(t){function e(e,i){return i&&(f=i),n.select(n.select(f).node().parentNode).selectAll(".svg-container>*:not(.chart-root)").remove(),r=r?l(r,e):e,a||(a=o.Axis()),u=o.adapter.plotly().convert(r),a.config(u).render(f),t.data=r.data,t.layout=r.layout,c.fillLayout(t),r}var r,i,a,u,f,h=new s;return e.isPolar=!0,e.svg=function(){return a.svg()},e.getConfig=function(){return r},e.getLiveConfig=function(){return o.adapter.plotly().convert(a.getLiveConfig(),!0)},e.getLiveScales=function(){return{t:a.angularScale(),r:a.radialScale()}},e.setUndoPoint=function(){var t=this,e=o.util.cloneJson(r);!function(e,r){h.add({undo:function(){r&&t(r)},redo:function(){t(e)}})}(e,i),i=o.util.cloneJson(e)},e.undo=function(){h.undo()},e.redo=function(){h.redo()},e},c.fillLayout=function(t){var e=n.select(t).selectAll(".plot-container"),r=e.selectAll(".svg-container"),i=t.framework&&t.framework.svg&&t.framework.svg(),o={width:800,height:600,paper_bgcolor:a.background,_container:e,_paperdiv:r,_paper:i};t._fullLayout=l(o,t.layout)}},{"../../../components/color":618,"../../../lib":743,"./micropolar":861,"./undo_manager":863,d3:128}],863:[function(t,e,r){"use strict";e.exports=function(){function t(t,e){return t?(i=!0,t[e](),i=!1,this):this}var e,r=[],n=-1,i=!1;return{add:function(t){return i?this:(r.splice(n+1,r.length-n),r.push(t),n=r.length-1,this)},setCallback:function(t){e=t},undo:function(){var i=r[n];return i?(t(i,"undo"),n-=1,e&&e(i.undo),this):this},redo:function(){var i=r[n+1];return i?(t(i,"redo"),n+=1,e&&e(i.redo),this):this},clear:function(){r=[],n=-1},hasUndo:function(){return-1!==n},hasRedo:function(){return n0?1:-1}function d(t){return h(Math.cos(t))}function p(t){return h(Math.sin(t))}var m=t("d3"),g=t("tinycolor2"),v=t("../../plotly"),y=t("../../registry"),x=t("../../lib"),b=t("../../components/color"),_=t("../../components/drawing"),w=t("../plots"),M=t("../cartesian/axes"),k=t("../../components/dragelement"),A=t("../cartesian/dragbox"),T=t("../../components/fx"),S=t("../../components/titles"),E=t("../cartesian/select"),L=t("../../lib/setcursor"),C=t("../../constants/alignment").MID_SHIFT,z=x._,D=x.deg2rad,I=x.rad2deg,P=x.wrap360,O=x.wrap180,F=t("./helpers").setConvertAngular,R=t("./constants"),N=n.prototype;e.exports=function(t,e){return new n(t,e)},N.plot=function(t,e){var r=e[this.id];this._hasClipOnAxisFalse=!1;for(var n=0;n=90||s>90&&l>=450?1:u<=0&&h<=0?0:Math.max(u,h),e=s<=180&&l>=180||s>180&&l>=540?-1:c>=0&&f>=0?0:Math.min(c,f),r=s<=270&&l>=270||s>270&&l>=630?-1:u>=0&&h>=0?0:Math.min(u,h),n=l>=360?1:c<=0&&f<=0?0:Math.max(c,f),[e,r,n,i]}(g),y=v[2]-v[0],x=v[3]-v[1],w=m/p,k=Math.abs(x/y);w>k?(l=p,d=(m-(c=p*k))/i.h/2,f=[a[0],a[1]],h=[o[0]+d,o[1]-d]):(c=m,d=(p-(l=m/k))/i.w/2,f=[a[0]+d,a[1]-d],h=[o[0],o[1]]),r.xLength2=l,r.yLength2=c,r.xDomain2=f,r.yDomain2=h;var A=r.xOffset2=i.l+i.w*f[0],T=r.yOffset2=i.t+i.h*(1-h[1]),S=r.radius=l/y,E=r.cx=A-S*v[0],L=r.cy=T+S*v[3],C=r.cxx=E-A,z=r.cyy=L-T;r.updateRadialAxis(t,e),r.updateRadialAxisTitle(t,e),r.updateAngularAxis(t,e);var I=r.radialAxis.range,O=I[1]-I[0],F=r.xaxis={type:"linear",_id:"x",range:[v[0]*O,v[2]*O],domain:f};M.setConvert(F,t),F.setScale();var R=r.yaxis={type:"linear",_id:"y",range:[v[1]*O,v[3]*O],domain:h};M.setConvert(R,t),R.setScale(),F.isPtWithinRange=function(t){return r.isPtWithinSector(t)},R.isPtWithinRange=function(){return!0},n.frontplot.attr("transform",u(A,T)).call(_.setClipUrl,r._hasClipOnAxisFalse?null:r.clipIds.circle),n.bgcircle.attr({d:s(S,g),transform:u(E,L)}).call(b.fill,e.bgcolor),r.clipPaths.circle.select("path").attr("d",s(S,g)).attr("transform",u(C,z)),r.framework.selectAll(".crisp").classed("crisp",0)},N.updateRadialAxis=function(t,e){var r=this.gd,n=this.layers,s=this.radius,l=this.cx,h=this.cy,d=t._size,p=e.radialaxis,m=e.sector,g=P(m[0]);this.fillViewInitialKey("radialaxis.angle",p.angle);var v=this.radialAxis=x.extendFlat({},p,{_axislayer:n["radial-axis"],_gridlayer:n["radial-grid"],_id:"x",_pos:0,side:{counterclockwise:"top",clockwise:"bottom"}[p.side],domain:[0,s/d.w],anchor:"free",position:0,_counteraxis:!0});i(v,p,t),M.doAutoRange(v),p.range=v.range.slice(),p._input.range=v.range.slice(),this.fillViewInitialKey("radialaxis.range",v.range.slice()),"auto"===v.tickangle&&g>90&&g<=270&&(v.tickangle=180),v._transfn=function(t){return"translate("+v.l2p(t.x)+",0)"},v._gridpath=function(t){return o(v.r2p(t.x),m)};var y=a(p);this.radialTickLayout!==y&&(n["radial-axis"].selectAll(".xtick").remove(),this.radialTickLayout=y),M.doTicks(r,v,!0),c(n["radial-axis"],p.showticklabels||p.ticks,{transform:u(l,h)+f(-p.angle)}),c(n["radial-grid"],p.showgrid,{transform:u(l,h)}).selectAll("path").attr("transform",null),c(n["radial-line"].select("line"),p.showline,{x1:0,y1:0,x2:s,y2:0,transform:u(l,h)+f(-p.angle)}).attr("stroke-width",p.linewidth).call(b.stroke,p.linecolor)},N.updateRadialAxisTitle=function(t,e,r){var n=this.gd,i=this.radius,a=this.cx,o=this.cy,s=e.radialaxis,l=this.id+"title",c=void 0!==r?r:s.angle,u=D(c),f=Math.cos(u),h=Math.sin(u),d=0;if(s.title){var p=_.bBox(this.layers["radial-axis"].node()).height,m=s.titlefont.size;d="counterclockwise"===s.side?-p-.4*m:p+.8*m}this.layers["radial-axis-title"]=S.draw(n,l,{propContainer:s,propName:this.id+".radialaxis.title",placeholder:z(n,"Click to enter radial axis title"),attributes:{x:a+i/2*f+d*h,y:o-i/2*h+d*f,"text-anchor":"middle"},transform:{rotate:-c}})},N.updateAngularAxis=function(t,e){function r(t){return T.c2rad(t.x,"degrees")}function n(t){return[v*Math.cos(t),v*Math.sin(t)]}var o=this,h=o.gd,g=o.layers,v=o.radius,y=o.cx,_=o.cy,w=e.angularaxis,k=e.sector,A=k.map(D);o.fillViewInitialKey("angularaxis.rotation",w.rotation);var T=o.angularAxis=x.extendFlat({},w,{_axislayer:g["angular-axis"],_gridlayer:g["angular-grid"],_id:"angular",_pos:0,side:"right",domain:[0,Math.PI],anchor:"free",position:0,_counteraxis:!0});"linear"===T.type?(T.autorange=!1,l(k)?T.range=k.slice():T.range=A.map(T.unTransformRad).map(I),"radians"===T.thetaunit&&(T.tick0=I(T.tick0),T.dtick=I(T.dtick))):"category"===T.type&&(T._tickFilter=function(t){return o.isPtWithinSector({r:o.radialAxis.range[1],rad:T.c2rad(t.x)})}),i(T,w,t),M.doAutoRange(T),T._transfn=function(t){var e=r(t),i=n(e),a=u(y+i[0],_-i[1]),o=m.select(this);return o&&o.node()&&o.classed("ticks")&&(a+=f(-I(e))),a},T._gridpath=function(t){var e=n(r(t));return"M0,0L"+-e[0]+","+e[1]};var S="outside"!==w.ticks?.7:.5;T._labelx=function(t){var e=r(t),n=T._labelStandoff,i=T._pad;return(0===p(e)?0:Math.cos(e)*(n+i+S*t.fontSize))+d(e)*(t.dx+n+i)},T._labely=function(t){var e=r(t),n=T._labelStandoff,i=T._labelShift,a=T._pad;return t.dy+t.fontSize*C-i+-Math.sin(e)*(n+a+S*t.fontSize)},T._labelanchor=function(t,e){var n=r(e);return 0===p(n)?d(n)>0?"start":"end":"middle"};var E=a(w);o.angularTickLayout!==E&&(g["angular-axis"].selectAll(".angulartick").remove(),o.angularTickLayout=E),M.doTicks(h,T,!0),c(g["angular-line"].select("path"),w.showline,{d:s(v,k),transform:u(y,_)}).attr("stroke-width",w.linewidth).call(b.stroke,w.linecolor)},N.updateFx=function(t,e){this.gd._context.staticPlot||(this.updateAngularDrag(t,e),this.updateRadialDrag(t,e),this.updateMainDrag(t,e))},N.updateMainDrag=function(t,e){function r(t,e){var r=t-w,n=e-M;return Math.sqrt(r*r+n*n)}function n(t,e){return Math.atan2(M-e,t-w)}function i(t,e){return[t*Math.cos(e),t*Math.sin(-e)]}function a(t,e){var r=R.cornerLen,n=R.cornerHalfWidth;if(0===t)return s(2*n,S);var a=r/t/2,o=e-a,l=e+a,c=Math.max(0,Math.min(t,x)),u=c-n,f=c+n;return"M"+i(u,o)+"A"+[u,u]+" 0,0,0 "+i(u,l)+"L"+i(f,l)+"A"+[f,f]+" 0,0,1 "+i(f,o)+"Z"}function o(t,e){var i=C+t,o=z+e,l=r(C,z),c=Math.min(r(i,o),x),u=n(C,z),f=n(i,o);lp?(l0!=n>g[0])return;P=h.range[1]=n,M.doTicks(a,i.radialAxis,!0),o["radial-grid"].attr("transform",u(l,c)).selectAll("path").attr("transform",null);var f=P-g[0],d=i.sectorBBox;i.xaxis.range=[d[0]*f,d[2]*f],i.yaxis.range=[d[1]*f,d[3]*f],i.xaxis.setScale(),i.yaxis.setScale();for(var m in i.traceHash){var v=i.traceHash[m],_=x.filterVisible(v),w=v[0][0].trace._module,k=a._fullLayout[i.id];if(w.plot(a,i,_,k),!y.traceIs(m,"gl"))for(var A=0;A<_.length;A++)w.style(a,_[A])}})}}function n(){null!==z?v.relayout(a,i.id+".radialaxis.angle",z):null!==P&&v.relayout(a,i.id+".radialaxis.range[1]",P)}var i=this,a=i.gd,o=i.layers,s=i.radius,l=i.cx,c=i.cy,h=i.radialAxis,d=e.radialaxis,p=D(d.angle),g=h.range.slice(),b=g[1]-g[0],_=R.radialDragBoxSize,w=_/2;if(d.visible){var T=A.makeRectDragger(o,"radialdrag","crosshair",-w,-w,_,_),S={element:T,gd:a},E=l+(s+w)*Math.cos(p),L=c-(s+w)*Math.sin(p);m.select(T).attr("transform",u(E,L));var C,z,P;S.prepFn=function(){C=null,z=null,P=null,S.moveFn=r,S.doneFn=n,A.clearSelect(t._zoomlayer)},S.clampFn=function(t,e){return Math.sqrt(t*t+e*e)o&&(o+=360);var s,c,u=P(I(t.rad)),f=u+360;return n[1]>=n[0]?(s=n[0],c=n[1]):(s=n[1],c=n[0]),i>=s&&i<=c&&(l(e)||u>=a&&u<=o||f>=a&&f<=o)},N.fillViewInitialKey=function(t,e){t in this.viewInitial||(this.viewInitial[t]=e)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../constants/alignment":716,"../../lib":743,"../../lib/setcursor":762,"../../plotly":784,"../../registry":873,"../cartesian/axes":789,"../cartesian/dragbox":797,"../cartesian/select":807,"../plots":852,"./constants":853,"./helpers":854,d3:128,tinycolor2:546}],865:[function(t,e,r){"use strict";var n=t("../lib");e.exports=function(t,e,r,i){function a(t,e){return n.coerce(o,s,c,t,e)}for(var o,s,l=i.type,c=i.attributes,u=i.handleDefaults,f=i.partition||"x",h=e._subplots[l],d=h.length,p=0;p=o&&(d.min=0,p.min=0,m.min=0,t.aaxis&&delete t.aaxis.min,t.baxis&&delete t.baxis.min,t.caxis&&delete t.caxis.min)}var i=t("../../../components/color"),a=t("../../subplot_defaults"),o=t("./layout_attributes"),s=t("./axis_defaults"),l=["aaxis","baxis","caxis"];e.exports=function(t,e,r){a(t,e,r,{type:"ternary",attributes:o,handleDefaults:n,font:e.font,paper_bgcolor:e.paper_bgcolor})}},{"../../../components/color":618,"../../subplot_defaults":865,"./axis_defaults":869,"./layout_attributes":871}],871:[function(t,e,r){"use strict";var n=t("../../../components/color/attributes"),i=t("../../domain_attributes"),a=t("./axis_attributes"),o=t("../../../plot_api/edit_types").overrideAll;e.exports=o({domain:i({name:"ternary"}),bgcolor:{valType:"color",dflt:n.background},sum:{valType:"number",dflt:1,min:0},aaxis:a,baxis:a,caxis:a},"plot","from-root")},{"../../../components/color/attributes":617,"../../../plot_api/edit_types":773,"../../domain_attributes":815,"./axis_attributes":868}],872:[function(t,e,r){"use strict";function n(t,e){this.id=t.id,this.graphDiv=t.graphDiv,this.init(e),this.makeFramework(e)}function i(t){a.select(t).selectAll(".zoombox,.js-zoombox-backdrop,.js-zoombox-menu,.zoombox-corners").remove()}var a=t("d3"),o=t("tinycolor2"),s=t("../../plotly"),l=t("../../lib"),c=l._,u=t("../../components/color"),f=t("../../components/drawing"),h=t("../cartesian/set_convert"),d=t("../../lib/extend").extendFlat,p=t("../plots"),m=t("../cartesian/axes"),g=t("../../components/dragelement"),v=t("../../components/fx"),y=t("../../components/titles"),x=t("../cartesian/select"),b=t("../cartesian/constants");e.exports=n;var _=n.prototype;_.init=function(t){this.container=t._ternarylayer,this.defs=t._defs,this.layoutId=t._uid,this.traceHash={},this.layers={}},_.plot=function(t,e){var r=e[this.id],n=e._size;this._hasClipOnAxisFalse=!1;for(var i=0;iw*x?i=(a=x)*w:a=(i=y)/w,o=g*i/y,s=v*a/x,r=e.l+e.w*p-i/2,n=e.t+e.h*(1-m)-a/2,l.x0=r,l.y0=n,l.w=i,l.h=a,l.sum=b,l.xaxis={type:"linear",range:[_+2*k-b,b-_-2*M],domain:[p-o/2,p+o/2],_id:"x"},h(l.xaxis,l.graphDiv._fullLayout),l.xaxis.setScale(),l.xaxis.isPtWithinRange=function(t){return t.a>=l.aaxis.range[0]&&t.a<=l.aaxis.range[1]&&t.b>=l.baxis.range[1]&&t.b<=l.baxis.range[0]&&t.c>=l.caxis.range[1]&&t.c<=l.caxis.range[0]},l.yaxis={type:"linear",range:[_,b-M-k],domain:[m-s/2,m+s/2],_id:"y"},h(l.yaxis,l.graphDiv._fullLayout),l.yaxis.setScale(),l.yaxis.isPtWithinRange=function(){return!0};var A=l.yaxis.domain[0],T=l.aaxis=d({},t.aaxis,{visible:!0,range:[_,b-M-k],side:"left",_counterangle:30,tickangle:(+t.aaxis.tickangle||0)-30,domain:[A,A+s*w],_axislayer:l.layers.aaxis,_gridlayer:l.layers.agrid,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l"+a+",-"+i/2});h(T,l.graphDiv._fullLayout),T.setScale();var S=l.baxis=d({},t.baxis,{visible:!0,range:[b-_-k,M],side:"bottom",_counterangle:30,domain:l.xaxis.domain,_axislayer:l.layers.baxis,_gridlayer:l.layers.bgrid,_counteraxis:l.aaxis,_pos:0,_id:"x",_length:i,_gridpath:"M0,0l-"+i/2+",-"+a});h(S,l.graphDiv._fullLayout),S.setScale(),T._counteraxis=S;var E=l.caxis=d({},t.caxis,{visible:!0,range:[b-_-M,k],side:"right",_counterangle:30,tickangle:(+t.caxis.tickangle||0)+30,domain:[A,A+s*w],_axislayer:l.layers.caxis,_gridlayer:l.layers.cgrid,_counteraxis:l.baxis,_pos:0,_id:"y",_length:i,_gridpath:"M0,0l-"+a+","+i/2});h(E,l.graphDiv._fullLayout),E.setScale();var L="M"+r+","+(n+a)+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDef.select("path").attr("d",L),l.layers.plotbg.select("path").attr("d",L);var C="M0,"+a+"h"+i+"l-"+i/2+",-"+a+"Z";l.clipDefRelative.select("path").attr("d",C);var z="translate("+r+","+n+")";l.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",z),l.clipDefRelative.select("path").attr("transform",null);var D="translate("+(r-S._offset)+","+(n+a)+")";l.layers.baxis.attr("transform",D),l.layers.bgrid.attr("transform",D);var I="translate("+(r+i/2)+","+n+")rotate(30)translate(0,-"+T._offset+")";l.layers.aaxis.attr("transform",I),l.layers.agrid.attr("transform",I);var P="translate("+(r+i/2)+","+n+")rotate(-30)translate(0,-"+E._offset+")";l.layers.caxis.attr("transform",P),l.layers.cgrid.attr("transform",P),l.drawAxes(!0),l.plotContainer.selectAll(".crisp").classed("crisp",!1),l.layers.aline.select("path").attr("d",T.showline?"M"+r+","+(n+a)+"l"+i/2+",-"+a:"M0,0").call(u.stroke,T.linecolor||"#000").style("stroke-width",(T.linewidth||0)+"px"),l.layers.bline.select("path").attr("d",S.showline?"M"+r+","+(n+a)+"h"+i:"M0,0").call(u.stroke,S.linecolor||"#000").style("stroke-width",(S.linewidth||0)+"px"),l.layers.cline.select("path").attr("d",E.showline?"M"+(r+i/2)+","+n+"l"+i/2+","+a:"M0,0").call(u.stroke,E.linecolor||"#000").style("stroke-width",(E.linewidth||0)+"px"),l.graphDiv._context.staticPlot||l.initInteractions(),f.setClipUrl(l.layers.frontplot,l._hasClipOnAxisFalse?null:l.clipId)},_.drawAxes=function(t){var e=this.graphDiv,r=this.id.substr(7)+"title",n=this.aaxis,i=this.baxis,a=this.caxis;if(m.doTicks(e,n,!0),m.doTicks(e,i,!0),m.doTicks(e,a,!0),t){var o=Math.max(n.showticklabels?n.tickfont.size/2:0,(a.showticklabels?.75*a.tickfont.size:0)+("outside"===a.ticks?.87*a.ticklen:0));this.layers["a-title"]=y.draw(e,"a"+r,{propContainer:n,propName:this.id+".aaxis.title",placeholder:c(e,"Click to enter Component A title"),attributes:{x:this.x0+this.w/2,y:this.y0-n.titlefont.size/3-o,"text-anchor":"middle"}});var s=(i.showticklabels?i.tickfont.size:0)+("outside"===i.ticks?i.ticklen:0)+3;this.layers["b-title"]=y.draw(e,"b"+r,{propContainer:i,propName:this.id+".baxis.title",placeholder:c(e,"Click to enter Component B title"),attributes:{x:this.x0-s,y:this.y0+this.h+.83*i.titlefont.size+s,"text-anchor":"middle"}}),this.layers["c-title"]=y.draw(e,"c"+r,{propContainer:a,propName:this.id+".caxis.title",placeholder:c(e,"Click to enter Component C title"),attributes:{x:this.x0+this.w+s,y:this.y0+this.h+.83*a.titlefont.size+s,"text-anchor":"middle"}})}};var M=b.MINZOOM/2+.87,k="m-0.87,.5h"+M+"v3h-"+(M+5.2)+"l"+(M/2+2.6)+",-"+(.87*M+4.5)+"l2.6,1.5l-"+M/2+","+.87*M+"Z",A="m0.87,.5h-"+M+"v3h"+(M+5.2)+"l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-2.6,1.5l"+M/2+","+.87*M+"Z",T="m0,1l"+M/2+","+.87*M+"l2.6,-1.5l-"+(M/2+2.6)+",-"+(.87*M+4.5)+"l-"+(M/2+2.6)+","+(.87*M+4.5)+"l2.6,1.5l"+M/2+",-"+.87*M+"Z",S="m0.5,0.5h5v-2h-5v-5h-2v5h-5v2h5v5h2Z",E=!0;_.initInteractions=function(){function t(t,e){return 1-e/O.h}function e(t,e){return 1-(t+(O.h-e)/Math.sqrt(3))/O.w}function r(t,e){return(t-(O.h-e)/Math.sqrt(3))/O.w}function n(n,i){var a=m+n,o=y+i,s=Math.max(0,Math.min(1,t(0,y),t(0,o))),l=Math.max(0,Math.min(1,e(m,y),e(a,o))),c=Math.max(0,Math.min(1,r(m,y),r(a,o))),u=(s/2+c)*O.w,f=(1-s/2-l)*O.w,h=(u+f)/2,d=f-u,p=(1-s)*O.h,g=p-d/w;d.2?"rgba(0,0,0,0.4)":"rgba(255,255,255,0.3)").duration(200),P.transition().style("opacity",1).duration(200),D=!0)}function a(){if(i(R),L!==_){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t),E&&R.data&&R._context.showTips&&(l.notifier(c(R,"Double-click to zoom back out"),"long"),E=!1)}}function h(t,e){var r=t/O.xaxis._m,n=e/O.yaxis._m,i=[(L={a:_.a-n,b:_.b+(r+n)/2,c:_.c-(r-n)/2}).a,L.b,L.c].sort(),a=i.indexOf(L.a),o=i.indexOf(L.b),s=i.indexOf(L.c);i[0]<0&&(i[1]+i[0]/2<0?(i[2]+=i[0]+i[1],i[0]=i[1]=0):(i[2]+=i[0]/2,i[1]+=i[0]/2,i[0]=0),L={a:i[a],b:i[o],c:i[s]},e=(_.a-L.a)*O.yaxis._m,t=(_.c-L.c-_.b+L.b)*O.xaxis._m);var l="translate("+(O.x0+t)+","+(O.y0+e)+")";O.plotContainer.selectAll(".scatterlayer,.maplayer").attr("transform",l);var c="translate("+-t+","+-e+")";O.clipDefRelative.select("path").attr("transform",c),O.aaxis.range=[L.a,O.sum-L.b-L.c],O.baxis.range=[O.sum-L.a-L.c,L.b],O.caxis.range=[O.sum-L.a-L.b,L.c],O.drawAxes(!1),O.plotContainer.selectAll(".crisp").classed("crisp",!1),O._hasClipOnAxisFalse&&O.plotContainer.select(".scatterlayer").selectAll(".trace").call(f.hideOutsideRangePoints,O)}function d(){var t={};t[O.id+".aaxis.min"]=L.a,t[O.id+".baxis.min"]=L.b,t[O.id+".caxis.min"]=L.c,s.relayout(R,t)}function p(){N.selectAll(".select-outline").remove()}var m,y,_,M,L,C,z,D,I,P,O=this,F=O.layers.plotbg.select("path").node(),R=O.graphDiv,N=R._fullLayout._zoomlayer,j={element:F,gd:R,plotinfo:{xaxis:O.xaxis,yaxis:O.yaxis},subplot:O.id,prepFn:function(t,e,r){j.xaxes=[O.xaxis],j.yaxes=[O.yaxis];var i=R._fullLayout.dragmode;t.shiftKey&&(i="pan"===i?"zoom":"pan"),j.minDrag="lasso"===i?1:void 0,"zoom"===i?(j.moveFn=n,j.doneFn=a,function(t,e,r){var n=F.getBoundingClientRect();m=e-n.left,y=r-n.top,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,M=O.aaxis.range[1]-_.a,C=o(O.graphDiv._fullLayout[O.id].bgcolor).getLuminance(),z="M0,"+O.h+"L"+O.w/2+", 0L"+O.w+","+O.h+"Z",D=!1,I=N.append("path").attr("class","zoombox").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:C>.2?"rgba(0,0,0,0)":"rgba(255,255,255,0)","stroke-width":0}).attr("d",z),P=N.append("path").attr("class","zoombox-corners").attr("transform","translate("+O.x0+", "+O.y0+")").style({fill:u.background,stroke:u.defaultLine,"stroke-width":1,opacity:0}).attr("d","M0,0Z"),p()}(0,e,r)):"pan"===i?(j.moveFn=h,j.doneFn=d,_={a:O.aaxis.range[0],b:O.baxis.range[1],c:O.caxis.range[1]},L=_,p()):"select"!==i&&"lasso"!==i||x(t,e,r,j,i)},clickFn:function(t,e){if(i(R),2===t){var r={};r[O.id+".aaxis.min"]=0,r[O.id+".baxis.min"]=0,r[O.id+".caxis.min"]=0,R.emit("plotly_doubleclick",null),s.relayout(R,r)}v.click(R,e,O.id)}};F.onmousemove=function(t){v.hover(R,t,O.id),R._fullLayout._lasthover=F,R._fullLayout._hoversubplot=O.id},F.onmouseout=function(t){R._dragging||g.unhover(R,t)},g.init(j)}},{"../../components/color":618,"../../components/dragelement":640,"../../components/drawing":643,"../../components/fx":660,"../../components/titles":709,"../../lib":743,"../../lib/extend":732,"../../plotly":784,"../cartesian/axes":789,"../cartesian/constants":794,"../cartesian/select":807,"../cartesian/set_convert":808,"../plots":852,d3:128,tinycolor2:546}],873:[function(t,e,r){"use strict";function n(t){if(t.layoutAttributes){var e=t.layoutAttributes._arrayAttrRegexps;if(e)for(var n=0;n-1}var a=t("../lib"),o=a.extendFlat,s=a.extendDeep;e.exports=function(t,e){t.framework&&t.framework.isPolar&&(t=t.framework.getConfig());var r,a=t.data,l=t.layout,c=s([],a),u=s({},l,n(e.tileClass)),f=t._context||{};if(e.width&&(u.width=e.width),e.height&&(u.height=e.height),"thumbnail"===e.tileClass||"themes__thumb"===e.tileClass){u.annotations=[];var h=Object.keys(u);for(r=0;r")?"":e.html(t).text()});return e.remove(),r}(w),w=function(t){return t.replace(/&(?!\w+;|\#[0-9]+;| \#x[0-9A-F]+;)/g,"&")}(w),w=w.replace(u,"'"),i.isIE()&&(w=(w=(w=w.replace(/"/gi,"'")).replace(/(\('#)([^']*)('\))/gi,'("#$2")')).replace(/(\\')/gi,'"')),w}},{"../components/color":618,"../components/drawing":643,"../constants/xmlns_namespaces":723,"../lib":743,d3:128}],882:[function(t,e,r){"use strict";var n=t("../../lib").mergeArray;e.exports=function(t,e){for(var r=0;r0&&E>0&&(S<=F&&E<=R||S<=R&&E<=F||("h"===M?F>=S*(R/E):R>=E*(F/S)))?m="inside":(m="outside",A.remove(),A=null)}else m="inside";if(!A&&(A=d(e,k,"outside"===m?z:C),T=p.bBox(A.node()),S=T.width,E=T.height,S<=0||E<=0))A.remove();else{var N;N="outside"===m?function(t,e,r,n,a,o,s){var l,c="h"===o?Math.abs(n-r):Math.abs(e-t);c>2*w&&(l=w);var u=1;s&&(u="h"===o?Math.min(1,c/a.height):Math.min(1,c/a.width));var f,h,d,p,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2;f=u*a.width,h=u*a.height,"h"===o?er?(d=(t+e)/2,p=n+l+h/2):(d=(t+e)/2,p=n-l-h/2);return i(m,g,d,p,u,!1)}(l,c,u,f,T,M,"both"===g.constraintext||"outside"===g.constraintext):function(t,e,r,n,a,o,s){var l,c,u,f,h,d=a.width,p=a.height,m=(a.left+a.right)/2,g=(a.top+a.bottom)/2,v=Math.abs(e-t),y=Math.abs(n-r);v>2*w&&y>2*w?(v-=2*(h=w),y-=2*h):h=0;var x,b;d<=v&&p<=y?(x=!1,b=1):d<=y&&p<=v?(x=!0,b=1):dr?(u=(t+e)/2,f=n-h-c/2):(u=(t+e)/2,f=n+h+c/2);return i(m,g,u,f,b,x)}(l,c,u,f,T,M,"both"===g.constraintext||"inside"===g.constraintext),A.attr("transform",N)}}}function i(t,e,r,n,i,a){var o;i<1?o="scale("+i+") ":(i=1,o="");return"translate("+(r-i*t)+" "+(n-i*e)+")"+o+(a?"rotate("+a+" "+t+" "+e+") ":"")}function a(t,e,r,n){var i=o((e=e||{}).family,r),a=o(e.size,r),l=o(e.color,r);return{family:s(t.family,i,n.family),size:function(t,e,r){if(c(e)){e=+e;var n=t.min,i=t.max,a=void 0!==n&&ei;if(!a)return e}return void 0!==r?r:t.dflt}(t.size,a,n.size),color:function(t,e,r){return u(e).isValid()?e:void 0!==r?r:t.dflt}(t.color,l,n.color)}}function o(t,e){var r;return Array.isArray(t)?e.01?f:function(t,e){return Math.abs(t-e)>=2?f(t):t>e?Math.ceil(t):Math.floor(t)};g=A(g,m=A(m,g)),y=A(y,v=A(v,y))}var T=l.select(this);T.append("path").style("vector-effect","non-scaling-stroke").attr("d","M"+m+","+v+"V"+y+"H"+g+"V"+v+"Z"),n(t,T,e,s,m,g,v,y)}else l.select(this).remove()})}),s.call(m.plot,e)}},{"../../components/color":618,"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/svg_text_utils":766,"./attributes":883,d3:128,"fast-isnumeric":140,tinycolor2:546}],891:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n=t.cd,i=t.xaxis,a=t.yaxis,o=[];if(!1===e)for(r=0;ru+s||!p(l))&&(h=!0,c(f,t))}for(var i=r.traces,a=d(e),o="fraction"===t._fullLayout.barnorm?1:100,s=o/1e9,l=e.l2c(e.c2l(0)),u="stack"===t._fullLayout.barmode?o:l,f=[l,u],h=!1,g=0;g1||0===s.bargap&&0===s.bargroupgap&&!t[0].trace.marker.line.width)&&n.select(this).attr("shape-rendering","crispEdges")}),r.selectAll("g.points").each(function(e){var r=n.select(this),a=r.selectAll("path"),o=r.selectAll("text"),s=e[0].trace;i.pointStyle(a,s,t),i.selectedPointStyle(a,s),o.each(function(t){function e(e){var n=r[e];return Array.isArray(n)?n[t.i]:n}var r,a=n.select(this);a.classed("bartext-inside")?r=s.insidetextfont:a.classed("bartext-outside")&&(r=s.outsidetextfont),r||(r=s.textfont),i.font(a,e("family"),e("size"),e("color"))}),i.selectedTextStyle(o,s)}),a.style(r)}},{"../../components/drawing":643,"../../components/errorbars":649,d3:128}],895:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults");e.exports=function(t,e,r,o,s){r("marker.color",o),i(t,"marker")&&a(t,e,s,r,{prefix:"marker.",cLetter:"c"}),r("marker.line.color",n.defaultLine),i(t,"marker.line")&&a(t,e,s,r,{prefix:"marker.line.",cLetter:"c"}),r("marker.line.width"),r("marker.opacity"),r("selected.marker.color"),r("unselected.marker.color")}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],896:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../components/color/attributes"),a=t("../../lib/extend").extendFlat,o=n.marker,s=o.line;e.exports={y:{valType:"data_array",editType:"calc+clearAxisTypes"},x:{valType:"data_array",editType:"calc+clearAxisTypes"},x0:{valType:"any",editType:"calc+clearAxisTypes"},y0:{valType:"any",editType:"calc+clearAxisTypes"},name:{valType:"string",editType:"calc+clearAxisTypes"},text:a({},n.text,{}),whiskerwidth:{valType:"number",min:0,max:1,dflt:.5,editType:"calcIfAutorange"},boxpoints:{valType:"enumerated",values:["all","outliers","suspectedoutliers",!1],dflt:"outliers",editType:"calcIfAutorange"},boxmean:{valType:"enumerated",values:[!0,"sd",!1],dflt:!1,editType:"calcIfAutorange"},jitter:{valType:"number",min:0,max:1,editType:"calcIfAutorange"},pointpos:{valType:"number",min:-2,max:2,editType:"calcIfAutorange"},orientation:{valType:"enumerated",values:["v","h"],editType:"calc+clearAxisTypes"},marker:{outliercolor:{valType:"color",dflt:"rgba(0, 0, 0, 0)",editType:"style"},symbol:a({},o.symbol,{arrayOk:!1,editType:"plot"}),opacity:a({},o.opacity,{arrayOk:!1,dflt:1,editType:"style"}),size:a({},o.size,{arrayOk:!1,editType:"calcIfAutorange"}),color:a({},o.color,{arrayOk:!1,editType:"style"}),line:{color:a({},s.color,{arrayOk:!1,dflt:i.defaultLine,editType:"style"}),width:a({},s.width,{arrayOk:!1,dflt:0,editType:"style"}),outliercolor:{valType:"color",editType:"style"},outlierwidth:{valType:"number",min:0,dflt:1,editType:"style"},editType:"style"},editType:"plot"},line:{color:{valType:"color",editType:"style"},width:{valType:"number",min:0,dflt:2,editType:"style"},editType:"plot"},fillcolor:n.fillcolor,selected:{marker:n.selected.marker,editType:"style"},unselected:{marker:n.unselected.marker,editType:"style"},hoveron:{valType:"flaglist",flags:["boxes","points"],dflt:"boxes+points",editType:"style"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../scatter/attributes":1066}],897:[function(t,e,r){"use strict";function n(t,e){return t.v-e.v}function i(t){return t.v}var a=t("fast-isnumeric"),o=t("../../lib"),s=o._,l=t("../../plots/cartesian/axes");e.exports=function(t,e){var r,c,u,f,h,d=t._fullLayout,p=l.getFromId(t,e.xaxis||"x"),m=l.getFromId(t,e.yaxis||"y"),g=[],v="violin"===e.type?"_numViolins":"_numBoxes";"h"===e.orientation?(c=p,u="x",f=m,h="y"):(c=m,u="y",f=p,h="x");var y=c.makeCalcdata(e,u),x=function(t,e,r,n,i){if(e in t)return r.makeCalcdata(t,e);var s;s=e+"0"in t?t[e+"0"]:"name"in t&&("category"===r.type||a(t.name)&&-1!==["linear","log"].indexOf(r.type)||o.isDateTime(t.name)&&"date"===r.type)?t.name:i;var l=r.d2c(s,0,t[e+"calendar"]);return n.map(function(){return l})}(e,h,f,y,d[v]),b=o.distinctVals(x),_=b.vals,w=b.minDiff/2,M=function(t,e){for(var r=t.length,n=new Array(r+1),i=0;i=0&&E0){var C=T[r].sort(n),z=C.map(i),D=z.length,I={pos:_[r],pts:C};I.min=z[0],I.max=z[D-1],I.mean=o.mean(z,D),I.sd=o.stdev(z,D,I.mean),I.q1=o.interp(z,.25),I.med=o.interp(z,.5),I.q3=o.interp(z,.75),I.lf=Math.min(I.q1,z[Math.min(o.findBin(2.5*I.q1-1.5*I.q3,z,!0)+1,D-1)]),I.uf=Math.max(I.q3,z[Math.max(o.findBin(2.5*I.q3-1.5*I.q1,z),0)]),I.lo=4*I.q1-3*I.q3,I.uo=4*I.q3-3*I.q1,g.push(I)}return function(t,e){if(Array.isArray(e.selectedpoints))for(var r=0;r0?(g[0].t={num:d[v],dPos:w,posLetter:h,valLetter:u,labels:{med:s(t,"median:"),min:s(t,"min:"),q1:s(t,"q1:"),q3:s(t,"q3:"),max:s(t,"max:"),mean:"sd"===e.boxmean?s(t,"mean \xb1 \u03c3:"):s(t,"mean:"),lf:s(t,"lower fence:"),uf:s(t,"upper fence:")}},e._fullInput&&"candlestick"===e._fullInput.type&&delete g[0].t.labels,d[v]++,g):[{t:{empty:!0}}]}},{"../../lib":743,"../../plots/cartesian/axes":789,"fast-isnumeric":140}],898:[function(t,e,r){"use strict";function n(t,e,r,n){var i,a=r("y"),s=r("x");if(a&&a.length)i="v",s||r("x0");else{if(!s||!s.length)return void(e.visible=!1);i="h",r("y0")}o.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],n),r("orientation",i)}function i(t,e,r,n){var i=n.prefix,o=a.coerce2(t,e,l,"marker.outliercolor"),s=r("marker.line.outliercolor"),c=r(i+"points",o||s?"suspectedoutliers":void 0);c?(r("jitter","all"===c?.3:0),r("pointpos","all"===c?-1.5:0),r("marker.symbol"),r("marker.opacity"),r("marker.size"),r("marker.color",e.line.color),r("marker.line.color"),r("marker.line.width"),"suspectedoutliers"===c&&(r("marker.line.outliercolor",e.marker.color),r("marker.line.outlierwidth")),r("selected.marker.color"),r("unselected.marker.color"),r("selected.marker.size"),r("unselected.marker.size"),r("text")):delete e.marker,r("hoveron"),a.coerceSelectionMarkerOpacity(e,r)}var a=t("../../lib"),o=t("../../registry"),s=t("../../components/color"),l=t("./attributes");e.exports={supplyDefaults:function(t,e,r,o){function c(r,n){return a.coerce(t,e,l,r,n)}n(t,e,c,o),!1!==e.visible&&(c("line.color",(t.marker||{}).color||r),c("line.width"),c("fillcolor",s.addOpacity(e.line.color,.5)),c("whiskerwidth"),c("boxmean"),i(t,e,c,{prefix:"box"}))},handleSampleDefaults:n,handlePointsDefaults:i}},{"../../components/color":618,"../../lib":743,"../../registry":873,"./attributes":896}],899:[function(t,e,r){"use strict";function n(t,e,r,n){var i,c,u,f,h,d,p,m,g,v=t.cd,y=t.xa,x=t.ya,b=v[0].trace,_=v[0].t,w="violin"===b.type,M=[],k="closest"!==n||w?_.bdPos:2.5*_.bdPos,A=function(t){return t.pos+_.bPos-d};w&&"both"!==b.side?("positive"===b.side&&(g=function(t){var e=A(t);return s.inbox(e,e+k)}),"negative"===b.side&&(g=function(t){var e=A(t);return s.inbox(e-k,e)})):g=function(t){var e=A(t);return s.inbox(e-k,e+k)};var T;T=w?function(t){return s.inbox(t.span[0]-h,t.span[1]-h)}:function(t){return s.inbox(t.min-h,t.max-h)},"h"===b.orientation?(h=e,d=r,p=T,m=g,i="y",u=x,c="x",f=y):(h=r,d=e,p=g,m=T,i="x",u=y,c="y",f=x);var S=s.getDistanceFunction(n,p,m);if(s.getClosest(v,S,t),!1===t.index)return[];var E=v[t.index],L=b.line.color,C=(b.marker||{}).color;l.opacity(L)&&b.line.width?t.color=L:l.opacity(C)&&b.boxpoints?t.color=C:t.color=b.fillcolor,t[i+"0"]=u.c2p(E.pos+_.bPos-_.bdPos,!0),t[i+"1"]=u.c2p(E.pos+_.bPos+_.bdPos,!0),a.tickText(u,u.c2l(E.pos),"hover").text,t[i+"LabelVal"]=E.pos;var z={},D=["med","min","q1","q3","max"];(b.boxmean||(b.meanline||{}).visible)&&D.push("mean"),(b.boxpoints||b.points)&&D.push("lf","uf");for(var I=0;It.uf}),o=Math.max((t.max-t.min)/10,t.q3-t.q1),c=1e-9*o,u=o*h,m=[],g=0;if(r.jitter){if(0===o)for(g=1,m=new Array(a.length),e=0;et.lo&&(w.so=!0)}return a}).enter().append("path").classed("point",!0).call(c.translatePoints,a,o)}function o(t,e,r,n){var i,a,o=e.pos,c=e.val,u=n.bPos,f=n.bPosPxOffset||0;Array.isArray(n.bdPos)?(i=n.bdPos[0],a=n.bdPos[1]):(i=n.bdPos,a=n.bdPos),t.selectAll("path.mean").data(l.identity).enter().append("path").attr("class","mean").style({fill:"none","vector-effect":"non-scaling-stroke"}).each(function(t){var e=o.c2p(t.pos+u,!0)+f,n=o.c2p(t.pos+u-i,!0)+f,l=o.c2p(t.pos+u+a,!0)+f,h=c.c2p(t.mean,!0),d=c.c2p(t.mean-t.sd,!0),p=c.c2p(t.mean+t.sd,!0);"h"===r.orientation?s.select(this).attr("d","M"+h+","+n+"V"+l+("sd"===r.boxmean?"m0,0L"+d+","+e+"L"+h+","+n+"L"+p+","+e+"Z":"")):s.select(this).attr("d","M"+n+","+h+"H"+l+("sd"===r.boxmean?"m0,0L"+e+","+d+"L"+n+","+h+"L"+e+","+p+"Z":""))})}var s=t("d3"),l=t("../../lib"),c=t("../../components/drawing"),u=2e9,f=5,h=.01;e.exports={plot:function(t,e,r){var n=t._fullLayout,l=e.xaxis,c=e.yaxis;e.plot.select(".boxlayer").selectAll("g.trace.boxes").data(r).enter().append("g").attr("class","trace boxes").each(function(t){var e=t[0],r=e.t,u=e.trace,f=e.node3=s.select(this),h=n._numBoxes,d="group"===n.boxmode&&h>1,p=r.dPos*(1-n.boxgap)*(1-n.boxgroupgap)/(d?h:1),m=d?2*r.dPos*((r.num+.5)/h-.5)*(1-n.boxgap):0,g=p*u.whiskerwidth;if(!0!==u.visible||r.empty)s.select(this).remove();else{var v,y;"h"===u.orientation?(v=c,y=l):(v=l,y=c),r.bPos=m,r.bdPos=p,r.wdPos=g,i(f,{pos:v,val:y},u,r),u.boxpoints&&a(f,{x:l,y:c},u,r),u.boxmean&&o(f,{pos:v,val:y},u,r)}})},plotBoxAndWhiskers:i,plotPoints:a,plotBoxMean:o}},{"../../components/drawing":643,"../../lib":743,d3:128}],904:[function(t,e,r){"use strict";e.exports=function(t,e){var r,n,i=t.cd,a=t.xaxis,o=t.yaxis,s=[];if(!1===e)for(r=0;r=10)return null;for(var r=1/0,i=-1/0,a=t.length,o=0;o0?Math.floor:Math.ceil,z=E>0?Math.ceil:Math.floor,D=E>0?Math.min:Math.max,I=E>0?Math.max:Math.min,P=C(T+L),O=z(S-L),F=[[u=A(T)]];for(i=P;i*E=0;i--)a[u-i]=t[f][i],o[u-i]=e[f][i];for(s.push({x:a,y:o,bicubic:l}),i=f,a=[],o=[];i>=0;i--)a[f-i]=t[i][0],o[f-i]=e[i][0];return s.push({x:a,y:o,bicubic:c}),s}},{}],919:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e,r,a){function o(e){var n,i,o,s,l,c,u,f,h,d,p,g,v=[],y=[],x={};if("b"===r)for(i=t.b2j(e),o=Math.floor(Math.max(0,Math.min(P-2,i))),s=i-o,x.length=P,x.crossLength=I,x.xy=function(e){return t.evalxy([],e,i)},x.dxy=function(e,r){return t.dxydi([],e,o,r,s)},n=0;n0&&(h=t.dxydi([],n-1,o,0,s),v.push(l[0]+h[0]/3),y.push(l[1]+h[1]/3),d=t.dxydi([],n-1,o,1,s),v.push(f[0]-d[0]/3),y.push(f[1]-d[1]/3)),v.push(f[0]),y.push(f[1]),l=f;else for(n=t.a2i(e),c=Math.floor(Math.max(0,Math.min(I-2,n))),u=n-c,x.length=I,x.crossLength=P,x.xy=function(e){return t.evalxy([],n,e)},x.dxy=function(e,r){return t.dxydj([],c,e,u,r)},i=0;i0&&(p=t.dxydj([],c,i-1,u,0),v.push(l[0]+p[0]/3),y.push(l[1]+p[1]/3),g=t.dxydj([],c,i-1,u,1),v.push(f[0]-g[0]/3),y.push(f[1]-g[1]/3)),v.push(f[0]),y.push(f[1]),l=f;return x.axisLetter=r,x.axis=M,x.crossAxis=E,x.value=e,x.constvar=a,x.index=m,x.x=v,x.y=y,x.smoothing=E.smoothing,x}function s(e){var n,i,o,s,l,c=[],u=[],f={};if(f.length=w.length,f.crossLength=S.length,"b"===r)for(o=Math.max(0,Math.min(P-2,e)),l=Math.min(1,Math.max(0,e-o)),f.xy=function(r){return t.evalxy([],r,e)},f.dxy=function(e,r){return t.dxydi([],e,o,r,l)},n=0;nw.length-1||k.push(i(s(c),{color:M.gridcolor,width:M.gridwidth}));for(m=d;mw.length-1||y<0||y>w.length-1))for(x=w[u],b=w[y],l=0;lw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(s(0),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(s(w.length-1),{color:M.endlinecolor,width:M.endlinewidth}))}else{for(f=5e-15,d=(h=[Math.floor((w[w.length-1]-M.tick0)/M.dtick*(1+f)),Math.ceil((w[0]-M.tick0)/M.dtick/(1+f))].sort(function(t,e){return t-e}))[0],p=h[1],m=d;m<=p;m++)g=M.tick0+M.dtick*m,k.push(i(o(g),{color:M.gridcolor,width:M.gridwidth}));for(m=d-1;mw[w.length-1]||A.push(i(o(v),{color:M.minorgridcolor,width:M.minorgridwidth}));M.startline&&T.push(i(o(w[0]),{color:M.startlinecolor,width:M.startlinewidth})),M.endline&&T.push(i(o(w[w.length-1]),{color:M.endlinecolor,width:M.endlinewidth}))}}},{"../../lib/extend":732,"../../plots/cartesian/axes":789}],920:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("../../lib/extend").extendFlat;e.exports=function(t,e){var r,a,o,s=e._labels=[],l=e._gridlines;for(r=0;re.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t=t.slice(0,e.length)):t=[],n=0;ne.length&&(t[n]=t[n].slice(0,e.length)):t[n]=[],i=0;i90&&(d-=180,l=-l),{angle:d,flip:l,p:t.c2p(n,e,r),offsetMultplier:c}}},{}],936:[function(t,e,r){"use strict";function n(t,e,r){var n=t.selectAll(e+"."+r).data([0]);return n.enter().append(e).classed(r,!0),n}function i(t,e,r){var i=r[0],l=r[0].trace,c=e.xaxis,d=e.yaxis,m=l.aaxis,g=l.baxis,v=t._fullLayout,y=e.plot.selectAll(".carpetlayer"),x=v._clips,b=n(y,"g","carpet"+l.uid).classed("trace",!0),_=n(b,"g","minorlayer"),w=n(b,"g","majorlayer"),M=n(b,"g","boundarylayer"),k=n(b,"g","labellayer");b.style("opacity",l.opacity),a(c,d,w,m,"a",m._gridlines),a(c,d,w,g,"b",g._gridlines),a(c,d,_,m,"a",m._minorgridlines),a(c,d,_,g,"b",g._minorgridlines),a(c,d,M,m,"a-boundary",m._boundarylines),a(c,d,M,g,"b-boundary",g._boundarylines);!function(t,e,r,n,i,a,o,l){var c,u,f,d;c=.5*(r.a[0]+r.a[r.a.length-1]),u=r.b[0],f=r.ab2xy(c,u,!0),d=r.dxyda_rough(c,u),void 0===o.angle&&p.extendFlat(o,h(r,i,a,f,r.dxydb_rough(c,u)));s(t,e,r,n,f,d,r.aaxis,i,a,o,"a-title"),c=r.a[0],u=.5*(r.b[0]+r.b[r.b.length-1]),f=r.ab2xy(c,u,!0),d=r.dxydb_rough(c,u),void 0===l.angle&&p.extendFlat(l,h(r,i,a,f,r.dxyda_rough(c,u)));s(t,e,r,n,f,d,r.baxis,i,a,l,"b-title")}(t,k,l,i,c,d,o(t,c,d,l,i,k,m._labels,"a-label"),o(t,c,d,l,i,k,g._labels,"b-label")),function(t,e,r,i,a){var o,s,l,c,h=r.select("#"+t._clipPathId);h.size()||(h=r.append("clipPath").classed("carpetclip",!0));var d=n(h,"path","carpetboundary"),p=e.clipsegments,m=[];for(c=0;c0?"start":"end","data-notex":1}).call(c.font,i.font).text(i.text).call(d.convertToTspans,t),g=c.bBox(this);m.attr("transform","translate("+o.p[0]+","+o.p[1]+") rotate("+o.angle+")translate("+i.axis.labelpadding*u+","+.3*g.height+")"),f=Math.max(f,g.width+i.axis.labelpadding)}),u.exit().remove(),p.maxExtent=f,p}function s(t,e,r,n,i,a,o,s,u,f,p){var m=[];o.title&&m.push(o.title);var y=e.selectAll("text."+p).data(m),x=f.maxExtent;y.enter().append("text").classed(p,!0),y.each(function(){var e=h(r,s,u,i,a);-1===["start","both"].indexOf(o.showticklabels)&&(x=0);var n=o.titlefont.size;x+=n+o.titleoffset;var p=(f.angle+(f.flip<0?180:0)-e.angle+450)%360,m=p>90&&p<270,y=l.select(this);y.text(o.title||"").call(d.convertToTspans,t),m&&(x=(-d.lineCount(y)+v)*g*n-x),y.attr("transform","translate("+e.p[0]+","+e.p[1]+") rotate("+e.angle+") translate(0,"+x+")").classed("user-select-none",!0).attr("text-anchor","middle").call(c.font,o.titlefont)}),y.exit().remove()}var l=t("d3"),c=t("../../components/drawing"),u=t("./map_1d_array"),f=t("./makepath"),h=t("./orient_text"),d=t("../../lib/svg_text_utils"),p=t("../../lib"),m=t("../../constants/alignment");e.exports=function(t,e,r){for(var n=0;nd&&tm&&ep||eg},f.c2p=function(t){return t},h.c2p=function(t){return t},t.setScale=function(){var e=t.x,r=t.y,n=a(t.xctrl,t.yctrl,e,r,f.smoothing,h.smoothing);t.xctrl=n[0],t.yctrl=n[1],t.evalxy=o([t.xctrl,t.yctrl],c,u,f.smoothing,h.smoothing),t.dxydi=s([t.xctrl,t.yctrl],f.smoothing,h.smoothing),t.dxydj=l([t.xctrl,t.yctrl],f.smoothing,h.smoothing)},t.i2a=function(t){var r=Math.max(0,Math.floor(t[0]),c-2),n=t[0]-r;return(1-n)*e[r]+n*e[r+1]},t.j2b=function(t){var e=Math.max(0,Math.floor(t[1]),c-2),n=t[1]-e;return(1-n)*r[e]+n*r[e+1]},t.ij2ab=function(e){return[t.i2a(e[0]),t.j2b(e[1])]},t.a2i=function(t){var r=Math.max(0,Math.min(i(t,e),c-2)),n=e[r],a=e[r+1];return Math.max(0,Math.min(c-1,r+(t-n)/(a-n)))},t.b2j=function(t){var e=Math.max(0,Math.min(i(t,r),u-2)),n=r[e],a=r[e+1];return Math.max(0,Math.min(u-1,e+(t-n)/(a-n)))},t.ab2ij=function(e){return[t.a2i(e[0]),t.b2j(e[1])]},t.i2c=function(e,r){return t.evalxy([],e,r)},t.ab2xy=function(n,i,a){if(!a&&(ne[c-1]|ir[u-1]))return[!1,!1];var o=t.a2i(n),s=t.b2j(i),l=t.evalxy([],o,s);if(a){var f,h,d,p,m=0,g=0,v=[];ne[c-1]?(f=c-2,h=1,m=(n-e[c-1])/(e[c-1]-e[c-2])):h=o-(f=Math.max(0,Math.min(c-2,Math.floor(o)))),ir[u-1]?(d=u-2,p=1,g=(i-r[u-1])/(r[u-1]-r[u-2])):p=s-(d=Math.max(0,Math.min(u-2,Math.floor(s)))),m&&(t.dxydi(v,f,d,h,p),l[0]+=v[0]*m,l[1]+=v[1]*m),g&&(t.dxydj(v,f,d,h,p),l[0]+=v[0]*g,l[1]+=v[1]*g)}return l},t.c2p=function(t,e,r){return[e.c2p(t[0]),r.c2p(t[1])]},t.p2x=function(t,e,r){return[e.p2c(t[0]),r.p2c(t[1])]},t.dadi=function(t){var r=Math.max(0,Math.min(e.length-2,t));return e[r+1]-e[r]},t.dbdj=function(t){var e=Math.max(0,Math.min(r.length-2,t));return r[e+1]-r[e]},t.dxyda=function(e,r,n,i){var a=t.dxydi(null,e,r,n,i),o=t.dadi(e,n);return[a[0]/o,a[1]/o]},t.dxydb=function(e,r,n,i){var a=t.dxydj(null,e,r,n,i),o=t.dbdj(r,i);return[a[0]/o,a[1]/o]},t.dxyda_rough=function(e,r,n){var i=v*(n||.1),a=t.ab2xy(e+i,r,!0),o=t.ab2xy(e-i,r,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dxydb_rough=function(e,r,n){var i=y*(n||.1),a=t.ab2xy(e,r+i,!0),o=t.ab2xy(e,r-i,!0);return[.5*(a[0]-o[0])/i,.5*(a[1]-o[1])/i]},t.dpdx=function(t){return t._m},t.dpdy=function(t){return t._m}}},{"../../lib/search":761,"./compute_control_points":923,"./constants":924,"./create_i_derivative_evaluator":925,"./create_j_derivative_evaluator":926,"./create_spline_evaluator":927}],938:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e,r){function i(e,r){var n,i=0,a=0;return e>0&&void 0!==(n=t[r][e-1])&&(a++,i+=n),e0&&void 0!==(n=t[r-1][e])&&(a++,i+=n),r0&&o0&&a1e-5);return n.log("Smoother converged to",k,"after",A,"iterations"),t}},{"../../lib":743}],939:[function(t,e,r){"use strict";var n=t("./has_columns"),i=t("../heatmap/convert_column_xyz");e.exports=function(t,e,r){var a=[],o=r("x");o&&!n(o)&&a.push("x"),e._cheater=!o;var s=r("y");if(s&&!n(s)&&a.push("y"),o||s)return a.length&&i(e,e.aaxis,e.baxis,"a","b",a),!0}},{"../heatmap/convert_column_xyz":981,"./has_columns":929}],940:[function(t,e,r){"use strict";var n=t("../scattergeo/attributes"),i=t("../../components/colorscale/attributes"),a=t("../../components/colorbar/attributes"),o=t("../../plots/attributes"),s=t("../../lib/extend"),l=s.extendFlat,c=s.extendDeepAll,u=n.marker.line;e.exports=l({locations:{valType:"data_array",editType:"calc"},locationmode:n.locationmode,z:{valType:"data_array",editType:"calc"},text:l({},n.text,{}),marker:{line:{color:u.color,width:l({},u.width,{dflt:1}),editType:"calc"},opacity:{valType:"number",arrayOk:!0,min:0,max:1,dflt:1,editType:"style"},editType:"calc"},selected:{marker:{opacity:n.selected.marker.opacity,editType:"plot"},editType:"plot"},unselected:{marker:{opacity:n.unselected.marker.opacity,editType:"plot"},editType:"plot"},hoverinfo:l({},o.hoverinfo,{editType:"calc",flags:["location","z","text","name"]})},c({},i,{zmax:{editType:"calc"},zmin:{editType:"calc"}}),{colorbar:a})},{"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plots/attributes":787,"../scattergeo/attributes":1104}],941:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../constants/numerical").BADNUM,a=t("../../components/colorscale/calc"),o=t("../scatter/arrays_to_calcdata"),s=t("../scatter/calc_selection");e.exports=function(t,e){for(var r=e.locations.length,l=new Array(r),c=0;cl&&(e.z=u.slice(0,l)),s("locationmode"),s("text"),s("marker.line.color"),s("marker.line.width"),s("marker.opacity"),i(t,e,o,s,{prefix:"",cLetter:"z"}),n.coerceSelectionMarkerOpacity(e,s)):e.visible=!1}else e.visible=!1}},{"../../components/colorscale/defaults":628,"../../lib":743,"./attributes":940}],943:[function(t,e,r){"use strict";e.exports=function(t,e){return t.location=e.location,t.z=e.z,t}},{}],944:[function(t,e,r){"use strict";var n=t("../../plots/cartesian/axes"),i=t("./attributes"),a=t("../scatter/fill_hover_text");e.exports=function(t,e,r){var o,s,l,c,u=t.cd,f=u[0].trace,h=t.subplot;for(s=0;s")}(t,f,o,h.mockAxis),[t]}},{"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"./attributes":940}],945:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../heatmap/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="choropleth",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","noOpacity"],n.meta={},e.exports=n},{"../../plots/geo":820,"../heatmap/colorbar":980,"./attributes":940,"./calc":941,"./defaults":942,"./event_data":943,"./hover":944,"./plot":946,"./select":947,"./style":948}],946:[function(t,e,r){"use strict";function n(t,e){for(var r=t[0].trace,n=t.length,i=s(r,e),a=0;a0&&t[e+1][0]<0)return e;return null}var r,n,i,a,s=t.geometry,l=s.coordinates,c=t.id,u=[];r="RUS"===c||"FJI"===c?function(t){var r;if(null===e(t))r=t;else for(r=new Array(t.length),a=0;ar?n[i++]=[t[a][0]+360,t[a][1]]:a===r?(n[i++]=t[a],n[i++]=[t[a][0],-90]):n[i++]=t[a];var s=o.tester(n);s.pts.pop(),u.push(s)}:function(t){u.push(o.tester(t))};switch(s.type){case"MultiPolygon":for(n=0;ns.end&&(s.start=s.end=(s.start+s.end)/2),e._input.contours||(e._input.contours={}),a(e._input.contours,{start:s.start,end:s.end,size:s.size}),e._input.autocontour=!0}else{var c=s.start,u=s.end,f=e._input.contours;if(c>u&&(s.start=f.start=u,u=s.end=f.end=c,c=s.start),!(s.size>0)){var h;h=c===u?1:n(c,u,e.ncontours).dtick,f.size=s.size=h}}return r}},{"../../lib":743,"../../plots/cartesian/axes":789,"../heatmap/calc":978}],951:[function(t,e,r){"use strict";var n=t("../../plots/plots"),i=t("../../components/colorbar/draw"),a=t("./make_color_map"),o=t("./end_plus");e.exports=function(t,e){var r=e[0].trace,s="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+s).remove(),r.showscale){var l=i(t,s);e[0].t.cb=l;var c=r.contours,u=r.line,f=c.size||1,h=c.coloring,d=a(r,{isColorbar:!0});"heatmap"===h&&l.filllevels({start:r.zmin,end:r.zmax,size:(r.zmax-r.zmin)/254}),l.fillcolor("fill"===h||"heatmap"===h?d:"").line({color:"lines"===h?d:u.color,width:!1!==c.showlines?u.width:0,dash:u.dash}).levels({start:c.start,end:o(c),size:f}).options(r.colorbar)()}else n.autoMargin(t,s)}},{"../../components/colorbar/draw":622,"../../plots/plots":852,"./end_plus":955,"./make_color_map":959}],952:[function(t,e,r){"use strict";e.exports={BOTTOMSTART:[1,9,13,104,713],TOPSTART:[4,6,7,104,713],LEFTSTART:[8,12,14,208,1114],RIGHTSTART:[2,3,11,208,1114],NEWDELTA:[null,[-1,0],[0,-1],[-1,0],[1,0],null,[0,-1],[-1,0],[0,1],[0,1],null,[0,1],[1,0],[1,0],[0,-1]],CHOOSESADDLE:{104:[4,1],208:[2,8],713:[7,13],1114:[11,14]},SADDLEREMAINDER:{1:4,2:8,4:1,7:13,8:2,11:14,13:7,14:11},LABELDISTANCE:2,LABELINCREASE:10,LABELMIN:3,LABELMAX:10,LABELOPTIMIZER:{EDGECOST:1,ANGLECOST:1,NEIGHBORCOST:5,SAMELEVELFACTOR:10,SAMELEVELDISTANCE:5,MAXCOST:100,INITIALSEARCHPOINTS:10,ITERATIONS:5}}},{}],953:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){var a=n.coerce2(t,e,i,"contours.start"),o=n.coerce2(t,e,i,"contours.end"),s=!1===a||!1===o,l=r("contours.size");!(s?e.autocontour=!0:r("autocontour",!1))&&l||r("ncontours")}},{"../../lib":743,"./attributes":949}],954:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("../heatmap/has_columns"),a=t("../heatmap/xyz_defaults"),o=t("./contours_defaults"),s=t("./style_defaults"),l=t("./attributes");e.exports=function(t,e,r,c){function u(r,i){return n.coerce(t,e,l,r,i)}a(t,e,u,c)?(u("text"),u("connectgaps",i(e)),o(t,e,u),s(t,e,u,c)):e.visible=!1}},{"../../lib":743,"../heatmap/has_columns":984,"../heatmap/xyz_defaults":993,"./attributes":949,"./contours_defaults":953,"./style_defaults":963}],955:[function(t,e,r){"use strict";e.exports=function(t){return t.end+t.size/1e6}},{}],956:[function(t,e,r){"use strict";function n(t,e,r,n){return Math.abs(t[0]-e[0])20&&e?208===t||1114===t?n=0===r[0]?1:-1:i=0===r[1]?1:-1:-1!==l.BOTTOMSTART.indexOf(t)?i=1:-1!==l.LEFTSTART.indexOf(t)?n=1:-1!==l.TOPSTART.indexOf(t)?i=-1:n=-1;return[n,i]}(p,r,e),g=[o(t,e,[-m[0],-m[1]])],v=m.join(","),y=t.z.length,x=t.z[0].length;for(f=0;f<1e4;f++){if(p>20?(p=l.CHOOSESADDLE[p][(m[0]||m[1])<0?0:1],t.crossings[d]=l.SADDLEREMAINDER[p]):delete t.crossings[d],!(m=l.NEWDELTA[p])){s.log("Found bad marching index:",p,e,t.level);break}g.push(o(t,e,m)),e[0]+=m[0],e[1]+=m[1],n(g[g.length-1],g[g.length-2],a,c)&&g.pop(),d=e.join(",");var b=m[0]&&(e[0]<0||e[0]>x-2)||m[1]&&(e[1]<0||e[1]>y-2);if(d===h&&m.join(",")===v||r&&b)break;p=t.crossings[d]}1e4===f&&s.log("Infinite loop in contour?");var _,w,M,k,A,T,S,E,L,C,z,D=n(g[0],g[g.length-1],a,c),I=0,P=.2*t.smoothing,O=[],F=0;for(f=1;f=F;f--)if((_=O[f])=F&&_+O[w]E&&L--,t.edgepaths[L]=z.concat(g,C));break}j||(t.edgepaths[E]=g.concat(C))}for(E=0;Et?0:1)+(e[0][1]>t?0:2)+(e[1][1]>t?0:4)+(e[1][0]>t?0:8);if(5===r||10===r)return t>(e[0][0]+e[0][1]+e[1][0]+e[1][1])/4?5===r?713:1114:5===r?104:208;return 15===r?0:r}((c=t[u]).level,s))&&(c.crossings[o]=l,-1!==i.indexOf(l)&&(c.starts.push([e,r]),p&&-1!==i.indexOf(l,i.indexOf(l)+1)&&c.starts.push([e,r])))}},{"./constants":952}],961:[function(t,e,r){"use strict";function n(t,e,n){var l=n[0].trace,c=n[0].x,u=n[0].y,g=l.contours,v=l.uid,y=e.xaxis,x=e.yaxis,b=t._fullLayout,_="contour"+v,w=function(t,e,r){for(var n=t.size,i=[],a=p(t),s=t.start;s1e3){o.warn("Too many contours, clipping at 1000",t);break}return i}(g,e,n[0]);if(!0!==l.visible)return b._paper.selectAll("."+_+",.hm"+v).remove(),void b._infolayer.selectAll(".cb"+v).remove();"heatmap"===g.coloring?(l.zauto&&!1===l.autocontour&&(l._input.zmin=l.zmin=g.start-g.size/2,l._input.zmax=l.zmax=l.zmin+w.length*g.size),f(t,e,[n])):(b._paper.selectAll(".hm"+v).remove(),b._infolayer.selectAll("g.rangeslider-container").selectAll(".hm"+v).remove()),h(w),d(w);var M=y.c2p(c[0],!0),k=y.c2p(c[c.length-1],!0),A=x.c2p(u[0],!0),T=x.c2p(u[u.length-1],!0),S=[[M,T],[k,T],[k,A],[M,A]],E=r.makeContourGroup(e,n,_);!function(t,e,r){var n=t.selectAll("g.contourbg").data([0]);n.enter().append("g").classed("contourbg",!0);var i=n.selectAll("path").data("fill"===r.coloring?[0]:[]);i.enter().append("path"),i.exit().remove(),i.attr("d","M"+e.join("L")+"Z").style("stroke","none")}(E,S,g),function(t,e,r,n){var o=t.selectAll("g.contourfill").data([0]);o.enter().append("g").classed("contourfill",!0);var s=o.selectAll("path").data("fill"===n.coloring?e:[]);s.enter().append("path"),s.exit().remove(),s.each(function(t){var e=i(t,r);e?a.select(this).attr("d",e).style("stroke","none"):a.select(this).remove()})}(E,w,S,g),function(t,e,n,i,l,c){var u=t.selectAll("g.contourlines").data([0]);u.enter().append("g").classed("contourlines",!0);var f=!1!==l.showlines,h=l.showlabels,d=f&&h,p=r.createLines(u,f||h,e),g=r.createLineClip(u,d,n._fullLayout._clips,i.trace.uid),v=t.selectAll("g.contourlabels").data(h?[0]:[]);if(v.exit().remove(),v.enter().append("g").classed("contourlabels",!0),h){var y=[c],x=[];o.clearLocationCache();var b=r.labelFormatter(l,i.t.cb,n._fullLayout),_=s.tester.append("text").attr("data-notex",1).call(s.font,l.labelfont),w=e[0].xaxis._length,M=e[0].yaxis._length,k={left:Math.max(c[0][0],0),right:Math.min(c[2][0],w),top:Math.max(c[0][1],0),bottom:Math.min(c[2][1],M)};k.middle=(k.top+k.bottom)/2,k.center=(k.left+k.right)/2;var A=Math.sqrt(w*w+M*M),T=m.LABELDISTANCE*A/Math.max(1,e.length/m.LABELINCREASE);p.each(function(t){var e=r.calcTextOpts(t.level,b,_,n);a.select(this).selectAll("path").each(function(){var t=o.getVisibleSegment(this,k,e.height/2);if(t&&!(t.len<(e.width+e.height)*m.LABELMIN))for(var n=Math.min(Math.ceil(t.len/T),m.LABELMAX),i=0;i=0&&(c=x,f=h):Math.abs(l[1]-c[1])<.01?Math.abs(l[1]-x[1])<.01&&(x[0]-l[0])*(c[0]-x[0])>=0&&(c=x,f=h):o.log("endpt to newendpt is not vert. or horz.",l,c,x)}if(l=c,f>=0)break;m+="L"+c}if(f===t.edgepaths.length){o.log("unclosed perimeter path");break}g=f,(y=-1===v.indexOf(g))&&(g=v[0],m+="Z")}for(g=0;gn.center?n.right-s:s-n.left)/(u+Math.abs(Math.sin(c)*a)),d=(l>n.middle?n.bottom-l:l-n.top)/(Math.abs(f)+Math.cos(c)*a);if(h<1||d<1)return 1/0;var p=g.EDGECOST*(1/(h-1)+1/(d-1));p+=g.ANGLECOST*c*c;for(var m=s-u,v=l-f,y=s+u,x=l+f,b=0;b2*g.MAXCOST)break;d&&(s/=2),l=(a=c-s/2)+1.5*s}if(h<=g.MAXCOST)return u},r.addLabelData=function(t,e,r,n){var i=e.width/2,a=e.height/2,o=t.x,s=t.y,l=t.theta,c=Math.sin(l),u=Math.cos(l),f=i*u,h=a*c,d=i*c,p=-a*u,m=[[o-f-h,s-d-p],[o+f-h,s+d-p],[o+f+h,s+d+p],[o-f+h,s-d+p]];r.push({text:e.text,x:o,y:s,dy:e.dy,theta:l,level:e.level,width:e.width,height:e.height}),n.push(m)},r.drawLabels=function(t,e,r,n,i){var o=t.selectAll("text").data(e,function(t){return t.text+","+t.x+","+t.y+","+t.theta});if(o.exit().remove(),o.enter().append("text").attr({"data-notex":1,"text-anchor":"middle"}).each(function(t){var e=t.x+Math.sin(t.theta)*t.dy,n=t.y-Math.cos(t.theta)*t.dy;a.select(this).text(t.text).attr({x:e,y:n,transform:"rotate("+180*t.theta/Math.PI+" "+e+" "+n+")"}).call(l.convertToTspans,r)}),i){for(var s="",c=0;cx.end&&(x.start=x.end=(x.start+x.end)/2),e._input.contours=a({},x)}else{var _=x.start,w=x.end,M=e._input.contours;if(_>w&&(x.start=M.start=w,w=x.end=M.end=_,_=x.start),!(x.size>0)){var k;k=_===w?1:n(_,w,e.ncontours).dtick,M.size=x.size=k}}return y}}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../carpet/lookup_carpetid":931,"../heatmap/clean_2d_array":979,"../heatmap/convert_column_xyz":981,"../heatmap/find_empties":983,"../heatmap/has_columns":984,"../heatmap/interp2d":987,"../heatmap/make_bound_array":988,"../heatmap/max_row_length":989,"./defaults":971}],966:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i,a,o,s=n.a.length,l=n.b.length,c=n.z,u=-1/0,f=1/0;for(i=0;i":case">=":n.contours.value>u&&(t[0].prefixBoundary=!0);break;case"<":case"<=":n.contours.valueu&&(t[0].prefixBoundary=!0);break;case"][":case")(":a=Math.min.apply(null,n.contours.value),o=Math.max.apply(null,n.contours.value),au&&(t[0].prefixBoundary=!0)}}},{}],967:[function(t,e,r){"use strict";e.exports={INEQUALITY_OPS:["=","<",">=",">","<="],INTERVAL_OPS:["[]","()","[)","(]","][",")(","](",")["],SET_OPS:["{}","}{"]}},{}],968:[function(t,e,r){"use strict";function n(t,e){function r(t){return s(t)?+t:null}var n,i=Array.isArray(e);return-1!==o.INEQUALITY_OPS.indexOf(t)?n=r(i?e[0]:e):-1!==o.INTERVAL_OPS.indexOf(t)?n=i?[r(e[0]),r(e[1])]:[r(e),r(e)]:-1!==o.SET_OPS.indexOf(t)&&(n=i?e.map(r):[r(e)]),n}function i(t){return function(e){e=n(t,e);var r=Math.min(e[0],e[1]),i=Math.max(e[0],e[1]);return{start:r,end:i,size:i-r}}}function a(t){return function(e){return e=n(t,e),{start:e,end:1/0,size:1/0}}}var o=t("./constants"),s=t("fast-isnumeric");e.exports["[]"]=i("[]"),e.exports["()"]=i("()"),e.exports["[)"]=i("[)"),e.exports["(]"]=i("(]"),e.exports["]["]=i("]["),e.exports[")("]=i(")("),e.exports[")["]=i(")["),e.exports["]("]=i("]("),e.exports[">"]=a(">"),e.exports[">="]=a(">="),e.exports["<"]=a("<"),e.exports["<="]=a("<="),e.exports["="]=a("=")},{"./constants":967,"fast-isnumeric":140}],969:[function(t,e,r){"use strict";var n=t("./constraint_mapping"),i=t("fast-isnumeric");e.exports=function(t,e){var r;-1===["=","<","<=",">",">="].indexOf(e.operation)?(t("contours.value",[0,1]),Array.isArray(e.value)?e.value.length>2?e.value=e.value.slice(2):0===e.length?e.value=[0,1]:e.length<2?(r=parseFloat(e.value[0]),e.value=[r,r+1]):e.value=[parseFloat(e.value[0]),parseFloat(e.value[1])]:i(e.value)&&(r=parseFloat(e.value),e.value=[r,r+1])):(t("contours.value",0),i(e.value)||(Array.isArray(e.value)?e.value=parseFloat(e.value[0]):e.value=0));var a=n[e.operation](e.value);e.start=a.start,e.end=a.end,e.size=a.size}},{"./constraint_mapping":968,"fast-isnumeric":140}],970:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){var r,i,a,o=function(t){return t.reverse()},s=function(t){return t};switch(e){case"][":case")[":case"](":case")(":var l=o;o=s,s=l;case"[]":case"[)":case"(]":case"()":if(2!==t.length)return void n.warn("Contour data invalid for the specified inequality range operation.");for(i=t[0],a=t[1],r=0;r=":case">":if(1!==t.length)return void n.warn("Contour data invalid for the specified inequality operation.");for(i=t[0],r=0;r1e3){n.warn("Too many contours, clipping at 1000",t);break}return a}},{"../../lib":743}],973:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../contour/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../contour/style"),n.moduleType="trace",n.name="contourcarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","carpet","contour","symbols","showLegend","hasLines","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../contour/colorbar":951,"../contour/style":962,"./attributes":964,"./calc":965,"./defaults":971,"./plot":976}],974:[function(t,e,r){"use strict";var n=t("../../components/drawing"),i=t("../carpet/axis_aligned_line"),a=t("../../lib");e.exports=function(t,e,r,o,s,l,c,u){function f(t){return Math.abs(t[1]-r[0][1])=0&&(y=L,b=_):Math.abs(v[1]-y[1])=0&&(y=L,b=_):a.log("endpt to newendpt is not vert. or horz.",v,y,L)}if(b>=0)break;M+=m(v,y),v=y}if(b===e.edgepaths.length){a.log("unclosed perimeter path");break}g=b,(A=-1===k.indexOf(g))&&(g=k[0],M+=m(v,y)+"Z",v=null)}for(g=0;g=0;U--)N=k.clipsegments[U],j=l([],N.x,L.c2p),B=l([],N.y,C.c2p),j.reverse(),B.reverse(),q.push(c(j,B,N.bicubic));var H="M"+q.join("L")+"Z";!function(t,e,r,n,i,a){var o,s,u,f,h=t.selectAll("g.contourbg").data([0]);h.enter().append("g").classed("contourbg",!0);var d=h.selectAll("path").data("fill"!==a||i?[]:[0]);d.enter().append("path"),d.exit().remove();var p=[];for(f=0;fx&&(n.max=x);n.len=n.max-n.min}(this,r,t,n,h,e.height),!(n.len<(e.width+e.height)*m.LABELMIN)))for(var s=Math.min(Math.ceil(n.len/D),m.LABELMAX),l=0;lz){r("x scale is not linear");break}}if(y.length&&"fast"===L){var D=(y[y.length-1]-y[0])/(y.length-1),I=Math.abs(D/100);for(w=0;wI){r("y scale is not linear");break}}}var P=u(_),O="scaled"===e.xtype?"":m,F=p(e,O,g,v,P,k),R="scaled"===e.ytype?"":y,N=p(e,R,x,b,_.length,A);E||(a.expand(k,F),a.expand(A,N));var j={x:F,y:N,z:_,text:e.text};if(O&&O.length===F.length-1&&(j.xCenter=O),R&&R.length===N.length-1&&(j.yCenter=R),S&&(j.xRanges=M.xRanges,j.yRanges=M.yRanges,j.pts=M.pts),s(e,_,"","z"),T&&e.contours&&"heatmap"===e.contours.coloring){var B={type:"contour"===e.type?"heatmap":"histogram2d",xcalendar:e.xcalendar,ycalendar:e.ycalendar};j.xfill=p(B,O,g,v,P,k),j.yfill=p(B,R,x,b,_.length,A)}return[j]}},{"../../components/colorscale/calc":625,"../../lib":743,"../../plots/cartesian/axes":789,"../../registry":873,"../histogram2d/calc":1010,"./clean_2d_array":979,"./convert_column_xyz":981,"./find_empties":983,"./has_columns":984,"./interp2d":987,"./make_bound_array":988,"./max_row_length":989}],979:[function(t,e,r){"use strict";var n=t("fast-isnumeric");e.exports=function(t,e){function r(t){if(n(t))return+t}var i,a,o,s,l,c;if(e){for(i=0,l=0;l=0;o--)(s=((f[[(r=(a=h[o])[0])-1,i=a[1]]]||m)[2]+(f[[r+1,i]]||m)[2]+(f[[r,i-1]]||m)[2]+(f[[r,i+1]]||m)[2])/20)&&(l[a]=[r,i,s],h.splice(o,1),c=!0);if(!c)throw"findEmpties iterated with no new neighbors";for(a in l)f[a]=l[a],u.push(l[a])}return u.sort(function(t,e){return e[2]-t[2]})}},{"./max_row_length":989}],984:[function(t,e,r){"use strict";e.exports=function(t){return!Array.isArray(t.z[0])}},{}],985:[function(t,e,r){"use strict";var n=t("../../components/fx"),i=t("../../lib"),a=t("../../plots/cartesian/axes"),o=n.constants.MAXDIST;e.exports=function(t,e,r,s,l,c){if(!(t.distance=b[0].length||d<0||d>b.length)return}else{if(n.inbox(e-y[0],e-y[y.length-1])>o||n.inbox(r-x[0],r-x[x.length-1])>o)return;if(c){var E;for(T=[2*y[0]-y[1]],E=1;Em&&(v=Math.max(v,Math.abs(t[i][a]-p)/(g-m))))}return v}var a=t("../../lib"),o=[[-1,0],[1,0],[0,-1],[0,1]];e.exports=function(t,e,r){var o,s,l=1;if(Array.isArray(r))for(o=0;o.01;o++)l=i(t,e,n(l));return l>.01&&a.log("interp2d didn't converge quickly",l),t}},{"../../lib":743}],988:[function(t,e,r){"use strict";var n=t("../../registry");e.exports=function(t,e,r,i,a,o){var s,l,c,u=[],f=n.traceIs(t,"contour"),h=n.traceIs(t,"histogram"),d=n.traceIs(t,"gl2d");if(Array.isArray(e)&&e.length>1&&!h&&"category"!==o.type){var p=e.length;if(!(p<=a))return f?e.slice(0,a):e.slice(0,a+1);if(f||d)u=e.slice(0,a);else if(1===a)u=[e[0]-.5,e[0]+.5];else{for(u=[1.5*e[0]-.5*e[1]],c=1;c0;)w=v.c2p(E[T]),T--;for(w<_&&(M=w,w=_,_=M,F=!0),T=0;void 0===k&&T0;)A=y.c2p(L[T]),T--;if(A0&&(n=!0);for(var s=0;sa){var o=a-r[t];return r[t]=a,o}}return 0},max:function(t,e,r,i){var a=i[e];if(n(a)){if(a=Number(a),!n(r[t]))return r[t]=a,a;if(r[t]c){var l=a(e,i,o),u=a(r,i,o),f=t===s?0:1;return l[f]!==u[f]}return Math.floor(r/t)-Math.floor(e/t)>.1}(h,t,e,l,r,n))break;u=h}return u}function i(t,e){return e&&t>h?t>c?t>1.1*s?s:t>1.1*l?l:c:t>u?u:t>f?f:h:Math.pow(10,Math.floor(Math.log(t)/Math.LN10))}function a(t,e,r){var n=e.c2d(t,s,r).split("-");return""===n[0]&&(n.unshift(),n[0]="-"+n[0]),n}var o=t("../../constants/numerical"),s=o.ONEAVGYEAR,l=o.ONEAVGMONTH,c=o.ONEDAY,u=o.ONEHOUR,f=o.ONEMIN,h=o.ONESEC,d=t("../../plots/cartesian/axes").tickIncrement;e.exports=function(t,e,r,i,a){var o,l,u=-1.1*e,f=-.1*e,h=t-f,p=r[0],m=r[1],g=Math.min(n(p+f,p+h,i,a),n(m+f,m+h,i,a)),v=Math.min(n(p+u,p+f,i,a),n(m+u,m+f,i,a));if(g>v&&vc){var y=o===s?1:6,x=o===s?"M12":"M1";return function(e,r){var n=i.c2d(e,s,a),o=n.indexOf("-",y);o>0&&(n=n.substr(0,o));var c=i.d2c(n,0,a);if(cp.size/1.9?p.size:p.size/Math.ceil(p.size/b);var T=p.start+(p.size-b)/2;_=T-b*Math.ceil((T-_)/b)}for(f=0;f=0&&w=0;a--)i(a);else if("increasing"===e){for(a=1;a=0;a--)t[a]+=t[a+1];"exclude"===r&&(t.push(0),t.shift())}}(a,x.direction,x.currentbin);var Z=Math.min(i.length,a.length),J=[],K=0,Q=Z-1;for(r=0;r=K;r--)if(a[r]){Q=r;break}for(r=K;r<=Q;r++)if(o(i[r])&&o(a[r])){var $={p:i[r],s:a[r],b:0};x.enabled||($.pts=z[r],q?$.p0=$.p1=z[r].length?A[z[r][0]]:i[r]:($.p0=X(S[r]),$.p1=X(S[r+1],!0))),J.push($)}return 1===J.length&&(J[0].width1=l.tickIncrement(J[0].p,k.size,!1,y)-J[0].p),c(J,e),Array.isArray(e.selectedpoints)&&s.tagSelected(J,e,Y),J}}},{"../../constants/numerical":721,"../../lib":743,"../../plots/cartesian/axes":789,"../bar/arrays_to_calcdata":882,"./average":998,"./bin_functions":1e3,"./bin_label_vals":1001,"./clean_bins":1003,"./norm_functions":1008,"fast-isnumeric":140}],1003:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib").cleanDate,a=t("../../constants/numerical"),o=a.ONEDAY,s=a.BADNUM;e.exports=function(t,e,r){var a=e.type,l=r+"bins",c=t[l];c||(c=t[l]={});var u="date"===a?function(t){return t||0===t?i(t,s,c.calendar):null}:function(t){return n(t)?Number(t):null};c.start=u(c.start),c.end=u(c.end);var f="date"===a?o:1,h=c.size;if(n(h))c.size=h>0?Number(h):f;else if("string"!=typeof h)c.size=f;else{var d=h.charAt(0),p=h.substr(1);((p=n(p)?Number(p):0)<=0||"date"!==a||"M"!==d||p!==Math.round(p))&&(c.size=f)}var m="autobin"+r;"boolean"!=typeof t[m]&&(t[m]=!((c.start||0===c.start)&&(c.end||0===c.end))),t[m]||delete t["nbins"+r]}},{"../../constants/numerical":721,"../../lib":743,"fast-isnumeric":140}],1004:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/color"),o=t("./bin_defaults"),s=t("../bar/style_defaults"),l=t("../../components/errorbars/defaults"),c=t("./attributes");e.exports=function(t,e,r,u){function f(r,n){return i.coerce(t,e,c,r,n)}var h=f("x"),d=f("y");f("cumulative.enabled")&&(f("cumulative.direction"),f("cumulative.currentbin")),f("text");var p=f("orientation",d&&!h?"h":"v"),m=e["v"===p?"x":"y"];if(m&&m.length){n.getComponentMethod("calendars","handleTraceDefaults")(t,e,["x","y"],u);e["h"===p?"x":"y"]&&f("histfunc");o(t,e,f,"h"===p?["y"]:["x"]),s(t,e,f,r,u),l(t,e,a.defaultLine,{axis:"y"}),l(t,e,a.defaultLine,{axis:"x",inherit:"y"}),i.coerceSelectionMarkerOpacity(e,f)}else e.visible=!1}},{"../../components/color":618,"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../bar/style_defaults":895,"./attributes":997,"./bin_defaults":999}],1005:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i){if(t.x="xVal"in e?e.xVal:e.x,t.y="yVal"in e?e.yVal:e.y,e.xa&&(t.xaxis=e.xa),e.ya&&(t.yaxis=e.ya),!(r.cumulative||{}).enabled){var a=Array.isArray(i)?n[0].pts[i[0]][i[1]]:n[i].pts;t.pointNumbers=a,t.binNumber=t.pointNumber,delete t.pointNumber,delete t.pointIndex;var o;if(r._indexToPoints){o=[];for(var s=0;sA&&g.splice(A,g.length-A),y.length>A&&y.splice(A,y.length-A),n(e,"x",g,m,_,M,x),n(e,"y",y,v,w,k,b);var T=[],S=[],E=[],L="string"==typeof e.xbins.size,C="string"==typeof e.ybins.size,z=[],D=[],I=L?z:e.xbins,P=C?D:e.ybins,O=0,F=[],R=[],N=e.histnorm,j=e.histfunc,B=-1!==N.indexOf("density"),U="max"===j||"min"===j?null:0,V=c.count,q=u[N],H=!1,G=[],Y=[],W="z"in e?e.z:"marker"in e&&Array.isArray(e.marker.color)?e.marker.color:"";W&&"count"!==j&&(H="avg"===j,V=c[j]);var X=e.xbins,Z=_(X.start),J=_(X.end)+(Z-l.tickIncrement(Z,X.size,!1,x))/1e6;for(r=Z;r=0&&d=0&&p0)o=c(t.alphahull,h);else{var d=["x","y","z"].indexOf(t.delaunayaxis);o=l(h.map(function(t){return[t[(d+1)%3],t[(d+2)%3]]}))}var p={positions:h,cells:o,lightPosition:[t.lightposition.x,t.lightposition.y,t.lightposition.z],ambient:t.lighting.ambient,diffuse:t.lighting.diffuse,specular:t.lighting.specular,roughness:t.lighting.roughness,fresnel:t.lighting.fresnel,vertexNormalsEpsilon:t.lighting.vertexnormalsepsilon,faceNormalsEpsilon:t.lighting.facenormalsepsilon,opacity:t.opacity,contourEnable:t.contour.show,contourColor:f(t.contour.color).slice(0,3),contourWidth:t.contour.width,useFacetNormals:t.flatshading};t.intensity?(this.color="#fff",p.vertexIntensity=t.intensity,p.vertexIntensityBounds=[t.cmin,t.cmax],p.colormap=function(t){return t.map(function(t){var e=t[0],r=s(t[1]).toRgb();return{index:e,rgb:[r.r,r.g,r.b,1]}})}(t.colorscale)):t.vertexcolor?(this.color=t.vertexcolor[0],p.vertexColors=i(t.vertexcolor)):t.facecolor?(this.color=t.facecolor[0],p.cellColors=i(t.facecolor)):(this.color=t.color,p.meshColor=f(t.color)),this.mesh.update(p)},h.dispose=function(){this.scene.glplot.remove(this.mesh),this.mesh.dispose()},e.exports=function(t,e){var r=t.glplot.gl,i=o({gl:r}),a=new n(t,i,e.uid);return i._trace=a,a.update(e),t.glplot.add(i),a}},{"../../lib/str2rgbarray":765,"alpha-shape":47,"convex-hull":109,"delaunay-triangulate":130,"gl-mesh3d":210,tinycolor2:546}],1022:[function(t,e,r){"use strict";var n=t("../../registry"),i=t("../../lib"),a=t("../../components/colorscale/defaults"),o=t("./attributes");e.exports=function(t,e,r,s){function l(r,n){return i.coerce(t,e,o,r,n)}function c(t){var e=t.map(function(t){var e=l(t);return e&&Array.isArray(e)?e:null});return e.every(function(t){return t&&t.length===e[0].length})&&e}var u=c(["x","y","z"]),f=c(["i","j","k"]);if(u){f&&f.forEach(function(t){for(var e=0;ei?r=!0:e1)){var f=a.simpleMap(u.x,e.d2c,0,r.xcalendar),h=a.distinctVals(f).minDiff;o=Math.min(o,h)}}for(o===1/0&&(o=1),c=0;c");S.push(o,o,o,o,o,o,null)},R=0;Rs&&(n.log("parcoords traces support up to "+s+" dimensions at the moment"),c.splice(s)),l=0;l0)&&(r("label"),r("tickvals"),r("ticktext"),r("tickformat"),r("range"),r("constraintrange"),f=Math.min(f,o.values.length)),o._index=l,u.push(o));if(isFinite(f))for(l=0;lf&&(o.values=o.values.slice(0,f));return u}(t,e);!function(t,e,r,i,s){s("line.color",r),a(t,"line")&&n.isArray(t.line.color)?(s("line.colorscale"),o(t,e,i,s,{prefix:"line.",cLetter:"c"})):s("line.color",r)}(t,e,r,l,c),c("domain.x"),c("domain.y"),Array.isArray(u)&&u.length||(e.visible=!1);var f={family:l.font.family,size:Math.round(l.font.size*(10/12)),color:l.font.color};n.coerceFont(c,"labelfont",f),n.coerceFont(c,"tickfont",f),n.coerceFont(c,"rangefont",f)}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"../../lib":743,"./attributes":1031,"./constants":1035}],1037:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.moduleType="trace",n.name="parcoords",n.basePlotModule=t("./base_plot"),n.categories=["gl","regl","noOpacity"],n.meta={},e.exports=n},{"./attributes":1031,"./base_plot":1032,"./calc":1033,"./colorbar":1034,"./defaults":1036,"./plot":1040}],1038:[function(t,e,r){"use strict";function n(t,e,r,n,i){var a=t._gl;a.enable(a.SCISSOR_TEST),a.scissor(e,r,n,i),t.clear({color:[0,0,0,0],depth:1})}function i(t,e,r,i,a,o){function s(c){var u;u=Math.min(i,a-c*i),o.offset=h*c*i,o.count=h*u,0===c&&(window.cancelAnimationFrame(r.currentRafs[l]),delete r.currentRafs[l],n(t,o.scissorX,o.scissorY,o.scissorWidth,o.viewBoxSize[1])),r.clearOnly||(e(o),c*i+u>>8*e)%256/255}function s(t,e){var r={};return[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15].map(function(r){return function(t,e,r){var n,i,a,o=[];for(i=0;i=f-4?o(s,f-2-l):.5);return i}(E,S,T,C),O=s(E,P),F=e.regl,R=F.texture({shape:[256,1],format:"rgba",type:"uint8",mag:"nearest",min:"nearest",data:function(t,e,r){for(var n=[],i=0;i<256;i++){var a=t(i/255);n.push((e?p:a).concat(r))}return n}(w,M,Math.round(255*(M?z:1)))}),N=F({profile:!1,blend:{enable:L,func:{srcRGB:"src alpha",dstRGB:"one minus src alpha",srcAlpha:1,dstAlpha:1},equation:{rgb:"add",alpha:"add"},color:[0,0,0,0]},depth:{enable:!L,mask:!0,func:"less",range:[0,1]},cull:{enable:!0,face:"back"},scissor:{enable:!0,box:{x:F.prop("scissorX"),y:F.prop("scissorY"),width:F.prop("scissorWidth"),height:F.prop("scissorHeight")}},viewport:{x:F.prop("viewportX"),y:F.prop("viewportY"),width:F.prop("viewportWidth"),height:F.prop("viewportHeight")},dither:!1,vert:k?"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // pick coloring\n fragColor = vec4(pf.rgb, 1.0);\n}\n":"precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 p0, p1, p2, p3,\n p4, p5, p6, p7,\n p8, p9, pa, pb,\n pc, pd, pe;\n\nattribute vec4 pf;\n\nuniform mat4 dim1A, dim2A, dim1B, dim2B, dim1C, dim2C, dim1D, dim2D,\n loA, hiA, loB, hiB, loC, hiC, loD, hiD;\n\nuniform vec2 resolution,\n viewBoxPosition,\n viewBoxSize;\n\nuniform sampler2D palette;\n\nuniform vec2 colorClamp;\n\nuniform float scatter;\n\nvarying vec4 fragColor;\n\nvec4 zero = vec4(0, 0, 0, 0);\nvec4 unit = vec4(1, 1, 1, 1);\nvec2 xyProjection = vec2(1, 1);\n\nmat4 mclamp(mat4 m, mat4 lo, mat4 hi) {\n return mat4(clamp(m[0], lo[0], hi[0]),\n clamp(m[1], lo[1], hi[1]),\n clamp(m[2], lo[2], hi[2]),\n clamp(m[3], lo[3], hi[3]));\n}\n\nbool mshow(mat4 p, mat4 lo, mat4 hi) {\n return mclamp(p, lo, hi) == p;\n}\n\nfloat val(mat4 p, mat4 v) {\n return dot(matrixCompMult(p, v) * unit, unit);\n}\n\nvoid main() {\n\n float x = 0.5 * sign(pf[3]) + 0.5;\n float prominence = abs(pf[3]);\n float depth = 1.0 - prominence;\n\n mat4 pA = mat4(p0, p1, p2, p3);\n mat4 pB = mat4(p4, p5, p6, p7);\n mat4 pC = mat4(p8, p9, pa, pb);\n mat4 pD = mat4(pc, pd, pe, abs(pf));\n\n float show = float(mshow(pA, loA, hiA) &&\n mshow(pB, loB, hiB) &&\n mshow(pC, loC, hiC) &&\n mshow(pD, loD, hiD));\n\n vec2 yy = show * vec2(val(pA, dim2A) + val(pB, dim2B) + val(pC, dim2C) + val(pD, dim2D),\n val(pA, dim1A) + val(pB, dim1B) + val(pC, dim1C) + val(pD, dim1D));\n\n vec2 dimensionToggle = vec2(x, 1.0 - x);\n\n vec2 scatterToggle = vec2(scatter, 1.0 - scatter);\n\n float y = dot(yy, dimensionToggle);\n mat2 xy = mat2(viewBoxSize * yy + dimensionToggle, viewBoxSize * vec2(x, y));\n\n vec2 viewBoxXY = viewBoxPosition + xy * scatterToggle;\n\n float depthOrHide = depth + 2.0 * (1.0 - show);\n\n gl_Position = vec4(\n xyProjection * (2.0 * viewBoxXY / resolution - 1.0),\n depthOrHide,\n 1.0\n );\n\n // visible coloring\n float clampedColorIndex = clamp((prominence - colorClamp[0]) / (colorClamp[1] - colorClamp[0]), 0.0, 1.0);\n fragColor = texture2D(palette, vec2((clampedColorIndex * 255.0 + 0.5) / 256.0, 0.5));\n}\n",frag:"precision lowp float;\n#define GLSLIFY 1\n\nvarying vec4 fragColor;\n\nvoid main() {\n gl_FragColor = fragColor;\n}\n",primitive:"lines",lineWidth:1,attributes:O,uniforms:{resolution:F.prop("resolution"),viewBoxPosition:F.prop("viewBoxPosition"),viewBoxSize:F.prop("viewBoxSize"),dim1A:F.prop("dim1A"),dim2A:F.prop("dim2A"),dim1B:F.prop("dim1B"),dim2B:F.prop("dim2B"),dim1C:F.prop("dim1C"),dim2C:F.prop("dim2C"),dim1D:F.prop("dim1D"),dim2D:F.prop("dim2D"),loA:F.prop("loA"),hiA:F.prop("hiA"),loB:F.prop("loB"),hiB:F.prop("hiB"),loC:F.prop("loC"),hiC:F.prop("hiC"),loD:F.prop("loD"),hiD:F.prop("hiD"),palette:R,colorClamp:F.prop("colorClamp"),scatter:F.prop("scatter")},offset:F.prop("offset"),count:F.prop("count")}),j=[0,1],B=[];return{setColorDomain:function(t){j[0]=t[0],j[1]=t[1]},render:function(t,e,a){var o,s,l,c=1/0,f=-1/0;for(o=0;of&&(f=t[o].dim2.canvasX,l=o),t[o].dim1.canvasXi)return a;i=o,a=n[r]}return n[n.length-1]}function o(t){return d.scale.linear().domain(i(t))}function s(t,e,r){var i=v(e),a=i.trace,s=i.lineColor,l=i.cscale,c=a.line,u=a.domain,p=a.dimensions,m=t.width,g=a.labelfont,y=a.tickfont,x=a.rangefont,b=h.extendDeep({},c,{color:s.map(o({values:s,range:[c.cmin,c.cmax]})),blockLineCount:f.blockLineCount,canvasOverdrag:f.overdrag*f.canvasPixelRatio}),_=Math.floor(m*(u.x[1]-u.x[0])),w=Math.floor(t.height*(u.y[1]-u.y[0])),M=t.margin||{l:80,r:80,t:100,b:80},k=_,A=w;return{key:r,colCount:p.filter(n).length,dimensions:p,tickDistance:f.tickDistance,unitToColor:function(t){var e=t.map(function(t){return t[0]}),r=t.map(function(t){return t[1]}).map(function(t){return d.rgb(t)}),n="rgb".split("").map(function(t){return d.scale.linear().clamp(!0).domain(e).range(r.map(function(t){return function(e){return e[t]}}(t)))});return function(t){return n.map(function(e){return e(t)})}}(l),lines:b,labelFont:g,tickFont:y,rangeFont:x,layoutWidth:m,layoutHeight:t.height,domain:u,translateX:u.x[0]*m,translateY:t.height-u.y[1]*t.height,pad:M,canvasWidth:k*f.canvasPixelRatio+2*b.canvasOverdrag,canvasHeight:A*f.canvasPixelRatio,width:k,height:A,canvasPixelRatio:f.canvasPixelRatio}}function l(t){var e=t.width,r=t.height,a=t.dimensions,s=t.canvasPixelRatio,l=function(r){return e*r/Math.max(1,t.colCount-1)},c=f.verticalPadding/(r*s),u=1-2*c,h=function(t){return c+u*t},p={key:t.key,xScale:l,model:t},m={};return p.dimensions=a.filter(n).map(function(e,n){var a=o(e),c=m[e.label];m[e.label]=(c||0)+1;return{key:e.label+(c?"__"+c:""),label:e.label,tickFormat:e.tickformat,tickvals:e.tickvals,ticktext:e.ticktext,ordinal:!!e.tickvals,scatter:f.scatter||e.scatter,xIndex:n,crossfilterDimensionIndex:n,visibleIndex:e._index,height:r,values:e.values,paddedUnitValues:e.values.map(a).map(h),xScale:l,x:l(n),canvasX:l(n)*s,unitScale:function(t,e){return d.scale.linear().range([t-e,e])}(r,f.verticalPadding),domainScale:function(t,e,r){var n=i(r),a=r.ticktext;return r.tickvals?d.scale.ordinal().domain(r.tickvals.map(function(t,e){return function(r,n){if(e){var i=e[n];return null===i||void 0===i?t(r):i}return t(r)}}(d.format(r.tickformat),a))).range(r.tickvals.map(function(t){return(t-n[0])/(n[1]-n[0])}).map(function(r){return t-e+r*(e-(t-e))})):d.scale.linear().domain(n).range([t-e,e])}(r,f.verticalPadding,e),ordinalScale:function(t){var e=i(t);return t.tickvals&&d.scale.ordinal().domain(t.tickvals).range(t.tickvals.map(function(t){return(t-e[0])/(e[1]-e[0])}))}(e),domainToUnitScale:a,filter:e.constraintrange?e.constraintrange.map(a):[0,1],parent:p,model:t}}),p}function c(t){t.classed(f.cn.axisExtentText,!0).attr("text-anchor","middle").style("cursor","default").style("user-select","none")}var u=t("./lines"),f=t("./constants"),h=t("../../lib"),d=t("d3"),p=t("../../components/drawing"),m=t("../../lib/gup").keyFun,g=t("../../lib/gup").repeat,v=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n,i,o){function y(t){return t.dimensions.some(function(t){return 0!==t.filter[0]||1!==t.filter[1]})}function x(t,e){return(f.scatter?function(t,e){for(var r=e.panels||(e.panels=[]),n=t.each(function(t){return t})[e.key].map(function(t){return t.__data__}),i=n.length-1,a=i,o=0;o=r||s>=n)return;var l=t.lineLayer.readPixel(a,n-1-s),c=0!==l[3],u=c?l[2]+256*(l[1]+256*l[0]):null,f={x:a,y:s,clientX:e.clientX,clientY:e.clientY,dataIndex:t.model.key,curveNumber:u};u!==L&&(c?o.hover(f):o.unhover&&o.unhover(f),L=u)}}),S.style("opacity",function(t){return t.pick?.01:1}),e.style("background","rgba(255, 255, 255, 0)");var C=e.selectAll("."+f.cn.parcoords).data(T,m);C.exit().remove(),C.enter().append("g").classed(f.cn.parcoords,!0).attr("overflow","visible").style("box-sizing","content-box").style("position","absolute").style("left",0).style("overflow","visible").style("shape-rendering","crispEdges").style("pointer-events","none").call(function(t){var e=t.selectAll("defs").data(g,m);e.enter().append("defs");var r=e.selectAll("#"+f.id.filterBarPattern).data(g,m);r.enter().append("pattern").attr("id",f.id.filterBarPattern).attr("patternUnits","userSpaceOnUse"),r.attr("x",-f.bar.width).attr("width",f.bar.capturewidth).attr("height",function(t){return t.model.height});var n=r.selectAll("rect").data(g,m);n.enter().append("rect").attr("shape-rendering","crispEdges"),n.attr("height",function(t){return t.model.height}).attr("width",f.bar.width).attr("x",f.bar.width/2).attr("fill",f.bar.fillcolor).attr("fill-opacity",f.bar.fillopacity).attr("stroke",f.bar.strokecolor).attr("stroke-opacity",f.bar.strokeopacity).attr("stroke-width",f.bar.strokewidth)}),C.attr("width",function(t){return t.model.width+t.model.pad.l+t.model.pad.r}).attr("height",function(t){return t.model.height+t.model.pad.t+t.model.pad.b}).attr("transform",function(t){return"translate("+t.model.translateX+","+t.model.translateY+")"});var z=C.selectAll("."+f.cn.parcoordsControlView).data(g,m);z.enter().append("g").classed(f.cn.parcoordsControlView,!0).style("box-sizing","content-box"),z.attr("transform",function(t){return"translate("+t.model.pad.l+","+t.model.pad.t+")"});var D=z.selectAll("."+f.cn.yAxis).data(function(t){return t.dimensions},m);D.enter().append("g").classed(f.cn.yAxis,!0).each(function(t){E.dimensions.push(t)}),z.each(function(t){x(D,t)}),S.filter(function(t){return!!t.viewModel}).each(function(t){t.lineLayer=u(this,t,f.scatter),t.viewModel[t.key]=t.lineLayer,E.renderers.push(function(){t.lineLayer.render(t.viewModel.panels,!0)}),t.lineLayer.render(t.viewModel.panels,!t.context)}),D.attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),D.call(d.behavior.drag().origin(function(t){return t}).on("drag",function(t){var e=t.parent;A=!1,k||(t.x=Math.max(-f.overdrag,Math.min(t.model.width+f.overdrag,d.event.x)),t.canvasX=t.x*t.model.canvasPixelRatio,D.sort(function(t,e){return t.x-e.x}).each(function(e,r){e.xIndex=r,e.x=t===e?e.x:e.xScale(e.xIndex),e.canvasX=e.x*e.model.canvasPixelRatio}),x(D,e),D.filter(function(e){return 0!==Math.abs(t.xIndex-e.xIndex)}).attr("transform",function(t){return"translate("+t.xScale(t.xIndex)+", 0)"}),d.select(this).attr("transform","translate("+t.x+", 0)"),D.each(function(r,n,i){i===t.parent.key&&(e.dimensions[n]=r)}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer.render&&e.focusLayer.render(e.panels))}).on("dragend",function(t){var e=t.parent;k?"ending"===k&&(k=!1):(t.x=t.xScale(t.xIndex),t.canvasX=t.x*t.model.canvasPixelRatio,x(D,e),d.select(this).attr("transform",function(t){return"translate("+t.x+", 0)"}),e.contextLayer&&e.contextLayer.render(e.panels,!1,!y(e)),e.focusLayer&&e.focusLayer.render(e.panels),e.pickLayer&&e.pickLayer.render(e.panels,!0),A=!0,o&&o.axesMoved&&o.axesMoved(e.key,e.dimensions.map(function(t){return t.crossfilterDimensionIndex})))})),D.exit().remove();var I=D.selectAll("."+f.cn.axisOverlays).data(g,m);I.enter().append("g").classed(f.cn.axisOverlays,!0),I.selectAll("."+f.cn.axis).remove();var P=I.selectAll("."+f.cn.axis).data(g,m);P.enter().append("g").classed(f.cn.axis,!0),P.each(function(t){var e=t.model.height/t.model.tickDistance,r=t.domainScale,n=r.domain();d.select(this).call(d.svg.axis().orient("left").tickSize(4).outerTickSize(2).ticks(e,t.tickFormat).tickValues(t.ordinal?n:null).tickFormat(t.ordinal?function(t){return t}:null).scale(r)),p.font(P.selectAll("text"),t.model.tickFont)}),P.selectAll(".domain, .tick>line").attr("fill","none").attr("stroke","black").attr("stroke-opacity",.25).attr("stroke-width","1px"),P.selectAll("text").style("text-shadow","1px 1px 1px #fff, -1px -1px 1px #fff, 1px -1px 1px #fff, -1px 1px 1px #fff").style("cursor","default").style("user-select","none");var O=I.selectAll("."+f.cn.axisHeading).data(g,m);O.enter().append("g").classed(f.cn.axisHeading,!0);var F=O.selectAll("."+f.cn.axisTitle).data(g,m);F.enter().append("text").classed(f.cn.axisTitle,!0).attr("text-anchor","middle").style("cursor","ew-resize").style("user-select","none").style("pointer-events","auto"),F.attr("transform","translate(0,"+-f.axisTitleOffset+")").text(function(t){return t.label}).each(function(t){p.font(F,t.model.labelFont)});var R=I.selectAll("."+f.cn.axisExtent).data(g,m);R.enter().append("g").classed(f.cn.axisExtent,!0);var N=R.selectAll("."+f.cn.axisExtentTop).data(g,m);N.enter().append("g").classed(f.cn.axisExtentTop,!0),N.attr("transform","translate(0,"+-f.axisExtentOffset+")");var j=N.selectAll("."+f.cn.axisExtentTopText).data(g,m);j.enter().append("text").classed(f.cn.axisExtentTopText,!0).call(c),j.text(function(t){return b(t)(t.domainScale.domain().slice(-1)[0])}).each(function(t){p.font(j,t.model.rangeFont)});var B=R.selectAll("."+f.cn.axisExtentBottom).data(g,m);B.enter().append("g").classed(f.cn.axisExtentBottom,!0),B.attr("transform",function(t){return"translate(0,"+(t.model.height+f.axisExtentOffset)+")"});var U=B.selectAll("."+f.cn.axisExtentBottomText).data(g,m);U.enter().append("text").classed(f.cn.axisExtentBottomText,!0).attr("dy","0.75em").call(c),U.text(function(t){return b(t)(t.domainScale.domain()[0])}).each(function(t){p.font(U,t.model.rangeFont)});var V=I.selectAll("."+f.cn.axisBrush).data(g,m),q=V.enter().append("g").classed(f.cn.axisBrush,!0);V.each(function(t){t.brush||(t.brush=d.svg.brush().y(t.unitScale).on("brushstart",_).on("brush",w).on("brushend",M),0===t.filter[0]&&1===t.filter[1]||t.brush.extent(t.filter),d.select(this).call(t.brush))}),q.selectAll("rect").attr("x",-f.bar.capturewidth/2).attr("width",f.bar.capturewidth),q.selectAll("rect.extent").attr("fill","url(#"+f.id.filterBarPattern+")").style("cursor","ns-resize").filter(function(t){return 0===t.filter[0]&&1===t.filter[1]}).attr("y",-100),q.selectAll(".resize rect").attr("height",f.bar.handleheight).attr("opacity",0).style("visibility","visible"),q.selectAll(".resize.n rect").style("cursor","n-resize").attr("y",f.bar.handleoverlap-f.bar.handleheight),q.selectAll(".resize.s rect").style("cursor","s-resize").attr("y",f.bar.handleoverlap);var H=!1,G=!1;return E}},{"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1035,"./lines":1038,d3:128}],1040:[function(t,e,r){(function(r){"use strict";var n=t("./parcoords"),i=t("regl");e.exports=function(t,e){var a=t._fullLayout,o=a._toppaper,s=a._paperdiv,l=a._glcontainer;a._glcanvas.each(function(e){e.regl||(e.regl=i({canvas:this,attributes:{antialias:!e.pick,preserveDrawingBuffer:!0},pixelRatio:t._context.plotGlPixelRatio||r.devicePixelRatio}))});var c={},u={},f=a._size;e.forEach(function(e,r){c[r]=t.data[r].dimensions,u[r]=t.data[r].dimensions.slice()});n(s,o,l,e,{width:f.w,height:f.h,margin:{t:f.t,r:f.r,b:f.b,l:f.l}},{filterChanged:function(e,r,n){var i=u[e][r],a=i.constraintrange;a&&2===a.length||(a=i.constraintrange=[]),a[0]=n[0],a[1]=n[1],t.emit("plotly_restyle")},hover:function(e){t.emit("plotly_hover",e)},unhover:function(e){t.emit("plotly_unhover",e)},axesMoved:function(e,r){function n(t){return!("visible"in t)||t.visible}function i(t,e,r){var n=e.indexOf(r),i=t.indexOf(n);return-1===i&&(i+=e.length),i}var a=function(t){return function(e,n){return i(r,t,e)-i(r,t,n)}}(u[e].filter(n));c[e].sort(a),u[e].filter(function(t){return!n(t)}).sort(function(t){return u[e].indexOf(t)}).forEach(function(t){c[e].splice(c[e].indexOf(t),1),c[e].splice(u[e].indexOf(t),0,t)}),t.emit("plotly_restyle")}})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./parcoords":1039,regl:506}],1041:[function(t,e,r){"use strict";var n=t("../../components/color/attributes"),i=t("../../plots/font_attributes"),a=t("../../plots/attributes"),o=t("../../plots/domain_attributes"),s=t("../../lib/extend").extendFlat,l=i({editType:"calc",colorEditType:"style"});e.exports={labels:{valType:"data_array",editType:"calc"},label0:{valType:"number",dflt:0,editType:"calc"},dlabel:{valType:"number",dflt:1,editType:"calc"},values:{valType:"data_array",editType:"calc"},marker:{colors:{valType:"data_array",editType:"calc"},line:{color:{valType:"color",dflt:n.defaultLine,arrayOk:!0,editType:"style"},width:{valType:"number",min:0,dflt:0,arrayOk:!0,editType:"style"},editType:"calc"},editType:"calc"},text:{valType:"data_array",editType:"calc"},hovertext:{valType:"string",dflt:"",arrayOk:!0,editType:"style"},scalegroup:{valType:"string",dflt:"",editType:"calc"},textinfo:{valType:"flaglist",flags:["label","text","value","percent"],extras:["none"],editType:"calc"},hoverinfo:s({},a.hoverinfo,{flags:["label","text","value","percent","name"]}),textposition:{valType:"enumerated",values:["inside","outside","auto","none"],dflt:"auto",arrayOk:!0,editType:"calc"},textfont:s({},l,{}),insidetextfont:s({},l,{}),outsidetextfont:s({},l,{}),domain:o({name:"pie",trace:!0,editType:"calc"}),hole:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},sort:{valType:"boolean",dflt:!0,editType:"calc"},direction:{valType:"enumerated",values:["clockwise","counterclockwise"],dflt:"counterclockwise",editType:"calc"},rotation:{valType:"number",min:-360,max:360,dflt:0,editType:"calc"},pull:{valType:"number",min:0,max:1,dflt:0,arrayOk:!0,editType:"calc"}}},{"../../components/color/attributes":617,"../../lib/extend":732,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1042:[function(t,e,r){"use strict";var n=t("../../registry");r.name="pie",r.plot=function(t){var e=n.getModule("pie"),r=function(t,e){for(var r=[],n=0;n")}}return y};var l},{"../../components/color":618,"./helpers":1046,"fast-isnumeric":140,tinycolor2:546}],1044:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}var s=n.coerceFont,l=o("values"),c=o("labels");if(!Array.isArray(c)){if(!Array.isArray(l)||!l.length)return void(e.visible=!1);o("label0"),o("dlabel")}o("marker.line.width")&&o("marker.line.color");var u=o("marker.colors");Array.isArray(u)||(e.marker.colors=[]),o("scalegroup");var f=o("text"),h=o("textinfo",Array.isArray(f)?"text+percent":"percent");if(o("hovertext"),h&&"none"!==h){var d=o("textposition"),p=Array.isArray(d)||"auto"===d,m=p||"inside"===d,g=p||"outside"===d;if(m||g){var v=s(o,"textfont",a.font);m&&s(o,"insidetextfont",v),g&&s(o,"outsidetextfont",v)}}o("domain.x"),o("domain.y"),o("hole"),o("sort"),o("direction"),o("rotation"),o("pull")}},{"../../lib":743,"./attributes":1041}],1045:[function(t,e,r){"use strict";var n=t("../../components/fx/helpers").appendArrayMultiPointValues;e.exports=function(t,e){var r={curveNumber:e.index,pointNumbers:t.pts,data:e._input,fullData:e,label:t.label,color:t.color,value:t.v,v:t.v};return 1===t.pts.length&&(r.pointNumber=r.i=t.pts[0]),n(r,e,t.pts),r}},{"../../components/fx/helpers":657}],1046:[function(t,e,r){"use strict";var n=t("../../lib");r.formatPiePercent=function(t,e){var r=(100*t).toPrecision(3);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)+"%"},r.formatPieValue=function(t,e){var r=t.toPrecision(10);return-1!==r.lastIndexOf(".")&&(r=r.replace(/[.]?0+$/,"")),n.numSeparate(r,e)},r.getFirstFilled=function(t,e){if(Array.isArray(t))for(var r=0;r0?1:-1)/2,y:a/(1+r*r/(n*n)),outside:!0}}var a=t("d3"),o=t("../../components/fx"),s=t("../../components/color"),l=t("../../components/drawing"),c=t("../../lib/svg_text_utils"),u=t("./helpers"),f=t("./event_data");e.exports=function(t,e){var r=t._fullLayout;!function(t,e){var r,n,i,a,o,s,l,c,u,f=[];for(i=0;il&&(l=s.pull[a]);o.r=Math.min(r,n)/(2+2*l),o.cx=e.l+e.w*(s.domain.x[1]+s.domain.x[0])/2,o.cy=e.t+e.h*(2-s.domain.y[1]-s.domain.y[0])/2,s.scalegroup&&-1===f.indexOf(s.scalegroup)&&f.push(s.scalegroup)}for(a=0;aa.vTotal/2?1:0)}(e),h.each(function(){var h=a.select(this).selectAll("g.slice").data(e);h.enter().append("g").classed("slice",!0),h.exit().remove();var m=[[[],[]],[[],[]]],g=!1;h.each(function(e){function s(t,r,n,i){return"a"+i*d.r+","+i*d.r+" 0 "+e.largeArc+(n?" 1 ":" 0 ")+i*(r[0]-t[0])+","+i*(r[1]-t[1])}if(e.hidden)a.select(this).selectAll("path,g").remove();else{e.pointNumber=e.i,e.curveNumber=p.index,m[e.pxmid[1]<0?0:1][e.pxmid[0]<0?0:1].push(e);var h=d.cx,v=d.cy,y=a.select(this),x=y.selectAll("path.surface").data([e]),b=!1,_=!1;if(x.enter().append("path").classed("surface",!0).style({"pointer-events":"all"}),y.select("path.textline").remove(),y.on("mouseover",function(){var i=t._fullLayout,s=t._fullData[p.index];if(!t._dragging&&!1!==i.hovermode){var l=s.hoverinfo;if(Array.isArray(l)&&(l=o.castHoverinfo({hoverinfo:[u.castOption(l,e.pts)],_module:p._module},i,0)),"all"===l&&(l="label+text+value+percent+name"),"none"!==l&&"skip"!==l&&l){var c=n(e,d),m=h+e.pxmid[0]*(1-c),g=v+e.pxmid[1]*(1-c),y=r.separators,x=[];if(-1!==l.indexOf("label")&&x.push(e.label),-1!==l.indexOf("text")){var w=u.castOption(s.hovertext||s.text,e.pts);w&&x.push(w)}-1!==l.indexOf("value")&&x.push(u.formatPieValue(e.v,y)),-1!==l.indexOf("percent")&&x.push(u.formatPiePercent(e.v/d.vTotal,y));var M=p.hoverlabel,k=M.font;o.loneHover({x0:m-c*d.r,x1:m+c*d.r,y:g,text:x.join("
"),name:-1!==l.indexOf("name")?s.name:void 0,idealAlign:e.pxmid[0]<0?"left":"right",color:u.castOption(M.bgcolor,e.pts)||e.color,borderColor:u.castOption(M.bordercolor,e.pts),fontFamily:u.castOption(k.family,e.pts),fontSize:u.castOption(k.size,e.pts),fontColor:u.castOption(k.color,e.pts)},{container:i._hoverlayer.node(),outerContainer:i._paper.node(),gd:t}),b=!0}t.emit("plotly_hover",{points:[f(e,s)],event:a.event}),_=!0}}).on("mouseout",function(r){var n=t._fullLayout,i=t._fullData[p.index];_&&(r.originalEvent=a.event,t.emit("plotly_unhover",{points:[f(e,i)],event:a.event}),_=!1),b&&(o.loneUnhover(n._hoverlayer.node()),b=!1)}).on("click",function(){var r=t._fullLayout,n=t._fullData[p.index];t._dragging||!1===r.hovermode||(t._hoverdata=[f(e,n)],o.click(t,a.event))}),p.pull){var w=+u.castOption(p.pull,e.pts)||0;w>0&&(h+=w*e.pxmid[0],v+=w*e.pxmid[1])}e.cxFinal=h,e.cyFinal=v;var M=p.hole;if(e.v===d.vTotal){var k="M"+(h+e.px0[0])+","+(v+e.px0[1])+s(e.px0,e.pxmid,!0,1)+s(e.pxmid,e.px0,!0,1)+"Z";M?x.attr("d","M"+(h+M*e.px0[0])+","+(v+M*e.px0[1])+s(e.px0,e.pxmid,!1,M)+s(e.pxmid,e.px0,!1,M)+"Z"+k):x.attr("d",k)}else{var A=s(e.px0,e.px1,!0,1);if(M){var T=1-M;x.attr("d","M"+(h+M*e.px1[0])+","+(v+M*e.px1[1])+s(e.px1,e.px0,!1,M)+"l"+T*e.px0[0]+","+T*e.px0[1]+A+"Z")}else x.attr("d","M"+h+","+v+"l"+e.px0[0]+","+e.px0[1]+A+"Z")}var S=u.castOption(p.textposition,e.pts),E=y.selectAll("g.slicetext").data(e.text&&"none"!==S?[0]:[]);E.enter().append("g").classed("slicetext",!0),E.exit().remove(),E.each(function(){var r=a.select(this).selectAll("text").data([0]);r.enter().append("text").attr("data-notex",1),r.exit().remove(),r.text(e.text).attr({class:"slicetext",transform:"","text-anchor":"middle"}).call(l.font,"outside"===S?p.outsidetextfont:p.insidetextfont).call(c.convertToTspans,t);var o,s=l.bBox(r.node());"outside"===S?o=i(s,e):(o=function(t,e,r){var i=Math.sqrt(t.width*t.width+t.height*t.height),a=t.width/t.height,o=Math.PI*Math.min(e.v/r.vTotal,.5),s=1-r.trace.hole,l=n(e,r),c={scale:l*r.r*2/i,rCenter:1-l,rotate:0};if(c.scale>=1)return c;var u=a+1/(2*Math.tan(o)),f=r.r*Math.min(1/(Math.sqrt(u*u+.5)+u),s/(Math.sqrt(a*a+s/2)+a)),h={scale:2*f/t.height,rCenter:Math.cos(f/r.r)-f*a/r.r,rotate:(180/Math.PI*e.midangle+720)%180-90},d=1/a,p=d+1/(2*Math.tan(o)),m=r.r*Math.min(1/(Math.sqrt(p*p+.5)+p),s/(Math.sqrt(d*d+s/2)+d)),g={scale:2*m/t.width,rCenter:Math.cos(m/r.r)-m/a/r.r,rotate:(180/Math.PI*e.midangle+810)%180-90},v=g.scale>h.scale?g:h;return c.scale<1&&v.scale>c.scale?v:c}(s,e,d),"auto"===S&&o.scale<1&&(r.call(l.font,p.outsidetextfont),p.outsidetextfont.family===p.insidetextfont.family&&p.outsidetextfont.size===p.insidetextfont.size||(s=l.bBox(r.node())),o=i(s,e)));var u=h+e.pxmid[0]*o.rCenter+(o.x||0),f=v+e.pxmid[1]*o.rCenter+(o.y||0);o.outside&&(e.yLabelMin=f-s.height/2,e.yLabelMid=f,e.yLabelMax=f+s.height/2,e.labelExtraX=0,e.labelExtraY=0,g=!0),r.attr("transform","translate("+u+","+f+")"+(o.scale<1?"scale("+o.scale+")":"")+(o.rotate?"rotate("+o.rotate+")":"")+"translate("+-(s.left+s.right)/2+","+-(s.top+s.bottom)/2+")")})}}),g&&function(t,e){function r(t,e){return t.pxmid[1]-e.pxmid[1]}function n(t,e){return e.pxmid[1]-t.pxmid[1]}function i(t,r){r||(r={});var n,i,a,s,d=r.labelExtraY+(o?r.yLabelMax:r.yLabelMin),p=o?t.yLabelMin:t.yLabelMax,g=o?t.yLabelMax:t.yLabelMin,v=t.cyFinal+c(t.px0[1],t.px1[1]),y=d-p;if(y*h>0&&(t.labelExtraY=y),Array.isArray(e.pull))for(i=0;i=(u.castOption(e.pull,a.pts)||0)||((t.pxmid[1]-a.pxmid[1])*h>0?(y=a.cyFinal+c(a.px0[1],a.px1[1])-p-t.labelExtraY)*h>0&&(t.labelExtraY+=y):(g+t.labelExtraY-v)*h>0&&(n=3*f*Math.abs(i-m.indexOf(t)),(s=a.cxFinal+l(a.px0[0],a.px1[0])+n-(t.cxFinal+t.pxmid[0])-t.labelExtraX)*f>0&&(t.labelExtraX+=s)))}var a,o,s,l,c,f,h,d,p,m,g,v,y;for(o=0;o<2;o++)for(s=o?r:n,c=o?Math.max:Math.min,h=o?1:-1,a=0;a<2;a++){for(l=a?Math.max:Math.min,f=a?1:-1,(d=t[o][a]).sort(s),p=t[1-o][a],m=p.concat(d),v=[],g=0;gMath.abs(c)?i+="l"+c*t.pxmid[0]/t.pxmid[1]+","+c+"H"+(n+t.labelExtraX+o):i+="l"+t.labelExtraX+","+l+"v"+(c-l)+"h"+o}else i+="V"+(t.yLabelMid+t.labelExtraY)+"h"+o;e.append("path").classed("textline",!0).call(s.stroke,p.outsidetextfont.color).attr({"stroke-width":Math.min(2,p.outsidetextfont.size/8),d:i,fill:"none"})}})})}),setTimeout(function(){h.selectAll("tspan").each(function(){var t=a.select(this);t.attr("dy")&&t.attr("dy",t.attr("dy"))})},0)}},{"../../components/color":618,"../../components/drawing":643,"../../components/fx":660,"../../lib/svg_text_utils":766,"./event_data":1045,"./helpers":1046,d3:128}],1051:[function(t,e,r){"use strict";var n=t("d3"),i=t("./style_one");e.exports=function(t){t._fullLayout._pielayer.selectAll(".trace").each(function(t){var e=t[0].trace,r=n.select(this);r.style({opacity:e.opacity}),r.selectAll("path.surface").each(function(t){n.select(this).call(i,t,e)})})}},{"./style_one":1052,d3:128}],1052:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("./helpers").castOption;e.exports=function(t,e,r){var a=r.marker.line,o=i(a.color,e.pts)||n.defaultLine,s=i(a.width,e.pts)||0;t.style({"stroke-width":s}).call(n.fill,e.color).call(n.stroke,o)}},{"../../components/color":618,"./helpers":1046}],1053:[function(t,e,r){"use strict";var n=t("../scatter/attributes");e.exports={x:n.x,y:n.y,xy:{valType:"data_array",editType:"calc"},indices:{valType:"data_array",editType:"calc"},xbounds:{valType:"data_array",editType:"calc"},ybounds:{valType:"data_array",editType:"calc"},text:n.text,marker:{color:{valType:"color",arrayOk:!1,editType:"calc"},opacity:{valType:"number",min:0,max:1,dflt:1,arrayOk:!1,editType:"calc"},blend:{valType:"boolean",dflt:null,editType:"calc"},sizemin:{valType:"number",min:.1,max:2,dflt:.5,editType:"calc"},sizemax:{valType:"number",min:.1,dflt:20,editType:"calc"},border:{color:{valType:"color",arrayOk:!1,editType:"calc"},arearatio:{valType:"number",min:0,max:1,dflt:0,editType:"calc"},editType:"calc"},editType:"calc"}}},{"../scatter/attributes":1066}],1054:[function(t,e,r){"use strict";function n(t,e){this.scene=t,this.uid=e,this.type="pointcloud",this.pickXData=[],this.pickYData=[],this.xData=[],this.yData=[],this.textLabels=[],this.color="rgb(0, 0, 0)",this.name="",this.hoverinfo="all",this.idToIndex=new Int32Array(0),this.bounds=[0,0,0,0],this.pointcloudOptions={positions:new Float32Array(0),idToIndex:this.idToIndex,sizemin:.5,sizemax:12,color:[0,0,0,1],areaRatio:1,borderColor:[0,0,0,1]},this.pointcloud=i(t.glplot,this.pointcloudOptions),this.pointcloud._trace=this}var i=t("gl-pointcloud2d"),a=t("../../lib/str2rgbarray"),o=t("../scatter/get_trace_color"),s=["xaxis","yaxis"],l=n.prototype;l.handlePick=function(t){var e=this.idToIndex[t.pointId];return{trace:this,dataCoord:t.dataCoord,traceCoord:this.pickXYData?[this.pickXYData[2*e],this.pickXYData[2*e+1]]:[this.pickXData[e],this.pickYData[e]],textLabel:Array.isArray(this.textLabels)?this.textLabels[e]:this.textLabels,color:this.color,name:this.name,pointIndex:e,hoverinfo:this.hoverinfo}},l.update=function(t){this.index=t.index,this.textLabels=t.text,this.name=t.name,this.hoverinfo=t.hoverinfo,this.bounds=[1/0,1/0,-1/0,-1/0],this.updateFast(t),this.color=o(t,{})},l.updateFast=function(t){var e,r,n,i,o,s,l=this.xData=this.pickXData=t.x,c=this.yData=this.pickYData=t.y,u=this.pickXYData=t.xy,f=t.xbounds&&t.ybounds,h=t.indices,d=this.bounds;if(u){if(n=u,e=u.length>>>1,f)d[0]=t.xbounds[0],d[2]=t.xbounds[1],d[1]=t.ybounds[0],d[3]=t.ybounds[1];else for(s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);if(h)r=h;else for(r=new Int32Array(e),s=0;sd[2]&&(d[2]=i),od[3]&&(d[3]=o);this.idToIndex=r,this.pointcloudOptions.idToIndex=r,this.pointcloudOptions.positions=n;var p=a(t.marker.color),m=a(t.marker.border.color),g=t.opacity*t.marker.opacity;p[3]*=g,this.pointcloudOptions.color=p;var v=t.marker.blend;if(null===v){v=l.length<100||c.length<100}this.pointcloudOptions.blend=v,m[3]*=g,this.pointcloudOptions.borderColor=m;var y=t.marker.sizemin,x=Math.max(t.marker.sizemax,t.marker.sizemin);this.pointcloudOptions.sizeMin=y,this.pointcloudOptions.sizeMax=x,this.pointcloudOptions.areaRatio=t.marker.border.arearatio,this.pointcloud.update(this.pointcloudOptions),this.expandAxesFast(d,x/2)},l.expandAxesFast=function(t,e){for(var r,n,i,a=e||.5,o=0;o<2;o++)(n=(r=this.scene[s[o]])._min)||(n=[]),n.push({val:t[o],pad:a}),(i=r._max)||(i=[]),i.push({val:t[o+2],pad:a})},l.dispose=function(){this.pointcloud.dispose()},e.exports=function(t,e){var r=new n(t,e.uid);return r.update(e),r}},{"../../lib/str2rgbarray":765,"../scatter/get_trace_color":1076,"gl-pointcloud2d":235}],1055:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r){function a(r,a){return n.coerce(t,e,i,r,a)}a("x"),a("y"),a("xbounds"),a("ybounds"),t.xy&&t.xy instanceof Float32Array&&(e.xy=t.xy),t.indices&&t.indices instanceof Int32Array&&(e.indices=t.indices),a("text"),a("marker.color",r),a("marker.opacity"),a("marker.blend"),a("marker.sizemin"),a("marker.sizemax"),a("marker.border.color",r),a("marker.border.arearatio")}},{"../../lib":743,"./attributes":1053}],1056:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("../scatter3d/calc"),n.plot=t("./convert"),n.moduleType="trace",n.name="pointcloud",n.basePlotModule=t("../../plots/gl2d"),n.categories=["gl","gl2d","showLegend"],n.meta={},e.exports=n},{"../../plots/gl2d":829,"../scatter3d/calc":1092,"./attributes":1053,"./convert":1054,"./defaults":1055}],1057:[function(t,e,r){"use strict";var n=t("../../plots/font_attributes"),i=t("../../plots/attributes"),a=t("../../components/color/attributes"),o=t("../../components/fx/attributes"),s=t("../../plots/domain_attributes"),l=t("../../lib/extend").extendFlat,c=t("../../plot_api/edit_types").overrideAll;e.exports=c({hoverinfo:l({},i.hoverinfo,{flags:["label","text","value","percent","name"]}),hoverlabel:o.hoverlabel,domain:s({name:"sankey",trace:!0}),orientation:{valType:"enumerated",values:["v","h"],dflt:"h"},valueformat:{valType:"string",dflt:".3s"},valuesuffix:{valType:"string",dflt:""},arrangement:{valType:"enumerated",values:["snap","perpendicular","freeform","fixed"],dflt:"snap"},textfont:n({}),node:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:.5,arrayOk:!0}},pad:{valType:"number",arrayOk:!1,min:0,dflt:20},thickness:{valType:"number",arrayOk:!1,min:1,dflt:20}},link:{label:{valType:"data_array",dflt:[]},color:{valType:"color",arrayOk:!0},line:{color:{valType:"color",dflt:a.defaultLine,arrayOk:!0},width:{valType:"number",min:0,dflt:0,arrayOk:!0}},source:{valType:"data_array",dflt:[]},target:{valType:"data_array",dflt:[]},value:{valType:"data_array",dflt:[]}}},"calc","nested")},{"../../components/color/attributes":617,"../../components/fx/attributes":652,"../../lib/extend":732,"../../plot_api/edit_types":773,"../../plots/attributes":787,"../../plots/domain_attributes":815,"../../plots/font_attributes":816}],1058:[function(t,e,r){"use strict";var n=t("../../plot_api/edit_types").overrideAll,i=t("../../plots/get_data").getModuleCalcData,a=t("./plot"),o=t("../../components/fx/layout_attributes");r.name="sankey",r.baseLayoutAttrOverrides=n({hoverlabel:o.hoverlabel},"plot","nested"),r.plot=function(t){var e=i(t.calcdata,"sankey");a(t,e)},r.clean=function(t,e,r,n){var i=n._has&&n._has("sankey"),a=e._has&&e._has("sankey");i&&!a&&n._paperdiv.selectAll(".sankey").remove()}},{"../../components/fx/layout_attributes":661,"../../plot_api/edit_types":773,"../../plots/get_data":826,"./plot":1063}],1059:[function(t,e,r){"use strict";var n=t("strongly-connected-components"),i=t("../../lib"),a=t("../../lib/gup").wrap;e.exports=function(t,e){return function(t,e,r){for(var i=t.map(function(){return[]}),a=0;a1})}(e.node.label,e.link.source,e.link.target)&&(i.error("Circularity is present in the Sankey data. Removing all nodes and links."),e.link.label=[],e.link.source=[],e.link.target=[],e.link.value=[],e.link.color=[],e.node.label=[],e.node.color=[]),a({link:e.link,node:e.node})}},{"../../lib":743,"../../lib/gup":740,"strongly-connected-components":537}],1060:[function(t,e,r){"use strict";e.exports={nodeTextOffsetHorizontal:4,nodeTextOffsetVertical:3,nodePadAcross:10,sankeyIterations:50,forceIterations:5,forceTicksPerFrame:10,duration:500,ease:"cubic-in-out",cn:{sankey:"sankey",sankeyLinks:"sankey-links",sankeyLink:"sankey-link",sankeyNodeSet:"sankey-node-set",sankeyNode:"sankey-node",nodeRect:"node-rect",nodeCapture:"node-capture",nodeCentered:"node-entered",nodeLabelGuide:"node-label-guide",nodeLabel:"node-label",nodeLabelTextPath:"node-label-text-path"}}},{}],1061:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("../../components/color"),o=t("tinycolor2");e.exports=function(t,e,r,s){function l(r,a){return n.coerce(t,e,i,r,a)}l("node.label"),l("node.pad"),l("node.thickness"),l("node.line.color"),l("node.line.width");var c=s.colorway;l("node.color",e.node.label.map(function(t,e){return a.addOpacity(function(t){return c[t%c.length]}(e),.8)})),l("link.label"),l("link.source"),l("link.target"),l("link.value"),l("link.line.color"),l("link.line.width"),l("link.color",e.link.value.map(function(){return o(s.paper_bgcolor).getLuminance()<.333?"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.2)"})),l("domain.x"),l("domain.y"),l("orientation"),l("valueformat"),l("valuesuffix"),l("arrangement"),n.coerceFont(l,"textfont",n.extendFlat({},s.font));e.node.label.some(function(t,r){return-1===e.link.source.indexOf(r)&&-1===e.link.target.indexOf(r)})&&n.warn("Some of the nodes are neither sources nor targets, they will not be displayed.")}},{"../../components/color":618,"../../lib":743,"./attributes":1057,tinycolor2:546}],1062:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.calc=t("./calc"),n.plot=t("./plot"),n.moduleType="trace",n.name="sankey",n.basePlotModule=t("./base_plot"),n.categories=["noOpacity"],n.meta={},e.exports=n},{"./attributes":1057,"./base_plot":1058,"./calc":1059,"./defaults":1061,"./plot":1063}],1063:[function(t,e,r){"use strict";function n(t){return""!==t}function i(t,e){return t.filter(function(t){return t.key===e.traceId})}function a(t,e){p.select(t).select("path").style("fill-opacity",e),p.select(t).select("rect").style("fill-opacity",e)}function o(t){p.select(t).select("text.name").style("fill","black")}function s(t){return function(e){return-1!==t.node.sourceLinks.indexOf(e.link)||-1!==t.node.targetLinks.indexOf(e.link)}}function l(t){return function(e){return-1!==e.node.sourceLinks.indexOf(t.link)||-1!==e.node.targetLinks.indexOf(t.link)}}function c(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(f.bind(0,e,r,!1))}function u(t,e,r){e&&r&&i(r,e).selectAll("."+x.sankeyLink).filter(s(e)).call(h.bind(0,e,r,!1))}function f(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",.4),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",.4),r&&i(e,t).selectAll("."+x.sankeyNode).filter(l(t)).call(c)}function h(t,e,r,n){var a=n.datum().link.label;n.style("fill-opacity",function(t){return t.tinyColorAlpha}),a&&i(e,t).selectAll("."+x.sankeyLink).filter(function(t){return t.link.label===a}).style("fill-opacity",function(t){return t.tinyColorAlpha}),r&&i(e,t).selectAll(x.sankeyNode).filter(l(t)).call(u)}function d(t,e){var r=t.hoverlabel||{},n=y.nestedProperty(r,e).get();return!Array.isArray(n)&&n}var p=t("d3"),m=t("./render"),g=t("../../components/fx"),v=t("../../components/color"),y=t("../../lib"),x=t("./constants").cn,b=y._;e.exports=function(t,e){var r=t._fullLayout,i=r._paper,s=r._size,l=b(t,"source:")+" ",y=b(t,"target:")+" ",_=b(t,"incoming flow count:")+" ",w=b(t,"outgoing flow count:")+" ";m(i,e,{width:s.w,height:s.h,margin:{t:s.t,r:s.r,b:s.b,l:s.l}},{linkEvents:{hover:function(e,r,n){p.select(e).call(f.bind(0,r,n,!0)),t.emit("plotly_hover",{event:p.event,points:[r.link]})},follow:function(e,i){var s=i.link.trace,c=t._fullLayout._paperdiv.node().getBoundingClientRect(),u=e.getBoundingClientRect(),f=u.left+u.width/2,h=u.top+u.height/2,m=g.loneHover({x:f-c.left,y:h-c.top,name:p.format(i.valueFormat)(i.link.value)+i.valueSuffix,text:[i.link.label||"",l+i.link.source.label,y+i.link.target.label].filter(n).join("
"),color:d(s,"bgcolor")||v.addOpacity(i.tinyColorHue,1),borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:p.event.x"),color:d(s,"bgcolor")||i.tinyColorHue,borderColor:d(s,"bordercolor"),fontFamily:d(s,"font.family"),fontSize:d(s,"font.size"),fontColor:d(s,"font.color"),idealAlign:"left"},{container:r._hoverlayer.node(),outerContainer:r._paper.node(),gd:t});a(v,.85),o(v)},unhover:function(e,n,i){p.select(e).call(u,n,i),t.emit("plotly_unhover",{event:p.event,points:[n.node]}),g.loneUnhover(r._hoverlayer.node())},select:function(e,r,n){var i=r.node;i.originalEvent=p.event,t._hoverdata=[i],p.select(e).call(u,r,n),g.click(t,{target:!0})}}})}},{"../../components/color":618,"../../components/fx":660,"../../lib":743,"./constants":1060,"./render":1064,d3:128}],1064:[function(t,e,r){"use strict";function n(t){t.lastDraggedX=t.x,t.lastDraggedY=t.y}function i(t){return function(e){return e.node.originalX===t.node.originalX}}function a(t){for(var e=0;e1||t.linkLineWidth>0}function h(t){return"translate("+t.translateX+","+t.translateY+")"+(t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)")}function d(t){return"translate("+(t.horizontal?0:t.labelY)+" "+(t.horizontal?t.labelY:0)+")"}function p(t){return w.svg.line()([[t.horizontal?t.left?-t.sizeAcross:t.visibleWidth+_.nodeTextOffsetHorizontal:_.nodeTextOffsetHorizontal,0],[t.horizontal?t.left?-_.nodeTextOffsetHorizontal:t.sizeAcross:t.visibleHeight-_.nodeTextOffsetHorizontal,0]])}function m(t){return t.horizontal?"matrix(1 0 0 1 0 0)":"matrix(0 1 1 0 0 0)"}function g(t){return t.horizontal?"scale(1 1)":"scale(-1 1)"}function v(t){return t.darkBackground&&!t.horizontal?"rgb(255,255,255)":"rgb(0,0,0)"}function y(t){return t.horizontal&&t.left?"100%":"0%"}function x(t,e,r){t.on(".basic",null).on("mouseover.basic",function(t){t.interactionState.dragInProgress||(r.hover(this,t,e),t.interactionState.hovered=[this,t])}).on("mousemove.basic",function(t){t.interactionState.dragInProgress||(r.follow(this,t),t.interactionState.hovered=[this,t])}).on("mouseout.basic",function(t){t.interactionState.dragInProgress||(r.unhover(this,t,e),t.interactionState.hovered=!1)}).on("click.basic",function(t){t.interactionState.hovered&&(r.unhover(this,t,e),t.interactionState.hovered=!1),t.interactionState.dragInProgress||r.select(this,t,e)})}function b(t,e,r){var a=w.behavior.drag().origin(function(t){return t.node}).on("dragstart",function(a){if("fixed"!==a.arrangement&&(E.raiseToTop(this),a.interactionState.dragInProgress=a.node,n(a.node),a.interactionState.hovered&&(r.nodeEvents.unhover.apply(0,a.interactionState.hovered),a.interactionState.hovered=!1),"snap"===a.arrangement)){var o=a.traceId+"|"+Math.floor(a.node.originalX);a.forceLayouts[o]?a.forceLayouts[o].alpha(1):function(t,e,r){var n=r.sankey.nodes().filter(function(t){return t.originalX===r.node.originalX});r.forceLayouts[e]=S.forceSimulation(n).alphaDecay(0).force("collide",S.forceCollide().radius(function(t){return t.dy/2+r.nodePad/2}).strength(1).iterations(_.forceIterations)).force("constrain",function(t,e,r,n){return function(){for(var t=0,i=0;i0&&n.forceLayouts[e].alpha(0)}}(0,e,n,r)).stop()}(0,o,a),function(t,e,r,n){window.requestAnimationFrame(function a(){for(var o=0;o<_.forceTicksPerFrame;o++)r.forceLayouts[n].tick();r.sankey.relayout(),c(t.filter(i(r)),e),r.forceLayouts[n].alpha()>0&&window.requestAnimationFrame(a)})}(t,e,a,o)}}).on("drag",function(r){if("fixed"!==r.arrangement){var a=w.event.x,o=w.event.y;"snap"===r.arrangement?(r.node.x=a,r.node.y=o):("freeform"===r.arrangement&&(r.node.x=a),r.node.y=Math.max(r.node.dy/2,Math.min(r.size-r.node.dy/2,o))),n(r.node),"snap"!==r.arrangement&&(r.sankey.relayout(),c(t.filter(i(r)),e))}}).on("dragend",function(t){t.interactionState.dragInProgress=!1});t.on(".drag",null).call(a)}var _=t("./constants"),w=t("d3"),M=t("tinycolor2"),k=t("../../components/color"),A=t("../../components/drawing"),T=t("@plotly/d3-sankey").sankey,S=t("d3-force"),E=t("../../lib"),L=t("../../lib/gup").keyFun,C=t("../../lib/gup").repeat,z=t("../../lib/gup").unwrap;e.exports=function(t,e,r,n){var i=t.selectAll("."+_.cn.sankey).data(e.filter(function(t){return z(t).trace.visible}).map(function(t,e,r){for(var n,i=z(e).trace,o=i.domain,s=i.node,l=i.link,c=i.arrangement,u="h"===i.orientation,f=i.node.pad,h=i.node.thickness,d=i.node.line.color,p=i.node.line.width,m=i.link.line.color,g=i.link.line.width,v=i.valueformat,y=i.valuesuffix,x=i.textfont,b=t.width*(o.x[1]-o.x[0]),w=t.height*(o.y[1]-o.y[0]),M=s.label.map(function(t,e){return{pointNumber:e,label:t,color:E.isArray(s.color)?s.color[e]:s.color}}),k=l.value.map(function(t,e){return{pointNumber:e,label:l.label[e],color:E.isArray(l.color)?l.color[e]:l.color,source:l.source[e],target:l.target[e],value:t}}),A=T().size(u?[b,w]:[w,b]).nodeWidth(h).nodePadding(f).nodes(M).links(k).layout(_.sankeyIterations),S=A.nodes(),L=0;L5?t.node.label:""}).attr("text-anchor",function(t){return t.horizontal&&t.left?"end":"start"}),R.transition().ease(_.ease).duration(_.duration).attr("startOffset",y).style("fill",v)}},{"../../components/color":618,"../../components/drawing":643,"../../lib":743,"../../lib/gup":740,"./constants":1060,"@plotly/d3-sankey":41,d3:128,"d3-force":124,tinycolor2:546}],1065:[function(t,e,r){"use strict";var n=t("../../lib");e.exports=function(t,e){for(var r=0;re&&l.splice(e,l.length-e),l.map(r)}return r(n.size)}}var i=t("fast-isnumeric"),a=t("../../plots/cartesian/axes"),o=t("../../constants/numerical").BADNUM,s=t("./subtypes"),l=t("./colorscale_calc"),c=t("./arrays_to_calcdata"),u=t("./calc_selection");e.exports={calc:function(t,e){var r=a.getFromId(t,e.xaxis||"x"),f=a.getFromId(t,e.yaxis||"y"),h=r.makeCalcdata(e,"x"),d=f.makeCalcdata(e,"y"),p=Math.min(h.length,d.length);r._minDtick=0,f._minDtick=0,h.length>p&&h.splice(p,h.length-p),d.length>p&&d.splice(p,d.length-p);var m={padded:!0},g={padded:!0},v=n(e,p);v&&(m.ppad=g.ppad=v),!("tozerox"===e.fill||"tonextx"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?e.error_y.visible||-1===["tonexty","tozeroy"].indexOf(e.fill)&&(s.hasMarkers(e)||s.hasText(e))||(m.padded=!1,m.ppad=0):m.tozero=!0,!("tozeroy"===e.fill||"tonexty"===e.fill&&t.firstscatter)||h[0]===h[p-1]&&d[0]===d[p-1]?-1!==["tonextx","tozerox"].indexOf(e.fill)&&(g.padded=!1):g.tozero=!0,a.expand(r,h,m),a.expand(f,d,g);for(var y=new Array(p),x=0;x=0;i--){var a=t[i];if("scatter"===a.type&&a.xaxis===r.xaxis&&a.yaxis===r.yaxis){a.opacity=void 0;break}}}}}},{}],1070:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l=r.marker,c="cb"+r.uid;if(t._fullLayout._infolayer.selectAll("."+c).remove(),void 0!==l&&l.showscale){var u=l.color,f=l.cmin,h=l.cmax;n(f)||(f=i.aggNums(Math.min,null,u)),n(h)||(h=i.aggNums(Math.max,null,u));var d=e[0].t.cb=s(t,c),p=o.makeColorScaleFunc(o.extractScale(l.colorscale,f,h),{noNumericCheck:!0});d.fillcolor(p).filllevels({start:f,end:h,size:(h-f)/254}).options(l.colorbar)()}else a.autoMargin(t,c)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1071:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/calc"),a=t("./subtypes");e.exports=function(t){a.hasLines(t)&&n(t,"line")&&i(t,t.line.color,"line","c"),a.hasMarkers(t)&&(n(t,"marker")&&i(t,t.marker.color,"marker","c"),n(t,"marker.line")&&i(t,t.marker.line.color,"marker.line","c"))}},{"../../components/colorscale/calc":625,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1072:[function(t,e,r){"use strict";e.exports={PTS_LINESONLY:20,minTolerance:.2,toleranceGrowth:10,maxScreensAway:20}},{}],1073:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes"),a=t("./constants"),o=t("./subtypes"),s=t("./xy_defaults"),l=t("./marker_defaults"),c=t("./line_defaults"),u=t("./line_shape_defaults"),f=t("./text_defaults"),h=t("./fillcolor_defaults"),d=t("../../components/errorbars/defaults");e.exports=function(t,e,r,p){function m(r,a){return n.coerce(t,e,i,r,a)}var g=s(t,e,p,m),v=gH!=(F=z[L][1])>=H&&(I=z[L-1][0],P=z[L][0],F-O&&(D=I+(P-I)*(H-O)/(F-O),B=Math.min(B,D),U=Math.max(U,D)));B=Math.max(B,0),U=Math.min(U,d._length);var G=s.defaultLine;return s.opacity(h.fillcolor)?G=h.fillcolor:s.opacity((h.line||{}).color)&&(G=h.line.color),n.extendFlat(t,{distance:c+10,x0:B,x1:U,y0:H,y1:H,color:G}),delete t.index,h.text&&!Array.isArray(h.text)?t.text=String(h.text):t.text=h.name,[t]}}}},{"../../components/color":618,"../../components/errorbars":649,"../../components/fx":660,"../../lib":743,"./fill_hover_text":1074,"./get_trace_color":1076}],1078:[function(t,e,r){"use strict";var n={},i=t("./subtypes");n.hasLines=i.hasLines,n.hasMarkers=i.hasMarkers,n.hasText=i.hasText,n.isBubble=i.isBubble,n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.cleanData=t("./clean_data"),n.calc=t("./calc").calc,n.arraysToCalcdata=t("./arrays_to_calcdata"),n.plot=t("./plot"),n.colorbar=t("./colorbar"),n.style=t("./style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("./select"),n.animatable=!0,n.moduleType="trace",n.name="scatter",n.basePlotModule=t("../../plots/cartesian"),n.categories=["cartesian","symbols","markerColorscale","errorBarsOK","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"./arrays_to_calcdata":1065,"./attributes":1066,"./calc":1067,"./clean_data":1069,"./colorbar":1070,"./defaults":1073,"./hover":1077,"./plot":1085,"./select":1086,"./style":1087,"./subtypes":1088}],1079:[function(t,e,r){"use strict";var n=t("../../components/colorscale/has_colorscale"),i=t("../../components/colorscale/defaults");e.exports=function(t,e,r,a,o,s){var l=(t.marker||{}).color;if(o("line.color",r),n(t,"line"))i(t,e,a,o,{prefix:"line.",cLetter:"c"});else{o("line.color",!Array.isArray(l)&&l||r)}o("line.width"),(s||{}).noDash||o("line.dash")}},{"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632}],1080:[function(t,e,r){"use strict";var n=t("../../constants/numerical").BADNUM,i=t("../../lib"),a=i.segmentsIntersect,o=i.constrain,s=t("./constants");e.exports=function(t,e){function r(e){var r=t[e],i=P.c2p(r.x),a=O.c2p(r.y);return i===n||a===n?r.intoCenter||!1:[i,a]}function l(t){var e=t[0]/P._length,r=t[1]/O._length;return(1+s.toleranceGrowth*Math.max(0,-e,e-1,-r,r-1))*N}function c(t,e){var r=t[0]-e[0],n=t[1]-e[1];return Math.sqrt(r*r+n*n)}function u(t,e){for(var r=[],n=0,i=0;i<4;i++){var o=nt[i],s=a(t[0],t[1],e[0],e[1],o[0],o[1],o[2],o[3]);s&&(!n||Math.abs(s.x-r[0][0])>1||Math.abs(s.y-r[0][1])>1)&&(s=[s.x,s.y],n&&c(s,t)tt||t[1]rt)return[o(t[0],$,tt),o(t[1],et,rt)]}function h(t,e){return t[0]===e[0]&&(t[0]===$||t[0]===tt)||(t[1]===e[1]&&(t[1]===et||t[1]===rt)||void 0)}function d(t,e){var r=[],n=f(t),i=f(e);return n&&i&&h(n,i)?r:(n&&r.push(n),i&&r.push(i),r)}function p(t,e,r){return function(n,a){var o=f(n),s=f(a),l=[];if(o&&s&&h(o,s))return l;o&&l.push(o),s&&l.push(s);var c=2*i.constrain((n[t]+a[t])/2,e,r)-((o||n)[t]+(s||a)[t]);if(c){(o&&s?c>0==o[t]>s[t]?o:s:o||s)[t]+=c}return l}}function m(t){var e=t[0],r=t[1],n=e===q[H-1][0],i=r===q[H-1][1];if(!n||!i)if(H>1){var a=e===q[H-2][0],o=r===q[H-2][1];n&&(e===$||e===tt)&&a?o?H--:q[H-1]=t:i&&(r===et||r===rt)&&o?a?H--:q[H-1]=t:q[H++]=t}else q[H++]=t}function g(t){q[H-1][0]!==t[0]&&q[H-1][1]!==t[1]&&m([W,X]),m(t),Z=null,W=X=0}function v(t){if(G=t[0]<$?$:t[0]>tt?tt:0,Y=t[1]rt?rt:0,G||Y){if(H)if(Z){var e=K(Z,t);e.length>1&&(g(e[0]),q[H++]=e[1])}else J=K(q[H-1],t)[0],q[H++]=J;else q[H++]=[G||t[0],Y||t[1]];var r=q[H-1];G&&Y&&(r[0]!==G||r[1]!==Y)?(Z&&(W!==G&&X!==Y?m(W&&X?function(t,e){var r=e[0]-t[0],n=(e[1]-t[1])/r;return(t[1]*e[0]-e[1]*t[0])/r>0?[n>0?$:tt,rt]:[n>0?tt:$,et]}(Z,t):[W||G,X||Y]):W&&X&&m([W,X])),m([G,Y])):W-G&&X-Y&&m([G||W,Y||X]),Z=t,W=G,X=Y}else Z&&g(K(Z,t)[0]),q[H++]=t}var y,x,b,_,w,M,k,A,T,S,E,L,C,z,D,I,P=e.xaxis,O=e.yaxis,F=e.simplify,R=e.connectGaps,N=e.baseTolerance,j=e.shape,B="linear"===j,U=[],V=s.minTolerance,q=new Array(t.length),H=0;F||(N=V=-1);var G,Y,W,X,Z,J,K,Q=s.maxScreensAway,$=-P._length*Q,tt=P._length*(1+Q),et=-O._length*Q,rt=O._length*(1+Q),nt=[[$,et,tt,et],[tt,et,tt,rt],[tt,rt,$,rt],[$,rt,$,et]];for("linear"===j||"spline"===j?K=u:"hv"===j||"vh"===j?K=d:"hvh"===j?K=p(0,$,tt):"vhv"===j&&(K=p(1,et,rt)),y=0;yl(M))break;b=M,(C=T[0]*A[0]+T[1]*A[1])>E?(E=C,_=M,k=!1):C=t.length||!M)break;v(M),x=M}}else v(_)}Z&&m([W||Z[0],X||Z[1]]),U.push(q.slice(0,H))}return U}},{"../../constants/numerical":721,"../../lib":743,"./constants":1072}],1081:[function(t,e,r){"use strict";e.exports=function(t,e,r){"spline"===r("line.shape")&&r("line.smoothing")}},{}],1082:[function(t,e,r){"use strict";e.exports=function(t,e,r){var n,i,a=null;for(i=0;i0?Math.max(e,i):0}}},{"fast-isnumeric":140}],1084:[function(t,e,r){"use strict";var n=t("../../components/color"),i=t("../../components/colorscale/has_colorscale"),a=t("../../components/colorscale/defaults"),o=t("./subtypes");e.exports=function(t,e,r,s,l,c){var u=o.isBubble(t),f=(t.line||{}).color;if(c=c||{},f&&(r=f),l("marker.symbol"),l("marker.opacity",u?.7:1),l("marker.size"),l("marker.color",r),i(t,"marker")&&a(t,e,s,l,{prefix:"marker.",cLetter:"c"}),c.noSelect||(l("selected.marker.color"),l("unselected.marker.color"),l("selected.marker.size"),l("unselected.marker.size")),c.noLine||(l("marker.line.color",f&&!Array.isArray(f)&&e.marker.color!==f?f:u?n.background:n.defaultLine),i(t,"marker.line")&&a(t,e,s,l,{prefix:"marker.line.",cLetter:"c"}),l("marker.line.width",u?1:0)),u&&(l("marker.sizeref"),l("marker.sizemin"),l("marker.sizemode")),c.gradient){"none"!==l("marker.gradient.type")&&l("marker.gradient.color")}}},{"../../components/color":618,"../../components/colorscale/defaults":628,"../../components/colorscale/has_colorscale":632,"./subtypes":1088}],1085:[function(t,e,r){"use strict";function n(t,e,r,n,u,h,d){function p(t){return w?t.transition():t}function m(t){p(t).attr("d","M0,0Z")}function g(t){return t.filter(function(t){return t.vis})}function v(t){return t.id}function y(){return!1}function x(e){var n,s,c=e[0].trace,u=i.select(this),f=l.hasMarkers(c),h=l.hasText(c),d=function(t){if(t.ids)return v}(c),m=y,x=y;f&&(m=c.marker.maxdisplayed||c._needsCull?g:a.identity),h&&(x=c.marker.maxdisplayed||c._needsCull?g:a.identity);var b=(n=u.selectAll("path.point").data(m,d)).enter().append("path").classed("point",!0);w&&b.call(o.pointStyle,c,t).call(o.translatePoints,M,k).style("opacity",0).transition().style("opacity",1);var _=f&&o.tryColorscale(c.marker,""),A=f&&o.tryColorscale(c.marker,"line");n.order(),n.each(function(e){var n=i.select(this),a=p(n);(s=o.translatePoint(e,a,M,k))?(o.singlePointStyle(e,a,c,_,A,t),r.layerClipId&&o.hideOutsideRangePoint(e,a,M,k,c.xcalendar,c.ycalendar),c.customdata&&n.classed("plotly-customdata",null!==e.data&&void 0!==e.data)):a.remove()}),w?n.exit().transition().style("opacity",0).remove():n.exit().remove(),(n=u.selectAll("g").data(x,d)).enter().append("g").classed("textpoint",!0).append("text"),n.order(),n.each(function(t){var e=i.select(this),n=p(e.select("text"));(s=o.translatePoint(t,n,M,k))?r.layerClipId&&o.hideOutsideRangePoint(t,e,M,k,c.xcalendar,c.ycalendar):e.remove()}),n.selectAll("text").call(o.textPointStyle,c,t).each(function(t){var e=M.c2p(t.x),r=k.c2p(t.y);i.select(this).selectAll("tspan.line").each(function(){p(i.select(this)).attr({x:e,y:r})})}),n.exit().remove()}var b,_;!function(t,e,r,n,o){var s=r.xaxis,c=r.yaxis,u=i.extent(a.simpleMap(s.range,s.r2c)),f=i.extent(a.simpleMap(c.range,c.r2c)),h=n[0].trace;if(!l.hasMarkers(h))return;var d=h.marker.maxdisplayed;if(0===d)return;var p=n.filter(function(t){return t.x>=u[0]&&t.x<=u[1]&&t.y>=f[0]&&t.y<=f[1]}),m=Math.ceil(p.length/d),g=0;o.forEach(function(t,r){var n=t[0].trace;l.hasMarkers(n)&&n.marker.maxdisplayed>0&&r0,M=r.xaxis,k=r.yaxis,A=n[0].trace,T=A.line,S=i.select(h);if(S.call(s.plot,r,d),!0===A.visible){p(S).style("opacity",A.opacity);var E,L,C=A.fill.charAt(A.fill.length-1);"x"!==C&&"y"!==C&&(C=""),n[0].node3=S;var z="",D=[],I=A._prevtrace;I&&(z=I._prevRevpath||"",L=I._nextFill,D=I._polygons);var P,O,F,R,N,j,B,U,V,q="",H="",G=[],Y=a.noop;if(E=A._ownFill,l.hasLines(A)||"none"!==A.fill){for(L&&L.datum(n),-1!==["hv","vh","hvh","vhv"].indexOf(T.shape)?(F=o.steps(T.shape),R=o.steps(T.shape.split("").reverse().join(""))):F=R="spline"===T.shape?function(t){var e=t[t.length-1];return t.length>1&&t[0][0]===e[0]&&t[0][1]===e[1]?o.smoothclosed(t.slice(1),T.smoothing):o.smoothopen(t,T.smoothing)}:function(t){return"M"+t.join("L")},N=function(t){return R(t.reverse())},G=c(n,{xaxis:M,yaxis:k,connectGaps:A.connectgaps,baseTolerance:Math.max(T.width||1,3)/4,shape:T.shape,simplify:T.simplify}),V=A._polygons=new Array(G.length),_=0;_1){var r=i.select(this);if(r.datum(n),t)p(r.style("opacity",0).attr("d",P).call(o.lineGroupStyle)).style("opacity",1);else{var a=p(r);a.attr("d",P),o.singleLineStyle(n,a)}}}}}var W=S.selectAll(".js-line").data(G);p(W.exit()).style("opacity",0).remove(),W.each(Y(!1)),W.enter().append("path").classed("js-line",!0).style("vector-effect","non-scaling-stroke").call(o.lineGroupStyle).each(Y(!0)),o.setClipUrl(W,r.layerClipId),G.length?(E?j&&U&&(C?("y"===C?j[1]=U[1]=k.c2p(0,!0):"x"===C&&(j[0]=U[0]=M.c2p(0,!0)),p(E).attr("d","M"+U+"L"+j+"L"+q.substr(1)).call(o.singleFillStyle)):p(E).attr("d",q+"Z").call(o.singleFillStyle)):L&&("tonext"===A.fill.substr(0,6)&&q&&z?("tonext"===A.fill?p(L).attr("d",q+"Z"+z+"Z").call(o.singleFillStyle):p(L).attr("d",q+"L"+z.substr(1)+"Z").call(o.singleFillStyle),A._polygons=A._polygons.concat(D)):(m(L),A._polygons=null)),A._prevRevpath=H,A._prevPolygons=V):(E?m(E):L&&m(L),A._polygons=A._prevRevpath=A._prevPolygons=null);var X=S.selectAll(".points");b=X.data([n]),X.each(x),b.enter().append("g").classed("points",!0).each(x),b.exit().remove(),b.each(function(t){var e=!1===t[0].trace.cliponaxis;o.setClipUrl(i.select(this),e?null:r.layerClipId)})}}var i=t("d3"),a=t("../../lib"),o=t("../../components/drawing"),s=t("../../components/errorbars"),l=t("./subtypes"),c=t("./line_points"),u=t("./link_traces"),f=t("../../lib/polygon").tester;e.exports=function(t,e,r,a,s){var l,c,f,h,d=e.plot.select("g.scatterlayer"),p=!a,m=!!a&&a.duration>0;for((f=d.selectAll("g.trace").data(r,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),u(t,e,r),function(t,e,r){var n;e.selectAll("g.trace").each(function(t){var e=i.select(this);if((n=t[0].trace)._nexttrace){if(n._nextFill=e.select(".js-fill.js-tonext"),!n._nextFill.size()){var a=":first-child";e.select(".js-fill.js-tozero").size()&&(a+=" + *"),n._nextFill=e.insert("path",a).attr("class","js-fill js-tonext")}}else e.selectAll(".js-fill.js-tonext").remove(),n._nextFill=null;n.fill&&("tozero"===n.fill.substr(0,6)||"toself"===n.fill||"to"===n.fill.substr(0,2)&&!n._prevtrace)?(n._ownFill=e.select(".js-fill.js-tozero"),n._ownFill.size()||(n._ownFill=e.insert("path",":first-child").attr("class","js-fill js-tozero"))):(e.selectAll(".js-fill.js-tozero").remove(),n._ownFill=null),e.selectAll(".js-fill").call(o.setClipUrl,r.layerClipId)})}(0,d,e),l=0,c={};lc[e[0].trace.uid]?1:-1}),m){s&&(h=s());i.transition().duration(a.duration).ease(a.easing).each("end",function(){h&&h()}).each("interrupt",function(){h&&h()}).each(function(){d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)})})}else d.selectAll("g.trace").each(function(i,o){n(t,o,e,i,r,this,a)});p&&f.exit().remove(),d.selectAll("path:not([d])").remove()}},{"../../components/drawing":643,"../../components/errorbars":649,"../../lib":743,"../../lib/polygon":755,"./line_points":1080,"./link_traces":1082,"./subtypes":1088,d3:128}],1086:[function(t,e,r){"use strict";var n=t("./subtypes");e.exports=function(t,e){var r,i,a,o,s=t.cd,l=t.xaxis,c=t.yaxis,u=[],f=s[0].trace;if(!n.hasMarkers(f)&&!n.hasText(f))return[];if(!1===e)for(r=0;r=0&&(e[1]+=1),t.indexOf("top")>=0&&(e[1]-=1),t.indexOf("left")>=0&&(e[0]-=1),t.indexOf("right")>=0&&(e[0]+=1),e)}(e.textposition),r.textColor=g(e.textfont,1,S),r.textSize=o(e.textfont.size,S,p.identity,12),r.textFont=e.textfont.family,r.textAngle=0);var D=["x","y","z"];for(r.project=[!1,!1,!1],r.projectScale=[1,1,1],r.projectOpacity=[1,1,1],n=0;n<3;++n){var I=e.projection[D[n]];(r.project[n]=I.show)&&(r.projectOpacity[n]=I.opacity,r.projectScale[n]=I.scale)}r.errorBounds=b(e,d);var P=function(t){for(var e=[0,0,0],r=[[0,0,0],[0,0,0],[0,0,0]],n=[0,0,0],i=0;i<3;i++){var a=t[i];a&&!1!==a.copy_zstyle&&(a=t[2]),a&&(e[i]=a.width/2,r[i]=m(a.color),n=a.thickness)}return{capSize:e,color:r,lineWidth:n}}([e.error_x,e.error_y,e.error_z]);return r.errorColor=P.color,r.errorLineWidth=P.lineWidth,r.errorCapSize=P.capSize,r.delaunayAxis=e.surfaceaxis,r.delaunayColor=m(e.surfacecolor),r}function l(t){if(Array.isArray(t)){var e=t[0];return Array.isArray(e)&&(t=e),"rgb("+t.slice(0,3).map(function(t){return Math.round(255*t)})+")"}return null}var c=t("gl-line3d"),u=t("gl-scatter3d"),f=t("gl-error3d"),h=t("gl-mesh3d"),d=t("delaunay-triangulate"),p=t("../../lib"),m=t("../../lib/str2rgbarray"),g=t("../../lib/gl_format_color"),v=t("../scatter/make_bubble_size_func"),y=t("../../constants/gl3d_dashes"),x=t("../../constants/gl3d_markers"),b=t("./calc_errors"),_=n.prototype;_.handlePick=function(t){if(t.object&&(t.object===this.linePlot||t.object===this.delaunayMesh||t.object===this.textMarkers||t.object===this.scatterPlot)){t.object.highlight&&t.object.highlight(null),this.scatterPlot&&(t.object=this.scatterPlot,this.scatterPlot.highlight(t.data)),this.textLabels?void 0!==this.textLabels[t.data.index]?t.textLabel=this.textLabels[t.data.index]:t.textLabel=this.textLabels:t.textLabel="";var e=t.index=t.data.index;return t.traceCoordinate=[this.data.x[e],this.data.y[e],this.data.z[e]],!0}},_.update=function(t){var e,r,n,i,a=this.scene.glplot.gl,o=y.solid;this.data=t;var p=s(this.scene,t);"mode"in p&&(this.mode=p.mode),"lineDashes"in p&&p.lineDashes in y&&(o=y[p.lineDashes]),this.color=l(p.scatterColor)||l(p.lineColor),this.dataPoints=p.position,e={gl:a,position:p.position,color:p.lineColor,lineWidth:p.lineWidth||1,dashes:o[0],dashScale:o[1],opacity:t.opacity,connectGaps:t.connectgaps},-1!==this.mode.indexOf("lines")?this.linePlot?this.linePlot.update(e):(this.linePlot=c(e),this.linePlot._trace=this,this.scene.glplot.add(this.linePlot)):this.linePlot&&(this.scene.glplot.remove(this.linePlot),this.linePlot.dispose(),this.linePlot=null);var m=t.opacity;if(t.marker&&t.marker.opacity&&(m*=t.marker.opacity),r={gl:a,position:p.position,color:p.scatterColor,size:p.scatterSize,glyph:p.scatterMarker,opacity:m,orthographic:!0,lineWidth:p.scatterLineWidth,lineColor:p.scatterLineColor,project:p.project,projectScale:p.projectScale,projectOpacity:p.projectOpacity},-1!==this.mode.indexOf("markers")?this.scatterPlot?this.scatterPlot.update(r):(this.scatterPlot=u(r),this.scatterPlot._trace=this,this.scatterPlot.highlightScale=1,this.scene.glplot.add(this.scatterPlot)):this.scatterPlot&&(this.scene.glplot.remove(this.scatterPlot),this.scatterPlot.dispose(),this.scatterPlot=null),i={gl:a,position:p.position,glyph:p.text,color:p.textColor,size:p.textSize,angle:p.textAngle,alignment:p.textOffset,font:p.textFont,orthographic:!0,lineWidth:0,project:!1,opacity:t.opacity},this.textLabels=t.hovertext||t.text,-1!==this.mode.indexOf("text")?this.textMarkers?this.textMarkers.update(i):(this.textMarkers=u(i),this.textMarkers._trace=this,this.textMarkers.highlightScale=1,this.scene.glplot.add(this.textMarkers)):this.textMarkers&&(this.scene.glplot.remove(this.textMarkers),this.textMarkers.dispose(),this.textMarkers=null),n={gl:a,position:p.position,color:p.errorColor,error:p.errorBounds,lineWidth:p.errorLineWidth,capSize:p.errorCapSize,opacity:t.opacity},this.errorBars?p.errorBounds?this.errorBars.update(n):(this.scene.glplot.remove(this.errorBars),this.errorBars.dispose(),this.errorBars=null):p.errorBounds&&(this.errorBars=f(n),this.errorBars._trace=this,this.scene.glplot.add(this.errorBars)),p.delaunayAxis>=0){var g=function(t,e,r){var n,i=(r+1)%3,a=(r+2)%3,o=[],s=[];for(n=0;n=0&&h("surfacecolor",d||p);for(var m=["x","y","z"],g=0;g<3;++g){var v="projection."+m[g];h(v+".show")&&(h(v+".opacity"),h(v+".scale"))}c(t,e,r,{axis:"z"}),c(t,e,r,{axis:"y",inherit:"z"}),c(t,e,r,{axis:"x",inherit:"z"})}else e.visible=!1}},{"../../components/errorbars/defaults":648,"../../lib":743,"../../registry":873,"../scatter/line_defaults":1079,"../scatter/marker_defaults":1084,"../scatter/subtypes":1088,"../scatter/text_defaults":1089,"./attributes":1091}],1096:[function(t,e,r){"use strict";var n={};n.plot=t("./convert"),n.attributes=t("./attributes"),n.markerSymbols=t("../../constants/gl3d_markers"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.moduleType="trace",n.name="scatter3d",n.basePlotModule=t("../../plots/gl3d"),n.categories=["gl3d","symbols","markerColorscale","showLegend"],n.meta={},e.exports=n},{"../../constants/gl3d_markers":719,"../../plots/gl3d":832,"../scatter/colorbar":1070,"./attributes":1091,"./calc":1092,"./convert":1094,"./defaults":1095}],1097:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=n.marker,c=n.line,u=l.line;e.exports={carpet:{valType:"string",editType:"calc"},a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},mode:s({},n.mode,{dflt:"markers"}),text:s({},n.text,{}),line:{color:c.color,width:c.width,dash:c.dash,shape:s({},c.shape,{values:["linear","spline"]}),smoothing:c.smoothing,editType:"calc"},connectgaps:n.connectgaps,fill:s({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:s({symbol:l.symbol,opacity:l.opacity,maxdisplayed:l.maxdisplayed,size:l.size,sizeref:l.sizeref,sizemin:l.sizemin,sizemode:l.sizemode,line:s({width:u.width,editType:"calc"},a("marker".line)),gradient:l.gradient,editType:"calc"},a("marker"),{showscale:l.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:s({},i.hoverinfo,{flags:["a","b","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1098:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=t("../carpet/lookup_carpetid");e.exports=function(t,e){var r=e.carpetTrace=l(t,e);if(r&&r.visible&&"legendonly"!==r.visible){var c;e.xaxis=r.xaxis,e.yaxis=r.yaxis;var u,f,h=e.a.length,d=new Array(h),p=!1;for(c=0;c0?t.labelprefix.replace(/ = $/,""):t._hovertitle,g.push(r+": "+e.toFixed(3)+t.labelsuffix)}var o=n(t,e,r,i);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index){var l=1-s.y0/t.ya._length,c=t.xa._length,u=c*l/2,f=c-u;return s.x0=Math.max(Math.min(s.x0,f),u),s.x1=Math.max(Math.min(s.x1,f),u),o}var h=s.cd[s.index];s.a=h.a,s.b=h.b,s.xLabelVal=void 0,s.yLabelVal=void 0;var d=s.trace,p=d._carpet,m=(h.hi||d.hoverinfo).split("+"),g=[];-1!==m.indexOf("all")&&(m=["a","b"]),-1!==m.indexOf("a")&&a(p.aaxis,h.a),-1!==m.indexOf("b")&&a(p.baxis,h.b);var v=p.ab2ij([h.a,h.b]),y=Math.floor(v[0]),x=v[0]-y,b=Math.floor(v[1]),_=v[1]-b,w=p.evalxy([],y,b,x,_);return g.push("y: "+w[1].toFixed(3)),s.extraText=g.join("
"),o}}},{"../scatter/hover":1077}],1102:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scattercarpet",n.basePlotModule=t("../../plots/cartesian"),n.categories=["carpet","symbols","markerColorscale","showLegend","carpetDependent"],n.meta={},e.exports=n},{"../../plots/cartesian":800,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1097,"./calc":1098,"./defaults":1099,"./event_data":1100,"./hover":1101,"./plot":1103}],1103:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../plots/cartesian/axes"),a=t("../../components/drawing");e.exports=function(t,e,r){var o,s,l,c=r[0][0].carpet,u={xaxis:i.getFromId(t,c.xaxis||"x"),yaxis:i.getFromId(t,c.yaxis||"y"),plot:e.plot};for(n(t,u,r),o=0;o")}(u,g,d.mockAxis,c[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../../plots/cartesian/axes":789,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076,"./attributes":1104}],1109:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("./style"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.moduleType="trace",n.name="scattergeo",n.basePlotModule=t("../../plots/geo"),n.categories=["geo","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/geo":820,"../scatter/colorbar":1070,"./attributes":1104,"./calc":1105,"./defaults":1106,"./event_data":1107,"./hover":1108,"./plot":1110,"./select":1111,"./style":1112}],1110:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../constants/numerical").BADNUM,o=t("../../lib/topojson_utils").getTopojsonFeatures,s=t("../../lib/geo_location_utils").locationToFeature,l=t("../../lib/geojson_utils"),c=t("../scatter/subtypes"),u=t("./style");e.exports=function(t,e,r){function f(t,e){t.lonlat[0]===a&&n.select(e).remove()}for(var h=0;h1,f=r.error_x&&!0===r.error_x.visible,h=r.error_y&&!0===r.error_y.visible,p=f||h,m=d.hasMarkers(r),x=!!r.fill&&"none"!==r.fill);var E,L,C,z,D,I,O,F,R=p?l.calcFromTrace(r,b):null;if(f){(C={}).positions=n;var N=new Float64Array(4*_);if("log"===T.type)for(o=0;o<_;++o)N[k++]=n[2*o]-T.d2l(R[o].xs)||0,N[k++]=T.d2l(R[o].xh)-n[2*o]||0,N[k++]=0,N[k++]=0;else for(o=0;o<_;++o)N[k++]=n[2*o]-R[o].xs||0,N[k++]=R[o].xh-n[2*o]||0,N[k++]=0,N[k++]=0;r.error_x.copy_ystyle&&(r.error_x=r.error_y),C.errors=N,C.capSize=2*r.error_x.width,C.lineWidth=r.error_x.thickness,C.color=r.error_x.color}if(h){(z={}).positions=n;var j=new Float64Array(4*_);if("log"===S.type)for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-S.d2l(R[o].ys)||0,j[A++]=S.d2l(R[o].yh)-n[2*o+1]||0;else for(o=0;o<_;++o)j[A++]=0,j[A++]=0,j[A++]=n[2*o+1]-R[o].ys||0,j[A++]=R[o].yh-n[2*o+1]||0;z.errors=j,z.capSize=2*r.error_y.width,z.lineWidth=r.error_y.thickness,z.color=r.error_y.color}if(s){(E={}).thickness=r.line.width,E.color=r.line.color,E.opacity=r.opacity,E.overlay=!0;var B=(v[r.line.dash]||[1]).slice();for(o=0;oP?"rect":m?"rect":"round",U&&r.connectgaps){var V=F[0],q=F[1];for(o=0;os&&(A[0]=s),A[1]l&&(T[0]=l),T[1]=0?Math.floor((e+180)/360):Math.ceil((e-180)/360)),h=e-f;if(n.getClosest(s,function(t){var e=t.lonlat;if(e[0]===o)return 1/0;var n=Math.abs(c.c2p(e)-c.c2p([h,e[1]])),i=Math.abs(u.c2p(e)-u.c2p([e[0],r])),a=Math.max(3,t.mrc||0);return Math.max(Math.sqrt(n*n+i*i)-a,1-3/a)},t),!1!==t.index){var d=s[t.index],p=d.lonlat,m=[p[0]+f,p[1]],g=c.c2p(m),v=u.c2p(m),y=d.mrc||1;return t.x0=g-y,t.x1=g+y,t.y0=v-y,t.y1=v+y,t.color=i(l,d),t.extraText=function(t,e,r){function n(t){return t+"\xb0"}var i=(e.hi||t.hoverinfo).split("+"),o=-1!==i.indexOf("all"),s=-1!==i.indexOf("lon"),l=-1!==i.indexOf("lat"),c=e.lonlat,u=[];return o||s&&l?u.push("("+n(c[0])+", "+n(c[1])+")"):s?u.push(r.lon+n(c[0])):l&&u.push(r.lat+n(c[1])),(o||-1!==i.indexOf("text"))&&a(e,t,u),u.join("
")}(l,d,s[0].t.labels),[t]}}},{"../../components/fx":660,"../../constants/numerical":721,"../scatter/fill_hover_text":1074,"../scatter/get_trace_color":1076}],1121:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("../scattergeo/calc"),n.plot=t("./plot"),n.hoverPoints=t("./hover"),n.eventData=t("./event_data"),n.selectPoints=t("./select"),n.style=function(t,e){if(e){e[0].trace._glTrace.update(e)}},n.moduleType="trace",n.name="scattermapbox",n.basePlotModule=t("../../plots/mapbox"),n.categories=["mapbox","gl","symbols","markerColorscale","showLegend","scatterlike"],n.meta={},e.exports=n},{"../../plots/mapbox":846,"../scatter/colorbar":1070,"../scattergeo/calc":1105,"./attributes":1116,"./defaults":1118,"./event_data":1119,"./hover":1120,"./plot":1122,"./select":1123}],1122:[function(t,e,r){"use strict";function n(t,e){this.mapbox=t,this.map=t.map,this.uid=e,this.idSourceFill=e+"-source-fill",this.idSourceLine=e+"-source-line",this.idSourceCircle=e+"-source-circle",this.idSourceSymbol=e+"-source-symbol",this.idLayerFill=e+"-layer-fill",this.idLayerLine=e+"-layer-line",this.idLayerCircle=e+"-layer-circle",this.idLayerSymbol=e+"-layer-symbol",this.mapbox.initSource(this.idSourceFill),this.mapbox.initSource(this.idSourceLine),this.mapbox.initSource(this.idSourceCircle),this.mapbox.initSource(this.idSourceSymbol),this.map.addLayer({id:this.idLayerFill,source:this.idSourceFill,type:"fill"}),this.map.addLayer({id:this.idLayerLine,source:this.idSourceLine,type:"line"}),this.map.addLayer({id:this.idLayerCircle,source:this.idSourceCircle,type:"circle"}),this.map.addLayer({id:this.idLayerSymbol,source:this.idSourceSymbol,type:"symbol"})}function i(t){return"visible"===t.layout.visibility}var a=t("./convert"),o=n.prototype;o.update=function(t){var e=this.mapbox,r=a(t);e.setOptions(this.idLayerFill,"setLayoutProperty",r.fill.layout),e.setOptions(this.idLayerLine,"setLayoutProperty",r.line.layout),e.setOptions(this.idLayerCircle,"setLayoutProperty",r.circle.layout),e.setOptions(this.idLayerSymbol,"setLayoutProperty",r.symbol.layout),i(r.fill)&&(e.setSourceData(this.idSourceFill,r.fill.geojson),e.setOptions(this.idLayerFill,"setPaintProperty",r.fill.paint)),i(r.line)&&(e.setSourceData(this.idSourceLine,r.line.geojson),e.setOptions(this.idLayerLine,"setPaintProperty",r.line.paint)),i(r.circle)&&(e.setSourceData(this.idSourceCircle,r.circle.geojson),e.setOptions(this.idLayerCircle,"setPaintProperty",r.circle.paint)),i(r.symbol)&&(e.setSourceData(this.idSourceSymbol,r.symbol.geojson),e.setOptions(this.idLayerSymbol,"setPaintProperty",r.symbol.paint)),t[0].trace._glTrace=this},o.dispose=function(){var t=this.map;t.removeLayer(this.idLayerFill),t.removeLayer(this.idLayerLine),t.removeLayer(this.idLayerCircle),t.removeLayer(this.idLayerSymbol),t.removeSource(this.idSourceFill),t.removeSource(this.idSourceLine),t.removeSource(this.idSourceCircle),t.removeSource(this.idSourceSymbol)},e.exports=function(t,e){var r=new n(t,e[0].trace.uid);return r.update(e),r}},{"./convert":1117}],1123:[function(t,e,r){"use strict";var n=t("../scatter/subtypes");e.exports=function(t,e){var r,i,a,o,s,l=t.cd,c=t.xaxis,u=t.yaxis,f=[],h=l[0].trace;if(!n.hasMarkers(h))return[];if(!1===e)for(s=0;s")}var i=t("../scatter/hover"),a=t("../../plots/cartesian/axes"),o=t("../../lib");e.exports={hoverPoints:function(t,e,r,a){var o=i(t,e,r,a);if(o&&!1!==o[0].index){var s=o[0];if(void 0===s.index)return o;var l=t.subplot,c=s.cd[s.index],u=s.trace;if(l.isPtWithinSector(c))return s.xLabelVal=void 0,s.yLabelVal=void 0,s.extraText=n(c,u,l),o}},makeHoverPointText:n}},{"../../lib":743,"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1128:[function(t,e,r){"use strict";e.exports={moduleType:"trace",name:"scatterpolar",basePlotModule:t("../../plots/polar"),categories:["polar","symbols","markerColorscale","showLegend","scatter-like"],attributes:t("./attributes"),supplyDefaults:t("./defaults"),calc:t("./calc"),plot:t("./plot"),style:t("../scatter/style").style,hoverPoints:t("./hover").hoverPoints,selectPoints:t("../scatter/select"),meta:{}}},{"../../plots/polar":855,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1124,"./calc":1125,"./defaults":1126,"./hover":1127,"./plot":1129}],1129:[function(t,e,r){"use strict";var n=t("../scatter/plot"),i=t("../../constants/numerical").BADNUM;e.exports=function(t,e,r){var a,o,s,l={xaxis:e.xaxis,yaxis:e.yaxis,plot:e.framework,layerClipId:e._hasClipOnAxisFalse?e.clipIds.circle:null},c=e.radialAxis,u=c.range;for(s=u[0]>u[1]?function(t){return t<=0}:function(t){return t>=0},a=0;a=0?(g=o.c2r(m)-l[0],y=d(v),E[p]=S[2*p]=g*Math.cos(y),L[p]=S[2*p+1]=g*Math.sin(y)):E[p]=L[p]=S[2*p]=S[2*p+1]=NaN;var C=a.sceneOptions(t,e,b,S);C.fill&&!u.fill2d&&(u.fill2d=!0),C.marker&&!u.scatter2d&&(u.scatter2d=!0),C.line&&!u.line2d&&(u.line2d=!0),!C.errorX&&!C.errorY||u.error2d||(u.error2d=!0),c.hasMarkers(b)&&(C.selected.positions=C.unselected.positions=C.marker.positions),u.lineOptions.push(C.line),u.errorXOptions.push(C.errorX),u.errorYOptions.push(C.errorY),u.fillOptions.push(C.fill),u.markerOptions.push(C.marker),u.selectedOptions.push(C.selected),u.unselectedOptions.push(C.unselected),u.count=r.length,_.scene=u,_.index=h,_.x=E,_.y=L,_.rawx=E,_.rawy=L,_.r=w,_.theta=M,_.positions=S,_.count=T,_.tree=n(S,512)}}),a.plot(t,e,r)},hoverPoints:function(t,e,r,n){var i=t.cd[0].t,o=i.r,s=i.theta,c=a.hoverPoints(t,e,r,n);if(c&&!1!==c[0].index){var u=c[0];if(void 0===u.index)return c;var f=t.subplot,h=f.angularAxis,d=u.cd[u.index],p=u.trace;if(d.r=o[u.index],d.theta=s[u.index],d.rad=h.c2rad(d.theta,p.thetaunit),f.isPtWithinSector(d))return u.xLabelVal=void 0,u.yLabelVal=void 0,u.extraText=l(d,p,f),c}},style:a.style,selectPoints:a.selectPoints,meta:{}}},{"../../plots/cartesian/axes":789,"../../plots/polar":855,"../scatter/colorscale_calc":1071,"../scatter/subtypes":1088,"../scattergl":1115,"../scatterpolar/hover":1127,"./attributes":1130,"./defaults":1131,"fast-isnumeric":140,kdgrass:292}],1133:[function(t,e,r){"use strict";var n=t("../scatter/attributes"),i=t("../../plots/attributes"),a=t("../../components/colorscale/color_attributes"),o=t("../../components/colorbar/attributes"),s=t("../../components/drawing/attributes").dash,l=t("../../lib/extend").extendFlat,c=n.marker,u=n.line,f=c.line;e.exports={a:{valType:"data_array",editType:"calc"},b:{valType:"data_array",editType:"calc"},c:{valType:"data_array",editType:"calc"},sum:{valType:"number",dflt:0,min:0,editType:"calc"},mode:l({},n.mode,{dflt:"markers"}),text:l({},n.text,{}),hovertext:l({},n.hovertext,{}),line:{color:u.color,width:u.width,dash:s,shape:l({},u.shape,{values:["linear","spline"]}),smoothing:u.smoothing,editType:"calc"},connectgaps:n.connectgaps,cliponaxis:n.cliponaxis,fill:l({},n.fill,{values:["none","toself","tonext"]}),fillcolor:n.fillcolor,marker:l({symbol:c.symbol,opacity:c.opacity,maxdisplayed:c.maxdisplayed,size:c.size,sizeref:c.sizeref,sizemin:c.sizemin,sizemode:c.sizemode,line:l({width:f.width,editType:"calc"},a("marker.line")),gradient:c.gradient,editType:"calc"},a("marker"),{showscale:c.showscale,colorbar:o}),textfont:n.textfont,textposition:n.textposition,selected:n.selected,unselected:n.unselected,hoverinfo:l({},i.hoverinfo,{flags:["a","b","c","text","name"]}),hoveron:n.hoveron}},{"../../components/colorbar/attributes":619,"../../components/colorscale/color_attributes":626,"../../components/drawing/attributes":642,"../../lib/extend":732,"../../plots/attributes":787,"../scatter/attributes":1066}],1134:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../scatter/colorscale_calc"),a=t("../scatter/arrays_to_calcdata"),o=t("../scatter/calc_selection"),s=t("../scatter/calc").calcMarkerSize,l=["a","b","c"],c={a:["b","c"],b:["a","c"],c:["a","b"]};e.exports=function(t,e){var r,u,f,h,d,p,m=t._fullLayout[e.subplot].sum,g=e.sum||m;for(r=0;r"),s}}},{"../../plots/cartesian/axes":789,"../scatter/hover":1077}],1138:[function(t,e,r){"use strict";var n={};n.attributes=t("./attributes"),n.supplyDefaults=t("./defaults"),n.colorbar=t("../scatter/colorbar"),n.calc=t("./calc"),n.plot=t("./plot"),n.style=t("../scatter/style").style,n.hoverPoints=t("./hover"),n.selectPoints=t("../scatter/select"),n.eventData=t("./event_data"),n.moduleType="trace",n.name="scatterternary",n.basePlotModule=t("../../plots/ternary"),n.categories=["ternary","symbols","markerColorscale","showLegend","scatter-like"],n.meta={},e.exports=n},{"../../plots/ternary":866,"../scatter/colorbar":1070,"../scatter/select":1086,"../scatter/style":1087,"./attributes":1133,"./calc":1134,"./defaults":1135,"./event_data":1136,"./hover":1137,"./plot":1139}],1139:[function(t,e,r){"use strict";var n=t("../scatter/plot");e.exports=function(t,e,r){var i=e.plotContainer;i.select(".scatterlayer").selectAll("*").remove();var a={xaxis:e.xaxis,yaxis:e.yaxis,plot:i,layerClipId:e._hasClipOnAxisFalse?e.clipIdRelative:null};n(t,a,r)}},{"../scatter/plot":1085}],1140:[function(t,e,r){"use strict";function n(t){return{show:{valType:"boolean",dflt:!1},project:{x:{valType:"boolean",dflt:!1},y:{valType:"boolean",dflt:!1},z:{valType:"boolean",dflt:!1}},color:{valType:"color",dflt:i.defaultLine},usecolormap:{valType:"boolean",dflt:!1},width:{valType:"number",min:1,max:16,dflt:2},highlight:{valType:"boolean",dflt:!0},highlightcolor:{valType:"color",dflt:i.defaultLine},highlightwidth:{valType:"number",min:1,max:16,dflt:2}}}var i=t("../../components/color"),a=t("../../components/colorscale/attributes"),o=t("../../components/colorbar/attributes"),s=t("../../lib/extend").extendFlat,l=t("../../plot_api/edit_types").overrideAll,c=e.exports=l({z:{valType:"data_array"},x:{valType:"data_array"},y:{valType:"data_array"},text:{valType:"data_array"},surfacecolor:{valType:"data_array"},cauto:a.zauto,cmin:a.zmin,cmax:a.zmax,colorscale:a.colorscale,autocolorscale:s({},a.autocolorscale,{dflt:!1}),reversescale:a.reversescale,showscale:a.showscale,colorbar:o,contours:{x:n(),y:n(),z:n()},hidesurface:{valType:"boolean",dflt:!1},lightposition:{x:{valType:"number",min:-1e5,max:1e5,dflt:10},y:{valType:"number",min:-1e5,max:1e5,dflt:1e4},z:{valType:"number",min:-1e5,max:1e5,dflt:0}},lighting:{ambient:{valType:"number",min:0,max:1,dflt:.8},diffuse:{valType:"number",min:0,max:1,dflt:.8},specular:{valType:"number",min:0,max:2,dflt:.05},roughness:{valType:"number",min:0,max:1,dflt:.5},fresnel:{valType:"number",min:0,max:5,dflt:.2}},opacity:{valType:"number",min:0,max:1,dflt:1},_deprecated:{zauto:s({},a.zauto,{}),zmin:s({},a.zmin,{}),zmax:s({},a.zmax,{})}},"calc","nested");c.x.editType=c.y.editType=c.z.editType="calc+clearAxisTypes"},{"../../components/color":618,"../../components/colorbar/attributes":619,"../../components/colorscale/attributes":624,"../../lib/extend":732,"../../plot_api/edit_types":773}],1141:[function(t,e,r){"use strict";var n=t("../../components/colorscale/calc");e.exports=function(t,e){e.surfacecolor?n(e,e.surfacecolor,"","c"):n(e,e.z,"","c")}},{"../../components/colorscale/calc":625}],1142:[function(t,e,r){"use strict";var n=t("fast-isnumeric"),i=t("../../lib"),a=t("../../plots/plots"),o=t("../../components/colorscale"),s=t("../../components/colorbar/draw");e.exports=function(t,e){var r=e[0].trace,l="cb"+r.uid,c=r.cmin,u=r.cmax,f=r.surfacecolor||r.z;if(n(c)||(c=i.aggNums(Math.min,null,f)),n(u)||(u=i.aggNums(Math.max,null,f)),t._fullLayout._infolayer.selectAll("."+l).remove(),r.showscale){var h=e[0].t.cb=s(t,l),d=o.makeColorScaleFunc(o.extractScale(r.colorscale,c,u),{noNumericCheck:!0});h.fillcolor(d).filllevels({start:c,end:u,size:(u-c)/254}).options(r.colorbar)()}else a.autoMargin(t,l)}},{"../../components/colorbar/draw":622,"../../components/colorscale":633,"../../lib":743,"../../plots/plots":852,"fast-isnumeric":140}],1143:[function(t,e,r){"use strict";function n(t,e,r){this.scene=t,this.uid=r,this.surface=e,this.data=null,this.showContour=[!1,!1,!1],this.dataScale=1}function i(t){var e=t.shape,r=[e[0]+2,e[1]+2],n=o(new Float32Array(r[0]*r[1]),r);return c.assign(n.lo(1,1).hi(e[0],e[1]),t),c.assign(n.lo(1).hi(e[0],1),t.hi(e[0],1)),c.assign(n.lo(1,r[1]-1).hi(e[0],1),t.lo(0,e[1]-1).hi(e[0],1)),c.assign(n.lo(0,1).hi(1,e[1]),t.hi(1)),c.assign(n.lo(r[0]-1,1).hi(1,e[1]),t.lo(e[0]-1)),n.set(0,0,t.get(0,0)),n.set(0,r[1]-1,t.get(0,e[1]-1)),n.set(r[0]-1,0,t.get(e[0]-1,0)),n.set(r[0]-1,r[1]-1,t.get(e[0]-1,e[1]-1)),n}var a=t("gl-surface3d"),o=t("ndarray"),s=t("ndarray-homography"),l=t("ndarray-fill"),c=t("ndarray-ops"),u=t("tinycolor2"),f=t("../../lib/str2rgbarray"),h=128,d=n.prototype;d.handlePick=function(t){if(t.object===this.surface){var e=t.index=[Math.min(0|Math.round(t.data.index[0]/this.dataScale-1),this.data.z[0].length-1),Math.min(0|Math.round(t.data.index[1]/this.dataScale-1),this.data.z.length-1)],r=[0,0,0];Array.isArray(this.data.x[0])?r[0]=this.data.x[e[1]][e[0]]:r[0]=this.data.x[e[0]],Array.isArray(this.data.y[0])?r[1]=this.data.y[e[1]][e[0]]:r[1]=this.data.y[e[1]],r[2]=this.data.z[e[1]][e[0]],t.traceCoordinate=r;var n=this.scene.fullSceneLayout;t.dataCoordinate=[n.xaxis.d2l(r[0],0,this.data.xcalendar)*this.scene.dataScale[0],n.yaxis.d2l(r[1],0,this.data.ycalendar)*this.scene.dataScale[1],n.zaxis.d2l(r[2],0,this.data.zcalendar)*this.scene.dataScale[2]];var i=this.data.text;return i&&i[e[1]]&&void 0!==i[e[1]][e[0]]?t.textLabel=i[e[1]][e[0]]:t.textLabel="",t.data.dataCoordinate=t.dataCoordinate.slice(),this.surface.highlight(t.data),this.scene.glplot.spikes.position=t.dataCoordinate,!0}},d.setContourLevels=function(){for(var t=[[],[],[]],e=!1,r=0;r<3;++r)this.showContour[r]&&(e=!0,t[r]=this.scene.contourLevels[r]);e&&this.surface.update({levels:t})},d.update=function(t){var e,r=this.scene,n=r.fullSceneLayout,a=this.surface,c=t.opacity,d=function(t,e){return void 0===e&&(e=1),t.map(function(t){var r=t[0],n=u(t[1]).toRgb();return{index:r,rgb:[n.r,n.g,n.b,e]}})}(t.colorscale,c),p=t.z,m=t.x,g=t.y,v=n.xaxis,y=n.yaxis,x=n.zaxis,b=r.dataScale,_=p[0].length,w=p.length,M=[o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w]),o(new Float32Array(_*w),[_,w])],k=M[0],A=M[1],T=r.contourLevels;this.data=t;var S=t.xcalendar,E=t.ycalendar,L=t.zcalendar;l(M[2],function(t,e){return x.d2l(p[e][t],0,L)*b[2]}),Array.isArray(m[0])?l(k,function(t,e){return v.d2l(m[e][t],0,S)*b[0]}):l(k,function(t){return v.d2l(m[t],0,S)*b[0]}),Array.isArray(g[0])?l(A,function(t,e){return y.d2l(g[e][t],0,E)*b[1]}):l(A,function(t,e){return y.d2l(g[e],0,E)*b[1]});var C={colormap:d,levels:[[],[],[]],showContour:[!0,!0,!0],showSurface:!t.hidesurface,contourProject:[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],contourWidth:[1,1,1],contourColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],contourTint:[1,1,1],dynamicColor:[[1,1,1,1],[1,1,1,1],[1,1,1,1]],dynamicWidth:[1,1,1],dynamicTint:[1,1,1],opacity:t.opacity};if(C.intensityBounds=[t.cmin,t.cmax],t.surfacecolor){var z=o(new Float32Array(_*w),[_,w]);l(z,function(e,r){return t.surfacecolor[r][e]}),M.push(z)}else C.intensityBounds[0]*=b[2],C.intensityBounds[1]*=b[2];this.dataScale=function(t){var e=Math.max(t[0].shape[0],t[0].shape[1]);if(e",uplift:5,goldenRatio:1.618,columnTitleOffset:28,columnExtentOffset:10,transitionEase:"cubic-out",transitionDuration:100,releaseTransitionEase:"cubic-out",releaseTransitionDuration:120,scrollbarWidth:8,scrollbarCaptureWidth:18,scrollbarOffset:5,scrollbarHideDelay:1e3,scrollbarHideDuration:1e3,cn:{table:"table",tableControlView:"table-control-view",scrollBackground:"scroll-background",yColumn:"y-column",columnBlock:"column-block",scrollAreaClip:"scroll-area-clip",scrollAreaClipRect:"scroll-area-clip-rect",columnBoundary:"column-boundary",columnBoundaryClippath:"column-boundary-clippath",columnBoundaryRect:"column-boundary-rect",columnCells:"column-cells",columnCell:"column-cell",cellRect:"cell-rect",cellText:"cell-text",cellTextHolder:"cell-text-holder",scrollbarKit:"scrollbar-kit",scrollbar:"scrollbar",scrollbarSlider:"scrollbar-slider",scrollbarGlyph:"scrollbar-glyph",scrollbarCaptureZone:"scrollbar-capture-zone"}}},{}],1150:[function(t,e,r){"use strict";function n(t){return t.calcdata.columns.reduce(function(e,r){return r.xIndex=e||c===t.length-1)&&(n[i]=o,o.key=l++,o.firstRowIndex=s,o.lastRowIndex=c,o={firstRowIndex:null,lastRowIndex:null,rows:[]},i+=a,s=c+1,a=0);return n}var o=t("./constants"),s=t("../../lib/extend").extendFlat,l=t("fast-isnumeric");e.exports=function(t,e){var r=e.header.values.map(function(t){return Array.isArray(t)?t:[t]}),c=e.cells.values,u=e.domain,f=Math.floor(t._fullLayout._size.w*(u.x[1]-u.x[0])),h=Math.floor(t._fullLayout._size.h*(u.y[1]-u.y[0])),d=r.length?r[0].map(function(){return e.header.height}):[],p=c.length?c[0].map(function(){return e.cells.height}):[],m=d.reduce(function(t,e){return t+e},0),g=a(p,h-m+o.uplift),v=i(a(d,m),[]),y=i(g,v),x={},b=e._fullInput.columnorder,_=r.map(function(t,r){var n=Array.isArray(e.columnwidth)?e.columnwidth[Math.min(r,e.columnwidth.length-1)]:e.columnwidth;return l(n)?Number(n):1}),w=_.reduce(function(t,e){return t+e},0);_=_.map(function(t){return t/w*f});var M={key:e.index,translateX:u.x[0]*t._fullLayout._size.w,translateY:t._fullLayout._size.h*(1-u.y[1]),size:t._fullLayout._size,width:f,height:h,columnOrder:b,groupHeight:h,rowBlocks:y,headerRowBlocks:v,scrollY:0,cells:e.cells,headerCells:s({},e.header,{values:r}),gdColumns:r.map(function(t){return t[0]}),gdColumnsOriginalOrder:r.map(function(t){return t[0]}),prevPages:[0,0],scrollbarState:{scrollbarScrollInProgress:!1},columns:r.map(function(t,e){var r=x[t];x[t]=(r||0)+1;return{key:t+"__"+x[t],label:t,specIndex:e,xIndex:b[e],xScale:n,x:void 0,calcdata:void 0,columnWidth:_[e]}})};return M.columns.forEach(function(t){t.calcdata=M,t.x=n(t)}),M}},{"../../lib/extend":732,"./constants":1149,"fast-isnumeric":140}],1151:[function(t,e,r){"use strict";var n=t("../../lib/extend").extendFlat;r.splitToPanels=function(t){var e=[0,0],r=n({},t,{key:"header",type:"header",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!0,values:t.calcdata.headerCells.values[t.specIndex],rowBlocks:t.calcdata.headerRowBlocks,calcdata:n({},t.calcdata,{cells:t.calcdata.headerCells})});return[n({},t,{key:"cells1",type:"cells",page:0,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),n({},t,{key:"cells2",type:"cells",page:1,prevPages:e,currentRepaint:[null,null],dragHandle:!1,values:t.calcdata.cells.values[t.specIndex],rowBlocks:t.calcdata.rowBlocks}),r]},r.splitToCells=function(t){var e=function(t){var e=t.rowBlocks[t.page],r=e?e.rows[0].rowIndex:0;return[r,e?r+e.rows.length:0]}(t);return t.values.slice(e[0],e[1]).map(function(r,n){return{keyWithinBlock:n+("string"==typeof r&&r.match(/[<$&> ]/)?"_keybuster_"+Math.random():""),key:e[0]+n,column:t,calcdata:t.calcdata,page:t.page,rowBlocks:t.rowBlocks,value:r}})}},{"../../lib/extend":732}],1152:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./attributes");e.exports=function(t,e,r,a){function o(r,a){return n.coerce(t,e,i,r,a)}o("domain.x"),o("domain.y"),o("columnwidth"),o("header.values"),o("header.format"),o("header.align"),o("header.prefix"),o("header.suffix"),o("header.height"),o("header.line.width"),o("header.line.color"),o("header.fill.color"),n.coerceFont(o,"header.font",n.extendFlat({},a.font)),function(t,e){for(var r=t.columnorder||[],n=t.header.values.length,i=r.slice(0,n),a=i.slice().sort(function(t,e){return t-e}),o=i.map(function(t){return a.indexOf(t)}),s=o.length;s/i),o=!i||a;t.mayHaveMarkup=i&&n.match(/[<&>]/);var s=function(t){return"string"==typeof t&&t.match(M.latexCheck)}(n);t.latex=s;var l,f=s?"":u(t.calcdata.cells.prefix,e,r)||"",h=s?"":u(t.calcdata.cells.suffix,e,r)||"",d=s?null:u(t.calcdata.cells.format,e,r)||null,p=f+(d?k.format(d)(t.value):t.value)+h;t.wrappingNeeded=!t.wrapped&&!o&&!s&&(l=c(p)),t.cellHeightMayIncrease=a||s||t.mayHaveMarkup||(void 0===l?c(p):l),t.needsConvertToTspans=t.mayHaveMarkup||t.wrappingNeeded||t.latex;var m;if(t.wrappingNeeded){var g=(" "===M.wrapSplitCharacter?p.replace(/
c&&(t.value+=s.join(M.wrapSpacer)+M.lineBreaker,s=[],l=0),s.push(r.text),l+=i;l&&(t.value+=s.join(M.wrapSpacer)),t.wrapped=!0}),n.selectAll("tspan.line").remove(),l(n.select("."+M.cn.cellText),r,t),k.select(e.parentNode.parentNode).call(x)}}:function(t,e,r,n,i){return function(){if(!i.settledY){var a=k.select(e.parentNode),s=w(i),l=i.key-s.firstRowIndex,c=s.rows[l].rowHeight,u=i.cellHeightMayIncrease?e.parentNode.getBoundingClientRect().height+2*M.cellPad:c,f=Math.max(u,c),d=f-s.rows[l].rowHeight;d&&(s.rows[l].rowHeight=f,t.selectAll("."+M.cn.columnCell).call(x),m(null,t.filter(h),0),o(r,n,!0)),a.attr("transform",function(){var t=this.parentNode,e=t.getBoundingClientRect(),r=k.select(this.parentNode).select("."+M.cn.cellRect).node().getBoundingClientRect(),n=this.transform.baseVal.consolidate(),a=r.top-e.top+(n?n.matrix.f:M.cellPad);return"translate("+y(i,k.select(this.parentNode).select("."+M.cn.cellTextHolder).node().getBoundingClientRect().width)+" "+a+")"}),i.settledY=!0}}};t.needsConvertToTspans?S.convertToTspans(i,n,a(r,this,e,n,t)):k.select(this.parentNode).attr("transform",function(t){return"translate("+y(t)+" "+M.cellPad+")"}).attr("text-anchor",function(t){return{left:"start",center:"middle",right:"end"}[t.align]})})}function c(t){return-1!==t.indexOf(M.wrapSplitCharacter)}function u(t,e,r){if(Array.isArray(t)){var n=t[Math.min(e,t.length-1)];return Array.isArray(n)?n[Math.min(r,n.length-1)]:n}return t}function f(t,e,r){t.transition().ease(M.releaseTransitionEase).duration(M.releaseTransitionDuration).attr("transform","translate("+e.x+" "+r+")")}function h(t){return"cells"===t.type}function d(t){return"header"===t.type}function p(t){return(t.rowBlocks.length?t.rowBlocks[0].auxiliaryBlocks:[]).reduce(function(t,e){return t+_(e,1/0)},0)}function m(t,e,r){var n=a(e)[0];if(void 0!==n){var i=n.rowBlocks,s=n.calcdata,l=b(i,i.length),c=n.calcdata.groupHeight-p(n),u=s.scrollY=Math.max(0,Math.min(l-c,s.scrollY)),f=function(t,e,r){for(var n=[],i=0,a=0;ai&&n.push(a),i+=l}return n}(i,u,c);1===f.length&&(f[0]===i.length-1?f.unshift(f[0]-1):f.push(f[0]+1)),f[0]%2&&f.reverse(),e.each(function(t,e){t.page=f[e],t.scrollY=u}),e.attr("transform",function(t){return"translate(0 "+(b(t.rowBlocks,t.page)-t.scrollY)+")"}),t&&(v(t,r,e,f,n.prevPages,n,0),v(t,r,e,f,n.prevPages,n,1),o(r,t))}}function g(t,e,r,n){return function(i){var a=i.calcdata?i.calcdata:i,o=e.filter(function(t){return a.key===t.key}),s=r||a.scrollbarState.dragMultiplier;a.scrollY=void 0===n?a.scrollY+s*k.event.dy:n;var l=o.selectAll("."+M.cn.yColumn).selectAll("."+M.cn.columnBlock).filter(h);m(t,l,o)}}function v(t,e,r,n,i,a,o){n[o]!==i[o]&&(clearTimeout(a.currentRepaint[o]),a.currentRepaint[o]=setTimeout(function(){var a=r.filter(function(t,e){return e===o&&n[e]!==i[e]});s(t,e,a,r),i[o]=n[o]}))}function y(t,e){switch(t.align){case"left":return M.cellPad;case"right":return t.column.columnWidth-(e||0)-M.cellPad;case"center":return(t.column.columnWidth-(e||0))/2;default:return M.cellPad}}function x(t){t.attr("transform",function(t){var e=t.rowBlocks[0].auxiliaryBlocks.reduce(function(t,e){return t+_(e,1/0)},0);return"translate(0 "+(_(w(t),t.key)+e)+")"}).selectAll("."+M.cn.cellRect).attr("height",function(t){return function(t,e){return t.rows[e-t.firstRowIndex]}(w(t),t.key).rowHeight})}function b(t,e){for(var r=0,n=e-1;n>=0;n--)r+=function(t){var e=t.allRowsHeight;if(void 0!==e)return e;for(var r=0,n=0;n0){var y,x,b,_,w,M=t.xa,k=t.ya;"h"===h.orientation?(w=e,y="y",b=k,x="x",_=M):(w=r,y="x",b=M,x="y",_=k);var A=f[t.index];if(w>=A.span[0]&&w<=A.span[1]){var T=n.extendFlat({},t),S=_.c2p(w,!0),E=o.getKdeValue(A,h,w),L=o.getPositionOnKdePath(A,h,S),C=b._offset,z=b._length;T[y+"0"]=L[0],T[y+"1"]=L[1],T[x+"0"]=T[x+"1"]=S,T[x+"Label"]=x+": "+i.hoverLabelText(_,w)+", "+f[0].t.labels.kde+" "+E.toFixed(3),g.push(T),(u={stroke:t.color})[y+"1"]=n.constrain(C+L[0],C,C+z),u[y+"2"]=n.constrain(C+L[1],C,C+z),u[x+"1"]=u[x+"2"]=_._offset+S}}}-1!==d.indexOf("points")&&(c=a.hoverOnPoints(t,e,r));var D=l.selectAll(".violinline-"+h.uid).data(u?[0]:[]);return D.enter().append("line").classed("violinline-"+h.uid,!0).attr("stroke-width",1.5),D.exit().remove(),D.attr(u),"closest"===s?c?[c]:g:c?(g.push(c),g):g}},{"../../lib":743,"../../plots/cartesian/axes":789,"../box/hover":899,"./helpers":1158}],1160:[function(t,e,r){"use strict";e.exports={attributes:t("./attributes"),layoutAttributes:t("./layout_attributes"),supplyDefaults:t("./defaults"),supplyLayoutDefaults:t("./layout_defaults"),calc:t("./calc"),setPositions:t("./set_positions"),plot:t("./plot"),style:t("./style"),hoverPoints:t("./hover"),selectPoints:t("../box/select"),moduleType:"trace",name:"violin",basePlotModule:t("../../plots/cartesian"),categories:["cartesian","symbols","oriented","box-violin","showLegend"],meta:{}}},{"../../plots/cartesian":800,"../box/select":904,"./attributes":1155,"./calc":1156,"./defaults":1157,"./hover":1159,"./layout_attributes":1161,"./layout_defaults":1162,"./plot":1163,"./set_positions":1164,"./style":1165}],1161:[function(t,e,r){"use strict";var n=t("../box/layout_attributes"),i=t("../../lib").extendFlat;e.exports={violinmode:i({},n.boxmode,{}),violingap:i({},n.boxgap,{}),violingroupgap:i({},n.boxgroupgap,{})}},{"../../lib":743,"../box/layout_attributes":901}],1162:[function(t,e,r){"use strict";var n=t("../../lib"),i=t("./layout_attributes"),a=t("../box/layout_defaults");e.exports=function(t,e,r){a._supply(t,e,r,function(r,a){return n.coerce(t,e,i,r,a)},"violin")}},{"../../lib":743,"../box/layout_defaults":902,"./layout_attributes":1161}],1163:[function(t,e,r){"use strict";var n=t("d3"),i=t("../../lib"),a=t("../../components/drawing"),o=t("../box/plot"),s=t("../scatter/line_points"),l=t("./helpers");e.exports=function(t,e,r){function c(t){var e=s(t,{xaxis:f,yaxis:h,connectGaps:!0,baseTolerance:.75,shape:"spline",simplify:!0});return a.smoothopen(e[0],1)}var u=t._fullLayout,f=e.xaxis,h=e.yaxis;e.plot.select(".violinlayer").selectAll("g.trace.violins").data(r).enter().append("g").attr("class","trace violins").each(function(t){var r=t[0],a=r.t,s=r.trace,d=r.node3=n.select(this),p=u._numViolins,m="group"===u.violinmode&&p>1,g=a.bdPos=a.dPos*(1-u.violingap)*(1-u.violingroupgap)/(m?p:1),v=a.bPos=m?2*a.dPos*((a.num+.5)/p-.5)*(1-u.violingap):0;if(!0!==s.visible||a.empty)n.select(this).remove();else{var y=e[a.valLetter+"axis"],x=e[a.posLetter+"axis"],b="both"===s.side,_=b||"positive"===s.side,w=b||"negative"===s.side,M=s.box&&s.box.visible,k=s.meanline&&s.meanline.visible,A=u._violinScaleGroupStats[s.scalegroup];if(d.selectAll("path.violin").data(i.identity).enter().append("path").style("vector-effect","non-scaling-stroke").attr("class","violin").each(function(t){var e,r=n.select(this),i=t.density,o=i.length,l=t.pos+v,u=x.c2p(l);switch(s.scalemode){case"width":e=A.maxWidth/g;break;case"count":e=A.maxWidth/g*(A.maxCount/t.pts.length)}var f,h,d,p,m,M,k;if(_){for(M=new Array(o),p=0;pi&&(i=c,a=l)}}return i?s(a):f};case"rms":return function(t,e){for(var r=0,i=0,a=0;a=",">","<="],l=["[]","()","[)","(]","][",")(","](",")["],c=["{}","}{"];r.moduleType="transform",r.name="filter",r.attributes={enabled:{valType:"boolean",dflt:!0,editType:"calc"},target:{valType:"string",strict:!0,noBlank:!0,arrayOk:!0,dflt:"x",editType:"calc"},operation:{valType:"enumerated",values:[].concat(s).concat(l).concat(c),dflt:"=",editType:"calc"},value:{valType:"any",dflt:0,editType:"calc"},preservegaps:{valType:"boolean",dflt:!1,editType:"calc"},editType:"calc"},r.supplyDefaults=function(t){function e(e,i){return n.coerce(t,a,r.attributes,e,i)}var a={};if(e("enabled")){e("preservegaps"),e("operation"),e("value"),e("target");var o=i.getComponentMethod("calendars","handleDefaults");o(t,a,"valuecalendar",null),o(t,a,"targetcalendar",null)}return a},r.calcTransform=function(t,e,r){function i(t,r){for(var i=0;i":return function(t){return h(t)>i};case">=":return function(t){return h(t)>=i};case"[]":return function(t){var e=h(t);return e>=i[0]&&e<=i[1]};case"()":return function(t){var e=h(t);return e>i[0]&&e=i[0]&&ei[0]&&e<=i[1]};case"][":return function(t){var e=h(t);return e<=i[0]||e>=i[1]};case")(":return function(t){var e=h(t);return ei[1]};case"](":return function(t){var e=h(t);return e<=i[0]||e>i[1]};case")[":return function(t){var e=h(t);return e=i[1]};case"{}":return function(t){return-1!==i.indexOf(h(t))};case"}{":return function(t){return-1===i.indexOf(h(t))}}}(r,a.getDataToCoordFunc(t,e,f,u),d),x={},b={},_=0;r.preservegaps?(g=function(t){x[t.astr]=n.extendDeep([],t.get()),t.set(new Array(h))},v=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([])},v=function(t,e){var r=x[t.astr][e];t.get().push(r)}),i(g);for(var w=o(e.transforms,r),M=0;M1?"%{group} (%{trace})":"%{group}");var l=t.styles,c=s.styles=[];if(l)for(o=0;o Date: Thu, 25 Jan 2018 13:16:15 -0600 Subject: [PATCH 15/15] improve demos (and don't force persistence unless it makes sense) --- R/highlight.R | 11 +++-------- demo/crosstalk-highlight-binned-target-c.R | 5 +---- demo/crosstalk-highlight-epl-2.R | 1 - demo/crosstalk-highlight-intro.R | 10 +++++----- demo/crosstalk-highlight-leaflet.R | 4 +--- demo/crosstalk-highlight-pipeline.R | 2 +- man/highlight.Rd | 11 +++-------- 7 files changed, 14 insertions(+), 30 deletions(-) diff --git a/R/highlight.R b/R/highlight.R index 28b98bb422..0d1f1c67bd 100644 --- a/R/highlight.R +++ b/R/highlight.R @@ -60,13 +60,11 @@ #' d <- SharedData$new(txhousing, ~city) #' p <- ggplot(d, aes(date, median, group = city)) + geom_line() #' gg <- ggplotly(p, tooltip = "city") -#' highlight(gg, persistent = TRUE, dynamic = TRUE) +#' highlight(gg, dynamic = TRUE) #' #' # supply custom colors to the brush #' cols <- toRGB(RColorBrewer::brewer.pal(3, "Dark2"), 0.5) -#' highlight( -#' gg, on = "plotly_hover", color = cols, persistent = TRUE, dynamic = TRUE -#' ) +#' highlight(gg, on = "plotly_hover", color = cols, dynamic = TRUE) #' #' # Use attrs_selected() for complete control over the selection appearance #' # note any relevant colors you specify here should override the color argument @@ -76,10 +74,7 @@ #' marker = list(symbol = "x") #' ) #' -#' highlight( -#' layout(gg, showlegend = TRUE), -#' selected = s, persistent = TRUE -#' ) +#' highlight(layout(gg, showlegend = TRUE), selected = s) #' highlight <- function(p, on = "plotly_click", off, diff --git a/demo/crosstalk-highlight-binned-target-c.R b/demo/crosstalk-highlight-binned-target-c.R index 6a1dd2fc75..e5fbad60dd 100644 --- a/demo/crosstalk-highlight-binned-target-c.R +++ b/demo/crosstalk-highlight-binned-target-c.R @@ -10,7 +10,4 @@ p2 <- plot_ly(tx, x = ~median, color = I("black")) %>% subplot(gg1, p2, titleX = TRUE, titleY = TRUE) %>% layout(barmode = "overlay") %>% - highlight( - dynamic = TRUE, persistent = TRUE, - selected = attrs_selected(opacity = 0.3) - ) + highlight(dynamic = TRUE, selected = attrs_selected(opacity = 0.3)) diff --git a/demo/crosstalk-highlight-epl-2.R b/demo/crosstalk-highlight-epl-2.R index 526d8dc93b..de17b89aaa 100644 --- a/demo/crosstalk-highlight-epl-2.R +++ b/demo/crosstalk-highlight-epl-2.R @@ -37,7 +37,6 @@ gg <- ggplotly(p, width = 1050, height = 600, tooltip = "team") highlight( gg, - persistent = TRUE, dynamic = TRUE, selectize = TRUE, color = RColorBrewer::brewer.pal(12, "Paired") diff --git a/demo/crosstalk-highlight-intro.R b/demo/crosstalk-highlight-intro.R index d803b00402..5f4493bed7 100644 --- a/demo/crosstalk-highlight-intro.R +++ b/demo/crosstalk-highlight-intro.R @@ -46,9 +46,9 @@ p %>% # By default, all selections are transient, meaning prior selections are # removed from the selection set before new selections are added. To prevent -# prior selections from being removed, simply set the persistent argument to -# `TRUE`. -highlight(p, on = "plotly_hover", persistent = TRUE) +# prior selections from being removed, hold down the shift key while triggering +# the event +highlight(p, on = "plotly_hover") # Sometimes its useful to compare two or more different selection sets. # For example, how do patients with a high response on visit 1 compare to those @@ -57,10 +57,10 @@ highlight(p, on = "plotly_hover", persistent = TRUE) # a colourpicker htmlwidget (@colourpicker) will appear just above the plotly # visualization. At any given time, the value of this widget controls the # color of new selection(s). -highlight(p, on = "plotly_hover", persistent = TRUE, dynamic = TRUE) +highlight(p, on = "plotly_hover", dynamic = TRUE) # By default, the colourpicker widget uses colors from the "Set1" # colour brewer palette (@RColorBrewer), but any set of valid R colors can # be supplied to the color argument. colors <- RColorBrewer::brewer.pal(4, "Dark2") -highlight(p, on = "plotly_hover", color = colors, dynamic = TRUE, persistent = TRUE) +highlight(p, on = "plotly_hover", color = colors, dynamic = TRUE) diff --git a/demo/crosstalk-highlight-leaflet.R b/demo/crosstalk-highlight-leaflet.R index cf55dd02ae..0579d00a2b 100644 --- a/demo/crosstalk-highlight-leaflet.R +++ b/demo/crosstalk-highlight-leaflet.R @@ -5,9 +5,7 @@ library(crosstalk) library(htmltools) # leaflet should respect these "global" highlight() options -options( - opacityDim = 0.5, persistent = TRUE -) +options(opacityDim = 0.5) sd <- SharedData$new(quakes) diff --git a/demo/crosstalk-highlight-pipeline.R b/demo/crosstalk-highlight-pipeline.R index 3cdc30dd6a..c55d4e7a24 100644 --- a/demo/crosstalk-highlight-pipeline.R +++ b/demo/crosstalk-highlight-pipeline.R @@ -24,4 +24,4 @@ p2 <- base %>% subplot(p1, p2, titleX = TRUE, widths = c(0.3, 0.7)) %>% layout(margin = list(l = 120)) %>% hide_legend() %>% - highlight(dynamic = TRUE, persistent = TRUE, selectize = TRUE) + highlight(dynamic = TRUE, selectize = TRUE) diff --git a/man/highlight.Rd b/man/highlight.Rd index 42e3a613ab..5ab45424ac 100644 --- a/man/highlight.Rd +++ b/man/highlight.Rd @@ -79,13 +79,11 @@ library(crosstalk) d <- SharedData$new(txhousing, ~city) p <- ggplot(d, aes(date, median, group = city)) + geom_line() gg <- ggplotly(p, tooltip = "city") -highlight(gg, persistent = TRUE, dynamic = TRUE) +highlight(gg, dynamic = TRUE) # supply custom colors to the brush cols <- toRGB(RColorBrewer::brewer.pal(3, "Dark2"), 0.5) -highlight( - gg, on = "plotly_hover", color = cols, persistent = TRUE, dynamic = TRUE -) +highlight(gg, on = "plotly_hover", color = cols, dynamic = TRUE) # Use attrs_selected() for complete control over the selection appearance # note any relevant colors you specify here should override the color argument @@ -95,10 +93,7 @@ s <- attrs_selected( marker = list(symbol = "x") ) -highlight( - layout(gg, showlegend = TRUE), - selected = s, persistent = TRUE -) +highlight(layout(gg, showlegend = TRUE), selected = s) } \references{